diff --git a/.chloggen/addresourcetotelemetry.yaml b/.chloggen/addresourcetotelemetry.yaml new file mode 100755 index 000000000000..289b823e4ec4 --- /dev/null +++ b/.chloggen/addresourcetotelemetry.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: "carbonexporter" + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "Add support for resourcetotelemetry" + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [29879] + +# 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/azuretranslator-parse-timestamp-resource-logs.yaml b/.chloggen/azuretranslator-parse-timestamp-resource-logs.yaml new file mode 100644 index 000000000000..738e94bc0781 --- /dev/null +++ b/.chloggen/azuretranslator-parse-timestamp-resource-logs.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: azuretranslatorpkg + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: When receiving data from Azure some data does not meet the Common Specifications when sending the timestamp. Allow the attribute timeStamp to be used as an alternative to the standard time. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [28806] + +# (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/carbonexporter.yaml b/.chloggen/carbonexporter.yaml new file mode 100755 index 000000000000..647bcda92930 --- /dev/null +++ b/.chloggen/carbonexporter.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: "carbonexporter" + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "Change Config member names" + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [29862] + +# 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/carbonexporter_enhance.yaml b/.chloggen/carbonexporter_enhance.yaml new file mode 100755 index 000000000000..362a3e9ac281 --- /dev/null +++ b/.chloggen/carbonexporter_enhance.yaml @@ -0,0 +1,13 @@ +# 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: "carbonexporter" + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "Add retry and queue, use standard configs" + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [29862] diff --git a/.chloggen/carbonexportermax.yaml b/.chloggen/carbonexportermax.yaml new file mode 100755 index 000000000000..7c4510e620d8 --- /dev/null +++ b/.chloggen/carbonexportermax.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: carbonexporter + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "Add ability to configure max_idle_conns" + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [30109] + +# 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/carbonreceiver.yaml b/.chloggen/carbonreceiver.yaml new file mode 100755 index 000000000000..26c5033d7a94 --- /dev/null +++ b/.chloggen/carbonreceiver.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: "carbonreceiver" + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Hide unnecessary public API + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [29895] + +# 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/codeboten_add-mdatagen-meter-method-2.yaml b/.chloggen/codeboten_add-mdatagen-meter-method-2.yaml new file mode 100755 index 000000000000..f2d91a9d905b --- /dev/null +++ b/.chloggen/codeboten_add-mdatagen-meter-method-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: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: mdatagen + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: add Meter/Tracer methods to simplify instrumenting components + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [29927] + +# (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-census-servicegraph.yaml b/.chloggen/codeboten_rm-census-servicegraph.yaml new file mode 100755 index 000000000000..bfdd7a64540f --- /dev/null +++ b/.chloggen/codeboten_rm-census-servicegraph.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: servicegraphprocessor + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: update own telemetry to use otel + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [29917] + +# (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/elasticsearchexporter_add_missing_trace_status_description_in_span.yaml b/.chloggen/elasticsearchexporter_add_missing_trace_status_description_in_span.yaml new file mode 100644 index 000000000000..215f4fe29f10 --- /dev/null +++ b/.chloggen/elasticsearchexporter_add_missing_trace_status_description_in_span.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: elasticsearchexporter + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: "add missing trace status description in span" + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [27645] + +# (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] \ No newline at end of file diff --git a/.chloggen/feat_routing_match_once.yaml b/.chloggen/feat_routing_match_once.yaml new file mode 100755 index 000000000000..66332284835f --- /dev/null +++ b/.chloggen/feat_routing_match_once.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: routingconnector supports matching the statement only once + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [26353] + +# (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/filterprocessor-telemetry.yaml b/.chloggen/filterprocessor-telemetry.yaml new file mode 100755 index 000000000000..ac98ca850d35 --- /dev/null +++ b/.chloggen/filterprocessor-telemetry.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: filterprocessor + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add telemetry for metrics, logs, and spans that were intentionally dropped via filterprocessor. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [13169] + +# (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/fix-11829.yaml b/.chloggen/fix-11829.yaml new file mode 100755 index 000000000000..e5c6a14d8200 --- /dev/null +++ b/.chloggen/fix-11829.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: "bug_fix" + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: "filterset" + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Fix concurrency issue when enabling caching. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [11829] + +# 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/fix_panic_supervisor.yaml b/.chloggen/fix_panic_supervisor.yaml new file mode 100755 index 000000000000..e6bb9266b6bf --- /dev/null +++ b/.chloggen/fix_panic_supervisor.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: opampsupervisor + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Fix panic on agent shutdown + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [29955] + +# (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/googlecloudpubsubexporter-expose-insecure.yaml b/.chloggen/googlecloudpubsubexporter-expose-insecure.yaml new file mode 100644 index 000000000000..3a6fd8fc45ea --- /dev/null +++ b/.chloggen/googlecloudpubsubexporter-expose-insecure.yaml @@ -0,0 +1,11 @@ +# 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: googlecloudpubsubexporter + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Expose `Endpoint` and `Insecure` in configuration. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [29304] diff --git a/.chloggen/honeycombmarker-set-the-User-Agent-header-in-the-outgoing-HTTP-requests.yaml b/.chloggen/honeycombmarker-set-the-User-Agent-header-in-the-outgoing-HTTP-requests.yaml new file mode 100755 index 000000000000..2f5674328249 --- /dev/null +++ b/.chloggen/honeycombmarker-set-the-User-Agent-header-in-the-outgoing-HTTP-requests.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: exporter/honeycombmarker + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: set the User-Agent header in the outgoing HTTP requests + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [29894] + +# (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/namedpipe_receiver.yaml b/.chloggen/namedpipe_receiver.yaml new file mode 100755 index 000000000000..c9481179e042 --- /dev/null +++ b/.chloggen/namedpipe_receiver.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: namedpipereceiver + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add "namedpipereceiver" that allows ingesting logs over a Named Pipe + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [27234] + +# (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/ottl-hide-consts.yaml b/.chloggen/ottl-hide-consts.yaml new file mode 100755 index 000000000000..533d916be3f3 --- /dev/null +++ b/.chloggen/ottl-hide-consts.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: pkg/ottl + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Unexport `ADD`, `SUB`, `MULT`, `DIV`, `EQ`, `NE`, `LT`, `LTE`, `GT`, and `GTE` + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [29925] + +# (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] diff --git a/.chloggen/ottl-update-to-use-new-paths.yaml b/.chloggen/ottl-update-to-use-new-paths.yaml new file mode 100755 index 000000000000..bb8281e50210 --- /dev/null +++ b/.chloggen/ottl-update-to-use-new-paths.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: pkg/ottl + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Change `Path` to be an Interface instead of the grammar struct. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [29897] + +# (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: Affects creators of custom contexts. + +# 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/ottl-valid-path-used.yaml b/.chloggen/ottl-valid-path-used.yaml new file mode 100755 index 000000000000..b7cb63d491dc --- /dev/null +++ b/.chloggen/ottl-valid-path-used.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: pkg/ottl + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Now validates against extraneous path segments that a context does not know how to use. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [30042] + +# (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_sampler.yaml b/.chloggen/remove_sampler.yaml new file mode 100755 index 000000000000..7f343051cd22 --- /dev/null +++ b/.chloggen/remove_sampler.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: Remove sampling policy from logger + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [23801] + +# (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/splunkhecreceiver-return-success-body.yaml b/.chloggen/splunkhecreceiver-return-success-body.yaml new file mode 100644 index 000000000000..4027c62f7feb --- /dev/null +++ b/.chloggen/splunkhecreceiver-return-success-body.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: splunkhecreceiver + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Returns json response in raw endpoint when it is successful + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [20766] + +# (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/zipkinexporter_clientsettings.yaml b/.chloggen/zipkinexporter_clientsettings.yaml new file mode 100755 index 000000000000..ac3e0fce8e82 --- /dev/null +++ b/.chloggen/zipkinexporter_clientsettings.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: zipkinexporter + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Use default client HTTP settings in zipkinexporter, move validation to config validation + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [29931] + +# (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/CODEOWNERS b/.github/CODEOWNERS index 23364282da1b..eda36a12665e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -227,6 +227,7 @@ receiver/memcachedreceiver/ @open-telemetry/collect receiver/mongodbatlasreceiver/ @open-telemetry/collector-contrib-approvers @djaglowski @schmikei receiver/mongodbreceiver/ @open-telemetry/collector-contrib-approvers @djaglowski @schmikei receiver/mysqlreceiver/ @open-telemetry/collector-contrib-approvers @djaglowski +receiver/namedpipereceiver/ @open-telemetry/collector-contrib-approvers @djaglowski receiver/nginxreceiver/ @open-telemetry/collector-contrib-approvers @djaglowski receiver/nsxtreceiver/ @open-telemetry/collector-contrib-approvers @dashpole @schmikei receiver/opencensusreceiver/ @open-telemetry/collector-contrib-approvers @open-telemetry/collector-approvers @@ -283,8 +284,8 @@ reports/distributions/grafana.yaml @open-telemetry/collector-contrib-approvers reports/distributions/observiq.yaml @open-telemetry/collector-contrib-approvers reports/distributions/redhat.yaml @open-telemetry/collector-contrib-approvers reports/distributions/splunk.yaml @open-telemetry/collector-contrib-approvers @atoulme @crobert-1 @dmitryax @hughesjj @jeffreyc-splunk @jinja2 @jvoravong @panotti @rmfitzpatrick @samiura -reports/distributions/sumo.yaml @open-telemetry/collector-contrib-approvers -reports/distributions/liatrio.yaml @open-telemetry/collector-contrib-approvers +reports/distributions/sumo.yaml @open-telemetry/collector-contrib-approvers @aboguszewski-sumo @astencel-sumo @kkujawa-sumo @rnishtala-sumo @sumo-drosiek @swiatekm-sumo +reports/distributions/liatrio.yaml @open-telemetry/collector-contrib-approvers @adrielp ## UNMAINTAINED components diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 050e78eeb78c..d4f5549e32a4 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -221,6 +221,7 @@ body: - receiver/mongodb - receiver/mongodbatlas - receiver/mysql + - receiver/namedpipe - receiver/nginx - receiver/nsxt - receiver/opencensus diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index b6d99c298db3..a3682024b350 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -215,6 +215,7 @@ body: - receiver/mongodb - receiver/mongodbatlas - receiver/mysql + - receiver/namedpipe - receiver/nginx - receiver/nsxt - receiver/opencensus diff --git a/.github/ISSUE_TEMPLATE/other.yaml b/.github/ISSUE_TEMPLATE/other.yaml index 6c95e4dec60d..0f5dc889ad00 100644 --- a/.github/ISSUE_TEMPLATE/other.yaml +++ b/.github/ISSUE_TEMPLATE/other.yaml @@ -215,6 +215,7 @@ body: - receiver/mongodb - receiver/mongodbatlas - receiver/mysql + - receiver/namedpipe - receiver/nginx - receiver/nsxt - receiver/opencensus diff --git a/.github/workflows/build-and-test-windows.yml b/.github/workflows/build-and-test-windows.yml index d7b8e0441566..6a0f95277e5a 100644 --- a/.github/workflows/build-and-test-windows.yml +++ b/.github/workflows/build-and-test-windows.yml @@ -36,7 +36,7 @@ jobs: - cmd - other runs-on: windows-latest - if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run Windows') || github.event_name == 'push') }} + if: ${{ github.actor != 'dependabot[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run Windows') || github.event_name == 'push') }} env: # Limit memory usage via GC environment variables to avoid OOM on GH runners, especially for `cmd/otelcontribcol`, # see https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/28682#issuecomment-1802296776 @@ -47,7 +47,7 @@ jobs: - if: matrix.group == 'receiver-0' name: install IIS run: Install-WindowsFeature -name Web-Server -IncludeManagementTools - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: ~1.20.12 cache: false @@ -66,7 +66,7 @@ jobs: - name: Run Unit tests run: make -j2 gotest GROUP=${{ matrix.group }} windows-unittest: - if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run Windows') || github.event_name == 'push') }} + if: ${{ github.actor != 'dependabot[bot]' && (contains(github.event.pull_request.labels.*.name, 'Run Windows') || github.event_name == 'push') }} runs-on: windows-latest needs: [windows-unittest-matrix] steps: diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 152a06d6bccf..8644ecf4ade2 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -20,10 +20,10 @@ jobs: setup-environment: timeout-minutes: 30 runs-on: ubuntu-latest - if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' }} + if: ${{ github.actor != 'dependabot[bot]' }} steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: ~1.20.12 cache: false @@ -78,7 +78,7 @@ jobs: needs: [setup-environment] steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: ~1.20.11 cache: false @@ -105,7 +105,7 @@ jobs: - name: Lint run: make -j2 golint GROUP=${{ matrix.group }} lint: - if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' && always() }} + if: ${{ github.actor != 'dependabot[bot]' && always() }} runs-on: ubuntu-latest needs: [setup-environment, lint-matrix] steps: @@ -134,13 +134,12 @@ jobs: - internal - pkg runs-on: ubuntu-latest - if: ${{ github.actor != 'renovate[bot]' }} timeout-minutes: 30 steps: - name: Checkout Repo uses: actions/checkout@v4 - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: ~1.20.12 cache: false @@ -163,7 +162,7 @@ jobs: needs: [setup-environment] steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: ~1.20.12 cache: false @@ -241,7 +240,7 @@ jobs: needs: [setup-environment] steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} cache: false @@ -277,7 +276,7 @@ jobs: name: coverage-artifacts path: ${{ matrix.group }}-coverage.txt unittest: - if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' && always() }} + if: ${{ github.actor != 'dependabot[bot]' && always() }} runs-on: ubuntu-latest needs: [setup-environment, unittest-matrix] steps: @@ -315,7 +314,7 @@ jobs: needs: [setup-environment] steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: ~1.20.12 cache: false @@ -336,7 +335,7 @@ jobs: needs: [setup-environment] steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: ~1.20.12 cache: false @@ -362,7 +361,7 @@ jobs: needs: [setup-environment] steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: ~1.20.12 cache: false @@ -431,7 +430,7 @@ jobs: arch: s390x steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: ~1.20.12 cache: false @@ -565,7 +564,7 @@ jobs: if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) && github.repository == 'open-telemetry/opentelemetry-collector-contrib' steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: ~1.20.12 cache: false diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 44a330147539..b2755d933ab8 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -23,7 +23,7 @@ concurrency: jobs: changelog: runs-on: ubuntu-latest - if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' }} + if: ${{ github.actor != 'dependabot[bot]' }} env: PR_HEAD: ${{ github.event.pull_request.head.sha }} @@ -31,7 +31,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: ~1.20.12 cache: false diff --git a/.github/workflows/check-links.yaml b/.github/workflows/check-links.yaml index b1213f7e7426..83817d99f1f5 100644 --- a/.github/workflows/check-links.yaml +++ b/.github/workflows/check-links.yaml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest env: PR_HEAD: ${{ github.event.pull_request.head.sha }} - if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' }} + if: ${{ github.actor != 'dependabot[bot]' }} outputs: md: ${{ steps.changes.outputs.md }} steps: diff --git a/.github/workflows/close-stale.yaml b/.github/workflows/close-stale.yaml index bc1df5ddc486..b78d73c099de 100644 --- a/.github/workflows/close-stale.yaml +++ b/.github/workflows/close-stale.yaml @@ -12,7 +12,7 @@ jobs: steps: - name: Check rate_limit before run: gh api /rate_limit - - uses: actions/stale@v8 + - uses: actions/stale@v9 with: repo-token: ${{ secrets.GITHUB_TOKEN }} stale-pr-message: 'This PR was marked stale due to lack of activity. It will be closed in 14 days.' diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index fe82bf864728..38f390db214d 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -7,7 +7,7 @@ on: jobs: CodeQL-Build: runs-on: macos-latest - if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' }} + if: ${{ github.actor != 'dependabot[bot]' }} env: # Force CodeQL to run the extraction on the files compiled by our custom # build command, as opposed to letting the autobuilder figure it out. @@ -16,14 +16,14 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: ~1.20.12 cache: false # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: go @@ -32,6 +32,6 @@ jobs: make otelcontribcol - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 timeout-minutes: 60 diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index c769772267eb..a297f8a4bc1a 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -14,11 +14,11 @@ env: jobs: collector-build: runs-on: ubuntu-latest - if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' }} + if: ${{ github.actor != 'dependabot[bot]' }} steps: - name: Checkout uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: ~1.20.12 cache: false @@ -47,7 +47,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: ~1.20.8 cache: false @@ -68,6 +68,7 @@ jobs: with: name: collector-binary path: bin/ + - run: chmod +x bin/* - name: Build Docker Image run: | make docker-otelcontribcol @@ -89,7 +90,7 @@ jobs: needs: docker-build steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: ~1.20.12 cache: false @@ -147,7 +148,7 @@ jobs: needs: collector-build steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: ~1.20.8 cache: false diff --git a/.github/workflows/load-tests.yml b/.github/workflows/load-tests.yml index a5e9f2cc390c..6421f7e185b2 100644 --- a/.github/workflows/load-tests.yml +++ b/.github/workflows/load-tests.yml @@ -19,12 +19,12 @@ jobs: setup-environment: timeout-minutes: 30 runs-on: self-hosted - if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' }} + if: ${{ github.actor != 'dependabot[bot]' }} outputs: loadtest_matrix: ${{ steps.splitloadtest.outputs.loadtest_matrix }} steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: ~1.20.12 cache: false @@ -62,7 +62,7 @@ jobs: matrix: ${{ fromJson(needs.setup-environment.outputs.loadtest_matrix) }} steps: - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: ~1.20.12 cache: false diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index 3701fcf0043b..8ca8474c846d 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@v4 with: path: opentelemetry-collector-contrib - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: ~1.20.12 cache: false diff --git a/.github/workflows/prometheus-compliance-tests.yml b/.github/workflows/prometheus-compliance-tests.yml index dae67fdd888b..ee787744ff74 100644 --- a/.github/workflows/prometheus-compliance-tests.yml +++ b/.github/workflows/prometheus-compliance-tests.yml @@ -19,12 +19,12 @@ env: jobs: prometheus-compliance-tests: runs-on: ubuntu-latest - if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' }} + if: ${{ github.actor != 'dependabot[bot]' }} steps: - uses: actions/checkout@v4 with: path: opentelemetry-collector-contrib - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: ~1.20.12 cache: false diff --git a/.github/workflows/telemetrygen.yml b/.github/workflows/telemetrygen.yml index 4fba30033737..0286ce6c27c2 100644 --- a/.github/workflows/telemetrygen.yml +++ b/.github/workflows/telemetrygen.yml @@ -14,15 +14,20 @@ concurrency: jobs: build-dev: runs-on: ubuntu-latest - if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' }} + if: ${{ github.actor != 'dependabot[bot]' }} steps: - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Build telemetrygen uses: docker/build-push-action@v5 with: context: cmd/telemetrygen push: false tags: ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:dev + platforms: linux/amd64,linux/arm64,linux/s390x,linux/ppc64le publish-latest: runs-on: ubuntu-latest @@ -31,6 +36,10 @@ jobs: packages: write steps: - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: @@ -43,6 +52,7 @@ jobs: context: cmd/telemetrygen push: true tags: ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:latest + platforms: linux/amd64,linux/arm64,linux/s390x,linux/ppc64le publish-stable: runs-on: ubuntu-latest @@ -51,6 +61,10 @@ jobs: packages: write steps: - uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Set Release Tag id: github_tag run: ./.github/workflows/scripts/set_release_tag.sh @@ -61,8 +75,9 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Push telemetrygen to Github packages - run: | - docker build cmd/telemetrygen -t ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:$RELEASE_TAG - docker push ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:$RELEASE_TAG - env: - RELEASE_TAG: ${{ steps.github_tag.outputs.tag }} + uses: docker/build-push-action@v5 + with: + context: cmd/telemetrygen + push: true + tags: ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:${{ steps.github_tag.outputs.tag }} + platforms: linux/amd64,linux/arm64,linux/s390x,linux/ppc64le diff --git a/.github/workflows/tidy-dependencies.yml b/.github/workflows/tidy-dependencies.yml index 57fc2f634ff4..b7234e412dc0 100644 --- a/.github/workflows/tidy-dependencies.yml +++ b/.github/workflows/tidy-dependencies.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: ~1.20.12 cache: false diff --git a/Makefile.Common b/Makefile.Common index fae4d9c3a338..ddb3194f9c9a 100644 --- a/Makefile.Common +++ b/Makefile.Common @@ -82,9 +82,16 @@ ALL_SRC := $(shell find $(ALL_PKG_DIRS) -name '*.go' \ -type f | sort) # All source code and documents. Used in spell check. -ALL_SRC_AND_DOC := $(shell find $(ALL_PKG_DIRS) -name "*.md" -o -name "*.go" -o -name "*.yaml" \ - -not -path '*/third_party/*' \ - -type f | sort) +ALL_SRC_AND_DOC_CMD := find $(ALL_PKG_DIRS) -name "*.md" -o -name "*.go" -o -name "*.yaml" -not -path '*/third_party/*' -type f | sort +ifeq ($(UNIX_SHELL_ON_WINDOWS),true) + # Windows has a low limit, 8192 chars, to create a process. Workaround it by breaking it in smaller commands. + MISSPELL_CMD := $(ALL_SRC_AND_DOC_CMD) | xargs -n 20 $(MISSPELL) + MISSPELL_CORRECTION_CMD := $(ALL_SRC_AND_DOC_CMD) | xargs -n 20 $(MISSPELL_CORRECTION) +else + ALL_SRC_AND_DOC := $(shell $(ALL_SRC_AND_DOC_CMD)) + MISSPELL_CMD := $(MISSPELL) $(ALL_SRC_AND_DOC) + MISSPELL_CORRECTION_CMD := $(MISSPELL_CORRECTION) $(ALL_SRC_AND_DOC) +endif # ALL_PKGS is used with 'go cover' ALL_PKGS := $(shell $(GOCMD) list $(sort $(dir $(ALL_SRC)))) @@ -190,11 +197,11 @@ tidy: .PHONY: misspell misspell: $(TOOLS_BIN_DIR)/misspell @echo "running $(MISSPELL)" - @$(MISSPELL) $(ALL_SRC_AND_DOC) + @$(MISSPELL_CMD) .PHONY: misspell-correction misspell-correction: $(TOOLS_BIN_DIR)/misspell - $(MISSPELL_CORRECTION) $(ALL_SRC_AND_DOC) + $(MISSPELL_CORRECTION_CMD) .PHONY: moddownload moddownload: diff --git a/cmd/configschema/go.mod b/cmd/configschema/go.mod index b9647161c2cd..f4b79ee248ec 100644 --- a/cmd/configschema/go.mod +++ b/cmd/configschema/go.mod @@ -22,8 +22,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.0 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.9.0 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.9.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.10.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.10.0 // 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.91.0 // indirect @@ -183,7 +183,7 @@ require ( cloud.google.com/go/longrunning v0.5.4 // indirect cloud.google.com/go/monitoring v1.16.3 // indirect cloud.google.com/go/pubsub v1.33.0 // indirect - cloud.google.com/go/spanner v1.53.1 // indirect + cloud.google.com/go/spanner v1.54.0 // indirect cloud.google.com/go/trace v1.10.4 // indirect code.cloudfoundry.org/clock v1.0.0 // indirect code.cloudfoundry.org/go-diodes v0.0.0-20211115184647-b584dd5df32c // indirect @@ -202,7 +202,7 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1 // indirect 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/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.1 // indirect github.com/Azure/azure-storage-queue-go v0.0.0-20230531184854-c06a8eff66fe // indirect github.com/Azure/go-amqp v1.0.2 // indirect github.com/Azure/go-autorest v14.2.0+incompatible // indirect @@ -215,23 +215,23 @@ require ( github.com/Azure/go-autorest/tracing v0.6.0 // indirect github.com/ClickHouse/ch-go v0.58.2 // indirect github.com/ClickHouse/clickhouse-go/v2 v2.16.0 // indirect - github.com/DataDog/agent-payload/v5 v5.0.101 // indirect - github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/trace v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0-rc.7 // indirect + github.com/DataDog/agent-payload/v5 v5.0.102 // indirect + github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/proto v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/trace v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0 // indirect github.com/DataDog/datadog-api-client-go/v2 v2.20.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-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.9.0 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.9.0 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.9.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.10.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.10.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.10.0 // indirect github.com/DataDog/sketches-go v1.4.3 // indirect github.com/DataDog/zstd v1.5.2 // indirect github.com/GehirnInc/crypt v0.0.0-20200316065508-bb7000b8a962 // indirect @@ -244,7 +244,7 @@ require ( 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 - github.com/SAP/go-hdb v1.6.5 // indirect + github.com/SAP/go-hdb v1.6.6 // indirect github.com/SermoDigital/jose v0.9.2-0.20180104203859-803625baeddc // indirect github.com/Showmax/go-fqdn v1.0.0 // indirect github.com/aerospike/aerospike-client-go/v6 v6.13.0 // indirect @@ -258,7 +258,7 @@ 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.49.1 // indirect + github.com/aws/aws-sdk-go v1.49.6 // indirect github.com/aws/aws-sdk-go-v2 v1.24.0 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4 // indirect github.com/aws/aws-sdk-go-v2/config v1.26.1 // indirect @@ -384,7 +384,7 @@ require ( github.com/hashicorp/cronexpr v1.1.2 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-hclog v1.5.0 // indirect + github.com/hashicorp/go-hclog v1.6.2 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.4 // indirect @@ -392,6 +392,7 @@ require ( github.com/hashicorp/go-uuid v1.0.3 // indirect github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/nomad/api v0.0.0-20230721134942-515895c7690c // indirect github.com/hashicorp/serf v0.10.1 // indirect @@ -448,7 +449,7 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-ieproxy v0.0.11 // indirect github.com/mattn/go-isatty v0.0.19 // indirect - github.com/mattn/go-sqlite3 v1.14.18 // indirect + github.com/mattn/go-sqlite3 v1.14.19 // indirect github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/microsoft/ApplicationInsights-Go v0.4.4 // indirect github.com/miekg/dns v1.1.56 // indirect @@ -567,7 +568,7 @@ require ( github.com/prometheus/prometheus v0.48.1 // indirect github.com/prometheus/statsd_exporter v0.22.7 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/redis/go-redis/v9 v9.3.0 // indirect + github.com/redis/go-redis/v9 v9.3.1 // indirect github.com/relvacode/iso8601 v1.3.0 // indirect github.com/rs/cors v1.10.1 // indirect github.com/sagikazarmark/locafero v0.3.0 // indirect @@ -580,7 +581,7 @@ require ( github.com/shirou/gopsutil/v3 v3.23.11 // indirect github.com/shopspring/decimal v1.3.1 // indirect github.com/signalfx/com_signalfx_metrics_protobuf v0.0.3 // indirect - github.com/signalfx/sapm-proto v0.13.0 // indirect + github.com/signalfx/sapm-proto v0.14.0 // indirect github.com/sijms/go-ora/v2 v2.7.26 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/snowflakedb/gosnowflake v1.7.1 // indirect @@ -595,8 +596,8 @@ require ( github.com/stretchr/objx v0.5.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.816 // indirect - github.com/tg123/go-htpasswd v1.2.1 // indirect + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.821 // indirect + github.com/tg123/go-htpasswd v1.2.2 // indirect github.com/tidwall/gjson v1.14.3 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.0 // indirect @@ -610,7 +611,7 @@ require ( github.com/vishvananda/netlink v1.2.1-beta.2 // indirect github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f // indirect github.com/vmware/go-vmware-nsxt v0.0.0-20230223012718-d31b8a1ca05e // indirect - github.com/vmware/govmomi v0.34.0 // indirect + github.com/vmware/govmomi v0.34.1 // indirect github.com/vultr/govultr/v2 v2.17.2 // indirect github.com/wavefronthq/wavefront-sdk-go v0.15.0 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect @@ -675,23 +676,23 @@ require ( 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.16.0 // indirect - golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect + golang.org/x/crypto v0.17.0 // indirect + golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/oauth2 v0.15.0 // indirect golang.org/x/sync v0.5.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.0 // indirect - golang.org/x/time v0.4.0 // indirect + golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.16.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect gonum.org/v1/gonum v0.14.0 // indirect - google.golang.org/api v0.151.0 // indirect + google.golang.org/api v0.154.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect - google.golang.org/grpc v1.60.0 // indirect + google.golang.org/grpc v1.60.1 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect @@ -703,15 +704,15 @@ require ( k8s.io/apimachinery v0.28.4 // indirect k8s.io/client-go v0.28.4 // indirect k8s.io/klog v1.0.0 // indirect - k8s.io/klog/v2 v2.100.1 // indirect + k8s.io/klog/v2 v2.110.1 // indirect k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect k8s.io/kubelet v0.28.4 // indirect - k8s.io/utils v0.0.0-20230711102312-30195339c3c7 // indirect + k8s.io/utils v0.0.0-20231127182322-b307cd553661 // indirect sigs.k8s.io/controller-runtime v0.16.3 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect sigs.k8s.io/yaml v1.3.0 // indirect - skywalking.apache.org/repo/goapi v0.0.0-20231026090926-09378dd56587 // indirect + skywalking.apache.org/repo/goapi v0.0.0-20231213062226-7849efc09ba3 // indirect ) // Replace references to modules that are in this repository with their relateive paths @@ -1154,3 +1155,11 @@ replace ( github.com/open-telemetry/opentelemetry-collector-contrib/connector/servicegraphconnector => ../../connector/servicegraphconnector github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector => ../../connector/spanmetricsconnector ) + +replace github.com/open-telemetry/opentelemetry-collector-contrib/testbed/mockdatasenders/mockdatadogagentexporter => ../../testbed/mockdatasenders/mockdatadogagentexporter + +replace github.com/open-telemetry/opentelemetry-collector-contrib/testbed/mockdatareceivers/mockawsxrayreceiver => ../../testbed/mockdatareceivers/mockawsxrayreceiver + +replace github.com/open-telemetry/opentelemetry-collector-contrib/testbed => ../../testbed + +replace github.com/open-telemetry/opentelemetry-collector-contrib/exporter/syslogexporter => ../../exporter/syslogexporter diff --git a/cmd/configschema/go.sum b/cmd/configschema/go.sum index 4fd267677f03..c7fcda614f7f 100644 --- a/cmd/configschema/go.sum +++ b/cmd/configschema/go.sum @@ -51,8 +51,8 @@ cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIA cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= cloud.google.com/go/pubsub v1.33.0 h1:6SPCPvWav64tj0sVX/+npCBKhUi/UjJehy9op/V3p2g= cloud.google.com/go/pubsub v1.33.0/go.mod h1:f+w71I33OMyxf9VpMVcZbnG5KSUkCOUHYpFd5U1GdRc= -cloud.google.com/go/spanner v1.53.1 h1:xNmE0SXMSxNBuk7lRZ5G/S+A49X91zkSTt7Jn5Ptlvw= -cloud.google.com/go/spanner v1.53.1/go.mod h1:liG4iCeLqm5L3fFLU5whFITqP0e0orsAW1uUSrd4rws= +cloud.google.com/go/spanner v1.54.0 h1:ttU+lhARPF/iZE3OkCpmfsemCz9mLaqBhGPd3Qub2sQ= +cloud.google.com/go/spanner v1.54.0/go.mod h1:wZvSQVBgngF0Gq86fKup6KIYmN2be7uOKjtK97X+bQU= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= @@ -113,9 +113,9 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2 v2.2 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2 v2.2.1/go.mod h1:Bzf34hhAE9NSxailk8xVeLEZbUjOXcC+GnU1mMKdhLw= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 h1:Dd+RhdJn0OTtVGaeDLZpcumkIVCtA/3/Fo42+eoYvVM= 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.2.0 h1:Ma67P/GGprNwsslzEH6+Kb8nybI8jpDTm4Wmzu2ReK8= -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/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0 h1:AifHbc4mg0x9zW52WOpKbsHaDKuRhlI7TVl47thgQ70= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.1 h1:AMf7YbZOZIW5b66cXNHMWWT/zkjhz5+a+k/3x40EO7E= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.1/go.mod h1:uwfk06ZBcvL/g4VHNjurPfVln9NMbsk2XIZxJ+hu81k= github.com/Azure/azure-storage-queue-go v0.0.0-20230531184854-c06a8eff66fe h1:HGuouUM1533rBXmMtR7qh5pYNSSjUZG90b/MgJAnb/A= github.com/Azure/azure-storage-queue-go v0.0.0-20230531184854-c06a8eff66fe/go.mod h1:K6am8mT+5iFXgingS9LUc7TmbsW6XBw3nxaRyaMyWc8= github.com/Azure/go-amqp v1.0.2 h1:zHCHId+kKC7fO8IkwyZJnWMvtRXhYC0VJtD0GYkHc6M= @@ -155,24 +155,24 @@ github.com/ClickHouse/ch-go v0.58.2/go.mod h1:Ap/0bEmiLa14gYjCiRkYGbXvbe8vwdrfTY github.com/ClickHouse/clickhouse-go/v2 v2.16.0 h1:rhMfnPewXPnY4Q4lQRGdYuTLRBRKJEIEYHtbUMrzmvI= github.com/ClickHouse/clickhouse-go/v2 v2.16.0/go.mod h1:J7SPfIxwR+x4mQ+o8MLSe0oY50NNntEqCIjFe/T1VPM= github.com/DATA-DOG/go-sqlmock v1.5.1 h1:FK6RCIUSfmbnI/imIICmboyQBkOckutaa6R5YYlLZyo= -github.com/DataDog/agent-payload/v5 v5.0.101 h1:/MjtenucwoRzv1cafv46fcvserECivPKEWDsemT2Grg= -github.com/DataDog/agent-payload/v5 v5.0.101/go.mod h1:COngtbYYCncpIPiE5D93QlXDH/3VAKk10jDNwGHcMRE= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0-rc.7 h1:ULN8UQqgtmEgWvOEIDzWgxLZ3TEZJ9MXBUpVGE8PPBc= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0-rc.7/go.mod h1:A4nLJvxlg6BO/8/zg81til9yT0uRPuXDFMAzDMpmgn4= -github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7 h1:qJuxmeIiXZNML5/Y9KEf7QKEKKIeliiTIxgRGvGAQBc= -github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7/go.mod h1:HvK26YCxg6MfYvPJgpHC7nSjw6DTpNhd75Wlb0GAvis= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0-rc.7 h1:pQh4uZnc9mQbGMJ1R8C88GlseqmdFIKftDZLrQW71Ss= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0-rc.7/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= -github.com/DataDog/datadog-agent/pkg/trace v0.50.0-rc.7 h1:qWKAINgUtyuJQOCcthjPST8PzigPP8Pr0EtHdTgJVoA= -github.com/DataDog/datadog-agent/pkg/trace v0.50.0-rc.7/go.mod h1:i6OrrkHDlgCB4vUaPfM4FxVij2QdA/t07Ykwu74ySGA= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0-rc.7 h1:J7ocZItHWrUEvGWVqFa7wsghotcF53oFn1qH7Tlh7VM= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0-rc.7/go.mod h1:b0I5L9Eegsq3kca9pQCAVt1rQHI05sza7LVHKGzC+ms= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.0-rc.7 h1:vBo+iVlLpjrvJkX88mbFDtWFy0F6tEi865p+N4RTf7A= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.0-rc.7/go.mod h1:/fGZteE4rr3iz6y30a0A3MuebJ6Jckx+AiKcyYgT87k= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0-rc.7 h1:eM+GcYjk4sSik8tFgf8zNT1KViZZM4F4I580SZnTs7s= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0-rc.7/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0-rc.7 h1:QByjh+uLdnYjqIjdYP9XyEgObD9o8ydL4jBy4sEPlbU= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0-rc.7/go.mod h1:EOGgNrSPskIxY3+KgCl+yEggMjrGqrA2oL5va+/p2jM= +github.com/DataDog/agent-payload/v5 v5.0.102 h1:X8EZQeOewahQ7N/arllAP7hCGHNScdThnGjPg5/ErN8= +github.com/DataDog/agent-payload/v5 v5.0.102/go.mod h1:COngtbYYCncpIPiE5D93QlXDH/3VAKk10jDNwGHcMRE= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0 h1:WOyRfsLPYO24Z6Q+s1jcjoOFYJUJ4PgiNaGz/qJCba0= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0/go.mod h1:A4nLJvxlg6BO/8/zg81til9yT0uRPuXDFMAzDMpmgn4= +github.com/DataDog/datadog-agent/pkg/proto v0.50.0 h1:FAzs/Hofs9CN7jYYd2P4l8/igdcDPc7q9amIXSje/3A= +github.com/DataDog/datadog-agent/pkg/proto v0.50.0/go.mod h1:HvK26YCxg6MfYvPJgpHC7nSjw6DTpNhd75Wlb0GAvis= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0 h1:/V/WtjIQCDNJpRVJ/wSfmUakLhBhxJ7joqwM7DXc9hI= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= +github.com/DataDog/datadog-agent/pkg/trace v0.50.0 h1:gZt7YTwtptMNYUN/Z5QHnabOz0ILHvSKC0jpTqqiXBo= +github.com/DataDog/datadog-agent/pkg/trace v0.50.0/go.mod h1:fV11a6fzBAbzgF8ie5Bk51rvLS5kMcsXjwaCzPAfsrk= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0 h1:jSAW27LAnpdZGEe8B0FzSbVT8YdmvPGxV/l8SDUKzYY= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0/go.mod h1:QO56TX/gJf9yZ8q+ix0EEjck6kJu+oirAvJPk8xpFa0= +github.com/DataDog/datadog-agent/pkg/util/log v0.50.0 h1:qIqqLKov9yjoHuoOK//a49vFiBZyduswcJz7jwgKuuo= +github.com/DataDog/datadog-agent/pkg/util/log v0.50.0/go.mod h1:byH8to7LKxTK5m7jf1n222QMeL55iiVszk+OA7Qxfao= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0 h1:MXYW7B+OamUkSBGVsLkPQt7bjQhO52Q6qym3VluB8IM= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0 h1:0QrqgObZkmv2Fcr10CN+pONfIeoul5loof3t20B1AAA= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0/go.mod h1:EOGgNrSPskIxY3+KgCl+yEggMjrGqrA2oL5va+/p2jM= github.com/DataDog/datadog-api-client-go/v2 v2.20.0 h1:80T+UuTh+28qODc2vw+HxzMoIu0dYBT7/RCHXxdYpJE= github.com/DataDog/datadog-api-client-go/v2 v2.20.0/go.mod h1:oD5Lx8Li3oPRa/BSBenkn4i48z+91gwYORF/+6ph71g= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= @@ -184,17 +184,17 @@ github.com/DataDog/go-tuf v1.0.2-0.5.2 h1:EeZr937eKAWPxJ26IykAdWA4A0jQXJgkhUjqEI 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.9.0 h1:y8rL7rCty4VhPFJi6TgOZXI7MrGRVYNV0oqbNblWi/c= -github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.9.0/go.mod h1:x+QjxvvVxewuyNymMjR+2fm0LAQSMF2mhw7Yhx61jp4= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.9.0 h1:oT5B12H+tLtAEEH0YqgmppofM/yRBzyI9+ykS9OQvIs= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.9.0 h1:Y+CllChr2yfE2RLd+c5hvK56DDGVEdDrhAl1OyzuuwU= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.9.0/go.mod h1:naFq9h+fQpgI7AKJ+YkWlAAYDU8/FB8LyfA39bmRNHs= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.9.0 h1:FbqbNsZ3179TUV+y932rKhhTxHMS5adlBb+9om1heGY= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.9.0/go.mod h1:v0FMEai3NccZjZr2jmX4t8Nobh3R8KxoRuj6PExoTRo= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.9.0 h1:WsCPJS+a34kw1gj46WpJjQBHrLVwh1ubCdHUx9nf1ec= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.9.0/go.mod h1:m61Tq6DA2U+PjNTX6WD3TH2U7QnA49+7IGaYK4bu7fQ= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.9.0 h1:U93rYuk3ChT/I+2r36JI8agi1AwdH8vRiHh+bCSXZeU= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.9.0/go.mod h1:KOzWHRj2AcJPmP1hm4WQUfzEIYRBP4NaTX9Iu+D3UNs= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.10.0 h1:kiPtYAgzvlOc6HV0qwS8xNeA39cYyAJs6q9dIRDpCFk= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.10.0/go.mod h1:MV/L0ESKjLGGE4JPDIDtz6H5u+9w0UKp1Wsw2lLREII= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.10.0 h1:O2PYvgTQA+31NuepzQqLexEpUX8FWsdNgq+0241OtH0= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.10.0 h1:56vp8vflG6lmhTO+YldUBTe0cIjStOC1neW1dIHYm5s= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.10.0/go.mod h1:naFq9h+fQpgI7AKJ+YkWlAAYDU8/FB8LyfA39bmRNHs= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.10.0 h1:+LxQNTpRM57lfcbGV7s+PVQ2B2Pegabfpf3yGJUXcgM= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.10.0/go.mod h1:WYm0DRBxBrKrmZrwoAJhcyJ7bGAFZbVQFcrrwwaGozU= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.10.0 h1:XwGT7/2NnO1RGxS5WD4BTsLWqO+z8234XBccUGhP8tM= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.10.0/go.mod h1:1fYkFs2pUyqBUUVDsjn1cKVEI79R+NluYhqX+pDTkSY= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.10.0 h1:mEao3xEP7iCfCd+teps0oM8U+ZRPVz02W6aE5cfi2Sc= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.10.0/go.mod h1:vPjlCjTrBzzZpVJbbVpox8x9nRYx5giCl/9Zy8oWFw0= github.com/DataDog/sketches-go v1.4.3 h1:ZB9nijteJRFUQixkQfatCqASartGNfiolIlMiEv3u/w= github.com/DataDog/sketches-go v1.4.3/go.mod h1:XR0ns2RtEEF09mDKXiKZiQg+nfZStrq1ZuL1eezeZe0= github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= @@ -233,8 +233,8 @@ github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/ReneKroon/ttlcache/v2 v2.11.0 h1:OvlcYFYi941SBN3v9dsDcC2N8vRxyHcCmJb3Vl4QMoM= github.com/ReneKroon/ttlcache/v2 v2.11.0/go.mod h1:mBxvsNY+BT8qLLd6CuAJubbKo6r0jh3nb5et22bbfGY= -github.com/SAP/go-hdb v1.6.5 h1:MmlBKJPV82HyVGJQr2PIC1g0HK+90qyUPuf7yPNSKZ8= -github.com/SAP/go-hdb v1.6.5/go.mod h1:RESA/tq6gO9jnSKeXokpnlWOYGmJ2jmCat+rC+AhRCI= +github.com/SAP/go-hdb v1.6.6 h1:n0uqv+omYcz01sLXQ4bK7vDj76x5ELU0qJ/8PPgri08= +github.com/SAP/go-hdb v1.6.6/go.mod h1:RESA/tq6gO9jnSKeXokpnlWOYGmJ2jmCat+rC+AhRCI= github.com/SermoDigital/jose v0.9.2-0.20161205224733-f6df55f235c2/go.mod h1:ARgCUhI1MHQH+ONky/PAtmVHQrP5JlGY0F3poXOp/fA= github.com/SermoDigital/jose v0.9.2-0.20180104203859-803625baeddc h1:MhBvG7RLaLqlyjxMR6of35vt6MVQ+eXMcgn9X/sy0FE= github.com/SermoDigital/jose v0.9.2-0.20180104203859-803625baeddc/go.mod h1:ARgCUhI1MHQH+ONky/PAtmVHQrP5JlGY0F3poXOp/fA= @@ -319,8 +319,8 @@ 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.49.1 h1:Dsamcd8d/nNb3A+bZ0ucfGl0vGZsW5wlRW0vhoYGoeQ= -github.com/aws/aws-sdk-go v1.49.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= +github.com/aws/aws-sdk-go v1.49.6/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= @@ -494,7 +494,6 @@ 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/deepmap/oapi-codegen v1.12.4 h1:pPmn6qI9MuOtCz82WY2Xaw46EQjgvxednXXrP7g5Q2s= github.com/denisenkom/go-mssqldb v0.12.3 h1:pBSGx9Tq67pBOTLmxNuirNTeB8Vjmf886Kx+8Y+8shw= github.com/denisenkom/go-mssqldb v0.12.3/go.mod h1:k0mtMFOnU+AihqFxPMiF05rtiDrorD1Vrm1KEz5hxDo= github.com/dennwc/varint v1.0.0 h1:kGNFFSSw8ToIy3obO/kKr8U9GZYUAxQEVuix4zfDWzE= @@ -626,7 +625,6 @@ github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KE github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -857,8 +855,8 @@ github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= -github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-hclog v1.6.2 h1:NOtoftovWkDheyUM/8JW3QMiXyxJK3uHRK7wV04nD2I= +github.com/hashicorp/go-hclog v1.6.2/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -890,6 +888,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 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/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= @@ -920,7 +920,7 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2 github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= 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.12.4 h1:9qJLqetEmhIlqaF/N9KUtdmRKSbNy6IohggyS3bxWlE= +github.com/influxdata/influxdb-client-go/v2 v2.13.0 h1:ioBbLmR5NMbAjP4UVA5r9b5xGjpABD7j65pI8kFphDM= github.com/influxdata/influxdb-observability/common v0.5.8 h1:nyk4dqnKbPGIyr1vAs6oEsFQEHWi5jkSQ7PtP4v//lc= github.com/influxdata/influxdb-observability/common v0.5.8/go.mod h1:aG8A2gbtXbl/P2FePd6QNsCUSOkcvz1n+NL5dJLUO1s= github.com/influxdata/influxdb-observability/influx2otel v0.5.8 h1:pHkeImZksXNNQbbH/w1qPuC/u6e7cK3kTG12otQHDuE= @@ -1130,8 +1130,8 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/ github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-sqlite3 v1.14.18 h1:JL0eqdCOq6DJVNPSvArO/bIV9/P7fbGrV00LZHc+5aI= -github.com/mattn/go-sqlite3 v1.14.18/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= +github.com/mattn/go-sqlite3 v1.14.19 h1:fhGleo2h1p8tVChob4I9HpmVFIAkKGpiukdrgQbWfGI= +github.com/mattn/go-sqlite3 v1.14.19/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= 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= @@ -1218,6 +1218,7 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oapi-codegen/runtime v1.0.0 h1:P4rqFX5fMFWqRzY9M/3YF9+aPSPPB06IzP2P7oOxrWo= github.com/observiq/nanojack v0.0.0-20201106172433-343928847ebc h1:49ewVBwLcy+eYqI4R0ICilCI4dPjddpFXWv3liXzUxM= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= @@ -1378,8 +1379,8 @@ github.com/prometheus/statsd_exporter v0.22.7/go.mod h1:N/TevpjkIh9ccs6nuzY3jQn9 github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/redis/go-redis/v9 v9.3.0 h1:RiVDjmig62jIWp7Kk4XVLs0hzV6pI3PyTnnL0cnn0u0= -github.com/redis/go-redis/v9 v9.3.0/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= +github.com/redis/go-redis/v9 v9.3.1 h1:KqdY8U+3X6z+iACvumCNxnoluToB+9Me+TvyFa21Mds= +github.com/redis/go-redis/v9 v9.3.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= github.com/relvacode/iso8601 v1.3.0 h1:HguUjsGpIMh/zsTczGN3DVJFxTU/GX+MMmzcKoMO7ko= github.com/relvacode/iso8601 v1.3.0/go.mod h1:FlNp+jz+TXpyRqgmM7tnzHHzBnz776kmAH2h3sZCn0I= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= @@ -1428,8 +1429,8 @@ github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFR github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/signalfx/com_signalfx_metrics_protobuf v0.0.3 h1:32k2QLgsKhcEs55q4REPKyIadvid5FPy2+VMgvbmKJ0= github.com/signalfx/com_signalfx_metrics_protobuf v0.0.3/go.mod h1:gJrXWi7wSGXfiC7+VheQaz+ypdCt5SmZNL+BRxUe7y4= -github.com/signalfx/sapm-proto v0.13.0 h1:yEkp1+MAU4vZvnJMp56uhVlRjlvCK7KQjBg0g2Apw8k= -github.com/signalfx/sapm-proto v0.13.0/go.mod h1:C72HjeCW5v0Llk6pIVJ/ZH8A5GbiZpCCSkE1dSlpWxY= +github.com/signalfx/sapm-proto v0.14.0 h1:KWh3I5E4EkelB19aP1/54Ik8khSioC/RVRW/riOfRGg= +github.com/signalfx/sapm-proto v0.14.0/go.mod h1:Km6PskZh966cqNoUn3AmRyGRix5VfwnxVBvn2vjRC9U= github.com/sijms/go-ora/v2 v2.7.26 h1:+o/1ej7znA/Wpklv9eTiyp4Jqn2DU9Urw9YHrtPRP64= github.com/sijms/go-ora/v2 v2.7.26/go.mod h1:EHxlY6x7y9HAsdfumurRfTd+v8NrEOTR3Xl4FWlH6xk= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -1502,11 +1503,11 @@ github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSW github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tedsuo/ifrit v0.0.0-20180802180643-bea94bb476cc/go.mod h1:eyZnKCc955uh98WQvzOm0dgAeLnf2O0Rz0LPoC5ze+0= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.816 h1:hPkFIZPc3PKsiqm6OdS0mSgW7LISfxsR5NrQIsWPiYo= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.816/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.821 h1:WEHm7jX2S+bzFt3IbatdWKTh8oRZF2M5M9h/uymxTHQ= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.821/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/testcontainers/testcontainers-go v0.26.0 h1:uqcYdoOHBy1ca7gKODfBd9uTHVK3a7UL848z09MVZ0c= -github.com/tg123/go-htpasswd v1.2.1 h1:i4wfsX1KvvkyoMiHZzjS0VzbAPWfxzI8INcZAKtutoU= -github.com/tg123/go-htpasswd v1.2.1/go.mod h1:erHp1B86KXdwQf1X5ZrLb7erXZnWueEQezb2dql4q58= +github.com/tg123/go-htpasswd v1.2.2 h1:tmNccDsQ+wYsoRfiONzIhDm5OkVHQzN3w4FOBAlN6BY= +github.com/tg123/go-htpasswd v1.2.2/go.mod h1:FcIrK0J+6zptgVwK1JDlqyajW/1B4PtuJ/FLWl7nx8A= github.com/tidwall/gjson v1.10.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.14.3 h1:9jvXn7olKEHU1S9vwoMGliaT8jq1vJ7IH/n9zD9Dnlw= github.com/tidwall/gjson v1.14.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= @@ -1547,8 +1548,8 @@ github.com/vmihailenco/msgpack/v4 v4.3.13 h1:A2wsiTbvp63ilDaWmsk2wjx6xZdxQOvpiNl github.com/vmihailenco/tagparser v0.1.2 h1:gnjoVuB/kljJ5wICEEOpx98oXMWPLj22G67Vbd1qPqc= github.com/vmware/go-vmware-nsxt v0.0.0-20230223012718-d31b8a1ca05e h1:Vu41Q0Pv3yMdd+tcDW6QeEUIK2L+9ZrPrq8NAMrKSLc= github.com/vmware/go-vmware-nsxt v0.0.0-20230223012718-d31b8a1ca05e/go.mod h1:aRq5pxwgdJpAuP97SCjX1+Db32z/b0dggQ07FDF+fqE= -github.com/vmware/govmomi v0.34.0 h1:Aun71BDf1t8r3jNeUWJ3ZM+7kHbIuuNzIuxRVo5LYYU= -github.com/vmware/govmomi v0.34.0/go.mod h1:qWWT6n9mdCr/T9vySsoUqcI04sSEj4CqHXxtk/Y+Los= +github.com/vmware/govmomi v0.34.1 h1:Hqu2Uke2itC+cNoIcFQBLEZvX9wBRTTOP04J7V1fqRw= +github.com/vmware/govmomi v0.34.1/go.mod h1:qWWT6n9mdCr/T9vySsoUqcI04sSEj4CqHXxtk/Y+Los= github.com/vultr/govultr/v2 v2.17.2 h1:gej/rwr91Puc/tgh+j33p/BLR16UrIPnSr+AIwYWZQs= github.com/vultr/govultr/v2 v2.17.2/go.mod h1:ZFOKGWmgjytfyjeyAdhQlSWwTjh2ig+X49cAp50dzXI= github.com/wavefronthq/wavefront-sdk-go v0.15.0 h1:po9E3vh/0y7kOx8D9EtFp7kbSLLLKbmu/w/s1xGJAQU= @@ -1763,8 +1764,9 @@ golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= 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.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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= @@ -1775,8 +1777,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1804,6 +1806,7 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1868,6 +1871,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1899,6 +1904,7 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/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.1.0/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-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -2002,6 +2008,7 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.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.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -2010,6 +2017,8 @@ golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9sn golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -2024,6 +2033,8 @@ 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.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= 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.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -2031,8 +2042,8 @@ golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.4.0 h1:Z81tqI5ddIoXDPvVQ7/7CC9TnLM7ubaFG2qXYd5BbYY= -golang.org/x/time v0.4.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +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-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -2102,6 +2113,7 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.16.0 h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM= golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2137,8 +2149,8 @@ google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjR google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= -google.golang.org/api v0.151.0 h1:FhfXLO/NFdJIzQtCqjpysWwqKk8AzGWBUhMIx67cVDU= -google.golang.org/api v0.151.0/go.mod h1:ccy+MJ6nrYFgE3WgRx/AMXOxOmU8Q4hSa+jjibzhxcg= +google.golang.org/api v0.154.0 h1:X7QkVKZBskztmpPKWQXgjJRPA2dJYrL6r+sYPRLj050= +google.golang.org/api v0.154.0/go.mod h1:qhSMkM85hgqiokIYsrRyKxrjfBeIhgl4Z2JmeRkYylc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -2226,8 +2238,8 @@ google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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= @@ -2318,16 +2330,16 @@ k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= -k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= +k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ= k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM= k8s.io/kubelet v0.28.4 h1:Ypxy1jaFlSXFXbg/yVtFOU2ZxErBVRJfLu8+t4s7Dtw= k8s.io/kubelet v0.28.4/go.mod h1:w1wPI12liY/aeC70nqKYcNNkr6/nbyvdMB7P7wmww2o= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20230711102312-30195339c3c7 h1:ZgnF1KZsYxWIifwSNZFZgNtWE89WI5yiP5WwlfDoIyc= -k8s.io/utils v0.0.0-20230711102312-30195339c3c7/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20231127182322-b307cd553661 h1:FepOBzJ0GXm8t0su67ln2wAZjbQ6RxQGZDnzuLcrUTI= +k8s.io/utils v0.0.0-20231127182322-b307cd553661/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= @@ -2343,6 +2355,6 @@ sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= -skywalking.apache.org/repo/goapi v0.0.0-20231026090926-09378dd56587 h1:TY79I5Y7xRB8q5LQ+MJn7NYsYi0VL5nj1QDrUHwK7cQ= -skywalking.apache.org/repo/goapi v0.0.0-20231026090926-09378dd56587/go.mod h1:onFubXaIoY/2FTRVrLMqCTlaNq4SilAEwF/2G0IcaBw= +skywalking.apache.org/repo/goapi v0.0.0-20231213062226-7849efc09ba3 h1:rqXePgPd1SeNYl4GSHyndwNggpGdOh+9ZMSRCfesgDU= +skywalking.apache.org/repo/goapi v0.0.0-20231213062226-7849efc09ba3/go.mod h1:oD2dxcDAHVIt95Ee7kJHgZ5f64QNhrqTjQYARwfafc4= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/cmd/githubgen/codeowners.go b/cmd/githubgen/codeowners.go index 4df9c3c66921..668513631ea1 100644 --- a/cmd/githubgen/codeowners.go +++ b/cmd/githubgen/codeowners.go @@ -10,7 +10,7 @@ import ( "sort" "strings" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v57/github" ) const allowlistHeader = `# Code generated by githubgen. DO NOT EDIT. diff --git a/cmd/githubgen/go.mod b/cmd/githubgen/go.mod index 3569093338c7..39e5f4ec40cb 100644 --- a/cmd/githubgen/go.mod +++ b/cmd/githubgen/go.mod @@ -3,15 +3,12 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/cmd/githubgen go 1.20 require ( - github.com/google/go-github/v53 v53.2.0 + github.com/google/go-github/v57 v57.0.0 go.opentelemetry.io/collector/confmap v0.91.0 gopkg.in/yaml.v3 v3.0.1 ) require ( - github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect - github.com/cloudflare/circl v1.3.3 // indirect - github.com/golang/protobuf v1.5.3 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect @@ -22,10 +19,4 @@ require ( github.com/mitchellh/reflectwalk v1.0.2 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.15.0 // indirect - golang.org/x/net v0.18.0 // indirect - golang.org/x/oauth2 v0.14.0 // indirect - golang.org/x/sys v0.14.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.31.0 // indirect ) diff --git a/cmd/githubgen/go.sum b/cmd/githubgen/go.sum index 3e98d89dae3c..ba4f5ca1f197 100644 --- a/cmd/githubgen/go.sum +++ b/cmd/githubgen/go.sum @@ -1,19 +1,8 @@ -github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 h1:wPbRQzjjwFc0ih8puEVAOFGELsn1zoIIYdxvML7mDxA= -github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8/go.mod h1:I0gYDMZ6Z5GRU7l58bNFSkPTFN6Yl12dsUlAZ8xy98g= -github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= -github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs= -github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -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/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.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-github/v53 v53.2.0 h1:wvz3FyF53v4BK+AsnvCmeNhf8AkTaeh2SoYu/XUvTtI= -github.com/google/go-github/v53 v53.2.0/go.mod h1:XhFRObz+m/l+UCm9b7KSIC3lT3NWSXGt7mOsAWEloao= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-github/v57 v57.0.0 h1:L+Y3UPTY8ALM8x+TV0lg+IEBI+upibemtBD8Q9u7zHs= +github.com/google/go-github/v57 v57.0.0/go.mod h1:s0omdnye0hvK/ecLvpsGfJMiRt85PimQh4oygmLIxHw= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= @@ -41,34 +30,7 @@ go.opentelemetry.io/collector/featuregate v1.0.0 h1:5MGqe2v5zxaoo73BUOvUTunftX5J go.opentelemetry.io/collector/featuregate v1.0.0/go.mod h1:xGbRuw+GbutRtVVSEy3YR2yuOlEyiUMhN2M9DJljgqY= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= -golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= -golang.org/x/oauth2 v0.14.0 h1:P0Vrf/2538nmC0H+pEQ3MNFRRnVR7RlqyVw+bvm26z0= -golang.org/x/oauth2 v0.14.0/go.mod h1:lAtNWgaWfL4cm7j2OV8TxGi9Qb7ECORx8DktCY74OwM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -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-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= 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/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/cmd/mdatagen/go.mod b/cmd/mdatagen/go.mod index 5d4958cbfdbb..6c9ec4e77d1f 100644 --- a/cmd/mdatagen/go.mod +++ b/cmd/mdatagen/go.mod @@ -10,6 +10,8 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 golang.org/x/text v0.14.0 @@ -34,8 +36,6 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect diff --git a/cmd/mdatagen/internal/metadata/generated_status.go b/cmd/mdatagen/internal/metadata/generated_status.go index e9ab937c5055..5fbfbc838263 100644 --- a/cmd/mdatagen/internal/metadata/generated_status.go +++ b/cmd/mdatagen/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( LogsStability = component.StabilityLevelDevelopment MetricsStability = component.StabilityLevelStable ) + +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/cmd/mdatagen/loader.go b/cmd/mdatagen/loader.go index 859b42cdbf36..701c008138be 100644 --- a/cmd/mdatagen/loader.go +++ b/cmd/mdatagen/loader.go @@ -267,22 +267,21 @@ func loadMetadata(filePath string) (metadata, error) { return md, nil } +var componentTypes = map[string]func(string) string{ + "connector": func(in string) string { return strings.TrimSuffix(in, "connector") }, + "exporter": func(in string) string { return strings.TrimSuffix(in, "exporter") }, + "extension": func(in string) string { return strings.TrimSuffix(in, "extension") }, + "processor": func(in string) string { return strings.TrimSuffix(in, "processor") }, + "scraper": func(in string) string { return strings.TrimSuffix(in, "scraper") }, + "receiver": func(in string) string { return in }, +} + func shortFolderName(filePath string) string { parentFolder := filepath.Base(filepath.Dir(filePath)) - if strings.HasSuffix(parentFolder, "connector") { - return strings.TrimSuffix(parentFolder, "connector") - } - if strings.HasSuffix(parentFolder, "exporter") { - return strings.TrimSuffix(parentFolder, "exporter") - } - if strings.HasSuffix(parentFolder, "extension") { - return strings.TrimSuffix(parentFolder, "extension") - } - if strings.HasSuffix(parentFolder, "processor") { - return strings.TrimSuffix(parentFolder, "processor") - } - if strings.HasSuffix(parentFolder, "receiver") { - return strings.TrimSuffix(parentFolder, "receiver") + for cType := range componentTypes { + if strings.HasSuffix(parentFolder, cType) { + return strings.TrimSuffix(parentFolder, cType) + } } return parentFolder } @@ -291,11 +290,18 @@ func scopeName(filePath string) string { sn := "otelcol" dirs := strings.Split(filepath.Dir(filePath), string(os.PathSeparator)) for _, dir := range dirs { - if dir != "receiver" && strings.HasSuffix(dir, "receiver") { - sn += "/" + dir + // skip directory names for component types + if _, ok := componentTypes[dir]; ok { + continue } - if dir != "scraper" && strings.HasSuffix(dir, "scraper") { - sn += "/" + strings.TrimSuffix(dir, "scraper") + // note here that the only component that receives a different + // treatment is receivers. this is to prevent breaking backwards + // compatibility for anyone that's using the generated metrics w/ + // scope names today. + for cType, normalizeFunc := range componentTypes { + if strings.HasSuffix(dir, cType) { + sn += "/" + normalizeFunc(dir) + } } } return sn diff --git a/cmd/mdatagen/main.go b/cmd/mdatagen/main.go index d65b4ff51505..d42ce8dbef7a 100644 --- a/cmd/mdatagen/main.go +++ b/cmd/mdatagen/main.go @@ -187,6 +187,9 @@ func templatize(tmplFile string, md metadata) *template.Template { "isReceiver": func() bool { return md.Status.Class == "receiver" }, + "isExtension": func() bool { + return md.Status.Class == "extension" + }, "skipLifecycle": func() bool { return md.Tests.SkipLifecycle }, diff --git a/cmd/mdatagen/main_test.go b/cmd/mdatagen/main_test.go index 821894d96dc3..2348aa8de804 100644 --- a/cmd/mdatagen/main_test.go +++ b/cmd/mdatagen/main_test.go @@ -324,12 +324,22 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "foo" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("") +} `, }, { @@ -348,12 +358,22 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "foo" MetricsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("") +} `, }, } diff --git a/cmd/mdatagen/templates/component_test.go.tmpl b/cmd/mdatagen/templates/component_test.go.tmpl index 646917a6cd5e..94739cb73f98 100644 --- a/cmd/mdatagen/templates/component_test.go.tmpl +++ b/cmd/mdatagen/templates/component_test.go.tmpl @@ -23,6 +23,9 @@ import ( "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receivertest" +{{ end }} +{{ if isExtension }} + "go.opentelemetry.io/collector/extension/extensiontest" {{ end }} "go.opentelemetry.io/collector/confmap/confmaptest" {{ if or (isExporter) (isProcessor) }} @@ -299,3 +302,39 @@ func Test_ComponentLifecycle(t *testing.T) { } } {{ end }} + +{{ if isExtension }} +func Test_ComponentLifecycle(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) { + {{ 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(), newAssertNoErrorHost(t))) + 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(), newAssertNoErrorHost(t))) + require.NoError(t, secondExt.Shutdown(context.Background())) + }) +} +{{ end }} diff --git a/cmd/mdatagen/templates/status.go.tmpl b/cmd/mdatagen/templates/status.go.tmpl index b9384570b8e6..654e6b1518a3 100644 --- a/cmd/mdatagen/templates/status.go.tmpl +++ b/cmd/mdatagen/templates/status.go.tmpl @@ -2,11 +2,11 @@ package {{ .Package }} -{{- if .Status.Stability }} import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) -{{- end }} const ( Type = "{{ .Type }}" @@ -15,4 +15,12 @@ const ( {{ toCamelCase $signal }}Stability = component.StabilityLevel{{ casesTitle $stability }} {{- end }} {{- end }} -) \ No newline at end of file +) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("{{ .ScopeName }}") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("{{ .ScopeName }}") +} \ No newline at end of file diff --git a/cmd/opampsupervisor/supervisor/commander/commander.go b/cmd/opampsupervisor/supervisor/commander/commander.go index 23ef147343b6..90901e0e7103 100644 --- a/cmd/opampsupervisor/supervisor/commander/commander.go +++ b/cmd/opampsupervisor/supervisor/commander/commander.go @@ -138,7 +138,8 @@ func (c *Commander) Stop(ctx context.Context) error { return nil } - c.logger.Debug("Stopping agent process", zap.Int("pid", c.cmd.Process.Pid)) + pid := c.cmd.Process.Pid + c.logger.Debug("Stopping agent process", zap.Int("pid", pid)) // Gracefully signal process to stop. if err := c.cmd.Process.Signal(syscall.SIGTERM); err != nil { @@ -154,14 +155,14 @@ func (c *Commander) Stop(ctx context.Context) error { <-waitCtx.Done() if !errors.Is(waitCtx.Err(), context.DeadlineExceeded) { - c.logger.Debug("Agent process successfully stopped.", zap.Int("pid", c.cmd.Process.Pid)) + c.logger.Debug("Agent process successfully stopped.", zap.Int("pid", pid)) return } // Time is out. Kill the process. c.logger.Debug( - "Agent process is not responding to SIGTERM. Sending SIGKILL to kill forcedly.", - zap.Int("pid", c.cmd.Process.Pid)) + "Agent process is not responding to SIGTERM. Sending SIGKILL to kill forcibly.", + zap.Int("pid", pid)) if innerErr = c.cmd.Process.Signal(syscall.SIGKILL); innerErr != nil { return } diff --git a/cmd/otelcontribcol/builder-config.yaml b/cmd/otelcontribcol/builder-config.yaml index 279bc2295838..e6701623ea4c 100644 --- a/cmd/otelcontribcol/builder-config.yaml +++ b/cmd/otelcontribcol/builder-config.yaml @@ -23,6 +23,7 @@ extensions: - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/k8sobserver v0.91.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/dockerobserver v0.91.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/oidcauthextension v0.91.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/opampextension v0.91.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.91.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/remotetapextension v0.91.0 - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/sigv4authextension v0.91.0 @@ -430,3 +431,7 @@ replaces: - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/skywalking => ../../pkg/translator/skywalking - github.com/open-telemetry/opentelemetry-collector-contrib/internal/collectd => ../../internal/collectd - github.com/open-telemetry/opentelemetry-collector-contrib/extension/remotetapextension => ../../extension/remotetapextension + - github.com/open-telemetry/opentelemetry-collector-contrib/extension/opampextension => ../../extension/opampextension + - github.com/open-telemetry/opentelemetry-collector-contrib/testbed/mockdatasenders/mockdatadogagentexporter => ../../testbed/mockdatasenders/mockdatadogagentexporter + - github.com/open-telemetry/opentelemetry-collector-contrib/testbed => ../../testbed + - github.com/open-telemetry/opentelemetry-collector-contrib/testbed/mockdatareceivers/mockawsxrayreceiver => ../../testbed/mockdatareceivers/mockawsxrayreceiver diff --git a/cmd/otelcontribcol/components.go b/cmd/otelcontribcol/components.go index 424267edca4a..b889e8a1b727 100644 --- a/cmd/otelcontribcol/components.go +++ b/cmd/otelcontribcol/components.go @@ -86,6 +86,7 @@ import ( hostobserver "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/hostobserver" k8sobserver "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/k8sobserver" oidcauthextension "github.com/open-telemetry/opentelemetry-collector-contrib/extension/oidcauthextension" + opampextension "github.com/open-telemetry/opentelemetry-collector-contrib/extension/opampextension" pprofextension "github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension" remotetapextension "github.com/open-telemetry/opentelemetry-collector-contrib/extension/remotetapextension" sigv4authextension "github.com/open-telemetry/opentelemetry-collector-contrib/extension/sigv4authextension" @@ -223,6 +224,7 @@ func components() (otelcol.Factories, error) { k8sobserver.NewFactory(), dockerobserver.NewFactory(), oidcauthextension.NewFactory(), + opampextension.NewFactory(), pprofextension.NewFactory(), remotetapextension.NewFactory(), sigv4authextension.NewFactory(), diff --git a/cmd/otelcontribcol/extensions_test.go b/cmd/otelcontribcol/extensions_test.go index 585ed1301f50..64ccfa283a63 100644 --- a/cmd/otelcontribcol/extensions_test.go +++ b/cmd/otelcontribcol/extensions_test.go @@ -30,6 +30,7 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/extension/oauth2clientauthextension" "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecstaskobserver" "github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/hostobserver" + "github.com/open-telemetry/opentelemetry-collector-contrib/extension/opampextension" "github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension" "github.com/open-telemetry/opentelemetry-collector-contrib/extension/remotetapextension" "github.com/open-telemetry/opentelemetry-collector-contrib/extension/sigv4authextension" @@ -220,6 +221,14 @@ func TestDefaultExtensions(t *testing.T) { return extFactories["remotetap"].CreateDefaultConfig().(*remotetapextension.Config) }, }, + { + extension: "opamp", + getConfigFn: func() component.Config { + cfg := extFactories["opamp"].CreateDefaultConfig().(*opampextension.Config) + cfg.Server.WS.Endpoint = "wss://" + endpoint + return cfg + }, + }, } extensionCount := 0 diff --git a/cmd/otelcontribcol/go.mod b/cmd/otelcontribcol/go.mod index c87d3e8b1877..99e07a706ebb 100644 --- a/cmd/otelcontribcol/go.mod +++ b/cmd/otelcontribcol/go.mod @@ -71,6 +71,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/hostobserver v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/k8sobserver v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/oidcauthextension v0.91.0 + github.com/open-telemetry/opentelemetry-collector-contrib/extension/opampextension v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/remotetapextension v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/extension/sigv4authextension v0.91.0 @@ -223,7 +224,7 @@ require ( cloud.google.com/go/longrunning v0.5.4 // indirect cloud.google.com/go/monitoring v1.16.3 // indirect cloud.google.com/go/pubsub v1.33.0 // indirect - cloud.google.com/go/spanner v1.53.1 // indirect + cloud.google.com/go/spanner v1.54.0 // indirect cloud.google.com/go/trace v1.10.4 // indirect code.cloudfoundry.org/clock v0.0.0-20180518195852-02e53af36e6c // indirect code.cloudfoundry.org/go-diodes v0.0.0-20211115184647-b584dd5df32c // indirect @@ -245,7 +246,7 @@ 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/network/armnetwork/v2 v2.2.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 // indirect - github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.1 // indirect github.com/Azure/azure-storage-queue-go v0.0.0-20230531184854-c06a8eff66fe // indirect github.com/Azure/go-amqp v1.0.2 // indirect github.com/Azure/go-autorest v14.2.0+incompatible // indirect @@ -259,25 +260,25 @@ require ( github.com/AzureAD/microsoft-authentication-library-for-go v1.2.0 // indirect github.com/ClickHouse/ch-go v0.58.2 // indirect github.com/ClickHouse/clickhouse-go/v2 v2.16.0 // indirect - github.com/DataDog/agent-payload/v5 v5.0.101 // indirect - github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/trace v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0-rc.7 // indirect + github.com/DataDog/agent-payload/v5 v5.0.102 // indirect + github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/proto v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/trace v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0 // indirect github.com/DataDog/datadog-api-client-go/v2 v2.20.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-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.9.0 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.9.0 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.9.0 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.9.0 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.9.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.10.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.10.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.10.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.10.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.10.0 // indirect github.com/DataDog/sketches-go v1.4.3 // indirect github.com/DataDog/zstd v1.5.2 // indirect github.com/GehirnInc/crypt v0.0.0-20200316065508-bb7000b8a962 // indirect @@ -290,7 +291,7 @@ require ( 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 - github.com/SAP/go-hdb v1.6.5 // indirect + github.com/SAP/go-hdb v1.6.6 // indirect github.com/SermoDigital/jose v0.9.2-0.20180104203859-803625baeddc // indirect github.com/Showmax/go-fqdn v1.0.0 // indirect github.com/aerospike/aerospike-client-go/v6 v6.13.0 // indirect @@ -304,7 +305,7 @@ 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.49.1 // indirect + github.com/aws/aws-sdk-go v1.49.6 // indirect github.com/aws/aws-sdk-go-v2 v1.24.0 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4 // indirect github.com/aws/aws-sdk-go-v2/config v1.26.1 // indirect @@ -433,7 +434,7 @@ require ( github.com/hashicorp/cronexpr v1.1.2 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-hclog v1.5.0 // indirect + github.com/hashicorp/go-hclog v1.6.2 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.4 // indirect @@ -441,6 +442,7 @@ require ( github.com/hashicorp/go-uuid v1.0.3 // indirect github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/nomad/api v0.0.0-20230721134942-515895c7690c // indirect github.com/hashicorp/serf v0.10.1 // indirect @@ -497,7 +499,7 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-ieproxy v0.0.11 // indirect github.com/mattn/go-isatty v0.0.19 // indirect - github.com/mattn/go-sqlite3 v1.14.18 // indirect + github.com/mattn/go-sqlite3 v1.14.19 // indirect github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/microsoft/ApplicationInsights-Go v0.4.4 // indirect github.com/miekg/dns v1.1.56 // indirect @@ -521,6 +523,8 @@ require ( github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect github.com/nginxinc/nginx-prometheus-exporter v0.8.1-0.20201110005315-f5a5f8086c19 // indirect + github.com/oklog/ulid/v2 v2.1.0 // indirect + github.com/open-telemetry/opamp-go v0.10.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer v0.91.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/awsutil v0.91.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/containerinsight v0.91.0 // indirect @@ -586,7 +590,7 @@ require ( github.com/prometheus/procfs v0.12.0 // indirect github.com/prometheus/statsd_exporter v0.22.7 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/redis/go-redis/v9 v9.3.0 // indirect + github.com/redis/go-redis/v9 v9.3.1 // indirect github.com/relvacode/iso8601 v1.3.0 // indirect github.com/rs/cors v1.10.1 // indirect github.com/sagikazarmark/locafero v0.3.0 // indirect @@ -601,7 +605,7 @@ require ( github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/shopspring/decimal v1.3.1 // indirect github.com/signalfx/com_signalfx_metrics_protobuf v0.0.3 // indirect - github.com/signalfx/sapm-proto v0.13.0 // indirect + github.com/signalfx/sapm-proto v0.14.0 // indirect github.com/sijms/go-ora/v2 v2.7.26 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/snowflakedb/gosnowflake v1.7.1 // indirect @@ -616,8 +620,8 @@ require ( github.com/stretchr/objx v0.5.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.816 // indirect - github.com/tg123/go-htpasswd v1.2.1 // indirect + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.821 // indirect + github.com/tg123/go-htpasswd v1.2.2 // indirect github.com/tidwall/gjson v1.10.2 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.0 // indirect @@ -631,7 +635,7 @@ require ( github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852 // indirect github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae // indirect github.com/vmware/go-vmware-nsxt v0.0.0-20230223012718-d31b8a1ca05e // indirect - github.com/vmware/govmomi v0.34.0 // indirect + github.com/vmware/govmomi v0.34.1 // indirect github.com/vultr/govultr/v2 v2.17.2 // indirect github.com/wavefronthq/wavefront-sdk-go v0.15.0 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect @@ -642,7 +646,7 @@ require ( github.com/yusufpapurcu/wmi v1.2.3 // indirect github.com/zeebo/xxh3 v1.0.2 // indirect go.etcd.io/bbolt v1.3.8 // indirect - go.mongodb.org/atlas v0.35.0 // indirect + go.mongodb.org/atlas v0.36.0 // indirect go.mongodb.org/mongo-driver v1.13.1 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector v0.91.0 // indirect @@ -680,8 +684,8 @@ require ( 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.16.0 // indirect - golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect + golang.org/x/crypto v0.17.0 // indirect + golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/oauth2 v0.15.0 // indirect @@ -692,12 +696,12 @@ require ( golang.org/x/tools v0.16.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect gonum.org/v1/gonum v0.14.0 // indirect - google.golang.org/api v0.151.0 // indirect + google.golang.org/api v0.154.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect - google.golang.org/grpc v1.60.0 // indirect + google.golang.org/grpc v1.60.1 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect @@ -710,15 +714,15 @@ require ( k8s.io/apimachinery v0.28.4 // indirect k8s.io/client-go v0.28.4 // indirect k8s.io/klog v1.0.0 // indirect - k8s.io/klog/v2 v2.100.1 // indirect + k8s.io/klog/v2 v2.110.1 // indirect k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect k8s.io/kubelet v0.28.4 // indirect - k8s.io/utils v0.0.0-20230711102312-30195339c3c7 // indirect + k8s.io/utils v0.0.0-20231127182322-b307cd553661 // indirect sigs.k8s.io/controller-runtime v0.16.3 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect sigs.k8s.io/yaml v1.3.0 // indirect - skywalking.apache.org/repo/goapi v0.0.0-20231026090926-09378dd56587 // indirect + skywalking.apache.org/repo/goapi v0.0.0-20231213062226-7849efc09ba3 // indirect ) replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage @@ -1164,3 +1168,11 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/collectd => ../../internal/collectd replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/remotetapextension => ../../extension/remotetapextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/opampextension => ../../extension/opampextension + +replace github.com/open-telemetry/opentelemetry-collector-contrib/testbed/mockdatasenders/mockdatadogagentexporter => ../../testbed/mockdatasenders/mockdatadogagentexporter + +replace github.com/open-telemetry/opentelemetry-collector-contrib/testbed => ../../testbed + +replace github.com/open-telemetry/opentelemetry-collector-contrib/testbed/mockdatareceivers/mockawsxrayreceiver => ../../testbed/mockdatareceivers/mockawsxrayreceiver diff --git a/cmd/otelcontribcol/go.sum b/cmd/otelcontribcol/go.sum index 48ef2c41ff80..29cf02fe9033 100644 --- a/cmd/otelcontribcol/go.sum +++ b/cmd/otelcontribcol/go.sum @@ -51,8 +51,8 @@ cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIA cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= cloud.google.com/go/pubsub v1.33.0 h1:6SPCPvWav64tj0sVX/+npCBKhUi/UjJehy9op/V3p2g= cloud.google.com/go/pubsub v1.33.0/go.mod h1:f+w71I33OMyxf9VpMVcZbnG5KSUkCOUHYpFd5U1GdRc= -cloud.google.com/go/spanner v1.53.1 h1:xNmE0SXMSxNBuk7lRZ5G/S+A49X91zkSTt7Jn5Ptlvw= -cloud.google.com/go/spanner v1.53.1/go.mod h1:liG4iCeLqm5L3fFLU5whFITqP0e0orsAW1uUSrd4rws= +cloud.google.com/go/spanner v1.54.0 h1:ttU+lhARPF/iZE3OkCpmfsemCz9mLaqBhGPd3Qub2sQ= +cloud.google.com/go/spanner v1.54.0/go.mod h1:wZvSQVBgngF0Gq86fKup6KIYmN2be7uOKjtK97X+bQU= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= @@ -112,9 +112,9 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2 v2.2 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2 v2.2.1/go.mod h1:Bzf34hhAE9NSxailk8xVeLEZbUjOXcC+GnU1mMKdhLw= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 h1:Dd+RhdJn0OTtVGaeDLZpcumkIVCtA/3/Fo42+eoYvVM= 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.2.0 h1:Ma67P/GGprNwsslzEH6+Kb8nybI8jpDTm4Wmzu2ReK8= -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/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0 h1:AifHbc4mg0x9zW52WOpKbsHaDKuRhlI7TVl47thgQ70= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.1 h1:AMf7YbZOZIW5b66cXNHMWWT/zkjhz5+a+k/3x40EO7E= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.1/go.mod h1:uwfk06ZBcvL/g4VHNjurPfVln9NMbsk2XIZxJ+hu81k= github.com/Azure/azure-storage-queue-go v0.0.0-20230531184854-c06a8eff66fe h1:HGuouUM1533rBXmMtR7qh5pYNSSjUZG90b/MgJAnb/A= github.com/Azure/azure-storage-queue-go v0.0.0-20230531184854-c06a8eff66fe/go.mod h1:K6am8mT+5iFXgingS9LUc7TmbsW6XBw3nxaRyaMyWc8= github.com/Azure/go-amqp v1.0.2 h1:zHCHId+kKC7fO8IkwyZJnWMvtRXhYC0VJtD0GYkHc6M= @@ -154,24 +154,24 @@ github.com/ClickHouse/ch-go v0.58.2/go.mod h1:Ap/0bEmiLa14gYjCiRkYGbXvbe8vwdrfTY github.com/ClickHouse/clickhouse-go/v2 v2.16.0 h1:rhMfnPewXPnY4Q4lQRGdYuTLRBRKJEIEYHtbUMrzmvI= github.com/ClickHouse/clickhouse-go/v2 v2.16.0/go.mod h1:J7SPfIxwR+x4mQ+o8MLSe0oY50NNntEqCIjFe/T1VPM= github.com/DATA-DOG/go-sqlmock v1.5.1 h1:FK6RCIUSfmbnI/imIICmboyQBkOckutaa6R5YYlLZyo= -github.com/DataDog/agent-payload/v5 v5.0.101 h1:/MjtenucwoRzv1cafv46fcvserECivPKEWDsemT2Grg= -github.com/DataDog/agent-payload/v5 v5.0.101/go.mod h1:COngtbYYCncpIPiE5D93QlXDH/3VAKk10jDNwGHcMRE= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0-rc.7 h1:ULN8UQqgtmEgWvOEIDzWgxLZ3TEZJ9MXBUpVGE8PPBc= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0-rc.7/go.mod h1:A4nLJvxlg6BO/8/zg81til9yT0uRPuXDFMAzDMpmgn4= -github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7 h1:qJuxmeIiXZNML5/Y9KEf7QKEKKIeliiTIxgRGvGAQBc= -github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7/go.mod h1:HvK26YCxg6MfYvPJgpHC7nSjw6DTpNhd75Wlb0GAvis= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0-rc.7 h1:pQh4uZnc9mQbGMJ1R8C88GlseqmdFIKftDZLrQW71Ss= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0-rc.7/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= -github.com/DataDog/datadog-agent/pkg/trace v0.50.0-rc.7 h1:qWKAINgUtyuJQOCcthjPST8PzigPP8Pr0EtHdTgJVoA= -github.com/DataDog/datadog-agent/pkg/trace v0.50.0-rc.7/go.mod h1:i6OrrkHDlgCB4vUaPfM4FxVij2QdA/t07Ykwu74ySGA= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0-rc.7 h1:J7ocZItHWrUEvGWVqFa7wsghotcF53oFn1qH7Tlh7VM= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0-rc.7/go.mod h1:b0I5L9Eegsq3kca9pQCAVt1rQHI05sza7LVHKGzC+ms= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.0-rc.7 h1:vBo+iVlLpjrvJkX88mbFDtWFy0F6tEi865p+N4RTf7A= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.0-rc.7/go.mod h1:/fGZteE4rr3iz6y30a0A3MuebJ6Jckx+AiKcyYgT87k= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0-rc.7 h1:eM+GcYjk4sSik8tFgf8zNT1KViZZM4F4I580SZnTs7s= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0-rc.7/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0-rc.7 h1:QByjh+uLdnYjqIjdYP9XyEgObD9o8ydL4jBy4sEPlbU= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0-rc.7/go.mod h1:EOGgNrSPskIxY3+KgCl+yEggMjrGqrA2oL5va+/p2jM= +github.com/DataDog/agent-payload/v5 v5.0.102 h1:X8EZQeOewahQ7N/arllAP7hCGHNScdThnGjPg5/ErN8= +github.com/DataDog/agent-payload/v5 v5.0.102/go.mod h1:COngtbYYCncpIPiE5D93QlXDH/3VAKk10jDNwGHcMRE= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0 h1:WOyRfsLPYO24Z6Q+s1jcjoOFYJUJ4PgiNaGz/qJCba0= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0/go.mod h1:A4nLJvxlg6BO/8/zg81til9yT0uRPuXDFMAzDMpmgn4= +github.com/DataDog/datadog-agent/pkg/proto v0.50.0 h1:FAzs/Hofs9CN7jYYd2P4l8/igdcDPc7q9amIXSje/3A= +github.com/DataDog/datadog-agent/pkg/proto v0.50.0/go.mod h1:HvK26YCxg6MfYvPJgpHC7nSjw6DTpNhd75Wlb0GAvis= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0 h1:/V/WtjIQCDNJpRVJ/wSfmUakLhBhxJ7joqwM7DXc9hI= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= +github.com/DataDog/datadog-agent/pkg/trace v0.50.0 h1:gZt7YTwtptMNYUN/Z5QHnabOz0ILHvSKC0jpTqqiXBo= +github.com/DataDog/datadog-agent/pkg/trace v0.50.0/go.mod h1:fV11a6fzBAbzgF8ie5Bk51rvLS5kMcsXjwaCzPAfsrk= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0 h1:jSAW27LAnpdZGEe8B0FzSbVT8YdmvPGxV/l8SDUKzYY= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0/go.mod h1:QO56TX/gJf9yZ8q+ix0EEjck6kJu+oirAvJPk8xpFa0= +github.com/DataDog/datadog-agent/pkg/util/log v0.50.0 h1:qIqqLKov9yjoHuoOK//a49vFiBZyduswcJz7jwgKuuo= +github.com/DataDog/datadog-agent/pkg/util/log v0.50.0/go.mod h1:byH8to7LKxTK5m7jf1n222QMeL55iiVszk+OA7Qxfao= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0 h1:MXYW7B+OamUkSBGVsLkPQt7bjQhO52Q6qym3VluB8IM= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0 h1:0QrqgObZkmv2Fcr10CN+pONfIeoul5loof3t20B1AAA= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0/go.mod h1:EOGgNrSPskIxY3+KgCl+yEggMjrGqrA2oL5va+/p2jM= github.com/DataDog/datadog-api-client-go/v2 v2.20.0 h1:80T+UuTh+28qODc2vw+HxzMoIu0dYBT7/RCHXxdYpJE= github.com/DataDog/datadog-api-client-go/v2 v2.20.0/go.mod h1:oD5Lx8Li3oPRa/BSBenkn4i48z+91gwYORF/+6ph71g= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= @@ -183,17 +183,17 @@ github.com/DataDog/go-tuf v1.0.2-0.5.2 h1:EeZr937eKAWPxJ26IykAdWA4A0jQXJgkhUjqEI 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.9.0 h1:y8rL7rCty4VhPFJi6TgOZXI7MrGRVYNV0oqbNblWi/c= -github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.9.0/go.mod h1:x+QjxvvVxewuyNymMjR+2fm0LAQSMF2mhw7Yhx61jp4= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.9.0 h1:oT5B12H+tLtAEEH0YqgmppofM/yRBzyI9+ykS9OQvIs= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.9.0 h1:Y+CllChr2yfE2RLd+c5hvK56DDGVEdDrhAl1OyzuuwU= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.9.0/go.mod h1:naFq9h+fQpgI7AKJ+YkWlAAYDU8/FB8LyfA39bmRNHs= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.9.0 h1:FbqbNsZ3179TUV+y932rKhhTxHMS5adlBb+9om1heGY= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.9.0/go.mod h1:v0FMEai3NccZjZr2jmX4t8Nobh3R8KxoRuj6PExoTRo= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.9.0 h1:WsCPJS+a34kw1gj46WpJjQBHrLVwh1ubCdHUx9nf1ec= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.9.0/go.mod h1:m61Tq6DA2U+PjNTX6WD3TH2U7QnA49+7IGaYK4bu7fQ= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.9.0 h1:U93rYuk3ChT/I+2r36JI8agi1AwdH8vRiHh+bCSXZeU= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.9.0/go.mod h1:KOzWHRj2AcJPmP1hm4WQUfzEIYRBP4NaTX9Iu+D3UNs= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.10.0 h1:kiPtYAgzvlOc6HV0qwS8xNeA39cYyAJs6q9dIRDpCFk= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.10.0/go.mod h1:MV/L0ESKjLGGE4JPDIDtz6H5u+9w0UKp1Wsw2lLREII= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.10.0 h1:O2PYvgTQA+31NuepzQqLexEpUX8FWsdNgq+0241OtH0= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.10.0 h1:56vp8vflG6lmhTO+YldUBTe0cIjStOC1neW1dIHYm5s= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.10.0/go.mod h1:naFq9h+fQpgI7AKJ+YkWlAAYDU8/FB8LyfA39bmRNHs= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.10.0 h1:+LxQNTpRM57lfcbGV7s+PVQ2B2Pegabfpf3yGJUXcgM= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.10.0/go.mod h1:WYm0DRBxBrKrmZrwoAJhcyJ7bGAFZbVQFcrrwwaGozU= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.10.0 h1:XwGT7/2NnO1RGxS5WD4BTsLWqO+z8234XBccUGhP8tM= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.10.0/go.mod h1:1fYkFs2pUyqBUUVDsjn1cKVEI79R+NluYhqX+pDTkSY= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.10.0 h1:mEao3xEP7iCfCd+teps0oM8U+ZRPVz02W6aE5cfi2Sc= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.10.0/go.mod h1:vPjlCjTrBzzZpVJbbVpox8x9nRYx5giCl/9Zy8oWFw0= github.com/DataDog/sketches-go v1.4.3 h1:ZB9nijteJRFUQixkQfatCqASartGNfiolIlMiEv3u/w= github.com/DataDog/sketches-go v1.4.3/go.mod h1:XR0ns2RtEEF09mDKXiKZiQg+nfZStrq1ZuL1eezeZe0= github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= @@ -232,8 +232,8 @@ github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/ReneKroon/ttlcache/v2 v2.11.0 h1:OvlcYFYi941SBN3v9dsDcC2N8vRxyHcCmJb3Vl4QMoM= github.com/ReneKroon/ttlcache/v2 v2.11.0/go.mod h1:mBxvsNY+BT8qLLd6CuAJubbKo6r0jh3nb5et22bbfGY= -github.com/SAP/go-hdb v1.6.5 h1:MmlBKJPV82HyVGJQr2PIC1g0HK+90qyUPuf7yPNSKZ8= -github.com/SAP/go-hdb v1.6.5/go.mod h1:RESA/tq6gO9jnSKeXokpnlWOYGmJ2jmCat+rC+AhRCI= +github.com/SAP/go-hdb v1.6.6 h1:n0uqv+omYcz01sLXQ4bK7vDj76x5ELU0qJ/8PPgri08= +github.com/SAP/go-hdb v1.6.6/go.mod h1:RESA/tq6gO9jnSKeXokpnlWOYGmJ2jmCat+rC+AhRCI= github.com/SermoDigital/jose v0.9.2-0.20161205224733-f6df55f235c2/go.mod h1:ARgCUhI1MHQH+ONky/PAtmVHQrP5JlGY0F3poXOp/fA= github.com/SermoDigital/jose v0.9.2-0.20180104203859-803625baeddc h1:MhBvG7RLaLqlyjxMR6of35vt6MVQ+eXMcgn9X/sy0FE= github.com/SermoDigital/jose v0.9.2-0.20180104203859-803625baeddc/go.mod h1:ARgCUhI1MHQH+ONky/PAtmVHQrP5JlGY0F3poXOp/fA= @@ -318,8 +318,8 @@ 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.49.1 h1:Dsamcd8d/nNb3A+bZ0ucfGl0vGZsW5wlRW0vhoYGoeQ= -github.com/aws/aws-sdk-go v1.49.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= +github.com/aws/aws-sdk-go v1.49.6/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= @@ -493,7 +493,6 @@ 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/deepmap/oapi-codegen v1.12.4 h1:pPmn6qI9MuOtCz82WY2Xaw46EQjgvxednXXrP7g5Q2s= github.com/denisenkom/go-mssqldb v0.12.3 h1:pBSGx9Tq67pBOTLmxNuirNTeB8Vjmf886Kx+8Y+8shw= github.com/denisenkom/go-mssqldb v0.12.3/go.mod h1:k0mtMFOnU+AihqFxPMiF05rtiDrorD1Vrm1KEz5hxDo= github.com/dennwc/varint v1.0.0 h1:kGNFFSSw8ToIy3obO/kKr8U9GZYUAxQEVuix4zfDWzE= @@ -623,7 +622,6 @@ github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KE github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -854,8 +852,8 @@ github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= -github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-hclog v1.6.2 h1:NOtoftovWkDheyUM/8JW3QMiXyxJK3uHRK7wV04nD2I= +github.com/hashicorp/go-hclog v1.6.2/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -887,6 +885,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 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/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= @@ -917,7 +917,7 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2 github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= 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.12.4 h1:9qJLqetEmhIlqaF/N9KUtdmRKSbNy6IohggyS3bxWlE= +github.com/influxdata/influxdb-client-go/v2 v2.13.0 h1:ioBbLmR5NMbAjP4UVA5r9b5xGjpABD7j65pI8kFphDM= github.com/influxdata/influxdb-observability/common v0.5.8 h1:nyk4dqnKbPGIyr1vAs6oEsFQEHWi5jkSQ7PtP4v//lc= github.com/influxdata/influxdb-observability/common v0.5.8/go.mod h1:aG8A2gbtXbl/P2FePd6QNsCUSOkcvz1n+NL5dJLUO1s= github.com/influxdata/influxdb-observability/influx2otel v0.5.8 h1:pHkeImZksXNNQbbH/w1qPuC/u6e7cK3kTG12otQHDuE= @@ -1126,8 +1126,8 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/ github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-sqlite3 v1.14.18 h1:JL0eqdCOq6DJVNPSvArO/bIV9/P7fbGrV00LZHc+5aI= -github.com/mattn/go-sqlite3 v1.14.18/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= +github.com/mattn/go-sqlite3 v1.14.19 h1:fhGleo2h1p8tVChob4I9HpmVFIAkKGpiukdrgQbWfGI= +github.com/mattn/go-sqlite3 v1.14.19/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= 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= @@ -1214,10 +1214,13 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oapi-codegen/runtime v1.0.0 h1:P4rqFX5fMFWqRzY9M/3YF9+aPSPPB06IzP2P7oOxrWo= github.com/observiq/nanojack v0.0.0-20201106172433-343928847ebc h1:49ewVBwLcy+eYqI4R0ICilCI4dPjddpFXWv3liXzUxM= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= +github.com/oklog/ulid/v2 v2.1.0 h1:+9lhoxAP56we25tyYETBBY1YLA2SaoLvUFgrP2miPJU= +github.com/oklog/ulid/v2 v2.1.0/go.mod h1:rcEKHmBBKfef9DhnvX7y1HZBYxjXb0cP5ExxNsTT1QQ= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -1239,6 +1242,8 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= +github.com/open-telemetry/opamp-go v0.10.0 h1:3PdhoKcKY1lPrfdXnsxeLlXluE+Xe1Uc/CpJ4I8uUJ0= +github.com/open-telemetry/opamp-go v0.10.0/go.mod h1:Pfmm5EdWqZCG0dZAJjAinlra3yEpqK5StCblxpbEp6Q= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI= @@ -1281,6 +1286,7 @@ github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTK github.com/paulmach/orb v0.10.0 h1:guVYVqzxHE/CQ1KpfGO077TR0ATHSNjp4s6XGLn3W9s= github.com/paulmach/orb v0.10.0/go.mod h1:5mULz1xQfs3bmQm63QEJA6lNGujuRafwA5S/EnuLaLU= github.com/paulmach/protoscan v0.2.1/go.mod h1:SpcSwydNLrxUGSDvXvO0P7g7AuhJ7lcKfDlhJCDw2gY= +github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= @@ -1374,8 +1380,8 @@ github.com/prometheus/statsd_exporter v0.22.7/go.mod h1:N/TevpjkIh9ccs6nuzY3jQn9 github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/redis/go-redis/v9 v9.3.0 h1:RiVDjmig62jIWp7Kk4XVLs0hzV6pI3PyTnnL0cnn0u0= -github.com/redis/go-redis/v9 v9.3.0/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= +github.com/redis/go-redis/v9 v9.3.1 h1:KqdY8U+3X6z+iACvumCNxnoluToB+9Me+TvyFa21Mds= +github.com/redis/go-redis/v9 v9.3.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= github.com/relvacode/iso8601 v1.3.0 h1:HguUjsGpIMh/zsTczGN3DVJFxTU/GX+MMmzcKoMO7ko= github.com/relvacode/iso8601 v1.3.0/go.mod h1:FlNp+jz+TXpyRqgmM7tnzHHzBnz776kmAH2h3sZCn0I= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= @@ -1424,8 +1430,8 @@ github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFR github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/signalfx/com_signalfx_metrics_protobuf v0.0.3 h1:32k2QLgsKhcEs55q4REPKyIadvid5FPy2+VMgvbmKJ0= github.com/signalfx/com_signalfx_metrics_protobuf v0.0.3/go.mod h1:gJrXWi7wSGXfiC7+VheQaz+ypdCt5SmZNL+BRxUe7y4= -github.com/signalfx/sapm-proto v0.13.0 h1:yEkp1+MAU4vZvnJMp56uhVlRjlvCK7KQjBg0g2Apw8k= -github.com/signalfx/sapm-proto v0.13.0/go.mod h1:C72HjeCW5v0Llk6pIVJ/ZH8A5GbiZpCCSkE1dSlpWxY= +github.com/signalfx/sapm-proto v0.14.0 h1:KWh3I5E4EkelB19aP1/54Ik8khSioC/RVRW/riOfRGg= +github.com/signalfx/sapm-proto v0.14.0/go.mod h1:Km6PskZh966cqNoUn3AmRyGRix5VfwnxVBvn2vjRC9U= github.com/sijms/go-ora/v2 v2.7.26 h1:+o/1ej7znA/Wpklv9eTiyp4Jqn2DU9Urw9YHrtPRP64= github.com/sijms/go-ora/v2 v2.7.26/go.mod h1:EHxlY6x7y9HAsdfumurRfTd+v8NrEOTR3Xl4FWlH6xk= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -1498,11 +1504,11 @@ github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSW github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tedsuo/ifrit v0.0.0-20180802180643-bea94bb476cc/go.mod h1:eyZnKCc955uh98WQvzOm0dgAeLnf2O0Rz0LPoC5ze+0= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.816 h1:hPkFIZPc3PKsiqm6OdS0mSgW7LISfxsR5NrQIsWPiYo= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.816/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.821 h1:WEHm7jX2S+bzFt3IbatdWKTh8oRZF2M5M9h/uymxTHQ= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.821/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/testcontainers/testcontainers-go v0.26.0 h1:uqcYdoOHBy1ca7gKODfBd9uTHVK3a7UL848z09MVZ0c= -github.com/tg123/go-htpasswd v1.2.1 h1:i4wfsX1KvvkyoMiHZzjS0VzbAPWfxzI8INcZAKtutoU= -github.com/tg123/go-htpasswd v1.2.1/go.mod h1:erHp1B86KXdwQf1X5ZrLb7erXZnWueEQezb2dql4q58= +github.com/tg123/go-htpasswd v1.2.2 h1:tmNccDsQ+wYsoRfiONzIhDm5OkVHQzN3w4FOBAlN6BY= +github.com/tg123/go-htpasswd v1.2.2/go.mod h1:FcIrK0J+6zptgVwK1JDlqyajW/1B4PtuJ/FLWl7nx8A= github.com/tidwall/gjson v1.10.2 h1:APbLGOM0rrEkd8WBw9C24nllro4ajFuJu0Sc9hRz8Bo= github.com/tidwall/gjson v1.10.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= @@ -1541,8 +1547,8 @@ github.com/vmihailenco/msgpack/v4 v4.3.13 h1:A2wsiTbvp63ilDaWmsk2wjx6xZdxQOvpiNl github.com/vmihailenco/tagparser v0.1.2 h1:gnjoVuB/kljJ5wICEEOpx98oXMWPLj22G67Vbd1qPqc= github.com/vmware/go-vmware-nsxt v0.0.0-20230223012718-d31b8a1ca05e h1:Vu41Q0Pv3yMdd+tcDW6QeEUIK2L+9ZrPrq8NAMrKSLc= github.com/vmware/go-vmware-nsxt v0.0.0-20230223012718-d31b8a1ca05e/go.mod h1:aRq5pxwgdJpAuP97SCjX1+Db32z/b0dggQ07FDF+fqE= -github.com/vmware/govmomi v0.34.0 h1:Aun71BDf1t8r3jNeUWJ3ZM+7kHbIuuNzIuxRVo5LYYU= -github.com/vmware/govmomi v0.34.0/go.mod h1:qWWT6n9mdCr/T9vySsoUqcI04sSEj4CqHXxtk/Y+Los= +github.com/vmware/govmomi v0.34.1 h1:Hqu2Uke2itC+cNoIcFQBLEZvX9wBRTTOP04J7V1fqRw= +github.com/vmware/govmomi v0.34.1/go.mod h1:qWWT6n9mdCr/T9vySsoUqcI04sSEj4CqHXxtk/Y+Los= github.com/vultr/govultr/v2 v2.17.2 h1:gej/rwr91Puc/tgh+j33p/BLR16UrIPnSr+AIwYWZQs= github.com/vultr/govultr/v2 v2.17.2/go.mod h1:ZFOKGWmgjytfyjeyAdhQlSWwTjh2ig+X49cAp50dzXI= github.com/wavefronthq/wavefront-sdk-go v0.15.0 h1:po9E3vh/0y7kOx8D9EtFp7kbSLLLKbmu/w/s1xGJAQU= @@ -1582,8 +1588,8 @@ go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mI 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= go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= -go.mongodb.org/atlas v0.35.0 h1:fLSPEyv+QcrG5djPWMekaM+BEVfEVBKQO4yEUQl4CQ4= -go.mongodb.org/atlas v0.35.0/go.mod h1:nfPldE9dSama6G2IbIzmEza02Ly7yFZjMMVscaM0uEc= +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= @@ -1757,8 +1763,9 @@ golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= 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.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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= @@ -1769,8 +1776,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1798,6 +1805,7 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1862,6 +1870,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1893,6 +1903,7 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/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.1.0/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-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1997,6 +2008,7 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.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.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -2005,6 +2017,8 @@ golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9sn golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -2019,6 +2033,8 @@ 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.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= 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.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -2097,6 +2113,7 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.16.0 h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM= golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2132,8 +2149,8 @@ google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjR google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= -google.golang.org/api v0.151.0 h1:FhfXLO/NFdJIzQtCqjpysWwqKk8AzGWBUhMIx67cVDU= -google.golang.org/api v0.151.0/go.mod h1:ccy+MJ6nrYFgE3WgRx/AMXOxOmU8Q4hSa+jjibzhxcg= +google.golang.org/api v0.154.0 h1:X7QkVKZBskztmpPKWQXgjJRPA2dJYrL6r+sYPRLj050= +google.golang.org/api v0.154.0/go.mod h1:qhSMkM85hgqiokIYsrRyKxrjfBeIhgl4Z2JmeRkYylc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -2221,8 +2238,8 @@ google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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= @@ -2313,16 +2330,16 @@ k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= -k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= +k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ= k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM= k8s.io/kubelet v0.28.4 h1:Ypxy1jaFlSXFXbg/yVtFOU2ZxErBVRJfLu8+t4s7Dtw= k8s.io/kubelet v0.28.4/go.mod h1:w1wPI12liY/aeC70nqKYcNNkr6/nbyvdMB7P7wmww2o= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20230711102312-30195339c3c7 h1:ZgnF1KZsYxWIifwSNZFZgNtWE89WI5yiP5WwlfDoIyc= -k8s.io/utils v0.0.0-20230711102312-30195339c3c7/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20231127182322-b307cd553661 h1:FepOBzJ0GXm8t0su67ln2wAZjbQ6RxQGZDnzuLcrUTI= +k8s.io/utils v0.0.0-20231127182322-b307cd553661/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= @@ -2338,6 +2355,6 @@ sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= -skywalking.apache.org/repo/goapi v0.0.0-20231026090926-09378dd56587 h1:TY79I5Y7xRB8q5LQ+MJn7NYsYi0VL5nj1QDrUHwK7cQ= -skywalking.apache.org/repo/goapi v0.0.0-20231026090926-09378dd56587/go.mod h1:onFubXaIoY/2FTRVrLMqCTlaNq4SilAEwF/2G0IcaBw= +skywalking.apache.org/repo/goapi v0.0.0-20231213062226-7849efc09ba3 h1:rqXePgPd1SeNYl4GSHyndwNggpGdOh+9ZMSRCfesgDU= +skywalking.apache.org/repo/goapi v0.0.0-20231213062226-7849efc09ba3/go.mod h1:oD2dxcDAHVIt95Ee7kJHgZ5f64QNhrqTjQYARwfafc4= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/cmd/oteltestbedcol/go.mod b/cmd/oteltestbedcol/go.mod index 7e2d5e68e5bd..b7b8b102dad1 100644 --- a/cmd/oteltestbedcol/go.mod +++ b/cmd/oteltestbedcol/go.mod @@ -129,6 +129,7 @@ require ( github.com/hashicorp/go-rootcerts v1.0.2 // indirect github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/nomad/api v0.0.0-20230721134942-515895c7690c // indirect github.com/hashicorp/serf v0.10.1 // indirect github.com/hetznercloud/hcloud-go/v2 v2.4.0 // indirect @@ -204,7 +205,7 @@ require ( github.com/shirou/gopsutil/v3 v3.23.11 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/signalfx/com_signalfx_metrics_protobuf v0.0.3 // indirect - github.com/signalfx/sapm-proto v0.13.0 // indirect + github.com/signalfx/sapm-proto v0.14.0 // indirect github.com/soheilhy/cmux v0.1.5 // indirect github.com/spf13/cobra v1.8.0 // indirect github.com/spf13/pflag v1.0.5 // indirect @@ -255,8 +256,8 @@ require ( 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.16.0 // indirect - golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect + golang.org/x/crypto v0.17.0 // indirect + golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/oauth2 v0.14.0 // indirect @@ -270,7 +271,7 @@ require ( google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f // indirect google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 // indirect - google.golang.org/grpc v1.60.0 // indirect + google.golang.org/grpc v1.60.1 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/cmd/oteltestbedcol/go.sum b/cmd/oteltestbedcol/go.sum index 893d934516ab..ef11450a9671 100644 --- a/cmd/oteltestbedcol/go.sum +++ b/cmd/oteltestbedcol/go.sum @@ -348,6 +348,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 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/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= @@ -575,8 +577,8 @@ github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnj github.com/shoenig/test v0.6.6 h1:Oe8TPH9wAbv++YPNDKJWUnI8Q4PPWCx3UbOfH+FxiMU= github.com/signalfx/com_signalfx_metrics_protobuf v0.0.3 h1:32k2QLgsKhcEs55q4REPKyIadvid5FPy2+VMgvbmKJ0= github.com/signalfx/com_signalfx_metrics_protobuf v0.0.3/go.mod h1:gJrXWi7wSGXfiC7+VheQaz+ypdCt5SmZNL+BRxUe7y4= -github.com/signalfx/sapm-proto v0.13.0 h1:yEkp1+MAU4vZvnJMp56uhVlRjlvCK7KQjBg0g2Apw8k= -github.com/signalfx/sapm-proto v0.13.0/go.mod h1:C72HjeCW5v0Llk6pIVJ/ZH8A5GbiZpCCSkE1dSlpWxY= +github.com/signalfx/sapm-proto v0.14.0 h1:KWh3I5E4EkelB19aP1/54Ik8khSioC/RVRW/riOfRGg= +github.com/signalfx/sapm-proto v0.14.0/go.mod h1:Km6PskZh966cqNoUn3AmRyGRix5VfwnxVBvn2vjRC9U= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= @@ -764,8 +766,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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= @@ -776,8 +778,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1082,8 +1084,8 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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= diff --git a/cmd/telemetrygen/go.mod b/cmd/telemetrygen/go.mod index 0ceb0be062ad..71924d82d984 100644 --- a/cmd/telemetrygen/go.mod +++ b/cmd/telemetrygen/go.mod @@ -21,7 +21,7 @@ require ( go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 golang.org/x/time v0.5.0 - google.golang.org/grpc v1.60.0 + google.golang.org/grpc v1.60.1 ) require ( diff --git a/cmd/telemetrygen/go.sum b/cmd/telemetrygen/go.sum index 0863839bc37f..6aee8348b63b 100644 --- a/cmd/telemetrygen/go.sum +++ b/cmd/telemetrygen/go.sum @@ -204,8 +204,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= diff --git a/cmd/telemetrygen/internal/e2etest/go.mod b/cmd/telemetrygen/internal/e2etest/go.mod index 8d257dcc6980..0d27c7958752 100644 --- a/cmd/telemetrygen/internal/e2etest/go.mod +++ b/cmd/telemetrygen/internal/e2etest/go.mod @@ -3,8 +3,8 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/cmd/telemetryge go 1.20 require ( - github.com/open-telemetry/opentelemetry-collector-contrib/cmd/telemetrygen v0.90.1 - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.90.1 + github.com/open-telemetry/opentelemetry-collector-contrib/cmd/telemetrygen v0.91.0 + github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.91.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/consumer v0.91.0 @@ -74,7 +74,7 @@ require ( golang.org/x/time v0.5.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 // indirect - google.golang.org/grpc v1.60.0 // indirect + google.golang.org/grpc v1.60.1 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/cmd/telemetrygen/internal/e2etest/go.sum b/cmd/telemetrygen/internal/e2etest/go.sum index cae82733a1d3..a823d8b070b2 100644 --- a/cmd/telemetrygen/internal/e2etest/go.sum +++ b/cmd/telemetrygen/internal/e2etest/go.sum @@ -282,8 +282,8 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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= diff --git a/confmap/provider/s3provider/go.mod b/confmap/provider/s3provider/go.mod index e89338588faa..c7760251eb4a 100644 --- a/confmap/provider/s3provider/go.mod +++ b/confmap/provider/s3provider/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/aws/aws-sdk-go-v2 v1.24.0 github.com/aws/aws-sdk-go-v2/config v1.26.1 - github.com/aws/aws-sdk-go-v2/service/s3 v1.47.5 + github.com/aws/aws-sdk-go-v2/service/s3 v1.47.6 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/confmap v0.91.0 gopkg.in/yaml.v2 v2.4.0 diff --git a/confmap/provider/s3provider/go.sum b/confmap/provider/s3provider/go.sum index 858ee6c12ca0..1c4718956b87 100644 --- a/confmap/provider/s3provider/go.sum +++ b/confmap/provider/s3provider/go.sum @@ -24,8 +24,8 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.9 h1:Nf2sHxjMJ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.9/go.mod h1:idky4TER38YIjr2cADF1/ugFMKvZV7p//pVeV5LZbF0= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.9 h1:iEAeF6YC3l4FzlJPP9H3Ko1TXpdjdqWffxXjp8SY6uk= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.9/go.mod h1:kjsXoK23q9Z/tLBrckZLLyvjhZoS+AGrzqzUfEClvMM= -github.com/aws/aws-sdk-go-v2/service/s3 v1.47.5 h1:Keso8lIOS+IzI2MkPZyK6G0LYcK3My2LQ+T5bxghEAY= -github.com/aws/aws-sdk-go-v2/service/s3 v1.47.5/go.mod h1:vADO6Jn+Rq4nDtfwNjhgR84qkZwiC6FqCaXdw/kYwjA= +github.com/aws/aws-sdk-go-v2/service/s3 v1.47.6 h1:bkmlzokzTJyrFNA0J+EPlsF8x4/wp+9D45HTHO/ZUiY= +github.com/aws/aws-sdk-go-v2/service/s3 v1.47.6/go.mod h1:vADO6Jn+Rq4nDtfwNjhgR84qkZwiC6FqCaXdw/kYwjA= github.com/aws/aws-sdk-go-v2/service/sso v1.18.5 h1:ldSFWz9tEHAwHNmjx2Cvy1MjP5/L9kNoR0skc6wyOOM= github.com/aws/aws-sdk-go-v2/service/sso v1.18.5/go.mod h1:CaFfXLYL376jgbP7VKC96uFcU8Rlavak0UlAwk1Dlhc= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.5 h1:2k9KmFawS63euAkY4/ixVNsYYwrwnd5fIvgEKkfZFNM= diff --git a/connector/countconnector/go.mod b/connector/countconnector/go.mod index 770f7bbea11b..ff377277789a 100644 --- a/connector/countconnector/go.mod +++ b/connector/countconnector/go.mod @@ -14,6 +14,8 @@ require ( go.opentelemetry.io/collector/connector v0.91.0 go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -23,10 +25,10 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/gobwas/glob v0.2.3 // 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/google/uuid v1.5.0 // 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 github.com/json-iterator/go v1.1.12 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect @@ -43,10 +45,8 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect + golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/connector/countconnector/go.sum b/connector/countconnector/go.sum index 587da7935c27..b4f5486c7964 100644 --- a/connector/countconnector/go.sum +++ b/connector/countconnector/go.sum @@ -13,8 +13,6 @@ github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -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/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= @@ -25,6 +23,8 @@ github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 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/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= @@ -90,8 +90,8 @@ 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/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= diff --git a/connector/countconnector/internal/metadata/generated_status.go b/connector/countconnector/internal/metadata/generated_status.go index 614bd16ddcdc..e624f25be5d4 100644 --- a/connector/countconnector/internal/metadata/generated_status.go +++ b/connector/countconnector/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsToMetricsStability = component.StabilityLevelDevelopment LogsToMetricsStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/count") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/count") +} diff --git a/connector/datadogconnector/go.mod b/connector/datadogconnector/go.mod index b7603aa5a5ad..5f93f75981d9 100644 --- a/connector/datadogconnector/go.mod +++ b/connector/datadogconnector/go.mod @@ -3,30 +3,32 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/connector/datad go 1.20 require ( - github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7 - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.9.0 + github.com/DataDog/datadog-agent/pkg/proto v0.50.0 + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.10.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog v0.91.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/connector v0.91.0 go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) require ( - github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/trace v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0-rc.7 // indirect + github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/trace v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.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-tuf v1.0.2-0.5.2 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.9.0 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.9.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.10.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.10.0 // indirect github.com/DataDog/sketches-go v1.4.3 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect @@ -74,8 +76,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/semconv v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect diff --git a/connector/datadogconnector/go.sum b/connector/datadogconnector/go.sum index c15f9773d4d9..691d369204b3 100644 --- a/connector/datadogconnector/go.sum +++ b/connector/datadogconnector/go.sum @@ -1,32 +1,32 @@ -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0-rc.7 h1:ULN8UQqgtmEgWvOEIDzWgxLZ3TEZJ9MXBUpVGE8PPBc= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0-rc.7/go.mod h1:A4nLJvxlg6BO/8/zg81til9yT0uRPuXDFMAzDMpmgn4= -github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7 h1:qJuxmeIiXZNML5/Y9KEf7QKEKKIeliiTIxgRGvGAQBc= -github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7/go.mod h1:HvK26YCxg6MfYvPJgpHC7nSjw6DTpNhd75Wlb0GAvis= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0-rc.7 h1:pQh4uZnc9mQbGMJ1R8C88GlseqmdFIKftDZLrQW71Ss= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0-rc.7/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= -github.com/DataDog/datadog-agent/pkg/trace v0.50.0-rc.7 h1:qWKAINgUtyuJQOCcthjPST8PzigPP8Pr0EtHdTgJVoA= -github.com/DataDog/datadog-agent/pkg/trace v0.50.0-rc.7/go.mod h1:i6OrrkHDlgCB4vUaPfM4FxVij2QdA/t07Ykwu74ySGA= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0-rc.7 h1:J7ocZItHWrUEvGWVqFa7wsghotcF53oFn1qH7Tlh7VM= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0-rc.7/go.mod h1:b0I5L9Eegsq3kca9pQCAVt1rQHI05sza7LVHKGzC+ms= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.0-rc.7 h1:vBo+iVlLpjrvJkX88mbFDtWFy0F6tEi865p+N4RTf7A= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.0-rc.7/go.mod h1:/fGZteE4rr3iz6y30a0A3MuebJ6Jckx+AiKcyYgT87k= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0-rc.7 h1:eM+GcYjk4sSik8tFgf8zNT1KViZZM4F4I580SZnTs7s= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0-rc.7/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0-rc.7 h1:QByjh+uLdnYjqIjdYP9XyEgObD9o8ydL4jBy4sEPlbU= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0-rc.7/go.mod h1:EOGgNrSPskIxY3+KgCl+yEggMjrGqrA2oL5va+/p2jM= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0 h1:WOyRfsLPYO24Z6Q+s1jcjoOFYJUJ4PgiNaGz/qJCba0= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0/go.mod h1:A4nLJvxlg6BO/8/zg81til9yT0uRPuXDFMAzDMpmgn4= +github.com/DataDog/datadog-agent/pkg/proto v0.50.0 h1:FAzs/Hofs9CN7jYYd2P4l8/igdcDPc7q9amIXSje/3A= +github.com/DataDog/datadog-agent/pkg/proto v0.50.0/go.mod h1:HvK26YCxg6MfYvPJgpHC7nSjw6DTpNhd75Wlb0GAvis= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0 h1:/V/WtjIQCDNJpRVJ/wSfmUakLhBhxJ7joqwM7DXc9hI= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= +github.com/DataDog/datadog-agent/pkg/trace v0.50.0 h1:gZt7YTwtptMNYUN/Z5QHnabOz0ILHvSKC0jpTqqiXBo= +github.com/DataDog/datadog-agent/pkg/trace v0.50.0/go.mod h1:fV11a6fzBAbzgF8ie5Bk51rvLS5kMcsXjwaCzPAfsrk= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0 h1:jSAW27LAnpdZGEe8B0FzSbVT8YdmvPGxV/l8SDUKzYY= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0/go.mod h1:QO56TX/gJf9yZ8q+ix0EEjck6kJu+oirAvJPk8xpFa0= +github.com/DataDog/datadog-agent/pkg/util/log v0.50.0 h1:qIqqLKov9yjoHuoOK//a49vFiBZyduswcJz7jwgKuuo= +github.com/DataDog/datadog-agent/pkg/util/log v0.50.0/go.mod h1:byH8to7LKxTK5m7jf1n222QMeL55iiVszk+OA7Qxfao= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0 h1:MXYW7B+OamUkSBGVsLkPQt7bjQhO52Q6qym3VluB8IM= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0 h1:0QrqgObZkmv2Fcr10CN+pONfIeoul5loof3t20B1AAA= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0/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/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.9.0 h1:oT5B12H+tLtAEEH0YqgmppofM/yRBzyI9+ykS9OQvIs= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.9.0 h1:Y+CllChr2yfE2RLd+c5hvK56DDGVEdDrhAl1OyzuuwU= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.9.0/go.mod h1:naFq9h+fQpgI7AKJ+YkWlAAYDU8/FB8LyfA39bmRNHs= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.9.0 h1:WsCPJS+a34kw1gj46WpJjQBHrLVwh1ubCdHUx9nf1ec= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.9.0/go.mod h1:m61Tq6DA2U+PjNTX6WD3TH2U7QnA49+7IGaYK4bu7fQ= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.9.0 h1:U93rYuk3ChT/I+2r36JI8agi1AwdH8vRiHh+bCSXZeU= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.9.0/go.mod h1:KOzWHRj2AcJPmP1hm4WQUfzEIYRBP4NaTX9Iu+D3UNs= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.10.0 h1:O2PYvgTQA+31NuepzQqLexEpUX8FWsdNgq+0241OtH0= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.10.0 h1:56vp8vflG6lmhTO+YldUBTe0cIjStOC1neW1dIHYm5s= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.10.0/go.mod h1:naFq9h+fQpgI7AKJ+YkWlAAYDU8/FB8LyfA39bmRNHs= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.10.0 h1:XwGT7/2NnO1RGxS5WD4BTsLWqO+z8234XBccUGhP8tM= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.10.0/go.mod h1:1fYkFs2pUyqBUUVDsjn1cKVEI79R+NluYhqX+pDTkSY= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.10.0 h1:mEao3xEP7iCfCd+teps0oM8U+ZRPVz02W6aE5cfi2Sc= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.10.0/go.mod h1:vPjlCjTrBzzZpVJbbVpox8x9nRYx5giCl/9Zy8oWFw0= github.com/DataDog/sketches-go v1.4.3 h1:ZB9nijteJRFUQixkQfatCqASartGNfiolIlMiEv3u/w= github.com/DataDog/sketches-go v1.4.3/go.mod h1:XR0ns2RtEEF09mDKXiKZiQg+nfZStrq1ZuL1eezeZe0= github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= diff --git a/connector/datadogconnector/internal/metadata/generated_status.go b/connector/datadogconnector/internal/metadata/generated_status.go index 1e601630c741..9c9f28a16830 100644 --- a/connector/datadogconnector/internal/metadata/generated_status.go +++ b/connector/datadogconnector/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -11,3 +13,11 @@ const ( TracesToMetricsStability = component.StabilityLevelBeta TracesToTracesStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/datadog") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/datadog") +} diff --git a/connector/exceptionsconnector/go.mod b/connector/exceptionsconnector/go.mod index c0049be7127a..c7e305c77c96 100644 --- a/connector/exceptionsconnector/go.mod +++ b/connector/exceptionsconnector/go.mod @@ -13,8 +13,10 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 - google.golang.org/grpc v1.60.0 + google.golang.org/grpc v1.60.1 ) require ( @@ -38,8 +40,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/connector/exceptionsconnector/go.sum b/connector/exceptionsconnector/go.sum index 5bcdae172a30..2ef4a4e9c672 100644 --- a/connector/exceptionsconnector/go.sum +++ b/connector/exceptionsconnector/go.sum @@ -109,8 +109,8 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0= google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= diff --git a/connector/exceptionsconnector/internal/metadata/generated_status.go b/connector/exceptionsconnector/internal/metadata/generated_status.go index 70e4fef83c5c..0e7fc8ea336a 100644 --- a/connector/exceptionsconnector/internal/metadata/generated_status.go +++ b/connector/exceptionsconnector/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -11,3 +13,11 @@ const ( TracesToMetricsStability = component.StabilityLevelDevelopment TracesToLogsStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/exceptions") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/exceptions") +} diff --git a/connector/failoverconnector/go.mod b/connector/failoverconnector/go.mod index aa779afe8451..7eb1da529510 100644 --- a/connector/failoverconnector/go.mod +++ b/connector/failoverconnector/go.mod @@ -9,6 +9,8 @@ require ( go.opentelemetry.io/collector/connector v0.91.0 go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -31,8 +33,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/connector/failoverconnector/internal/metadata/generated_status.go b/connector/failoverconnector/internal/metadata/generated_status.go index 4c2a0465aa5f..c215cb121ec4 100644 --- a/connector/failoverconnector/internal/metadata/generated_status.go +++ b/connector/failoverconnector/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( TracesToTracesStability = component.StabilityLevelDevelopment LogsToLogsStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/failover") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/failover") +} diff --git a/connector/routingconnector/README.md b/connector/routingconnector/README.md index d1dfef73ab02..ff9e5b8bb416 100644 --- a/connector/routingconnector/README.md +++ b/connector/routingconnector/README.md @@ -36,6 +36,7 @@ The following settings are available: - `table.pipelines (required)`: the list of pipelines to use when the routing condition is met. - `default_pipelines (optional)`: contains the list of pipelines to use when a record does not meet any of specified conditions. - `error_mode (optional)`: determines how errors returned from OTTL statements are handled. Valid values are `propagate`, `ignore` and `silent`. If `ignored` or `silent` is used and a statement's condition has an error then the payload will be routed to the default pipelines. When `silent` is used the error is not logged. If not supplied, `propagate` is used. +- `match_once (optional, default: false)`: determines whether the connector matches multiple statements or not. If enabled, the payload will be routed to the first pipeline in the `table` whose routing condition is met. Example: @@ -55,12 +56,23 @@ connectors: routing: default_pipelines: [traces/jaeger] error_mode: ignore + match_once: false table: - statement: route() where attributes["X-Tenant"] == "acme" pipelines: [traces/jaeger-acme] - statement: delete_key(attributes, "X-Tenant") where IsMatch(attributes["X-Tenant"], ".*corp") pipelines: [traces/jaeger-ecorp] + routing/match_once: + default_pipelines: [traces/jaeger] + error_mode: ignore + match_once: true + table: + - statement: route() where attributes["X-Tenant"] == "acme" + pipelines: [traces/jaeger-acme] + - statement: route() where attributes["X-Tenant"] == ".*acme" + pipelines: [traces/jaeger-ecorp] + service: pipelines: traces/in: diff --git a/connector/routingconnector/config.go b/connector/routingconnector/config.go index 58c5102dff5c..11abda52b217 100644 --- a/connector/routingconnector/config.go +++ b/connector/routingconnector/config.go @@ -39,6 +39,10 @@ type Config struct { // Table contains the routing table for this processor. // Required. Table []RoutingTableItem `mapstructure:"table"` + + // MatchOnce determines whether the connector matches multiple statements. + // Optional. + MatchOnce bool `mapstructure:"match_once"` } // Validate checks if the processor configuration is valid. diff --git a/connector/routingconnector/go.mod b/connector/routingconnector/go.mod index 77e6aab8f25b..c9fa8839d722 100644 --- a/connector/routingconnector/go.mod +++ b/connector/routingconnector/go.mod @@ -10,6 +10,8 @@ require ( go.opentelemetry.io/collector/connector v0.91.0 go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -37,10 +39,8 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect + golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/connector/routingconnector/go.sum b/connector/routingconnector/go.sum index 924f3063fd2b..0afa1a73076f 100644 --- a/connector/routingconnector/go.sum +++ b/connector/routingconnector/go.sum @@ -88,8 +88,8 @@ 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/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= diff --git a/connector/routingconnector/internal/metadata/generated_status.go b/connector/routingconnector/internal/metadata/generated_status.go index c118c256ee31..16465d9cc597 100644 --- a/connector/routingconnector/internal/metadata/generated_status.go +++ b/connector/routingconnector/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsToMetricsStability = component.StabilityLevelAlpha LogsToLogsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/routing") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/routing") +} diff --git a/connector/routingconnector/logs.go b/connector/routingconnector/logs.go index e1db011eefda..eb58175a25e9 100644 --- a/connector/routingconnector/logs.go +++ b/connector/routingconnector/logs.go @@ -72,7 +72,7 @@ func (c *logsConnector) ConsumeLogs(ctx context.Context, ld plog.Logs) error { rtx := ottlresource.NewTransformContext(rlogs.Resource()) noRoutesMatch := true - for _, route := range c.router.routes { + for _, route := range c.router.routeSlice { _, isMatch, err := route.statement.Execute(ctx, rtx) if err != nil { if c.config.ErrorMode == ottl.PropagateError { @@ -84,6 +84,9 @@ func (c *logsConnector) ConsumeLogs(ctx context.Context, ld plog.Logs) error { if isMatch { noRoutesMatch = false c.group(groups, route.consumer, rlogs) + if c.config.MatchOnce { + break + } } } diff --git a/connector/routingconnector/logs_test.go b/connector/routingconnector/logs_test.go index ed2c8dcc0cba..b68ec958fca0 100644 --- a/connector/routingconnector/logs_test.go +++ b/connector/routingconnector/logs_test.go @@ -229,6 +229,158 @@ func TestLogsAreCorrectlySplitPerResourceAttributeWithOTTL(t *testing.T) { }) } +func TestLogsAreCorrectlyMatchOnceWithOTTL(t *testing.T) { + logsDefault := component.NewIDWithName(component.DataTypeLogs, "default") + logs0 := component.NewIDWithName(component.DataTypeLogs, "0") + logs1 := component.NewIDWithName(component.DataTypeLogs, "1") + + cfg := &Config{ + DefaultPipelines: []component.ID{logsDefault}, + Table: []RoutingTableItem{ + { + Statement: `route() where IsMatch(attributes["X-Tenant"], ".*acme") == true`, + Pipelines: []component.ID{logs0}, + }, + { + Statement: `route() where IsMatch(attributes["X-Tenant"], "_acme") == true`, + Pipelines: []component.ID{logs1}, + }, + { + Statement: `route() where attributes["X-Tenant"] == "ecorp"`, + Pipelines: []component.ID{logsDefault, logs0}, + }, + }, + MatchOnce: true, + } + + var defaultSink, sink0, sink1 consumertest.LogsSink + + router := connectortest.NewLogsRouter( + connectortest.WithLogsSink(logsDefault, &defaultSink), + connectortest.WithLogsSink(logs0, &sink0), + connectortest.WithLogsSink(logs1, &sink1), + ) + + resetSinks := func() { + defaultSink.Reset() + sink0.Reset() + sink1.Reset() + } + + factory := NewFactory() + conn, err := factory.CreateLogsToLogs( + context.Background(), + connectortest.NewNopCreateSettings(), + cfg, + router.(consumer.Logs), + ) + + require.NoError(t, err) + require.NotNil(t, conn) + require.NoError(t, conn.Start(context.Background(), componenttest.NewNopHost())) + defer func() { + assert.NoError(t, conn.Shutdown(context.Background())) + }() + + t.Run("logs matched by no expressions", func(t *testing.T) { + resetSinks() + + l := plog.NewLogs() + rl := l.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("X-Tenant", "something-else") + rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + + require.NoError(t, conn.ConsumeLogs(context.Background(), l)) + + assert.Len(t, defaultSink.AllLogs(), 1) + assert.Len(t, sink0.AllLogs(), 0) + assert.Len(t, sink1.AllLogs(), 0) + }) + + t.Run("logs matched one expression", func(t *testing.T) { + resetSinks() + + l := plog.NewLogs() + + rl := l.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("X-Tenant", "xacme") + rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + + require.NoError(t, conn.ConsumeLogs(context.Background(), l)) + + assert.Len(t, defaultSink.AllLogs(), 0) + assert.Len(t, sink0.AllLogs(), 1) + assert.Len(t, sink1.AllLogs(), 0) + }) + + t.Run("logs matched by two expressions, but sinks to one", func(t *testing.T) { + resetSinks() + + l := plog.NewLogs() + + rl := l.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("X-Tenant", "x_acme") + rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + + rl = l.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("X-Tenant", "_acme") + rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + + require.NoError(t, conn.ConsumeLogs(context.Background(), l)) + + assert.Len(t, defaultSink.AllLogs(), 0) + assert.Len(t, sink0.AllLogs(), 1) + assert.Len(t, sink1.AllLogs(), 0) + + assert.Equal(t, sink0.AllLogs()[0].LogRecordCount(), 2) + }) + + t.Run("one log matched by multiple expressions, other matched none", func(t *testing.T) { + resetSinks() + + l := plog.NewLogs() + + rl := l.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("X-Tenant", "_acme") + rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + + rl = l.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("X-Tenant", "something-else") + rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + + require.NoError(t, conn.ConsumeLogs(context.Background(), l)) + + assert.Len(t, defaultSink.AllLogs(), 1) + assert.Len(t, sink0.AllLogs(), 1) + assert.Len(t, sink1.AllLogs(), 0) + + rlog := defaultSink.AllLogs()[0].ResourceLogs().At(0) + attr, ok := rlog.Resource().Attributes().Get("X-Tenant") + assert.True(t, ok, "routing attribute must exists") + assert.Equal(t, attr.AsString(), "something-else") + }) + + t.Run("logs matched by one expression, multiple pipelines", func(t *testing.T) { + resetSinks() + + l := plog.NewLogs() + + rl := l.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("X-Tenant", "ecorp") + rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + + require.NoError(t, conn.ConsumeLogs(context.Background(), l)) + + assert.Len(t, defaultSink.AllLogs(), 1) + assert.Len(t, sink0.AllLogs(), 1) + assert.Len(t, sink1.AllLogs(), 0) + + assert.Equal(t, defaultSink.AllLogs()[0].LogRecordCount(), 1) + assert.Equal(t, sink0.AllLogs()[0].LogRecordCount(), 1) + assert.Equal(t, defaultSink.AllLogs(), sink0.AllLogs()) + }) +} + func TestLogsResourceAttributeDroppedByOTTL(t *testing.T) { logsDefault := component.NewIDWithName(component.DataTypeLogs, "default") logsOther := component.NewIDWithName(component.DataTypeLogs, "other") diff --git a/connector/routingconnector/metrics.go b/connector/routingconnector/metrics.go index c0c7fdad5e7e..5c186f424f9a 100644 --- a/connector/routingconnector/metrics.go +++ b/connector/routingconnector/metrics.go @@ -72,7 +72,7 @@ func (c *metricsConnector) ConsumeMetrics(ctx context.Context, md pmetric.Metric rtx := ottlresource.NewTransformContext(rmetrics.Resource()) noRoutesMatch := true - for _, route := range c.router.routes { + for _, route := range c.router.routeSlice { _, isMatch, err := route.statement.Execute(ctx, rtx) if err != nil { if c.config.ErrorMode == ottl.PropagateError { @@ -84,6 +84,9 @@ func (c *metricsConnector) ConsumeMetrics(ctx context.Context, md pmetric.Metric if isMatch { noRoutesMatch = false c.group(groups, route.consumer, rmetrics) + if c.config.MatchOnce { + break + } } } diff --git a/connector/routingconnector/metrics_test.go b/connector/routingconnector/metrics_test.go index 377d966865f8..02f732401efa 100644 --- a/connector/routingconnector/metrics_test.go +++ b/connector/routingconnector/metrics_test.go @@ -244,6 +244,173 @@ func TestMetricsAreCorrectlySplitPerResourceAttributeWithOTTL(t *testing.T) { }) } +func TestMetricsAreCorrectlyMatchOnceWithOTTL(t *testing.T) { + metricsDefault := component.NewIDWithName(component.DataTypeMetrics, "default") + metrics0 := component.NewIDWithName(component.DataTypeMetrics, "0") + metrics1 := component.NewIDWithName(component.DataTypeMetrics, "1") + + cfg := &Config{ + DefaultPipelines: []component.ID{metricsDefault}, + Table: []RoutingTableItem{ + { + Statement: `route() where attributes["value"] > 2.5`, + Pipelines: []component.ID{metrics0}, + }, + { + Statement: `route() where attributes["value"] > 3.0`, + Pipelines: []component.ID{metrics1}, + }, + { + Statement: `route() where attributes["value"] == 1.0`, + Pipelines: []component.ID{metricsDefault, metrics0}, + }, + }, + MatchOnce: true, + } + + var defaultSink, sink0, sink1 consumertest.MetricsSink + + router := connectortest.NewMetricsRouter( + connectortest.WithMetricsSink(metricsDefault, &defaultSink), + connectortest.WithMetricsSink(metrics0, &sink0), + connectortest.WithMetricsSink(metrics1, &sink1), + ) + + resetSinks := func() { + defaultSink.Reset() + sink0.Reset() + sink1.Reset() + } + + factory := NewFactory() + conn, err := factory.CreateMetricsToMetrics( + context.Background(), + connectortest.NewNopCreateSettings(), + cfg, + router.(consumer.Metrics), + ) + + require.NoError(t, err) + require.NotNil(t, conn) + require.NoError(t, conn.Start(context.Background(), componenttest.NewNopHost())) + defer func() { + assert.NoError(t, conn.Shutdown(context.Background())) + }() + + t.Run("metric matched by no expressions", func(t *testing.T) { + resetSinks() + + m := pmetric.NewMetrics() + + rm := m.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutDouble("value", 0.0) + metric := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + metric.SetEmptyGauge() + metric.SetName("cpu") + + require.NoError(t, conn.ConsumeMetrics(context.Background(), m)) + + assert.Len(t, defaultSink.AllMetrics(), 1) + assert.Len(t, sink0.AllMetrics(), 0) + assert.Len(t, sink1.AllMetrics(), 0) + }) + + t.Run("metric matched by one of two expressions", func(t *testing.T) { + resetSinks() + + m := pmetric.NewMetrics() + + rm := m.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutDouble("value", 2.7) + metric := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + metric.SetEmptyGauge() + metric.SetName("cpu") + + require.NoError(t, conn.ConsumeMetrics(context.Background(), m)) + + assert.Len(t, defaultSink.AllMetrics(), 0) + assert.Len(t, sink0.AllMetrics(), 1) + assert.Len(t, sink1.AllMetrics(), 0) + }) + + t.Run("metric matched by two expressions, but sinks to one", func(t *testing.T) { + resetSinks() + + m := pmetric.NewMetrics() + + rm := m.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutDouble("value", 5.0) + metric := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + metric.SetEmptyGauge() + metric.SetName("cpu") + + rm = m.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutDouble("value", 3.1) + metric = rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + metric.SetEmptyGauge() + metric.SetName("cpu1") + + require.NoError(t, conn.ConsumeMetrics(context.Background(), m)) + + assert.Len(t, defaultSink.AllMetrics(), 0) + assert.Len(t, sink0.AllMetrics(), 1) + assert.Len(t, sink1.AllMetrics(), 0) + + assert.Equal(t, sink0.AllMetrics()[0].MetricCount(), 2) + }) + + t.Run("one metric matched by 2 expressions, others matched by none", func(t *testing.T) { + resetSinks() + + m := pmetric.NewMetrics() + + rm := m.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutDouble("value", 5.0) + metric := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + metric.SetEmptyGauge() + metric.SetName("cpu") + + rm = m.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutDouble("value", -1.0) + metric = rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + metric.SetEmptyGauge() + metric.SetName("cpu1") + + require.NoError(t, conn.ConsumeMetrics(context.Background(), m)) + + assert.Len(t, defaultSink.AllMetrics(), 1) + assert.Len(t, sink0.AllMetrics(), 1) + assert.Len(t, sink1.AllMetrics(), 0) + + rmetric := defaultSink.AllMetrics()[0].ResourceMetrics().At(0) + attr, ok := rmetric.Resource().Attributes().Get("value") + assert.True(t, ok, "routing attribute must exist") + assert.Equal(t, attr.Double(), float64(-1.0)) + }) + + t.Run("metric matched by one expression, multiple pipelines", func(t *testing.T) { + resetSinks() + + m := pmetric.NewMetrics() + + rm := m.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutDouble("value", 1.0) + metric := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + metric.SetEmptyGauge() + metric.SetName("cpu") + + require.NoError(t, conn.ConsumeMetrics(context.Background(), m)) + + assert.Len(t, defaultSink.AllMetrics(), 1) + assert.Len(t, sink0.AllMetrics(), 1) + assert.Len(t, sink1.AllMetrics(), 0) + + assert.Equal(t, defaultSink.AllMetrics()[0].MetricCount(), 1) + assert.Equal(t, sink0.AllMetrics()[0].MetricCount(), 1) + assert.Equal(t, defaultSink.AllMetrics(), sink0.AllMetrics()) + }) +} + func TestMetricsResourceAttributeDroppedByOTTL(t *testing.T) { metricsDefault := component.NewIDWithName(component.DataTypeMetrics, "default") metricsOther := component.NewIDWithName(component.DataTypeMetrics, "other") diff --git a/connector/routingconnector/router.go b/connector/routingconnector/router.go index 65a4b639d1d6..53558c6ff71a 100644 --- a/connector/routingconnector/router.go +++ b/connector/routingconnector/router.go @@ -29,8 +29,9 @@ type router[C any] struct { logger *zap.Logger parser ottl.Parser[ottlresource.TransformContext] - table []RoutingTableItem - routes map[string]routingItem[C] + table []RoutingTableItem + routes map[string]routingItem[C] + routeSlice []routingItem[C] defaultConsumer C consumerProvider consumerProvider[C] @@ -125,6 +126,9 @@ func (r *router[C]) registerRouteConsumers() error { return fmt.Errorf("%w: %s", errPipelineNotFound, err.Error()) } route.consumer = consumer + if !ok { + r.routeSlice = append(r.routeSlice, route) + } r.routes[key(item)] = route } diff --git a/connector/routingconnector/traces.go b/connector/routingconnector/traces.go index 99397d4482ab..73735c75a275 100644 --- a/connector/routingconnector/traces.go +++ b/connector/routingconnector/traces.go @@ -71,7 +71,7 @@ func (c *tracesConnector) ConsumeTraces(ctx context.Context, t ptrace.Traces) er rtx := ottlresource.NewTransformContext(rspans.Resource()) noRoutesMatch := true - for _, route := range c.router.routes { + for _, route := range c.router.routeSlice { _, isMatch, err := route.statement.Execute(ctx, rtx) if err != nil { if c.config.ErrorMode == ottl.PropagateError { @@ -83,6 +83,9 @@ func (c *tracesConnector) ConsumeTraces(ctx context.Context, t ptrace.Traces) er if isMatch { noRoutesMatch = false c.group(groups, route.consumer, rspans) + if c.config.MatchOnce { + break + } } } diff --git a/connector/routingconnector/traces_test.go b/connector/routingconnector/traces_test.go index f45c6fcb7c51..20397cedeb45 100644 --- a/connector/routingconnector/traces_test.go +++ b/connector/routingconnector/traces_test.go @@ -204,6 +204,135 @@ func TestTracesCorrectlySplitPerResourceAttributeWithOTTL(t *testing.T) { }) } +func TestTracesCorrectlyMatchOnceWithOTTL(t *testing.T) { + tracesDefault := component.NewIDWithName(component.DataTypeTraces, "default") + traces0 := component.NewIDWithName(component.DataTypeTraces, "0") + traces1 := component.NewIDWithName(component.DataTypeTraces, "1") + + cfg := &Config{ + DefaultPipelines: []component.ID{tracesDefault}, + MatchOnce: true, + Table: []RoutingTableItem{ + { + Statement: `route() where attributes["value"] > 0 and attributes["value"] < 4`, + Pipelines: []component.ID{traces0}, + }, + { + Statement: `route() where attributes["value"] > 1 and attributes["value"] < 4`, + Pipelines: []component.ID{traces1}, + }, + { + Statement: `route() where attributes["value"] == 5`, + Pipelines: []component.ID{tracesDefault, traces0}, + }, + }, + } + + var defaultSink, sink0, sink1 consumertest.TracesSink + + resetSinks := func() { + defaultSink.Reset() + sink0.Reset() + sink1.Reset() + } + + router := connectortest.NewTracesRouter( + connectortest.WithTracesSink(tracesDefault, &defaultSink), + connectortest.WithTracesSink(traces0, &sink0), + connectortest.WithTracesSink(traces1, &sink1), + ) + + factory := NewFactory() + conn, err := factory.CreateTracesToTraces( + context.Background(), + connectortest.NewNopCreateSettings(), + cfg, + router.(consumer.Traces), + ) + + require.NoError(t, err) + require.NotNil(t, conn) + require.NoError(t, conn.Start(context.Background(), componenttest.NewNopHost())) + defer func() { + assert.NoError(t, conn.Shutdown(context.Background())) + }() + + t.Run("span matched by 0 expressions", func(t *testing.T) { + resetSinks() + + tr := ptrace.NewTraces() + rl := tr.ResourceSpans().AppendEmpty() + rl.Resource().Attributes().PutInt("value", 10) + span := rl.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.SetName("span") + + require.NoError(t, conn.ConsumeTraces(context.Background(), tr)) + + assert.Len(t, defaultSink.AllTraces(), 1) + assert.Len(t, sink0.AllTraces(), 0) + assert.Len(t, sink1.AllTraces(), 0) + }) + + t.Run("span matched by one of two expressions", func(t *testing.T) { + resetSinks() + + tr := ptrace.NewTraces() + rl := tr.ResourceSpans().AppendEmpty() + rl.Resource().Attributes().PutInt("value", 1) + span := rl.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.SetName("span") + + require.NoError(t, conn.ConsumeTraces(context.Background(), tr)) + + assert.Len(t, defaultSink.AllTraces(), 0) + assert.Len(t, sink0.AllTraces(), 1) + assert.Len(t, sink1.AllTraces(), 0) + }) + + t.Run("span matched by all expressions, but sinks to one", func(t *testing.T) { + resetSinks() + + tr := ptrace.NewTraces() + rl := tr.ResourceSpans().AppendEmpty() + rl.Resource().Attributes().PutInt("value", 2) + span := rl.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.SetName("span") + + rl = tr.ResourceSpans().AppendEmpty() + rl.Resource().Attributes().PutInt("value", 3) + span = rl.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.SetName("span1") + + require.NoError(t, conn.ConsumeTraces(context.Background(), tr)) + + assert.Len(t, defaultSink.AllTraces(), 0) + assert.Len(t, sink0.AllTraces(), 1) + assert.Len(t, sink1.AllTraces(), 0) + + assert.Equal(t, sink0.AllTraces()[0].SpanCount(), 2) + }) + + t.Run("span matched by one expression, multiple pipelines", func(t *testing.T) { + resetSinks() + + tr := ptrace.NewTraces() + rl := tr.ResourceSpans().AppendEmpty() + rl.Resource().Attributes().PutInt("value", 5) + span := rl.ScopeSpans().AppendEmpty().Spans().AppendEmpty() + span.SetName("span") + + require.NoError(t, conn.ConsumeTraces(context.Background(), tr)) + + assert.Len(t, defaultSink.AllTraces(), 1) + assert.Len(t, sink0.AllTraces(), 1) + assert.Len(t, sink1.AllTraces(), 0) + + assert.Equal(t, defaultSink.AllTraces()[0].SpanCount(), 1) + assert.Equal(t, sink0.AllTraces()[0].SpanCount(), 1) + assert.Equal(t, defaultSink.AllTraces(), sink0.AllTraces()) + }) +} + func TestTracesResourceAttributeDroppedByOTTL(t *testing.T) { tracesDefault := component.NewIDWithName(component.DataTypeTraces, "default") tracesOther := component.NewIDWithName(component.DataTypeTraces, "other") diff --git a/connector/servicegraphconnector/go.mod b/connector/servicegraphconnector/go.mod index d2b7d166eeee..98ef36f12f0c 100644 --- a/connector/servicegraphconnector/go.mod +++ b/connector/servicegraphconnector/go.mod @@ -8,6 +8,8 @@ require ( go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/connector v0.91.0 go.opentelemetry.io/collector/consumer v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 ) require ( @@ -35,8 +37,6 @@ require ( go.opentelemetry.io/collector/processor v0.91.0 // indirect go.opentelemetry.io/collector/semconv v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.19.0 // indirect @@ -55,3 +55,11 @@ retract ( ) replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/servicegraphprocessor => ../../processor/servicegraphprocessor/ + +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/connector/servicegraphconnector/internal/metadata/generated_status.go b/connector/servicegraphconnector/internal/metadata/generated_status.go index 4c38438390fe..d2197167296b 100644 --- a/connector/servicegraphconnector/internal/metadata/generated_status.go +++ b/connector/servicegraphconnector/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "servicegraph" TracesToMetricsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/servicegraph") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/servicegraph") +} diff --git a/connector/spanmetricsconnector/README.md b/connector/spanmetricsconnector/README.md index fdc415f2dd68..3bc0001b2f4f 100644 --- a/connector/spanmetricsconnector/README.md +++ b/connector/spanmetricsconnector/README.md @@ -3,13 +3,14 @@ | Status | | | ------------- |-----------| -| Distributions | [contrib], [grafana], [splunk], [sumo] | +| 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) | [@albertteoh](https://www.github.com/albertteoh) | [alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib [grafana]: https://github.com/grafana/agent +[liatrio]: https://github.com/liatrio/liatrio-otel-collector [splunk]: https://github.com/signalfx/splunk-otel-collector [sumo]: https://github.com/SumoLogic/sumologic-otel-collector diff --git a/connector/spanmetricsconnector/go.mod b/connector/spanmetricsconnector/go.mod index 6291caf9d47b..bb7d88e7f30e 100644 --- a/connector/spanmetricsconnector/go.mod +++ b/connector/spanmetricsconnector/go.mod @@ -15,8 +15,10 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 - google.golang.org/grpc v1.60.0 + google.golang.org/grpc v1.60.1 ) require ( @@ -39,8 +41,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/connector/spanmetricsconnector/go.sum b/connector/spanmetricsconnector/go.sum index 923d30ccbce5..b15fbad16011 100644 --- a/connector/spanmetricsconnector/go.sum +++ b/connector/spanmetricsconnector/go.sum @@ -115,8 +115,8 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0= google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= diff --git a/connector/spanmetricsconnector/internal/metadata/generated_status.go b/connector/spanmetricsconnector/internal/metadata/generated_status.go index 19337d4e8a25..5672e2c0604f 100644 --- a/connector/spanmetricsconnector/internal/metadata/generated_status.go +++ b/connector/spanmetricsconnector/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "spanmetrics" TracesToMetricsStability = component.StabilityLevelAlpha ) + +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/connector/spanmetricsconnector/metadata.yaml b/connector/spanmetricsconnector/metadata.yaml index c700c0bf1332..2237128d9377 100644 --- a/connector/spanmetricsconnector/metadata.yaml +++ b/connector/spanmetricsconnector/metadata.yaml @@ -4,6 +4,6 @@ status: class: connector stability: alpha: [traces_to_metrics] - distributions: [contrib, sumo, grafana, splunk] + distributions: [contrib, sumo, grafana, splunk, liatrio] codeowners: active: [albertteoh] diff --git a/distributions.yaml b/distributions.yaml index 89b97a0f43d8..d6c9cfb0824d 100644 --- a/distributions.yaml +++ b/distributions.yaml @@ -29,5 +29,14 @@ - samiura - name: sumo url: https://github.com/SumoLogic/sumologic-otel-collector + maintainers: + - aboguszewski-sumo + - astencel-sumo + - kkujawa-sumo + - rnishtala-sumo + - sumo-drosiek + - swiatekm-sumo - name: liatrio - url: https://github.com/liatrio/liatrio-otel-collector \ No newline at end of file + url: https://github.com/liatrio/liatrio-otel-collector + maintainers: + - adrielp diff --git a/examples/demo/client/go.mod b/examples/demo/client/go.mod index 9243d9e939ce..109b88c31ff7 100644 --- a/examples/demo/client/go.mod +++ b/examples/demo/client/go.mod @@ -11,7 +11,7 @@ require ( go.opentelemetry.io/otel/metric v1.21.0 go.opentelemetry.io/otel/sdk v1.21.0 go.opentelemetry.io/otel/sdk/metric v1.21.0 - google.golang.org/grpc v1.60.0 + google.golang.org/grpc v1.60.1 ) require ( diff --git a/examples/demo/client/go.sum b/examples/demo/client/go.sum index 4de9f1d294d0..06bda5df37e3 100644 --- a/examples/demo/client/go.sum +++ b/examples/demo/client/go.sum @@ -50,8 +50,8 @@ google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1: google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 h1:AB/lmRny7e2pLhFEYIbl5qkDAUt2h0ZRO4wGPhZf+ik= google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405/go.mod h1:67X1fPuzjcrkymZzZV1vvkFeTn2Rvc6lYF9MYFGCcwE= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= diff --git a/examples/demo/server/go.mod b/examples/demo/server/go.mod index 78be864b0e3a..7ff8ba487561 100644 --- a/examples/demo/server/go.mod +++ b/examples/demo/server/go.mod @@ -12,7 +12,7 @@ require ( go.opentelemetry.io/otel/sdk v1.21.0 go.opentelemetry.io/otel/sdk/metric v1.21.0 go.opentelemetry.io/otel/trace v1.21.0 - google.golang.org/grpc v1.60.0 + google.golang.org/grpc v1.60.1 ) require ( diff --git a/examples/demo/server/go.sum b/examples/demo/server/go.sum index 4de9f1d294d0..06bda5df37e3 100644 --- a/examples/demo/server/go.sum +++ b/examples/demo/server/go.sum @@ -50,8 +50,8 @@ google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1: google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 h1:AB/lmRny7e2pLhFEYIbl5qkDAUt2h0ZRO4wGPhZf+ik= google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405/go.mod h1:67X1fPuzjcrkymZzZV1vvkFeTn2Rvc6lYF9MYFGCcwE= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= diff --git a/exporter/alertmanagerexporter/go.mod b/exporter/alertmanagerexporter/go.mod index ebf691626642..7a87dc78551c 100644 --- a/exporter/alertmanagerexporter/go.mod +++ b/exporter/alertmanagerexporter/go.mod @@ -16,6 +16,8 @@ require ( go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -53,8 +55,6 @@ require ( go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/exporter/alertmanagerexporter/internal/metadata/generated_status.go b/exporter/alertmanagerexporter/internal/metadata/generated_status.go index a8c6c32b1f19..7e33d6317133 100644 --- a/exporter/alertmanagerexporter/internal/metadata/generated_status.go +++ b/exporter/alertmanagerexporter/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "alertmanager" TracesStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/alertmanager") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/alertmanager") +} diff --git a/exporter/alibabacloudlogserviceexporter/README.md b/exporter/alibabacloudlogserviceexporter/README.md index 9709eda9e794..8db8cc37c2da 100644 --- a/exporter/alibabacloudlogserviceexporter/README.md +++ b/exporter/alibabacloudlogserviceexporter/README.md @@ -3,12 +3,12 @@ | Status | | | ------------- |-----------| -| Stability | [beta]: traces, metrics, logs | +| Stability | [unmaintained]: 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%2Falibabacloudlogservice%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aexporter%2Falibabacloudlogservice) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aexporter%2Falibabacloudlogservice%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aexporter%2Falibabacloudlogservice) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@shabicheng](https://www.github.com/shabicheng), [@kongluoxing](https://www.github.com/kongluoxing), [@qiansheng91](https://www.github.com/qiansheng91) | -[beta]: https://github.com/open-telemetry/opentelemetry-collector#beta +[unmaintained]: https://github.com/open-telemetry/opentelemetry-collector#unmaintained [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib [observiq]: https://github.com/observIQ/observiq-otel-collector diff --git a/exporter/alibabacloudlogserviceexporter/go.mod b/exporter/alibabacloudlogserviceexporter/go.mod index 56df6e6a41d2..bf0b7907370d 100644 --- a/exporter/alibabacloudlogserviceexporter/go.mod +++ b/exporter/alibabacloudlogserviceexporter/go.mod @@ -13,6 +13,8 @@ require ( go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -44,8 +46,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/exporter/alibabacloudlogserviceexporter/internal/metadata/generated_status.go b/exporter/alibabacloudlogserviceexporter/internal/metadata/generated_status.go index 2edd082d57f7..b7d837dd70bc 100644 --- a/exporter/alibabacloudlogserviceexporter/internal/metadata/generated_status.go +++ b/exporter/alibabacloudlogserviceexporter/internal/metadata/generated_status.go @@ -4,11 +4,21 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "alibabacloud_logservice" - TracesStability = component.StabilityLevelBeta - MetricsStability = component.StabilityLevelBeta - LogsStability = component.StabilityLevelBeta + TracesStability = component.StabilityLevelUnmaintained + MetricsStability = component.StabilityLevelUnmaintained + LogsStability = component.StabilityLevelUnmaintained ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/alibabacloudlogservice") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/alibabacloudlogservice") +} diff --git a/exporter/alibabacloudlogserviceexporter/metadata.yaml b/exporter/alibabacloudlogserviceexporter/metadata.yaml index 4f2b6cb14f64..73c19c844b77 100644 --- a/exporter/alibabacloudlogserviceexporter/metadata.yaml +++ b/exporter/alibabacloudlogserviceexporter/metadata.yaml @@ -3,7 +3,7 @@ type: alibabacloud_logservice status: class: exporter stability: - beta: [traces, metrics, logs] + unmaintained: [traces, metrics, logs] distributions: [contrib, observiq] codeowners: active: [shabicheng, kongluoxing, qiansheng91] diff --git a/exporter/awscloudwatchlogsexporter/README.md b/exporter/awscloudwatchlogsexporter/README.md index ce85109deb58..02af0fb0aaff 100644 --- a/exporter/awscloudwatchlogsexporter/README.md +++ b/exporter/awscloudwatchlogsexporter/README.md @@ -4,12 +4,13 @@ | Status | | | ------------- |-----------| | Stability | [beta]: logs | -| Distributions | [contrib], [observiq] | +| Distributions | [contrib], [liatrio], [observiq] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aexporter%2Fawscloudwatchlogs%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aexporter%2Fawscloudwatchlogs) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aexporter%2Fawscloudwatchlogs%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aexporter%2Fawscloudwatchlogs) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@boostchicken](https://www.github.com/boostchicken), [@bryan-aguilar](https://www.github.com/bryan-aguilar), [@rapphil](https://www.github.com/rapphil) | [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/exporter/awscloudwatchlogsexporter/go.mod b/exporter/awscloudwatchlogsexporter/go.mod index a9067162c575..1d18ad815dda 100644 --- a/exporter/awscloudwatchlogsexporter/go.mod +++ b/exporter/awscloudwatchlogsexporter/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awsclo go 1.20 require ( - github.com/aws/aws-sdk-go v1.49.1 + github.com/aws/aws-sdk-go v1.49.6 github.com/cenkalti/backoff/v4 v4.2.1 github.com/google/uuid v1.5.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/awsutil v0.91.0 @@ -14,6 +14,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -42,8 +44,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/exporter/awscloudwatchlogsexporter/go.sum b/exporter/awscloudwatchlogsexporter/go.sum index e7cf0b8c0c05..aabce162eecd 100644 --- a/exporter/awscloudwatchlogsexporter/go.sum +++ b/exporter/awscloudwatchlogsexporter/go.sum @@ -1,8 +1,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= contrib.go.opencensus.io/exporter/prometheus v0.4.2 h1:sqfsYl5GIY/L570iT+l93ehxaWJs2/OwXtiWwew3oAg= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/aws/aws-sdk-go v1.49.1 h1:Dsamcd8d/nNb3A+bZ0ucfGl0vGZsW5wlRW0vhoYGoeQ= -github.com/aws/aws-sdk-go v1.49.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= +github.com/aws/aws-sdk-go v1.49.6/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= 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= diff --git a/exporter/awscloudwatchlogsexporter/internal/metadata/generated_status.go b/exporter/awscloudwatchlogsexporter/internal/metadata/generated_status.go index 85737d8480e2..7ca2f73ce53f 100644 --- a/exporter/awscloudwatchlogsexporter/internal/metadata/generated_status.go +++ b/exporter/awscloudwatchlogsexporter/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "awscloudwatchlogs" LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/awscloudwatchlogs") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/awscloudwatchlogs") +} diff --git a/exporter/awscloudwatchlogsexporter/metadata.yaml b/exporter/awscloudwatchlogsexporter/metadata.yaml index 370faa1e41e2..edf50e3d1ea8 100644 --- a/exporter/awscloudwatchlogsexporter/metadata.yaml +++ b/exporter/awscloudwatchlogsexporter/metadata.yaml @@ -4,6 +4,6 @@ status: class: exporter stability: beta: [logs] - distributions: [contrib, observiq] + distributions: [contrib, observiq, liatrio] codeowners: active: [boostchicken, bryan-aguilar, rapphil] diff --git a/exporter/awsemfexporter/go.mod b/exporter/awsemfexporter/go.mod index 955b15ec9369..042abb663d43 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.20 require ( - github.com/aws/aws-sdk-go v1.49.1 + github.com/aws/aws-sdk-go v1.49.6 github.com/google/uuid v1.5.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/awsutil v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/cwlogs v0.91.0 @@ -18,9 +18,11 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 - golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb + golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 ) require ( @@ -47,8 +49,6 @@ require ( go.opentelemetry.io/collector/extension v0.91.0 // indirect go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/exporter/awsemfexporter/go.sum b/exporter/awsemfexporter/go.sum index 1d8874415e51..6ebac8c39e7d 100644 --- a/exporter/awsemfexporter/go.sum +++ b/exporter/awsemfexporter/go.sum @@ -1,8 +1,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= contrib.go.opencensus.io/exporter/prometheus v0.4.2 h1:sqfsYl5GIY/L570iT+l93ehxaWJs2/OwXtiWwew3oAg= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/aws/aws-sdk-go v1.49.1 h1:Dsamcd8d/nNb3A+bZ0ucfGl0vGZsW5wlRW0vhoYGoeQ= -github.com/aws/aws-sdk-go v1.49.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= +github.com/aws/aws-sdk-go v1.49.6/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= 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= @@ -144,8 +144,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= diff --git a/exporter/awsemfexporter/internal/metadata/generated_status.go b/exporter/awsemfexporter/internal/metadata/generated_status.go index 4496ea408180..352cba3cdf7b 100644 --- a/exporter/awsemfexporter/internal/metadata/generated_status.go +++ b/exporter/awsemfexporter/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "awsemf" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/awsemf") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/awsemf") +} diff --git a/exporter/awskinesisexporter/go.mod b/exporter/awskinesisexporter/go.mod index fa6315a957e7..471d8c2bafbf 100644 --- a/exporter/awskinesisexporter/go.mod +++ b/exporter/awskinesisexporter/go.mod @@ -20,6 +20,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -59,8 +61,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/semconv v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/exporter/awskinesisexporter/internal/metadata/generated_status.go b/exporter/awskinesisexporter/internal/metadata/generated_status.go index 3f8213f8f2cf..3a15b19c63d4 100644 --- a/exporter/awskinesisexporter/internal/metadata/generated_status.go +++ b/exporter/awskinesisexporter/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/awskinesis") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/awskinesis") +} diff --git a/exporter/awss3exporter/go.mod b/exporter/awss3exporter/go.mod index 13d224a54a8c..799fd3be7630 100644 --- a/exporter/awss3exporter/go.mod +++ b/exporter/awss3exporter/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/awss3e go 1.20 require ( - github.com/aws/aws-sdk-go v1.49.1 + github.com/aws/aws-sdk-go v1.49.6 github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.91.0 @@ -12,6 +12,8 @@ require ( go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/otelcol v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -82,10 +84,8 @@ require ( go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.44.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/otel/sdk v1.21.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/exporter/awss3exporter/go.sum b/exporter/awss3exporter/go.sum index ef72bdb49468..22da8f227a7f 100644 --- a/exporter/awss3exporter/go.sum +++ b/exporter/awss3exporter/go.sum @@ -41,8 +41,8 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= -github.com/aws/aws-sdk-go v1.49.1 h1:Dsamcd8d/nNb3A+bZ0ucfGl0vGZsW5wlRW0vhoYGoeQ= -github.com/aws/aws-sdk-go v1.49.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= +github.com/aws/aws-sdk-go v1.49.6/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= diff --git a/exporter/awss3exporter/internal/metadata/generated_status.go b/exporter/awss3exporter/internal/metadata/generated_status.go index 37542f92cd7e..d2f6bc690f89 100644 --- a/exporter/awss3exporter/internal/metadata/generated_status.go +++ b/exporter/awss3exporter/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/awss3") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/awss3") +} diff --git a/exporter/awsxrayexporter/README.md b/exporter/awsxrayexporter/README.md index e8898f731be6..c35d99c9391f 100644 --- a/exporter/awsxrayexporter/README.md +++ b/exporter/awsxrayexporter/README.md @@ -4,13 +4,14 @@ | Status | | | ------------- |-----------| | Stability | [beta]: traces | -| Distributions | [contrib], [aws], [observiq] | +| Distributions | [contrib], [aws], [liatrio], [observiq] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aexporter%2Fawsxray%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aexporter%2Fawsxray) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aexporter%2Fawsxray%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aexporter%2Fawsxray) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@wangzlei](https://www.github.com/wangzlei), [@srprash](https://www.github.com/srprash) | [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 +[liatrio]: https://github.com/liatrio/liatrio-otel-collector [observiq]: https://github.com/observIQ/observiq-otel-collector diff --git a/exporter/awsxrayexporter/go.mod b/exporter/awsxrayexporter/go.mod index e417b7fcf88d..b8bae28143f7 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.20 require ( - github.com/aws/aws-sdk-go v1.49.1 + github.com/aws/aws-sdk-go v1.49.6 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/awsutil v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xray v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 @@ -15,6 +15,8 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -41,8 +43,6 @@ require ( go.opentelemetry.io/collector/extension v0.91.0 // indirect go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/exporter/awsxrayexporter/go.sum b/exporter/awsxrayexporter/go.sum index 83180fc4d9ea..d3773347b798 100644 --- a/exporter/awsxrayexporter/go.sum +++ b/exporter/awsxrayexporter/go.sum @@ -1,8 +1,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= contrib.go.opencensus.io/exporter/prometheus v0.4.2 h1:sqfsYl5GIY/L570iT+l93ehxaWJs2/OwXtiWwew3oAg= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/aws/aws-sdk-go v1.49.1 h1:Dsamcd8d/nNb3A+bZ0ucfGl0vGZsW5wlRW0vhoYGoeQ= -github.com/aws/aws-sdk-go v1.49.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= +github.com/aws/aws-sdk-go v1.49.6/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= 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= diff --git a/exporter/awsxrayexporter/internal/metadata/generated_status.go b/exporter/awsxrayexporter/internal/metadata/generated_status.go index 12af796c7f9f..f60df3ca9ac5 100644 --- a/exporter/awsxrayexporter/internal/metadata/generated_status.go +++ b/exporter/awsxrayexporter/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "awsxray" TracesStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/awsxray") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/awsxray") +} diff --git a/exporter/awsxrayexporter/metadata.yaml b/exporter/awsxrayexporter/metadata.yaml index 327ff2f2a011..2e59810fd298 100644 --- a/exporter/awsxrayexporter/metadata.yaml +++ b/exporter/awsxrayexporter/metadata.yaml @@ -4,6 +4,6 @@ status: class: exporter stability: beta: [traces] - distributions: [contrib, aws, observiq] + distributions: [contrib, aws, observiq, liatrio] codeowners: active: [wangzlei, srprash] diff --git a/exporter/azuredataexplorerexporter/go.mod b/exporter/azuredataexplorerexporter/go.mod index 980273d7853d..ad2bdfb392cb 100644 --- a/exporter/azuredataexplorerexporter/go.mod +++ b/exporter/azuredataexplorerexporter/go.mod @@ -13,6 +13,8 @@ require ( go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -61,10 +63,8 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.15.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/exporter/azuredataexplorerexporter/go.sum b/exporter/azuredataexplorerexporter/go.sum index cdc79ae9a9b7..ab35dcb369f6 100644 --- a/exporter/azuredataexplorerexporter/go.sum +++ b/exporter/azuredataexplorerexporter/go.sum @@ -200,8 +200,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= diff --git a/exporter/azuredataexplorerexporter/internal/metadata/generated_status.go b/exporter/azuredataexplorerexporter/internal/metadata/generated_status.go index 9e42ff39a993..22d1cf329f27 100644 --- a/exporter/azuredataexplorerexporter/internal/metadata/generated_status.go +++ b/exporter/azuredataexplorerexporter/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/azuredataexplorer") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/azuredataexplorer") +} diff --git a/exporter/azuremonitorexporter/go.mod b/exporter/azuremonitorexporter/go.mod index 9c8c72a28d27..a6906e6f6245 100644 --- a/exporter/azuremonitorexporter/go.mod +++ b/exporter/azuremonitorexporter/go.mod @@ -13,6 +13,8 @@ require ( go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 golang.org/x/net v0.19.0 ) @@ -43,8 +45,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/exporter/azuremonitorexporter/internal/metadata/generated_status.go b/exporter/azuremonitorexporter/internal/metadata/generated_status.go index 5dd0580e914d..d8c79c8ea560 100644 --- a/exporter/azuremonitorexporter/internal/metadata/generated_status.go +++ b/exporter/azuremonitorexporter/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/azuremonitor") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/azuremonitor") +} diff --git a/exporter/carbonexporter/README.md b/exporter/carbonexporter/README.md index 327a66fda990..55f7e315b4f8 100644 --- a/exporter/carbonexporter/README.md +++ b/exporter/carbonexporter/README.md @@ -24,8 +24,6 @@ The following settings are required: - `endpoint` (default = `localhost:2003`): Address and port that the exporter should send data to. -- `timeout` (default = `5s`): Maximum duration allowed to connect - and send data to the configured `endpoint`. Example: @@ -45,3 +43,10 @@ exporters: The full list of settings exposed for this receiver are documented [here](./config.go) with detailed sample configurations [here](./testdata/config.yaml). + +## Advanced Configuration + +Several helper files are leveraged to provide additional capabilities automatically: + +- [net settings](https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/confignet/README.md) +- [Queuing, retry and timeout settings](https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/exporterhelper/README.md) diff --git a/exporter/carbonexporter/config.go b/exporter/carbonexporter/config.go index ead7eee80219..90ed96f719be 100644 --- a/exporter/carbonexporter/config.go +++ b/exporter/carbonexporter/config.go @@ -7,26 +7,29 @@ import ( "errors" "fmt" "net" - "time" -) -// Defaults for not specified configuration settings. -const ( - DefaultEndpoint = "localhost:2003" - DefaultSendTimeout = 5 * time.Second + "go.opentelemetry.io/collector/config/confignet" + "go.opentelemetry.io/collector/exporter/exporterhelper" + + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry" ) // Config defines configuration for Carbon exporter. type Config struct { - - // Endpoint specifies host and port to send metrics in the Carbon plaintext - // format. The default value is defined by the DefaultEndpoint constant. - Endpoint string `mapstructure:"endpoint"` + // Specifies the connection endpoint config. The default value is "localhost:2003". + confignet.TCPAddr `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct. + // MaxIdleConns is used to set a limit to the maximum idle TCP connections the client can keep open. Default value is 100. + // If `sending_queue` is enabled, it is recommended to use same value as `sending_queue::num_consumers`. + MaxIdleConns int `mapstructure:"max_idle_conns"` // Timeout is the maximum duration allowed to connecting and sending the - // data to the Carbon/Graphite backend. - // The default value is defined by the DefaultSendTimeout constant. - Timeout time.Duration `mapstructure:"timeout"` + // data to the Carbon/Graphite backend. The default value is 5s. + exporterhelper.TimeoutSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct. + QueueConfig exporterhelper.QueueSettings `mapstructure:"sending_queue"` + RetryConfig exporterhelper.RetrySettings `mapstructure:"retry_on_failure"` + + // ResourceToTelemetrySettings defines configuration for converting resource attributes to metric labels. + ResourceToTelemetryConfig resourcetotelemetry.Settings `mapstructure:"resource_to_telemetry_conversion"` } func (cfg *Config) Validate() error { @@ -38,7 +41,11 @@ func (cfg *Config) Validate() error { // Negative timeouts are not acceptable, since all sends will fail. if cfg.Timeout < 0 { - return errors.New("exporter requires a positive timeout") + return errors.New("'timeout' must be non-negative") + } + + if cfg.MaxIdleConns < 0 { + return errors.New("'max_idle_conns' must be non-negative") } return nil diff --git a/exporter/carbonexporter/config_test.go b/exporter/carbonexporter/config_test.go index 07cfaf48e42b..1bf4dcc7c7be 100644 --- a/exporter/carbonexporter/config_test.go +++ b/exporter/carbonexporter/config_test.go @@ -11,9 +11,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/config/confignet" "go.opentelemetry.io/collector/confmap/confmaptest" + "go.opentelemetry.io/collector/exporter/exporterhelper" "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/carbonexporter/internal/metadata" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry" ) func TestLoadConfig(t *testing.T) { @@ -35,8 +38,29 @@ func TestLoadConfig(t *testing.T) { { id: component.NewIDWithName(metadata.Type, "allsettings"), expected: &Config{ - Endpoint: "localhost:8080", - Timeout: 10 * time.Second, + TCPAddr: confignet.TCPAddr{ + Endpoint: "localhost:8080", + }, + MaxIdleConns: 15, + TimeoutSettings: exporterhelper.TimeoutSettings{ + Timeout: 10 * time.Second, + }, + RetryConfig: exporterhelper.RetrySettings{ + Enabled: true, + InitialInterval: 10 * time.Second, + RandomizationFactor: 0.7, + Multiplier: 3.14, + MaxInterval: 1 * time.Minute, + MaxElapsedTime: 10 * time.Minute, + }, + QueueConfig: exporterhelper.QueueSettings{ + Enabled: true, + NumConsumers: 2, + QueueSize: 10, + }, + ResourceToTelemetryConfig: resourcetotelemetry.Settings{ + Enabled: true, + }, }, }, } @@ -69,14 +93,27 @@ func TestValidateConfig(t *testing.T) { { name: "invalid_tcp_addr", config: &Config{ - Endpoint: "http://localhost:2003", + TCPAddr: confignet.TCPAddr{ + Endpoint: "http://localhost:2003", + }, }, wantErr: true, }, { name: "invalid_timeout", config: &Config{ - Timeout: -5 * time.Second, + TCPAddr: confignet.TCPAddr{Endpoint: defaultEndpoint}, + TimeoutSettings: exporterhelper.TimeoutSettings{ + Timeout: -5 * time.Second, + }, + }, + wantErr: true, + }, + { + name: "invalid_max_idle_conns", + config: &Config{ + TCPAddr: confignet.TCPAddr{Endpoint: defaultEndpoint}, + MaxIdleConns: -1, }, wantErr: true, }, diff --git a/exporter/carbonexporter/exporter.go b/exporter/carbonexporter/exporter.go index e6a8fbc62ccb..3414833e6e8f 100644 --- a/exporter/carbonexporter/exporter.go +++ b/exporter/carbonexporter/exporter.go @@ -9,145 +9,196 @@ import ( "sync" "time" + "go.opentelemetry.io/collector/config/confignet" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exporterhelper" "go.opentelemetry.io/collector/pdata/pmetric" + "go.uber.org/multierr" + + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry" ) // newCarbonExporter returns a new Carbon exporter. -func newCarbonExporter(cfg *Config, set exporter.CreateSettings) (exporter.Metrics, error) { +func newCarbonExporter(ctx context.Context, cfg *Config, set exporter.CreateSettings) (exporter.Metrics, error) { sender := carbonSender{ - connPool: newTCPConnPool(cfg.Endpoint, cfg.Timeout), + writeTimeout: cfg.Timeout, + conns: newConnPool(cfg.TCPAddr, cfg.Timeout, cfg.MaxIdleConns), } - return exporterhelper.NewMetricsExporter( - context.TODO(), + exp, err := exporterhelper.NewMetricsExporter( + ctx, set, cfg, sender.pushMetricsData, + // We don't use exporterhelper.WithTimeout because the TCP connection does not accept writing with context. + exporterhelper.WithQueue(cfg.QueueConfig), + exporterhelper.WithRetry(cfg.RetryConfig), exporterhelper.WithShutdown(sender.Shutdown)) + if err != nil { + return nil, err + } + + return resourcetotelemetry.WrapMetricsExporter(cfg.ResourceToTelemetryConfig, exp), nil } // carbonSender is the struct tying the translation function and the TCP // connections into an implementations of exporterhelper.PushMetricsData so // the exporter can leverage the helper and get consistent observability. type carbonSender struct { - connPool *connPool + writeTimeout time.Duration + conns connPool } func (cs *carbonSender) pushMetricsData(_ context.Context, md pmetric.Metrics) error { lines := metricDataToPlaintext(md) - if _, err := cs.connPool.Write([]byte(lines)); err != nil { - // Use the sum of converted and dropped since the write failed for all. + // There is no way to do a call equivalent to recvfrom with an empty buffer + // to check if the connection was terminated (if the size of the buffer is + // 0 the Read call doesn't call lower level). So due to buffer sizes it is + // possible that a write will succeed on a connection that was already + // closed by the server. + // + // At least on Darwin it is possible to work around this by configuring the + // buffer on each call, ie.: + // + // if err = conn.SetWriteBuffer(len(bytes)-1); err != nil { + // return 0, err + // } + // + // However, this causes a performance penalty of ~10% cpu and it is not + // present in various implementations of Carbon clients. Considering these + // facts this "workaround" is not being added at this moment. If it is + // needed in some scenarios the workaround should be validated on other + // platforms and offered as a configuration setting. + conn, err := cs.conns.get() + if err != nil { return err } + if err = conn.SetWriteDeadline(time.Now().Add(cs.writeTimeout)); err != nil { + // Do not re-enqueue the connection since it failed to set a deadline. + return multierr.Append(err, conn.Close()) + } + + // If we did not write all bytes will get an error, so no need to check for that. + _, err = conn.Write([]byte(lines)) + if err != nil { + // Do not re-enqueue the connection since it failed to write. + return multierr.Append(err, conn.Close()) + } + + // Even if we close the connection because of the max idle connections, + cs.conns.put(conn) return nil } func (cs *carbonSender) Shutdown(context.Context) error { - cs.connPool.Close() - return nil + return cs.conns.close() } -// connPool is a very simple implementation of a pool of net.TCPConn instances. -// The implementation hides the pool and exposes a Write and Close methods. -// It leverages the prior art from SignalFx Gateway (see -// https://github.com/signalfx/gateway/blob/master/protocol/carbon/conn_pool.go -// but not its implementation). -// -// It keeps a unbounded "stack" of TCPConn instances always "popping" the most -// recently returned to the pool. There is no accounting to terminating old -// unused connections as that was the case on the prior art mentioned above. -type connPool struct { - mtx sync.Mutex - conns []*net.TCPConn - endpoint string - timeout time.Duration +// connPool is a very simple implementation of a pool of net.Conn instances. +type connPool interface { + get() (net.Conn, error) + put(conn net.Conn) + close() error } -func newTCPConnPool( - endpoint string, +func newConnPool( + tcpConfig confignet.TCPAddr, timeout time.Duration, -) *connPool { - return &connPool{ - endpoint: endpoint, - timeout: timeout, + maxIdleConns int, +) connPool { + if maxIdleConns == 0 { + return &nopConnPool{ + timeout: timeout, + tcpConfig: tcpConfig, + } + } + return &connPoolWithIdle{ + timeout: timeout, + tcpConfig: tcpConfig, + maxIdleConns: maxIdleConns, } } -func (cp *connPool) Write(bytes []byte) (int, error) { - var conn *net.TCPConn - var err error +// nopConnPool is a very simple implementation that does not cache any net.Conn. +type nopConnPool struct { + timeout time.Duration + tcpConfig confignet.TCPAddr +} - // The deferred function below is what puts back connections on the pool. - defer func() { - if err == nil { - cp.mtx.Lock() - cp.conns = append(cp.conns, conn) - cp.mtx.Unlock() - } else if conn != nil { - conn.Close() - } - }() +func (cp *nopConnPool) get() (net.Conn, error) { + return createTCPConn(cp.tcpConfig, cp.timeout) +} - start := time.Now() - cp.mtx.Lock() - lastIdx := len(cp.conns) - 1 - if lastIdx >= 0 { - conn = cp.conns[lastIdx] - cp.conns = cp.conns[0:lastIdx] - } - cp.mtx.Unlock() - if conn == nil { - if conn, err = cp.createTCPConn(); err != nil { - return 0, err - } +func (cp *nopConnPool) put(conn net.Conn) { + _ = conn.Close() +} + +func (cp *nopConnPool) close() error { + return nil +} + +// connPool is a very simple implementation of a pool of net.Conn instances. +// +// It keeps at most maxIdleConns net.Conn and always "popping" the most +// recently returned to the pool. There is no accounting to terminating old +// unused connections. +type connPoolWithIdle struct { + timeout time.Duration + maxIdleConns int + mtx sync.Mutex + conns []net.Conn + tcpConfig confignet.TCPAddr +} + +func (cp *connPoolWithIdle) get() (net.Conn, error) { + if conn := cp.getFromCache(); conn != nil { + return conn, nil } - // There is no way to do a call equivalent to recvfrom with an empty buffer - // to check if the connection was terminated (if the size of the buffer is - // 0 the Read call doesn't call lower level). So due to buffer sizes it is - // possible that a write will succeed on a connection that was already - // closed by the server. - // - // At least on Darwin it is possible to work around this by configuring the - // buffer on each call, ie.: - // - // if err = conn.SetWriteBuffer(len(bytes)-1); err != nil { - // return 0, err - // } - // - // However, this causes a performance penalty of ~10% cpu and it is not - // present in various implementations of Carbon clients. Considering these - // facts this "workaround" is not being added at this moment. If it is - // needed in some scenarios the workaround should be validated on other - // platforms and offered as a configuration setting. + return createTCPConn(cp.tcpConfig, cp.timeout) +} - if err = conn.SetWriteDeadline(start.Add(cp.timeout)); err != nil { - return 0, err +func (cp *connPoolWithIdle) put(conn net.Conn) { + cp.mtx.Lock() + defer cp.mtx.Unlock() + // Do not cache if above limit. + if len(cp.conns) > cp.maxIdleConns { + _ = conn.Close() + return } + cp.conns = append(cp.conns, conn) +} - var n int - n, err = conn.Write(bytes) - return n, err +func (cp *connPoolWithIdle) getFromCache() net.Conn { + cp.mtx.Lock() + defer cp.mtx.Unlock() + lastIdx := len(cp.conns) - 1 + if lastIdx < 0 { + return nil + } + conn := cp.conns[lastIdx] + cp.conns = cp.conns[0:lastIdx] + return conn } -func (cp *connPool) Close() { +func (cp *connPoolWithIdle) close() error { cp.mtx.Lock() defer cp.mtx.Unlock() + var errs error for _, conn := range cp.conns { - conn.Close() + errs = multierr.Append(errs, conn.Close()) } cp.conns = nil + return errs } -func (cp *connPool) createTCPConn() (*net.TCPConn, error) { - c, err := net.DialTimeout("tcp", cp.endpoint, cp.timeout) +func createTCPConn(tcpConfig confignet.TCPAddr, timeout time.Duration) (net.Conn, error) { + c, err := net.DialTimeout("tcp", tcpConfig.Endpoint, timeout) if err != nil { return nil, err } - return c.(*net.TCPConn), err + return c, err } diff --git a/exporter/carbonexporter/exporter_test.go b/exporter/carbonexporter/exporter_test.go index a97f61cf5e32..471423ac08e2 100644 --- a/exporter/carbonexporter/exporter_test.go +++ b/exporter/carbonexporter/exporter_test.go @@ -7,7 +7,6 @@ import ( "bufio" "context" "errors" - "fmt" "io" "net" "runtime" @@ -20,233 +19,347 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/config/confignet" + "go.opentelemetry.io/collector/exporter/exporterhelper" "go.opentelemetry.io/collector/exporter/exportertest" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/pmetric" conventions "go.opentelemetry.io/collector/semconv/v1.9.0" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/testutil" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry" ) -func TestNew(t *testing.T) { +func TestNewWithDefaultConfig(t *testing.T) { cfg := createDefaultConfig().(*Config) - got, err := newCarbonExporter(cfg, exportertest.NewNopCreateSettings()) + got, err := newCarbonExporter(context.Background(), cfg, exportertest.NewNopCreateSettings()) assert.NotNil(t, got) assert.NoError(t, err) } -func TestConsumeMetricsData(t *testing.T) { - t.Skip("skipping flaky test, see https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/396") - smallBatch := pmetric.NewMetrics() - m := smallBatch.ResourceMetrics().AppendEmpty().ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() - m.SetName("test_gauge") - dp := m.SetEmptyGauge().DataPoints().AppendEmpty() - dp.Attributes().PutStr("k0", "v0") - dp.Attributes().PutStr("k1", "v1") - dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) - dp.SetDoubleValue(123) - largeBatch := generateLargeBatch() +func TestConsumeMetricsNoServer(t *testing.T) { + exp, err := newCarbonExporter( + context.Background(), + &Config{ + TCPAddr: confignet.TCPAddr{Endpoint: testutil.GetAvailableLocalAddress(t)}, + TimeoutSettings: exporterhelper.TimeoutSettings{Timeout: 5 * time.Second}, + }, + exportertest.NewNopCreateSettings()) + require.NoError(t, err) + require.NoError(t, exp.Start(context.Background(), componenttest.NewNopHost())) + require.Error(t, exp.ConsumeMetrics(context.Background(), generateSmallBatch())) + require.NoError(t, exp.Shutdown(context.Background())) +} + +func TestConsumeMetricsWithResourceToTelemetry(t *testing.T) { + addr := testutil.GetAvailableLocalAddress(t) + cs := newCarbonServer(t, addr, "test_0;key_0=value_0;key_1=value_1;key_2=value_2;service.name=carbon 0") + // Each metric point will generate one Carbon line, set up the wait + // for all of them. + cs.start(t, 1) + + exp, err := newCarbonExporter( + context.Background(), + &Config{ + TCPAddr: confignet.TCPAddr{Endpoint: addr}, + TimeoutSettings: exporterhelper.TimeoutSettings{Timeout: 5 * time.Second}, + ResourceToTelemetryConfig: resourcetotelemetry.Settings{Enabled: true}, + }, + exportertest.NewNopCreateSettings()) + require.NoError(t, err) + require.NoError(t, exp.Start(context.Background(), componenttest.NewNopHost())) + require.NoError(t, exp.ConsumeMetrics(context.Background(), generateSmallBatch())) + assert.NoError(t, exp.Shutdown(context.Background())) + cs.shutdownAndVerify(t) +} + +func TestConsumeMetrics(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("skipping test on windows, see https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/10147") + } tests := []struct { - name string - md pmetric.Metrics - acceptClient bool - createServer bool + name string + md pmetric.Metrics + numProducers int + writesPerProducer int }{ { - name: "small_batch", - md: smallBatch, - }, - { - name: "small_batch", - md: smallBatch, - createServer: true, + name: "small_batch", + md: generateSmallBatch(), + numProducers: 1, + writesPerProducer: 5, }, { - name: "small_batch", - md: smallBatch, - createServer: true, - acceptClient: true, + name: "large_batch", + md: generateLargeBatch(), + numProducers: 1, + writesPerProducer: 5, }, { - name: "large_batch", - md: largeBatch, + name: "concurrent_small_batch", + md: generateSmallBatch(), + numProducers: 5, + writesPerProducer: 5, }, { - name: "large_batch", - md: largeBatch, - createServer: true, + name: "concurrent_large_batch", + md: generateLargeBatch(), + numProducers: 5, + writesPerProducer: 5, }, { - name: "large_batch", - md: largeBatch, - createServer: true, - acceptClient: true, + name: "high_concurrency", + md: generateLargeBatch(), + numProducers: 10, + writesPerProducer: 200, }, } for _, tt := range tests { - testName := fmt.Sprintf( - "%s_createServer_%t_acceptClient_%t", tt.name, tt.createServer, tt.acceptClient) - t.Run(testName, func(t *testing.T) { + t.Run(tt.name, func(t *testing.T) { addr := testutil.GetAvailableLocalAddress(t) - var ln *net.TCPListener - if tt.createServer { - laddr, err := net.ResolveTCPAddr("tcp", addr) - require.NoError(t, err) - ln, err = net.ListenTCP("tcp", laddr) - require.NoError(t, err) - defer ln.Close() - } + cs := newCarbonServer(t, addr, "") + // Each metric point will generate one Carbon line, set up the wait + // for all of them. + cs.start(t, tt.numProducers*tt.writesPerProducer*tt.md.DataPointCount()) - config := &Config{Endpoint: addr, Timeout: 1000 * time.Millisecond} - exp, err := newCarbonExporter(config, exportertest.NewNopCreateSettings()) + exp, err := newCarbonExporter( + context.Background(), + &Config{ + TCPAddr: confignet.TCPAddr{Endpoint: addr}, + MaxIdleConns: tt.numProducers, + TimeoutSettings: exporterhelper.TimeoutSettings{Timeout: 5 * time.Second}, + }, + exportertest.NewNopCreateSettings()) require.NoError(t, err) - require.NoError(t, exp.Start(context.Background(), componenttest.NewNopHost())) - if !tt.createServer { - require.Error(t, exp.ConsumeMetrics(context.Background(), tt.md)) - assert.NoError(t, exp.Shutdown(context.Background())) - return + startCh := make(chan struct{}) + var writersWG sync.WaitGroup + writersWG.Add(tt.numProducers) + for i := 0; i < tt.numProducers; i++ { + go func() { + defer writersWG.Done() + <-startCh + for j := 0; j < tt.writesPerProducer; j++ { + require.NoError(t, exp.ConsumeMetrics(context.Background(), tt.md)) + } + }() } - if !tt.acceptClient { - // Due to differences between platforms is not certain if the call to ConsumeMetrics below will produce error or not. - // See comment about recvfrom at connPool.Write for detailed information. - _ = exp.ConsumeMetrics(context.Background(), tt.md) - assert.NoError(t, exp.Shutdown(context.Background())) - return - } + // Release all senders. + close(startCh) + // Wait for all senders to finish. + writersWG.Wait() - // Each metric point will generate one Carbon line, set up the wait - // for all of them. - var wg sync.WaitGroup - wg.Add(tt.md.DataPointCount()) - go func() { - assert.NoError(t, ln.SetDeadline(time.Now().Add(time.Second))) - conn, err := ln.AcceptTCP() - require.NoError(t, err) - defer conn.Close() + assert.NoError(t, exp.Shutdown(context.Background())) + cs.shutdownAndVerify(t) + }) + } +} - reader := bufio.NewReader(conn) - for { - // Actual metric validation is done by other tests, here it - // is just flow. - _, err := reader.ReadBytes(byte('\n')) - if err != nil && !errors.Is(err, io.EOF) { - assert.NoError(t, err) // Just to print any error - } +func TestNewConnectionPool(t *testing.T) { + assert.IsType(t, &nopConnPool{}, newConnPool(confignet.TCPAddr{Endpoint: defaultEndpoint}, 10*time.Second, 0)) + assert.IsType(t, &connPoolWithIdle{}, newConnPool(confignet.TCPAddr{Endpoint: defaultEndpoint}, 10*time.Second, 10)) +} - if errors.Is(err, io.EOF) { - break - } - wg.Done() - } - }() +func TestNopConnPool(t *testing.T) { + addr := testutil.GetAvailableLocalAddress(t) + cs := newCarbonServer(t, addr, "") + // Each metric point will generate one Carbon line, set up the wait + // for all of them. + cs.start(t, 2) - <-time.After(100 * time.Millisecond) + cp := &nopConnPool{ + timeout: 1 * time.Second, + tcpConfig: confignet.TCPAddr{Endpoint: addr}, + } - require.NoError(t, exp.ConsumeMetrics(context.Background(), tt.md)) - assert.NoError(t, exp.Shutdown(context.Background())) + conn, err := cp.get() + require.NoError(t, err) + _, err = conn.Write([]byte(metricDataToPlaintext(generateSmallBatch()))) + assert.NoError(t, err) + cp.put(conn) - wg.Wait() - }) - } + // Get a new connection and confirm is not the same. + conn2, err2 := cp.get() + require.NoError(t, err2) + assert.NotSame(t, conn, conn2) + _, err = conn2.Write([]byte(metricDataToPlaintext(generateSmallBatch()))) + assert.NoError(t, err) + cp.put(conn2) + + require.NoError(t, cp.close()) + cs.shutdownAndVerify(t) } -// Other tests didn't for the concurrency aspect of connPool, this test -// is designed to force that. -func Test_connPool_Concurrency(t *testing.T) { - if runtime.GOOS == "windows" { - t.Skip("skipping test on windows, see https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/10147") - } +func TestConnPoolWithIdle(t *testing.T) { addr := testutil.GetAvailableLocalAddress(t) - laddr, err := net.ResolveTCPAddr("tcp", addr) - require.NoError(t, err) - ln, err := net.ListenTCP("tcp", laddr) - require.NoError(t, err) - defer ln.Close() + cs := newCarbonServer(t, addr, "") + // Each metric point will generate one Carbon line, set up the wait + // for all of them. + cs.start(t, 2) - startCh := make(chan struct{}) + cp := &connPoolWithIdle{ + timeout: 1 * time.Second, + tcpConfig: confignet.TCPAddr{Endpoint: addr}, + maxIdleConns: 4, + } - cp := newTCPConnPool(addr, 500*time.Millisecond) - sender := carbonSender{connPool: cp} - ctx := context.Background() - md := generateLargeBatch() - concurrentWriters := 3 - writesPerRoutine := 3 + conn, err := cp.get() + require.NoError(t, err) + _, err = conn.Write([]byte(metricDataToPlaintext(generateSmallBatch()))) + assert.NoError(t, err) + cp.put(conn) - doneFlag := &atomic.Bool{} - defer func() { - doneFlag.Store(true) - }() + // Get a new connection and confirm it is the same as the first one. + conn2, err2 := cp.get() + require.NoError(t, err2) + assert.Same(t, conn, conn2) + _, err = conn2.Write([]byte(metricDataToPlaintext(generateSmallBatch()))) + assert.NoError(t, err) + cp.put(conn2) - var recvWG sync.WaitGroup - recvWG.Add(concurrentWriters * writesPerRoutine * md.MetricCount()) - go func() { - for { - conn, err := ln.AcceptTCP() - if doneFlag.Load() { - // Close is expected to cause error. - return - } - require.NoError(t, err) - go func(conn *net.TCPConn) { - defer conn.Close() + require.NoError(t, cp.close()) + cs.shutdownAndVerify(t) +} - reader := bufio.NewReader(conn) - for { - // Actual metric validation is done by other tests, here it - // is just flow. - _, err := reader.ReadBytes(byte('\n')) - if err != nil && !errors.Is(err, io.EOF) { - assert.NoError(t, err) // Just to print any error - } +func TestConnPoolWithIdleMaxConnections(t *testing.T) { + addr := testutil.GetAvailableLocalAddress(t) + cs := newCarbonServer(t, addr, "") + const maxIdleConns = 4 + // Each metric point will generate one Carbon line, set up the wait + // for all of them. + cs.start(t, maxIdleConns+1) - if errors.Is(err, io.EOF) { - break - } - recvWG.Done() - } - }(conn) + cp := &connPoolWithIdle{ + timeout: 1 * time.Second, + tcpConfig: confignet.TCPAddr{Endpoint: addr}, + maxIdleConns: maxIdleConns, + } + + // Create connections and + var conns []net.Conn + for i := 0; i < maxIdleConns; i++ { + conn, err := cp.get() + require.NoError(t, err) + conns = append(conns, conn) + if i != 0 { + assert.NotSame(t, conn, conns[i-1]) } - }() - var writersWG sync.WaitGroup - for i := 0; i < concurrentWriters; i++ { - writersWG.Add(1) - go func() { - <-startCh - for i := 0; i < writesPerRoutine; i++ { - assert.NoError(t, sender.pushMetricsData(ctx, md)) - } - writersWG.Done() - }() + } + for _, conn := range conns { + cp.put(conn) } - close(startCh) // Release all workers - writersWG.Wait() - assert.NoError(t, sender.Shutdown(context.Background())) + for i := 0; i < maxIdleConns+1; i++ { + conn, err := cp.get() + require.NoError(t, err) + _, err = conn.Write([]byte(metricDataToPlaintext(generateSmallBatch()))) + assert.NoError(t, err) + if i != maxIdleConns { + assert.Same(t, conn, conns[maxIdleConns-i-1]) + } else { + // this should be a new connection + for _, cachedConn := range conns { + assert.NotSame(t, conn, cachedConn) + } + cp.put(conn) + } + } + for _, conn := range conns { + cp.put(conn) + } + require.NoError(t, cp.close()) + cs.shutdownAndVerify(t) +} - recvWG.Wait() +func generateSmallBatch() pmetric.Metrics { + return generateMetricsBatch(1) } func generateLargeBatch() pmetric.Metrics { + return generateMetricsBatch(1024) +} + +func generateMetricsBatch(size int) pmetric.Metrics { ts := time.Now() metrics := pmetric.NewMetrics() rm := metrics.ResourceMetrics().AppendEmpty() - rm.Resource().Attributes().PutStr(conventions.AttributeServiceName, "test_carbon") + rm.Resource().Attributes().PutStr(conventions.AttributeServiceName, "carbon") ms := rm.ScopeMetrics().AppendEmpty().Metrics() - for i := 0; i < 65000; i++ { + for i := 0; i < size; i++ { m := ms.AppendEmpty() m.SetName("test_" + strconv.Itoa(i)) dp := m.SetEmptyGauge().DataPoints().AppendEmpty() - dp.Attributes().PutStr("k0", "v0") - dp.Attributes().PutStr("k1", "v1") + dp.Attributes().PutStr("key_0", "value_0") + dp.Attributes().PutStr("key_1", "value_1") + dp.Attributes().PutStr("key_2", "value_2") dp.SetTimestamp(pcommon.NewTimestampFromTime(ts)) dp.SetIntValue(int64(i)) } return metrics } + +type carbonServer struct { + ln *net.TCPListener + doneServer *atomic.Bool + wg sync.WaitGroup + expectedContainsValue string +} + +func newCarbonServer(t *testing.T, addr string, expectedContainsValue string) *carbonServer { + laddr, err := net.ResolveTCPAddr("tcp", addr) + require.NoError(t, err) + ln, err := net.ListenTCP("tcp", laddr) + require.NoError(t, err) + return &carbonServer{ + ln: ln, + doneServer: &atomic.Bool{}, + expectedContainsValue: expectedContainsValue, + } +} + +func (cs *carbonServer) start(t *testing.T, numExpectedReq int) { + cs.wg.Add(numExpectedReq) + go func() { + for { + conn, err := cs.ln.Accept() + if cs.doneServer.Load() { + // Close is expected to cause error. + return + } + require.NoError(t, err) + go func(conn net.Conn) { + defer func() { + require.NoError(t, conn.Close()) + }() + + reader := bufio.NewReader(conn) + for { + buf, err := reader.ReadBytes(byte('\n')) + if errors.Is(err, io.EOF) { + return + } + require.NoError(t, err) + + if cs.expectedContainsValue != "" { + assert.Contains(t, string(buf), cs.expectedContainsValue) + } + + cs.wg.Done() + } + }(conn) + } + }() + <-time.After(100 * time.Millisecond) +} + +func (cs *carbonServer) shutdownAndVerify(t *testing.T) { + cs.wg.Wait() + cs.doneServer.Store(true) + require.NoError(t, cs.ln.Close()) +} diff --git a/exporter/carbonexporter/factory.go b/exporter/carbonexporter/factory.go index 87d5666332e4..a4caffe372e7 100644 --- a/exporter/carbonexporter/factory.go +++ b/exporter/carbonexporter/factory.go @@ -7,11 +7,18 @@ import ( "context" "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/config/confignet" "go.opentelemetry.io/collector/exporter" + "go.opentelemetry.io/collector/exporter/exporterhelper" "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/carbonexporter/internal/metadata" ) +// Defaults for not specified configuration settings. +const ( + defaultEndpoint = "localhost:2003" +) + // NewFactory creates a factory for Carbon exporter. func NewFactory() exporter.Factory { return exporter.NewFactory( @@ -22,17 +29,22 @@ func NewFactory() exporter.Factory { func createDefaultConfig() component.Config { return &Config{ - Endpoint: DefaultEndpoint, - Timeout: DefaultSendTimeout, + TCPAddr: confignet.TCPAddr{ + Endpoint: defaultEndpoint, + }, + MaxIdleConns: 100, + TimeoutSettings: exporterhelper.NewDefaultTimeoutSettings(), + QueueConfig: exporterhelper.NewDefaultQueueSettings(), + RetryConfig: exporterhelper.NewDefaultRetrySettings(), } } func createMetricsExporter( - _ context.Context, + ctx context.Context, params exporter.CreateSettings, config component.Config, ) (exporter.Metrics, error) { - exp, err := newCarbonExporter(config.(*Config), params) + exp, err := newCarbonExporter(ctx, config.(*Config), params) if err != nil { return nil, err diff --git a/exporter/carbonexporter/go.mod b/exporter/carbonexporter/go.mod index 621283cb2ec1..df978a82c9d1 100644 --- a/exporter/carbonexporter/go.mod +++ b/exporter/carbonexporter/go.mod @@ -4,12 +4,17 @@ go 1.20 require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.91.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry v0.91.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.91.0 + go.opentelemetry.io/collector/config/confignet v0.91.0 go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 + go.uber.org/multierr v1.11.0 ) require ( @@ -36,9 +41,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect - go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect @@ -56,3 +58,13 @@ retract ( v0.76.1 v0.65.0 ) + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry => ../../pkg/resourcetotelemetry + +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/carbonexporter/go.sum b/exporter/carbonexporter/go.sum index d741f02ad8c2..4895414681f0 100644 --- a/exporter/carbonexporter/go.sum +++ b/exporter/carbonexporter/go.sum @@ -99,6 +99,8 @@ go.opentelemetry.io/collector v0.91.0 h1:C7sGUJDJ5nwm+CkWpAaVP3lNsuYpwSRbkmLncFj go.opentelemetry.io/collector v0.91.0/go.mod h1:YhQpIDZsn+bICAAqgBwXk9wqK8GKZDv+aogfG52zUuE= go.opentelemetry.io/collector/component v0.91.0 h1:aBT1i2zGyfh9PalYJLfXVvQp+osHyalwyDFselI1CtA= go.opentelemetry.io/collector/component v0.91.0/go.mod h1:2KBHvjNFdU7oOjsObQeC4Ta2Ef607OISU5obznW00fw= +go.opentelemetry.io/collector/config/confignet v0.91.0 h1:3huNXh04O3wXaN4qPhmmiefyz4dYbOlNcR/OKMByqig= +go.opentelemetry.io/collector/config/confignet v0.91.0/go.mod h1:cpO8JYWGONaViOygKVw+Hd2UoBcn2cUiyi0WWeFTwJY= go.opentelemetry.io/collector/config/configtelemetry v0.91.0 h1:mEwvqrYfwUJ7LwYfpcF9M8z7LHFoYaKhEPhnERD/88E= go.opentelemetry.io/collector/config/configtelemetry v0.91.0/go.mod h1:+LAXM5WFMW/UbTlAuSs6L/W72WC+q8TBJt/6z39FPOU= go.opentelemetry.io/collector/confmap v0.91.0 h1:7U2MT+u74oEzq/WWrpXSLKB7nX5jPNC4drwtQdYfwKk= diff --git a/exporter/carbonexporter/internal/metadata/generated_status.go b/exporter/carbonexporter/internal/metadata/generated_status.go index 6dbde87f829a..ce6617d16408 100644 --- a/exporter/carbonexporter/internal/metadata/generated_status.go +++ b/exporter/carbonexporter/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "carbon" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/carbon") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/carbon") +} diff --git a/exporter/carbonexporter/metricdata_to_plaintext.go b/exporter/carbonexporter/metricdata_to_plaintext.go index cf9694bd7f29..2cb81a7bfa20 100644 --- a/exporter/carbonexporter/metricdata_to_plaintext.go +++ b/exporter/carbonexporter/metricdata_to_plaintext.go @@ -4,8 +4,10 @@ package carbonexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/carbonexporter" import ( + "bytes" "strconv" "strings" + "sync" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/pmetric" @@ -16,10 +18,11 @@ const ( sanitizedRune = '_' // Tag related constants per Carbon plaintext protocol. - tagPrefix = ";" - tagKeyValueSeparator = "=" - tagValueEmptyPlaceholder = "" - tagValueNotSetPlaceholder = "" + tagPrefix = ";" + tagKeyValueSeparator = "=" + tagValueEmptyPlaceholder = "" + tagLineEmptySpace = " " + tagLineNewLine = "\n" // Constants used when converting from distribution metrics to Carbon format. distributionBucketSuffix = ".bucket" @@ -40,6 +43,13 @@ const ( infinityCarbonValue = "inf" ) +var writerPool = sync.Pool{ + New: func() any { + // Start with a buffer of 1KB. + return bytes.NewBuffer(make([]byte, 0, 1024)) + }, +} + // metricDataToPlaintext converts internal metrics data to the Carbon plaintext // format as defined in https://graphite.readthedocs.io/en/latest/feeding-carbon.html#the-plaintext-protocol) // and https://graphite.readthedocs.io/en/latest/tags.html#carbon. See details @@ -74,7 +84,9 @@ func metricDataToPlaintext(md pmetric.Metrics) string { return "" } - var sb strings.Builder + buf := writerPool.Get().(*bytes.Buffer) + buf.Reset() + defer writerPool.Put(buf) for i := 0; i < md.ResourceMetrics().Len(); i++ { rm := md.ResourceMetrics().At(i) @@ -88,22 +100,22 @@ func metricDataToPlaintext(md pmetric.Metrics) string { } switch metric.Type() { case pmetric.MetricTypeGauge: - formatNumberDataPoints(&sb, metric.Name(), metric.Gauge().DataPoints()) + writeNumberDataPoints(buf, metric.Name(), metric.Gauge().DataPoints()) case pmetric.MetricTypeSum: - formatNumberDataPoints(&sb, metric.Name(), metric.Sum().DataPoints()) + writeNumberDataPoints(buf, metric.Name(), metric.Sum().DataPoints()) case pmetric.MetricTypeHistogram: - formatHistogramDataPoints(&sb, metric.Name(), metric.Histogram().DataPoints()) + formatHistogramDataPoints(buf, metric.Name(), metric.Histogram().DataPoints()) case pmetric.MetricTypeSummary: - formatSummaryDataPoints(&sb, metric.Name(), metric.Summary().DataPoints()) + formatSummaryDataPoints(buf, metric.Name(), metric.Summary().DataPoints()) } } } } - return sb.String() + return buf.String() } -func formatNumberDataPoints(sb *strings.Builder, metricName string, dps pmetric.NumberDataPointSlice) { +func writeNumberDataPoints(buf *bytes.Buffer, metricName string, dps pmetric.NumberDataPointSlice) { for i := 0; i < dps.Len(); i++ { dp := dps.At(i) var valueStr string @@ -113,7 +125,11 @@ func formatNumberDataPoints(sb *strings.Builder, metricName string, dps pmetric. case pmetric.NumberDataPointValueTypeDouble: valueStr = formatFloatForValue(dp.DoubleValue()) } - sb.WriteString(buildLine(buildPath(metricName, dp.Attributes()), valueStr, formatTimestamp(dp.Timestamp()))) + writeLine( + buf, + buildPath(metricName, dp.Attributes()), + valueStr, + formatTimestamp(dp.Timestamp())) } } @@ -132,7 +148,7 @@ func formatNumberDataPoints(sb *strings.Builder, metricName string, dps pmetric. // that bucket. This metric specifies the number of events with a value that is // less than or equal to the upper bound. func formatHistogramDataPoints( - sb *strings.Builder, + buf *bytes.Buffer, metricName string, dps pmetric.HistogramDataPointSlice, ) { @@ -140,7 +156,7 @@ func formatHistogramDataPoints( dp := dps.At(i) timestampStr := formatTimestamp(dp.Timestamp()) - formatCountAndSum(sb, metricName, dp.Attributes(), dp.Count(), dp.Sum(), timestampStr) + formatCountAndSum(buf, metricName, dp.Attributes(), dp.Count(), dp.Sum(), timestampStr) if dp.ExplicitBounds().Len() == 0 { continue } @@ -154,7 +170,11 @@ func formatHistogramDataPoints( bucketPath := buildPath(metricName+distributionBucketSuffix, dp.Attributes()) for j := 0; j < dp.BucketCounts().Len(); j++ { - sb.WriteString(buildLine(bucketPath+distributionUpperBoundTagBeforeValue+carbonBounds[j], formatUint64(dp.BucketCounts().At(j)), timestampStr)) + writeLine( + buf, + bucketPath+distributionUpperBoundTagBeforeValue+carbonBounds[j], + formatUint64(dp.BucketCounts().At(j)), + timestampStr) } } } @@ -172,7 +192,7 @@ func formatHistogramDataPoints( // 3. Each quantile is represented by a metric named ".quantile" // and will include a tag key "quantile" that specifies the quantile value. func formatSummaryDataPoints( - sb *strings.Builder, + buf *bytes.Buffer, metricName string, dps pmetric.SummaryDataPointSlice, ) { @@ -180,7 +200,7 @@ func formatSummaryDataPoints( dp := dps.At(i) timestampStr := formatTimestamp(dp.Timestamp()) - formatCountAndSum(sb, metricName, dp.Attributes(), dp.Count(), dp.Sum(), timestampStr) + formatCountAndSum(buf, metricName, dp.Attributes(), dp.Count(), dp.Sum(), timestampStr) if dp.QuantileValues().Len() == 0 { continue @@ -188,10 +208,11 @@ func formatSummaryDataPoints( quantilePath := buildPath(metricName+summaryQuantileSuffix, dp.Attributes()) for j := 0; j < dp.QuantileValues().Len(); j++ { - sb.WriteString(buildLine( + writeLine( + buf, quantilePath+summaryQuantileTagBeforeValue+formatFloatForLabel(dp.QuantileValues().At(j).Quantile()*100), formatFloatForValue(dp.QuantileValues().At(j).Value()), - timestampStr)) + timestampStr) } } } @@ -204,21 +225,25 @@ func formatSummaryDataPoints( // // 2. The total sum will be represented by a metruc with the original "". func formatCountAndSum( - sb *strings.Builder, + buf *bytes.Buffer, metricName string, attributes pcommon.Map, count uint64, sum float64, timestampStr string, ) { - // Build count and sum metrics. - countPath := buildPath(metricName+countSuffix, attributes) - valueStr := formatUint64(count) - sb.WriteString(buildLine(countPath, valueStr, timestampStr)) - - sumPath := buildPath(metricName, attributes) - valueStr = formatFloatForValue(sum) - sb.WriteString(buildLine(sumPath, valueStr, timestampStr)) + // Write count and sum metrics. + writeLine( + buf, + buildPath(metricName+countSuffix, attributes), + formatUint64(count), + timestampStr) + + writeLine( + buf, + buildPath(metricName, attributes), + formatFloatForValue(sum), + timestampStr) } // buildPath is used to build the per description above. @@ -227,25 +252,35 @@ func buildPath(name string, attributes pcommon.Map) string { return name } - var sb strings.Builder - sb.WriteString(name) + buf := writerPool.Get().(*bytes.Buffer) + buf.Reset() + defer writerPool.Put(buf) + buf.WriteString(name) attributes.Range(func(k string, v pcommon.Value) bool { value := v.AsString() if value == "" { value = tagValueEmptyPlaceholder } - sb.WriteString(tagPrefix + sanitizeTagKey(k) + tagKeyValueSeparator + value) + buf.WriteString(tagPrefix) + buf.WriteString(sanitizeTagKey(k)) + buf.WriteString(tagKeyValueSeparator) + buf.WriteString(value) return true }) - return sb.String() + return buf.String() } -// buildLine builds a single Carbon metric textual line, ie.: it already adds +// writeLine builds a single Carbon metric textual line, ie.: it already adds // a new-line character at the end of the string. -func buildLine(path, value, timestamp string) string { - return path + " " + value + " " + timestamp + "\n" +func writeLine(buf *bytes.Buffer, path, value, timestamp string) { + buf.WriteString(path) + buf.WriteString(tagLineEmptySpace) + buf.WriteString(value) + buf.WriteString(tagLineEmptySpace) + buf.WriteString(timestamp) + buf.WriteString(tagLineNewLine) } // sanitizeTagKey removes any invalid character from the tag key, the invalid diff --git a/exporter/carbonexporter/metricdata_to_plaintext_test.go b/exporter/carbonexporter/metricdata_to_plaintext_test.go index 1fb08ccd9637..c55d8f3c3fbf 100644 --- a/exporter/carbonexporter/metricdata_to_plaintext_test.go +++ b/exporter/carbonexporter/metricdata_to_plaintext_test.go @@ -331,3 +331,12 @@ func expectedSummaryLines( } return lines } + +func BenchmarkConsumeMetricsDefault(b *testing.B) { + md := generateSmallBatch() + b.ResetTimer() + b.ReportAllocs() + for n := 0; n < b.N; n++ { + assert.Len(b, metricDataToPlaintext(md), 62) + } +} diff --git a/exporter/carbonexporter/testdata/config.yaml b/exporter/carbonexporter/testdata/config.yaml index 991b655ea415..a0d330fbf595 100644 --- a/exporter/carbonexporter/testdata/config.yaml +++ b/exporter/carbonexporter/testdata/config.yaml @@ -4,7 +4,21 @@ carbon/allsettings: # use endpoint to specify alternative destinations for the exporter, # the default is localhost:2003 endpoint: localhost:8080 + max_idle_conns: 15 # timeout is the maximum duration allowed to connecting and sending the # data to the Carbon/Graphite backend. # The default is 5 seconds. timeout: 10s + sending_queue: + enabled: true + num_consumers: 2 + queue_size: 10 + retry_on_failure: + enabled: true + initial_interval: 10s + randomization_factor: 0.7 + multiplier: 3.14 + max_interval: 60s + max_elapsed_time: 10m + resource_to_telemetry_conversion: + enabled: true diff --git a/exporter/cassandraexporter/go.mod b/exporter/cassandraexporter/go.mod index ba13ad611ecb..b199b48848ae 100644 --- a/exporter/cassandraexporter/go.mod +++ b/exporter/cassandraexporter/go.mod @@ -10,6 +10,8 @@ require ( go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -38,8 +40,6 @@ require ( go.opentelemetry.io/collector/extension v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/exporter/cassandraexporter/internal/metadata/generated_status.go b/exporter/cassandraexporter/internal/metadata/generated_status.go index 1cf5068630e7..a6831fe3a93e 100644 --- a/exporter/cassandraexporter/internal/metadata/generated_status.go +++ b/exporter/cassandraexporter/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -11,3 +13,11 @@ const ( TracesStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/cassandra") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/cassandra") +} diff --git a/exporter/clickhouseexporter/go.mod b/exporter/clickhouseexporter/go.mod index 917e78dcb113..0c5a7219fd91 100644 --- a/exporter/clickhouseexporter/go.mod +++ b/exporter/clickhouseexporter/go.mod @@ -13,6 +13,8 @@ require ( go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -50,8 +52,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/exporter/clickhouseexporter/internal/metadata/generated_status.go b/exporter/clickhouseexporter/internal/metadata/generated_status.go index 4e0bd1ba6553..3f3c0c7cd032 100644 --- a/exporter/clickhouseexporter/internal/metadata/generated_status.go +++ b/exporter/clickhouseexporter/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/clickhouse") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/clickhouse") +} diff --git a/exporter/coralogixexporter/go.mod b/exporter/coralogixexporter/go.mod index 9a1dd4cc4f92..cb476084bc59 100644 --- a/exporter/coralogixexporter/go.mod +++ b/exporter/coralogixexporter/go.mod @@ -14,8 +14,10 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 - google.golang.org/grpc v1.60.0 + google.golang.org/grpc v1.60.1 ) require ( @@ -53,8 +55,6 @@ require ( go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/exporter/coralogixexporter/go.sum b/exporter/coralogixexporter/go.sum index 49ed22baae7b..4af376532b27 100644 --- a/exporter/coralogixexporter/go.sum +++ b/exporter/coralogixexporter/go.sum @@ -227,8 +227,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac 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.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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= diff --git a/exporter/coralogixexporter/internal/metadata/generated_status.go b/exporter/coralogixexporter/internal/metadata/generated_status.go index 05e13e21651b..cb2981f1b68a 100644 --- a/exporter/coralogixexporter/internal/metadata/generated_status.go +++ b/exporter/coralogixexporter/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/coralogix") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/coralogix") +} diff --git a/exporter/datadogexporter/go.mod b/exporter/datadogexporter/go.mod index 6b78f00f3310..d0269317c9e4 100644 --- a/exporter/datadogexporter/go.mod +++ b/exporter/datadogexporter/go.mod @@ -3,19 +3,19 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datado go 1.20 require ( - github.com/DataDog/agent-payload/v5 v5.0.101 - github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7 - github.com/DataDog/datadog-agent/pkg/trace v0.50.0-rc.7 + github.com/DataDog/agent-payload/v5 v5.0.102 + github.com/DataDog/datadog-agent/pkg/proto v0.50.0 + github.com/DataDog/datadog-agent/pkg/trace v0.50.0 github.com/DataDog/datadog-api-client-go/v2 v2.20.0 github.com/DataDog/gohai v0.0.0-20230524154621-4316413895ee - github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.9.0 - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.9.0 - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.9.0 - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.9.0 - github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.9.0 + github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.10.0 + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.10.0 + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.10.0 + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.10.0 + github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.10.0 github.com/DataDog/sketches-go v1.4.3 github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.21.0 - github.com/aws/aws-sdk-go v1.49.1 + github.com/aws/aws-sdk-go v1.49.6 github.com/cenkalti/backoff/v4 v4.2.1 github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.91.0 @@ -47,6 +47,8 @@ require ( go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/collector/receiver/otlpreceiver v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 google.golang.org/protobuf v1.31.0 gopkg.in/yaml.v2 v2.4.0 @@ -65,12 +67,12 @@ 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.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0-rc.7 // indirect + github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.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-tuf v1.0.2-0.5.2 // indirect @@ -144,6 +146,7 @@ require ( github.com/hashicorp/go-rootcerts v1.0.2 // indirect github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/nomad/api v0.0.0-20230721134942-515895c7690c // indirect github.com/hashicorp/serf v0.10.1 // indirect github.com/hetznercloud/hcloud-go/v2 v2.4.0 // indirect @@ -248,15 +251,13 @@ require ( go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.44.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/otel/sdk v1.21.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.16.0 // indirect - golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect + golang.org/x/crypto v0.17.0 // indirect + golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/oauth2 v0.14.0 // indirect diff --git a/exporter/datadogexporter/go.sum b/exporter/datadogexporter/go.sum index ea04dd3889fd..20771e919959 100644 --- a/exporter/datadogexporter/go.sum +++ b/exporter/datadogexporter/go.sum @@ -63,24 +63,24 @@ 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/agent-payload/v5 v5.0.101 h1:/MjtenucwoRzv1cafv46fcvserECivPKEWDsemT2Grg= -github.com/DataDog/agent-payload/v5 v5.0.101/go.mod h1:COngtbYYCncpIPiE5D93QlXDH/3VAKk10jDNwGHcMRE= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0-rc.7 h1:ULN8UQqgtmEgWvOEIDzWgxLZ3TEZJ9MXBUpVGE8PPBc= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0-rc.7/go.mod h1:A4nLJvxlg6BO/8/zg81til9yT0uRPuXDFMAzDMpmgn4= -github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7 h1:qJuxmeIiXZNML5/Y9KEf7QKEKKIeliiTIxgRGvGAQBc= -github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7/go.mod h1:HvK26YCxg6MfYvPJgpHC7nSjw6DTpNhd75Wlb0GAvis= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0-rc.7 h1:pQh4uZnc9mQbGMJ1R8C88GlseqmdFIKftDZLrQW71Ss= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0-rc.7/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= -github.com/DataDog/datadog-agent/pkg/trace v0.50.0-rc.7 h1:qWKAINgUtyuJQOCcthjPST8PzigPP8Pr0EtHdTgJVoA= -github.com/DataDog/datadog-agent/pkg/trace v0.50.0-rc.7/go.mod h1:i6OrrkHDlgCB4vUaPfM4FxVij2QdA/t07Ykwu74ySGA= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0-rc.7 h1:J7ocZItHWrUEvGWVqFa7wsghotcF53oFn1qH7Tlh7VM= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0-rc.7/go.mod h1:b0I5L9Eegsq3kca9pQCAVt1rQHI05sza7LVHKGzC+ms= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.0-rc.7 h1:vBo+iVlLpjrvJkX88mbFDtWFy0F6tEi865p+N4RTf7A= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.0-rc.7/go.mod h1:/fGZteE4rr3iz6y30a0A3MuebJ6Jckx+AiKcyYgT87k= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0-rc.7 h1:eM+GcYjk4sSik8tFgf8zNT1KViZZM4F4I580SZnTs7s= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0-rc.7/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0-rc.7 h1:QByjh+uLdnYjqIjdYP9XyEgObD9o8ydL4jBy4sEPlbU= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0-rc.7/go.mod h1:EOGgNrSPskIxY3+KgCl+yEggMjrGqrA2oL5va+/p2jM= +github.com/DataDog/agent-payload/v5 v5.0.102 h1:X8EZQeOewahQ7N/arllAP7hCGHNScdThnGjPg5/ErN8= +github.com/DataDog/agent-payload/v5 v5.0.102/go.mod h1:COngtbYYCncpIPiE5D93QlXDH/3VAKk10jDNwGHcMRE= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0 h1:WOyRfsLPYO24Z6Q+s1jcjoOFYJUJ4PgiNaGz/qJCba0= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0/go.mod h1:A4nLJvxlg6BO/8/zg81til9yT0uRPuXDFMAzDMpmgn4= +github.com/DataDog/datadog-agent/pkg/proto v0.50.0 h1:FAzs/Hofs9CN7jYYd2P4l8/igdcDPc7q9amIXSje/3A= +github.com/DataDog/datadog-agent/pkg/proto v0.50.0/go.mod h1:HvK26YCxg6MfYvPJgpHC7nSjw6DTpNhd75Wlb0GAvis= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0 h1:/V/WtjIQCDNJpRVJ/wSfmUakLhBhxJ7joqwM7DXc9hI= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= +github.com/DataDog/datadog-agent/pkg/trace v0.50.0 h1:gZt7YTwtptMNYUN/Z5QHnabOz0ILHvSKC0jpTqqiXBo= +github.com/DataDog/datadog-agent/pkg/trace v0.50.0/go.mod h1:fV11a6fzBAbzgF8ie5Bk51rvLS5kMcsXjwaCzPAfsrk= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0 h1:jSAW27LAnpdZGEe8B0FzSbVT8YdmvPGxV/l8SDUKzYY= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0/go.mod h1:QO56TX/gJf9yZ8q+ix0EEjck6kJu+oirAvJPk8xpFa0= +github.com/DataDog/datadog-agent/pkg/util/log v0.50.0 h1:qIqqLKov9yjoHuoOK//a49vFiBZyduswcJz7jwgKuuo= +github.com/DataDog/datadog-agent/pkg/util/log v0.50.0/go.mod h1:byH8to7LKxTK5m7jf1n222QMeL55iiVszk+OA7Qxfao= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0 h1:MXYW7B+OamUkSBGVsLkPQt7bjQhO52Q6qym3VluB8IM= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0 h1:0QrqgObZkmv2Fcr10CN+pONfIeoul5loof3t20B1AAA= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0/go.mod h1:EOGgNrSPskIxY3+KgCl+yEggMjrGqrA2oL5va+/p2jM= github.com/DataDog/datadog-api-client-go/v2 v2.20.0 h1:80T+UuTh+28qODc2vw+HxzMoIu0dYBT7/RCHXxdYpJE= github.com/DataDog/datadog-api-client-go/v2 v2.20.0/go.mod h1:oD5Lx8Li3oPRa/BSBenkn4i48z+91gwYORF/+6ph71g= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= @@ -92,17 +92,17 @@ github.com/DataDog/go-tuf v1.0.2-0.5.2 h1:EeZr937eKAWPxJ26IykAdWA4A0jQXJgkhUjqEI 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.9.0 h1:y8rL7rCty4VhPFJi6TgOZXI7MrGRVYNV0oqbNblWi/c= -github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.9.0/go.mod h1:x+QjxvvVxewuyNymMjR+2fm0LAQSMF2mhw7Yhx61jp4= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.9.0 h1:oT5B12H+tLtAEEH0YqgmppofM/yRBzyI9+ykS9OQvIs= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.9.0 h1:Y+CllChr2yfE2RLd+c5hvK56DDGVEdDrhAl1OyzuuwU= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.9.0/go.mod h1:naFq9h+fQpgI7AKJ+YkWlAAYDU8/FB8LyfA39bmRNHs= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.9.0 h1:FbqbNsZ3179TUV+y932rKhhTxHMS5adlBb+9om1heGY= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.9.0/go.mod h1:v0FMEai3NccZjZr2jmX4t8Nobh3R8KxoRuj6PExoTRo= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.9.0 h1:WsCPJS+a34kw1gj46WpJjQBHrLVwh1ubCdHUx9nf1ec= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.9.0/go.mod h1:m61Tq6DA2U+PjNTX6WD3TH2U7QnA49+7IGaYK4bu7fQ= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.9.0 h1:U93rYuk3ChT/I+2r36JI8agi1AwdH8vRiHh+bCSXZeU= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.9.0/go.mod h1:KOzWHRj2AcJPmP1hm4WQUfzEIYRBP4NaTX9Iu+D3UNs= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.10.0 h1:kiPtYAgzvlOc6HV0qwS8xNeA39cYyAJs6q9dIRDpCFk= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.10.0/go.mod h1:MV/L0ESKjLGGE4JPDIDtz6H5u+9w0UKp1Wsw2lLREII= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.10.0 h1:O2PYvgTQA+31NuepzQqLexEpUX8FWsdNgq+0241OtH0= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.10.0 h1:56vp8vflG6lmhTO+YldUBTe0cIjStOC1neW1dIHYm5s= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.10.0/go.mod h1:naFq9h+fQpgI7AKJ+YkWlAAYDU8/FB8LyfA39bmRNHs= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.10.0 h1:+LxQNTpRM57lfcbGV7s+PVQ2B2Pegabfpf3yGJUXcgM= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.10.0/go.mod h1:WYm0DRBxBrKrmZrwoAJhcyJ7bGAFZbVQFcrrwwaGozU= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.10.0 h1:XwGT7/2NnO1RGxS5WD4BTsLWqO+z8234XBccUGhP8tM= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.10.0/go.mod h1:1fYkFs2pUyqBUUVDsjn1cKVEI79R+NluYhqX+pDTkSY= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.10.0 h1:mEao3xEP7iCfCd+teps0oM8U+ZRPVz02W6aE5cfi2Sc= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.10.0/go.mod h1:vPjlCjTrBzzZpVJbbVpox8x9nRYx5giCl/9Zy8oWFw0= github.com/DataDog/sketches-go v1.4.3 h1:ZB9nijteJRFUQixkQfatCqASartGNfiolIlMiEv3u/w= github.com/DataDog/sketches-go v1.4.3/go.mod h1:XR0ns2RtEEF09mDKXiKZiQg+nfZStrq1ZuL1eezeZe0= github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= @@ -133,8 +133,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.49.1 h1:Dsamcd8d/nNb3A+bZ0ucfGl0vGZsW5wlRW0vhoYGoeQ= -github.com/aws/aws-sdk-go v1.49.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= +github.com/aws/aws-sdk-go v1.49.6/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= @@ -419,6 +419,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 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/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= github.com/hashicorp/memberlist v0.5.0 h1:EtYPN8DpAURiapus508I4n9CzHs2W+8NZGbmmR/prTM= @@ -854,8 +856,8 @@ golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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= @@ -866,8 +868,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= diff --git a/exporter/datadogexporter/integrationtest/go.mod b/exporter/datadogexporter/integrationtest/go.mod index 7f40d1a03a14..68408c08cf5a 100644 --- a/exporter/datadogexporter/integrationtest/go.mod +++ b/exporter/datadogexporter/integrationtest/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datado go 1.20 require ( - github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7 + github.com/DataDog/datadog-agent/pkg/proto v0.50.0 github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.91.0 @@ -29,30 +29,30 @@ require ( cloud.google.com/go/compute v1.23.3 // indirect cloud.google.com/go/compute/metadata v0.2.4-0.20230617002413-005d2dfb6b68 // indirect contrib.go.opencensus.io/exporter/prometheus v0.4.2 // indirect - github.com/DataDog/agent-payload/v5 v5.0.101 // indirect - github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/trace v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0-rc.7 // indirect + github.com/DataDog/agent-payload/v5 v5.0.102 // indirect + github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/trace v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0 // indirect github.com/DataDog/datadog-api-client-go/v2 v2.20.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-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.9.0 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.9.0 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.9.0 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.9.0 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.9.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.10.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.10.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.10.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.10.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.10.0 // indirect github.com/DataDog/sketches-go v1.4.3 // 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.49.1 // indirect + github.com/aws/aws-sdk-go v1.49.6 // 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 +88,7 @@ require ( github.com/google/uuid v1.5.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 // 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 github.com/imdario/mergo v0.3.16 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect @@ -179,7 +180,7 @@ require ( 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/exp v0.0.0-20231206192017-f3f8817b8deb // indirect + golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/oauth2 v0.14.0 // indirect diff --git a/exporter/datadogexporter/integrationtest/go.sum b/exporter/datadogexporter/integrationtest/go.sum index 86e43eb5481d..9cef59653640 100644 --- a/exporter/datadogexporter/integrationtest/go.sum +++ b/exporter/datadogexporter/integrationtest/go.sum @@ -52,24 +52,24 @@ github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBp github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 h1:WpB/QDNLpMw72xHJc34BNNykqSOeEJDAWkhf0u12/Jk= 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/agent-payload/v5 v5.0.101 h1:/MjtenucwoRzv1cafv46fcvserECivPKEWDsemT2Grg= -github.com/DataDog/agent-payload/v5 v5.0.101/go.mod h1:COngtbYYCncpIPiE5D93QlXDH/3VAKk10jDNwGHcMRE= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0-rc.7 h1:ULN8UQqgtmEgWvOEIDzWgxLZ3TEZJ9MXBUpVGE8PPBc= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0-rc.7/go.mod h1:A4nLJvxlg6BO/8/zg81til9yT0uRPuXDFMAzDMpmgn4= -github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7 h1:qJuxmeIiXZNML5/Y9KEf7QKEKKIeliiTIxgRGvGAQBc= -github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7/go.mod h1:HvK26YCxg6MfYvPJgpHC7nSjw6DTpNhd75Wlb0GAvis= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0-rc.7 h1:pQh4uZnc9mQbGMJ1R8C88GlseqmdFIKftDZLrQW71Ss= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0-rc.7/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= -github.com/DataDog/datadog-agent/pkg/trace v0.50.0-rc.7 h1:qWKAINgUtyuJQOCcthjPST8PzigPP8Pr0EtHdTgJVoA= -github.com/DataDog/datadog-agent/pkg/trace v0.50.0-rc.7/go.mod h1:i6OrrkHDlgCB4vUaPfM4FxVij2QdA/t07Ykwu74ySGA= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0-rc.7 h1:J7ocZItHWrUEvGWVqFa7wsghotcF53oFn1qH7Tlh7VM= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0-rc.7/go.mod h1:b0I5L9Eegsq3kca9pQCAVt1rQHI05sza7LVHKGzC+ms= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.0-rc.7 h1:vBo+iVlLpjrvJkX88mbFDtWFy0F6tEi865p+N4RTf7A= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.0-rc.7/go.mod h1:/fGZteE4rr3iz6y30a0A3MuebJ6Jckx+AiKcyYgT87k= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0-rc.7 h1:eM+GcYjk4sSik8tFgf8zNT1KViZZM4F4I580SZnTs7s= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0-rc.7/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0-rc.7 h1:QByjh+uLdnYjqIjdYP9XyEgObD9o8ydL4jBy4sEPlbU= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0-rc.7/go.mod h1:EOGgNrSPskIxY3+KgCl+yEggMjrGqrA2oL5va+/p2jM= +github.com/DataDog/agent-payload/v5 v5.0.102 h1:X8EZQeOewahQ7N/arllAP7hCGHNScdThnGjPg5/ErN8= +github.com/DataDog/agent-payload/v5 v5.0.102/go.mod h1:COngtbYYCncpIPiE5D93QlXDH/3VAKk10jDNwGHcMRE= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0 h1:WOyRfsLPYO24Z6Q+s1jcjoOFYJUJ4PgiNaGz/qJCba0= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0/go.mod h1:A4nLJvxlg6BO/8/zg81til9yT0uRPuXDFMAzDMpmgn4= +github.com/DataDog/datadog-agent/pkg/proto v0.50.0 h1:FAzs/Hofs9CN7jYYd2P4l8/igdcDPc7q9amIXSje/3A= +github.com/DataDog/datadog-agent/pkg/proto v0.50.0/go.mod h1:HvK26YCxg6MfYvPJgpHC7nSjw6DTpNhd75Wlb0GAvis= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0 h1:/V/WtjIQCDNJpRVJ/wSfmUakLhBhxJ7joqwM7DXc9hI= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= +github.com/DataDog/datadog-agent/pkg/trace v0.50.0 h1:gZt7YTwtptMNYUN/Z5QHnabOz0ILHvSKC0jpTqqiXBo= +github.com/DataDog/datadog-agent/pkg/trace v0.50.0/go.mod h1:fV11a6fzBAbzgF8ie5Bk51rvLS5kMcsXjwaCzPAfsrk= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0 h1:jSAW27LAnpdZGEe8B0FzSbVT8YdmvPGxV/l8SDUKzYY= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0/go.mod h1:QO56TX/gJf9yZ8q+ix0EEjck6kJu+oirAvJPk8xpFa0= +github.com/DataDog/datadog-agent/pkg/util/log v0.50.0 h1:qIqqLKov9yjoHuoOK//a49vFiBZyduswcJz7jwgKuuo= +github.com/DataDog/datadog-agent/pkg/util/log v0.50.0/go.mod h1:byH8to7LKxTK5m7jf1n222QMeL55iiVszk+OA7Qxfao= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0 h1:MXYW7B+OamUkSBGVsLkPQt7bjQhO52Q6qym3VluB8IM= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0 h1:0QrqgObZkmv2Fcr10CN+pONfIeoul5loof3t20B1AAA= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0/go.mod h1:EOGgNrSPskIxY3+KgCl+yEggMjrGqrA2oL5va+/p2jM= github.com/DataDog/datadog-api-client-go/v2 v2.20.0 h1:80T+UuTh+28qODc2vw+HxzMoIu0dYBT7/RCHXxdYpJE= github.com/DataDog/datadog-api-client-go/v2 v2.20.0/go.mod h1:oD5Lx8Li3oPRa/BSBenkn4i48z+91gwYORF/+6ph71g= github.com/DataDog/datadog-go/v5 v5.1.1 h1:JLZ6s2K1pG2h9GkvEvMdEGqMDyVLEAccdX5TltWcLMU= @@ -80,17 +80,17 @@ github.com/DataDog/go-tuf v1.0.2-0.5.2 h1:EeZr937eKAWPxJ26IykAdWA4A0jQXJgkhUjqEI 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.9.0 h1:y8rL7rCty4VhPFJi6TgOZXI7MrGRVYNV0oqbNblWi/c= -github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.9.0/go.mod h1:x+QjxvvVxewuyNymMjR+2fm0LAQSMF2mhw7Yhx61jp4= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.9.0 h1:oT5B12H+tLtAEEH0YqgmppofM/yRBzyI9+ykS9OQvIs= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.9.0 h1:Y+CllChr2yfE2RLd+c5hvK56DDGVEdDrhAl1OyzuuwU= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.9.0/go.mod h1:naFq9h+fQpgI7AKJ+YkWlAAYDU8/FB8LyfA39bmRNHs= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.9.0 h1:FbqbNsZ3179TUV+y932rKhhTxHMS5adlBb+9om1heGY= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.9.0/go.mod h1:v0FMEai3NccZjZr2jmX4t8Nobh3R8KxoRuj6PExoTRo= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.9.0 h1:WsCPJS+a34kw1gj46WpJjQBHrLVwh1ubCdHUx9nf1ec= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.9.0/go.mod h1:m61Tq6DA2U+PjNTX6WD3TH2U7QnA49+7IGaYK4bu7fQ= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.9.0 h1:U93rYuk3ChT/I+2r36JI8agi1AwdH8vRiHh+bCSXZeU= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.9.0/go.mod h1:KOzWHRj2AcJPmP1hm4WQUfzEIYRBP4NaTX9Iu+D3UNs= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.10.0 h1:kiPtYAgzvlOc6HV0qwS8xNeA39cYyAJs6q9dIRDpCFk= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.10.0/go.mod h1:MV/L0ESKjLGGE4JPDIDtz6H5u+9w0UKp1Wsw2lLREII= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.10.0 h1:O2PYvgTQA+31NuepzQqLexEpUX8FWsdNgq+0241OtH0= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.10.0 h1:56vp8vflG6lmhTO+YldUBTe0cIjStOC1neW1dIHYm5s= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.10.0/go.mod h1:naFq9h+fQpgI7AKJ+YkWlAAYDU8/FB8LyfA39bmRNHs= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.10.0 h1:+LxQNTpRM57lfcbGV7s+PVQ2B2Pegabfpf3yGJUXcgM= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.10.0/go.mod h1:WYm0DRBxBrKrmZrwoAJhcyJ7bGAFZbVQFcrrwwaGozU= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.10.0 h1:XwGT7/2NnO1RGxS5WD4BTsLWqO+z8234XBccUGhP8tM= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.10.0/go.mod h1:1fYkFs2pUyqBUUVDsjn1cKVEI79R+NluYhqX+pDTkSY= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.10.0 h1:mEao3xEP7iCfCd+teps0oM8U+ZRPVz02W6aE5cfi2Sc= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.10.0/go.mod h1:vPjlCjTrBzzZpVJbbVpox8x9nRYx5giCl/9Zy8oWFw0= github.com/DataDog/sketches-go v1.4.3 h1:ZB9nijteJRFUQixkQfatCqASartGNfiolIlMiEv3u/w= github.com/DataDog/sketches-go v1.4.3/go.mod h1:XR0ns2RtEEF09mDKXiKZiQg+nfZStrq1ZuL1eezeZe0= github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= @@ -117,8 +117,8 @@ github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAu github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/aws/aws-sdk-go v1.49.1 h1:Dsamcd8d/nNb3A+bZ0ucfGl0vGZsW5wlRW0vhoYGoeQ= -github.com/aws/aws-sdk-go v1.49.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= +github.com/aws/aws-sdk-go v1.49.6/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= @@ -344,6 +344,8 @@ github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09 github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/nomad/api v0.0.0-20230721134942-515895c7690c h1:Nc3Mt2BAnq0/VoLEntF/nipX+K1S7pG+RgwiitSv6v0= github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY= github.com/hetznercloud/hcloud-go/v2 v2.4.0 h1:MqlAE+w125PLvJRCpAJmEwrIxoVdUdOyuFUhE/Ukbok= @@ -702,7 +704,7 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= 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= @@ -713,8 +715,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= diff --git a/exporter/datadogexporter/internal/metadata/generated_status.go b/exporter/datadogexporter/internal/metadata/generated_status.go index 0c8a1b30a60b..2b54718b6486 100644 --- a/exporter/datadogexporter/internal/metadata/generated_status.go +++ b/exporter/datadogexporter/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( TracesStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/datadog") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/datadog") +} diff --git a/exporter/datasetexporter/go.mod b/exporter/datasetexporter/go.mod index e5836b735fb0..28aa293338b2 100644 --- a/exporter/datasetexporter/go.mod +++ b/exporter/datasetexporter/go.mod @@ -19,6 +19,8 @@ require ( require ( github.com/cenkalti/backoff/v4 v4.2.1 go.opentelemetry.io/collector/config/configopaque v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 ) require ( @@ -46,8 +48,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.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.18.0 // indirect diff --git a/exporter/datasetexporter/internal/metadata/generated_status.go b/exporter/datasetexporter/internal/metadata/generated_status.go index 8b046b1fbb8a..f1fb14c3c227 100644 --- a/exporter/datasetexporter/internal/metadata/generated_status.go +++ b/exporter/datasetexporter/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -11,3 +13,11 @@ const ( LogsStability = component.StabilityLevelAlpha TracesStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/dataset") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/dataset") +} diff --git a/exporter/dynatraceexporter/go.mod b/exporter/dynatraceexporter/go.mod index 2115378acc83..5b3897d8e7fc 100644 --- a/exporter/dynatraceexporter/go.mod +++ b/exporter/dynatraceexporter/go.mod @@ -16,6 +16,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -54,8 +56,6 @@ require ( go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/exporter/dynatraceexporter/internal/metadata/generated_status.go b/exporter/dynatraceexporter/internal/metadata/generated_status.go index c7553b5d7b66..74b946fecc17 100644 --- a/exporter/dynatraceexporter/internal/metadata/generated_status.go +++ b/exporter/dynatraceexporter/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "dynatrace" MetricsStability = component.StabilityLevelDeprecated ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/dynatrace") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/dynatrace") +} diff --git a/exporter/elasticsearchexporter/go.mod b/exporter/elasticsearchexporter/go.mod index a6376e235f3c..1d00945eb3a7 100644 --- a/exporter/elasticsearchexporter/go.mod +++ b/exporter/elasticsearchexporter/go.mod @@ -17,6 +17,8 @@ require ( go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -45,8 +47,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/exporter/elasticsearchexporter/internal/metadata/generated_status.go b/exporter/elasticsearchexporter/internal/metadata/generated_status.go index 68d85c28d943..a583a1963043 100644 --- a/exporter/elasticsearchexporter/internal/metadata/generated_status.go +++ b/exporter/elasticsearchexporter/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -11,3 +13,11 @@ const ( TracesStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/elasticsearch") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/elasticsearch") +} diff --git a/exporter/elasticsearchexporter/model.go b/exporter/elasticsearchexporter/model.go index 74737b7d1b32..c727de45e644 100644 --- a/exporter/elasticsearchexporter/model.go +++ b/exporter/elasticsearchexporter/model.go @@ -72,6 +72,7 @@ func (m *encodeModel) encodeSpan(resource pcommon.Resource, span ptrace.Span, sc document.AddString("Name", span.Name()) document.AddString("Kind", traceutil.SpanKindStr(span.Kind())) document.AddInt("TraceStatus", int64(span.Status().Code())) + document.AddString("TraceStatusDescription", span.Status().Message()) document.AddString("Link", spanLinksToString(span.Links())) document.AddAttributes("Attributes", span.Attributes()) document.AddAttributes("Resource", resource.Attributes()) diff --git a/exporter/elasticsearchexporter/model_test.go b/exporter/elasticsearchexporter/model_test.go index 4ee35f74e819..e76d1f39e491 100644 --- a/exporter/elasticsearchexporter/model_test.go +++ b/exporter/elasticsearchexporter/model_test.go @@ -13,7 +13,7 @@ import ( semconv "go.opentelemetry.io/collector/semconv/v1.18.0" ) -var expectedSpanBody = `{"@timestamp":"2023-04-19T03:04:05.000000006Z","Attributes.service.instance.id":"23","Duration":1000000,"EndTimestamp":"2023-04-19T03:04:06.000000006Z","Events.fooEvent.evnetMockBar":"bar","Events.fooEvent.evnetMockFoo":"foo","Events.fooEvent.time":"2023-04-19T03:04:05.000000006Z","Kind":"SPAN_KIND_CLIENT","Link":"[{\"attribute\":{},\"spanID\":\"\",\"traceID\":\"01020304050607080807060504030200\"}]","Name":"client span","Resource.cloud.platform":"aws_elastic_beanstalk","Resource.cloud.provider":"aws","Resource.deployment.environment":"BETA","Resource.service.instance.id":"23","Resource.service.name":"some-service","Resource.service.version":"env-version-1234","Scope.lib-foo":"lib-bar","Scope.name":"io.opentelemetry.rabbitmq-2.7","Scope.version":"1.30.0-alpha","SpanId":"1920212223242526","TraceId":"01020304050607080807060504030201","TraceStatus":0}` +var expectedSpanBody = `{"@timestamp":"2023-04-19T03:04:05.000000006Z","Attributes.service.instance.id":"23","Duration":1000000,"EndTimestamp":"2023-04-19T03:04:06.000000006Z","Events.fooEvent.evnetMockBar":"bar","Events.fooEvent.evnetMockFoo":"foo","Events.fooEvent.time":"2023-04-19T03:04:05.000000006Z","Kind":"SPAN_KIND_CLIENT","Link":"[{\"attribute\":{},\"spanID\":\"\",\"traceID\":\"01020304050607080807060504030200\"}]","Name":"client span","Resource.cloud.platform":"aws_elastic_beanstalk","Resource.cloud.provider":"aws","Resource.deployment.environment":"BETA","Resource.service.instance.id":"23","Resource.service.name":"some-service","Resource.service.version":"env-version-1234","Scope.lib-foo":"lib-bar","Scope.name":"io.opentelemetry.rabbitmq-2.7","Scope.version":"1.30.0-alpha","SpanId":"1920212223242526","TraceId":"01020304050607080807060504030201","TraceStatus":2,"TraceStatusDescription":"Test"}` func TestEncodeSpan(t *testing.T) { model := &encodeModel{dedup: true, dedot: false} @@ -51,6 +51,8 @@ func mockResourceSpans() ptrace.Traces { span.SetKind(ptrace.SpanKindClient) span.SetStartTimestamp(pcommon.NewTimestampFromTime(tStart)) span.SetEndTimestamp(pcommon.NewTimestampFromTime(tEnd)) + span.Status().SetCode(2) + span.Status().SetMessage("Test") span.Attributes().PutStr("service.instance.id", "23") span.Links().AppendEmpty().SetTraceID([16]byte{1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 0}) diff --git a/exporter/f5cloudexporter/go.mod b/exporter/f5cloudexporter/go.mod index e8d718ef7419..e875294e1da3 100644 --- a/exporter/f5cloudexporter/go.mod +++ b/exporter/f5cloudexporter/go.mod @@ -12,12 +12,14 @@ require ( go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/exporter/otlphttpexporter v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 golang.org/x/oauth2 v0.15.0 - google.golang.org/api v0.151.0 + google.golang.org/api v0.154.0 ) require ( - cloud.google.com/go/compute v1.23.1 // indirect + cloud.google.com/go/compute v1.23.3 // indirect cloud.google.com/go/compute/metadata v0.2.4-0.20230617002413-005d2dfb6b68 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect @@ -58,11 +60,9 @@ require ( go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect - golang.org/x/crypto v0.16.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/exporter/f5cloudexporter/go.sum b/exporter/f5cloudexporter/go.sum index 3811a094c6c9..889a4b8a5341 100644 --- a/exporter/f5cloudexporter/go.sum +++ b/exporter/f5cloudexporter/go.sum @@ -1,6 +1,6 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go/compute v1.23.1 h1:V97tBoDaZHb6leicZ1G6DLK2BAaZLJ/7+9BB/En3hR0= -cloud.google.com/go/compute v1.23.1/go.mod h1:CqB3xpmPKKt3OJpW2ndFIXnA9A4xAy/F3Xp1ixncW78= +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= contrib.go.opencensus.io/exporter/prometheus v0.4.2 h1:sqfsYl5GIY/L570iT+l93ehxaWJs2/OwXtiWwew3oAg= @@ -181,8 +181,8 @@ 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.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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= @@ -221,7 +221,7 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 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= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= 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= @@ -234,8 +234,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.151.0 h1:FhfXLO/NFdJIzQtCqjpysWwqKk8AzGWBUhMIx67cVDU= -google.golang.org/api v0.151.0/go.mod h1:ccy+MJ6nrYFgE3WgRx/AMXOxOmU8Q4hSa+jjibzhxcg= +google.golang.org/api v0.154.0 h1:X7QkVKZBskztmpPKWQXgjJRPA2dJYrL6r+sYPRLj050= +google.golang.org/api v0.154.0/go.mod h1:qhSMkM85hgqiokIYsrRyKxrjfBeIhgl4Z2JmeRkYylc= 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.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= diff --git a/exporter/f5cloudexporter/internal/metadata/generated_status.go b/exporter/f5cloudexporter/internal/metadata/generated_status.go index 7b47f7437e60..79d17e465073 100644 --- a/exporter/f5cloudexporter/internal/metadata/generated_status.go +++ b/exporter/f5cloudexporter/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) + +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/fileexporter/go.mod b/exporter/fileexporter/go.mod index 2c2defd9e6d4..78b75a5651dd 100644 --- a/exporter/fileexporter/go.mod +++ b/exporter/fileexporter/go.mod @@ -12,6 +12,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 gopkg.in/natefinch/lumberjack.v2 v2.2.1 ) @@ -38,8 +40,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/exporter/fileexporter/internal/metadata/generated_status.go b/exporter/fileexporter/internal/metadata/generated_status.go index 3ca3f1406dd1..ee908154b9df 100644 --- a/exporter/fileexporter/internal/metadata/generated_status.go +++ b/exporter/fileexporter/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/file") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/file") +} diff --git a/exporter/googlecloudexporter/go.mod b/exporter/googlecloudexporter/go.mod index d13b577bb665..7523a5625a00 100644 --- a/exporter/googlecloudexporter/go.mod +++ b/exporter/googlecloudexporter/go.mod @@ -9,6 +9,8 @@ require ( go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/featuregate v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 ) require ( @@ -57,13 +59,11 @@ require ( go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/collector/semconv v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/otel/sdk v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect - golang.org/x/crypto v0.15.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/oauth2 v0.14.0 // indirect golang.org/x/sync v0.5.0 // indirect diff --git a/exporter/googlecloudexporter/go.sum b/exporter/googlecloudexporter/go.sum index db5e38ee2f37..e81ff0a4ba17 100644 --- a/exporter/googlecloudexporter/go.sum +++ b/exporter/googlecloudexporter/go.sum @@ -182,8 +182,8 @@ 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.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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= diff --git a/exporter/googlecloudexporter/internal/metadata/generated_status.go b/exporter/googlecloudexporter/internal/metadata/generated_status.go index b4520b594593..c3d96226894c 100644 --- a/exporter/googlecloudexporter/internal/metadata/generated_status.go +++ b/exporter/googlecloudexporter/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/googlecloud") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/googlecloud") +} diff --git a/exporter/googlecloudpubsubexporter/README.md b/exporter/googlecloudpubsubexporter/README.md index 9b061451029b..83eeefa48380 100644 --- a/exporter/googlecloudpubsubexporter/README.md +++ b/exporter/googlecloudpubsubexporter/README.md @@ -28,6 +28,11 @@ The following configuration options are supported: the smallest timestamp of all the messages. * `allow_drift` (Optional): The maximum difference the `ce-time` attribute can be set from the system clock. When the drift is set to 0, the maximum drift from the clock is allowed (only applicable to `earliest`). +* `endpoint` (Optional): Override the default Pubsub Endpoint, useful when connecting to the PubSub emulator instance + or switching between [global and regional service endpoints](https://cloud.google.com/pubsub/docs/reference/service_apis_overview#service_endpoints). +* `insecure` (Optional): allows performing “insecure” SSL connections and transfers, useful when connecting to a local + emulator instance. Only has effect if Endpoint is not "" + ```yaml exporters: googlecloudpubsub: diff --git a/exporter/googlecloudpubsubexporter/config.go b/exporter/googlecloudpubsubexporter/config.go index a87ee88872cd..5bd1da1dbcfb 100644 --- a/exporter/googlecloudpubsubexporter/config.go +++ b/exporter/googlecloudpubsubexporter/config.go @@ -22,10 +22,10 @@ type Config struct { ProjectID string `mapstructure:"project"` // User agent that will be used by the Pubsub client to connect to the service UserAgent string `mapstructure:"user_agent"` - // Override of the Pubsub endpoint, for testing only - endpoint string + // Override of the Pubsub Endpoint, leave empty for the default endpoint + Endpoint string `mapstructure:"endpoint"` // Only has effect if Endpoint is not "" - insecure bool + Insecure bool `mapstructure:"insecure"` // The fully qualified resource name of the Pubsub topic Topic string `mapstructure:"topic"` diff --git a/exporter/googlecloudpubsubexporter/exporter.go b/exporter/googlecloudpubsubexporter/exporter.go index 357b915111bc..7a93980d22dc 100644 --- a/exporter/googlecloudpubsubexporter/exporter.go +++ b/exporter/googlecloudpubsubexporter/exporter.go @@ -94,16 +94,16 @@ func (ex *pubsubExporter) generateClientOptions() (copts []option.ClientOption) if ex.userAgent != "" { copts = append(copts, option.WithUserAgent(ex.userAgent)) } - if ex.config.endpoint != "" { - if ex.config.insecure { + if ex.config.Endpoint != "" { + if ex.config.Insecure { var dialOpts []grpc.DialOption if ex.userAgent != "" { dialOpts = append(dialOpts, grpc.WithUserAgent(ex.userAgent)) } - conn, _ := grpc.Dial(ex.config.endpoint, append(dialOpts, grpc.WithTransportCredentials(insecure.NewCredentials()))...) + conn, _ := grpc.Dial(ex.config.Endpoint, append(dialOpts, grpc.WithTransportCredentials(insecure.NewCredentials()))...) copts = append(copts, option.WithGRPCConn(conn)) } else { - copts = append(copts, option.WithEndpoint(ex.config.endpoint)) + copts = append(copts, option.WithEndpoint(ex.config.Endpoint)) } } return copts diff --git a/exporter/googlecloudpubsubexporter/exporter_test.go b/exporter/googlecloudpubsubexporter/exporter_test.go index a698f8aeb057..099af678bcfd 100644 --- a/exporter/googlecloudpubsubexporter/exporter_test.go +++ b/exporter/googlecloudpubsubexporter/exporter_test.go @@ -31,9 +31,9 @@ func TestGenerateClientOptions(t *testing.T) { factory := NewFactory() cfg := factory.CreateDefaultConfig() exporterConfig := cfg.(*Config) - exporterConfig.endpoint = srv.Addr + exporterConfig.Endpoint = srv.Addr exporterConfig.UserAgent = "test-user-agent" - exporterConfig.insecure = true + exporterConfig.Insecure = true exporterConfig.ProjectID = "my-project" exporterConfig.Topic = "projects/my-project/topics/otlp" exporterConfig.TimeoutSettings = exporterhelper.TimeoutSettings{ @@ -44,7 +44,7 @@ func TestGenerateClientOptions(t *testing.T) { options := exporter.generateClientOptions() assert.Equal(t, option.WithUserAgent("test-user-agent"), options[0]) - exporter.config.insecure = false + exporter.config.Insecure = false options = exporter.generateClientOptions() assert.Equal(t, option.WithUserAgent("test-user-agent"), options[0]) assert.Equal(t, option.WithEndpoint(srv.Addr), options[1]) @@ -63,8 +63,8 @@ func TestExporterDefaultSettings(t *testing.T) { factory := NewFactory() cfg := factory.CreateDefaultConfig() exporterConfig := cfg.(*Config) - exporterConfig.endpoint = srv.Addr - exporterConfig.insecure = true + exporterConfig.Endpoint = srv.Addr + exporterConfig.Insecure = true exporterConfig.ProjectID = "my-project" exporterConfig.Topic = "projects/my-project/topics/otlp" exporterConfig.TimeoutSettings = exporterhelper.TimeoutSettings{ @@ -91,9 +91,9 @@ func TestExporterCompression(t *testing.T) { factory := NewFactory() cfg := factory.CreateDefaultConfig() exporterConfig := cfg.(*Config) - exporterConfig.endpoint = srv.Addr + exporterConfig.Endpoint = srv.Addr exporterConfig.UserAgent = "test-user-agent" - exporterConfig.insecure = true + exporterConfig.Insecure = true exporterConfig.ProjectID = "my-project" exporterConfig.Topic = "projects/my-project/topics/otlp" exporterConfig.TimeoutSettings = exporterhelper.TimeoutSettings{ diff --git a/exporter/googlecloudpubsubexporter/factory_test.go b/exporter/googlecloudpubsubexporter/factory_test.go index a5c4cdeda2ab..fffea47b722d 100644 --- a/exporter/googlecloudpubsubexporter/factory_test.go +++ b/exporter/googlecloudpubsubexporter/factory_test.go @@ -31,7 +31,7 @@ func TestCreateTracesExporter(t *testing.T) { factory := NewFactory() cfg := factory.CreateDefaultConfig() eCfg := cfg.(*Config) - eCfg.endpoint = "http://testing.invalid" + eCfg.Endpoint = "http://testing.invalid" te, err := factory.CreateTracesExporter( context.Background(), @@ -46,7 +46,7 @@ func TestCreateMetricsExporter(t *testing.T) { factory := NewFactory() cfg := factory.CreateDefaultConfig() eCfg := cfg.(*Config) - eCfg.endpoint = "http://testing.invalid" + eCfg.Endpoint = "http://testing.invalid" me, err := factory.CreateMetricsExporter( context.Background(), @@ -61,7 +61,7 @@ func TestLogsCreateExporter(t *testing.T) { factory := NewFactory() cfg := factory.CreateDefaultConfig() eCfg := cfg.(*Config) - eCfg.endpoint = "http://testing.invalid" + eCfg.Endpoint = "http://testing.invalid" me, err := factory.CreateLogsExporter( context.Background(), @@ -76,7 +76,7 @@ func TestEnsureExporter(t *testing.T) { factory := NewFactory() cfg := factory.CreateDefaultConfig() eCfg := cfg.(*Config) - eCfg.endpoint = "http://testing.invalid" + eCfg.Endpoint = "http://testing.invalid" exporter1 := ensureExporter(exportertest.NewNopCreateSettings(), eCfg) exporter2 := ensureExporter(exportertest.NewNopCreateSettings(), eCfg) diff --git a/exporter/googlecloudpubsubexporter/go.mod b/exporter/googlecloudpubsubexporter/go.mod index 68f64be7405d..03888e03cf25 100644 --- a/exporter/googlecloudpubsubexporter/go.mod +++ b/exporter/googlecloudpubsubexporter/go.mod @@ -11,18 +11,23 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 - google.golang.org/api v0.151.0 - google.golang.org/grpc v1.60.0 + google.golang.org/api v0.154.0 + google.golang.org/grpc v1.60.1 ) require ( cloud.google.com/go v0.110.10 // indirect - cloud.google.com/go/compute v1.23.1 // indirect + cloud.google.com/go/compute v1.23.3 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v1.1.3 // indirect + cloud.google.com/go/iam v1.1.5 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/go-logr/logr v1.3.0 // indirect + github.com/go-logr/stdr v1.2.2 // 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 @@ -47,21 +52,21 @@ require ( go.opentelemetry.io/collector/extension v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/receiver v0.91.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.15.0 // indirect - golang.org/x/net v0.18.0 // indirect - golang.org/x/oauth2 v0.14.0 // indirect + golang.org/x/crypto v0.17.0 // indirect + golang.org/x/net v0.19.0 // indirect + golang.org/x/oauth2 v0.15.0 // indirect golang.org/x/sync v0.5.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/time v0.3.0 // indirect + golang.org/x/time v0.5.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect + google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/exporter/googlecloudpubsubexporter/go.sum b/exporter/googlecloudpubsubexporter/go.sum index bfa21e391e4c..c6f67532b267 100644 --- a/exporter/googlecloudpubsubexporter/go.sum +++ b/exporter/googlecloudpubsubexporter/go.sum @@ -1,12 +1,12 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.110.10 h1:LXy9GEO+timppncPIAZoOj3l58LIU9k+kn48AN7IO3Y= cloud.google.com/go v0.110.10/go.mod h1:v1OoFqYxiBkUrruItNM3eT4lLByNjxmJSV/xDKJNnic= -cloud.google.com/go/compute v1.23.1 h1:V97tBoDaZHb6leicZ1G6DLK2BAaZLJ/7+9BB/En3hR0= -cloud.google.com/go/compute v1.23.1/go.mod h1:CqB3xpmPKKt3OJpW2ndFIXnA9A4xAy/F3Xp1ixncW78= +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.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= -cloud.google.com/go/iam v1.1.3 h1:18tKG7DzydKWUnLjonWcJO6wjSCAtzh4GcRKlH/Hrzc= -cloud.google.com/go/iam v1.1.3/go.mod h1:3khUlaBXfPKKe7huYgEpDn6FtgRyMEqbkvBxrQyY5SE= +cloud.google.com/go/iam v1.1.5 h1:1jTsCu4bcsNsE4iiqNT5SHwrDRCfRmIaaaVFhRveTJI= +cloud.google.com/go/iam v1.1.5/go.mod h1:rB6P/Ic3mykPbFio+vo7403drjlgvoWfYpJhMXEbzv8= cloud.google.com/go/pubsub v1.33.0 h1:6SPCPvWav64tj0sVX/+npCBKhUi/UjJehy9op/V3p2g= cloud.google.com/go/pubsub v1.33.0/go.mod h1:f+w71I33OMyxf9VpMVcZbnG5KSUkCOUHYpFd5U1GdRc= contrib.go.opencensus.io/exporter/prometheus v0.4.2 h1:sqfsYl5GIY/L570iT+l93ehxaWJs2/OwXtiWwew3oAg= @@ -18,6 +18,7 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= 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/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -25,10 +26,16 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF 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/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/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/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= @@ -137,6 +144,10 @@ go.opentelemetry.io/collector/pdata v1.0.0 h1:ECP2jnLztewsHmL1opL8BeMtWVc7/oSlKN go.opentelemetry.io/collector/pdata v1.0.0/go.mod h1:TsDFgs4JLNG7t6x9D8kGswXUz4mme+MyNChHx8zSF6k= go.opentelemetry.io/collector/receiver v0.91.0 h1:0TZF/0OXoJtxgm+mvOinRRXo9LgVyOsOgCQfWkNGXJA= go.opentelemetry.io/collector/receiver v0.91.0/go.mod h1:d5qo2mpovqKoi47hrMxj5BLdLzOXM0mUHL5CKrjfWNM= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 h1:SpGay3w+nEwMpfVnbqOLH5gY52/foP8RE8UzTZ1pdSE= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1/go.mod h1:4UoMYEZOC0yN/sPGH76KPkkU7zgiEWYWL9vwmbnTJPE= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 h1:aFJWCqJMNjENlcleuuOkGAPH82y0yULBScfXcIEdS24= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1/go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo= go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 h1:TnhkxGJ5qPHAMIMI4r+HPT/BbpoHxqn4xONJrok054o= @@ -155,8 +166,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk 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.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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= @@ -175,11 +186,11 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY 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.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= -golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.14.0 h1:P0Vrf/2538nmC0H+pEQ3MNFRRnVR7RlqyVw+bvm26z0= -golang.org/x/oauth2 v0.14.0/go.mod h1:lAtNWgaWfL4cm7j2OV8TxGi9Qb7ECORx8DktCY74OwM= +golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ= +golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= 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= @@ -206,8 +217,8 @@ 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.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +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= @@ -221,8 +232,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.151.0 h1:FhfXLO/NFdJIzQtCqjpysWwqKk8AzGWBUhMIx67cVDU= -google.golang.org/api v0.151.0/go.mod h1:ccy+MJ6nrYFgE3WgRx/AMXOxOmU8Q4hSa+jjibzhxcg= +google.golang.org/api v0.154.0 h1:X7QkVKZBskztmpPKWQXgjJRPA2dJYrL6r+sYPRLj050= +google.golang.org/api v0.154.0/go.mod h1:qhSMkM85hgqiokIYsrRyKxrjfBeIhgl4Z2JmeRkYylc= 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= @@ -230,19 +241,19 @@ google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJ 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-20231016165738-49dd2c1f3d0b h1:+YaDE2r2OG8t/z5qmsh7Y+XXwCbvadxxZ0YY6mTdrVA= -google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:CgAqfJo+Xmu0GwA0411Ht3OU3OntXwsGmrmjI8ioGXI= -google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b h1:CIC2YMXmIhYw6evmhPxBKJ4fmLbOFtXQN/GV3XOZR8k= -google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:IBQ646DjkDkvUIsVq/cc03FUFQ9wbZu7yE396YcL870= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 h1:AB/lmRny7e2pLhFEYIbl5qkDAUt2h0ZRO4wGPhZf+ik= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405/go.mod h1:67X1fPuzjcrkymZzZV1vvkFeTn2Rvc6lYF9MYFGCcwE= +google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f h1:Vn+VyHU5guc9KjB5KrjI2q0wCOWEOIh0OEsleqakHJg= +google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f/go.mod h1:nWSwAFPb+qfNJXsoeO3Io7zf4tMSfN8EA8RlDA04GhY= +google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f h1:2yNACc1O40tTnrsbk9Cv6oxiW8pxI/pXj0wRtdlYmgY= +google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f/go.mod h1:Uy9bTZJqmfrw2rIBxgGLnamc78euZULUBrLZ9XTITKI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 h1:DC7wcm+i+P1rN3Ff07vL+OndGg5OhNddHyTA+ocPqYE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4/go.mod h1:eJVxU6o+4G1PSczBr85xmyvSNYAKvAYgkub40YGomFM= 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.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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= diff --git a/exporter/googlecloudpubsubexporter/internal/metadata/generated_status.go b/exporter/googlecloudpubsubexporter/internal/metadata/generated_status.go index 48d4414d0182..74600824e34b 100644 --- a/exporter/googlecloudpubsubexporter/internal/metadata/generated_status.go +++ b/exporter/googlecloudpubsubexporter/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/googlecloudpubsub") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/googlecloudpubsub") +} diff --git a/exporter/googlemanagedprometheusexporter/go.mod b/exporter/googlemanagedprometheusexporter/go.mod index 9a4db1e64884..bf37a56619e1 100644 --- a/exporter/googlemanagedprometheusexporter/go.mod +++ b/exporter/googlemanagedprometheusexporter/go.mod @@ -9,6 +9,8 @@ require ( go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/otelcol v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 ) require ( @@ -98,15 +100,13 @@ require ( go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.44.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/otel/sdk v1.21.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect - golang.org/x/crypto v0.15.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/oauth2 v0.14.0 // indirect golang.org/x/sync v0.5.0 // indirect diff --git a/exporter/googlemanagedprometheusexporter/go.sum b/exporter/googlemanagedprometheusexporter/go.sum index 31024cb758ef..ab3e6d30f945 100644 --- a/exporter/googlemanagedprometheusexporter/go.sum +++ b/exporter/googlemanagedprometheusexporter/go.sum @@ -418,8 +418,8 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 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.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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/exporter/googlemanagedprometheusexporter/internal/metadata/generated_status.go b/exporter/googlemanagedprometheusexporter/internal/metadata/generated_status.go index fe5ab47c090a..5eb21959873f 100644 --- a/exporter/googlemanagedprometheusexporter/internal/metadata/generated_status.go +++ b/exporter/googlemanagedprometheusexporter/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "googlemanagedprometheus" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/googlemanagedprometheus") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/googlemanagedprometheus") +} diff --git a/exporter/honeycombmarkerexporter/factory.go b/exporter/honeycombmarkerexporter/factory.go index e40f3240e83e..950fbdf34f10 100644 --- a/exporter/honeycombmarkerexporter/factory.go +++ b/exporter/honeycombmarkerexporter/factory.go @@ -34,7 +34,7 @@ func createLogsExporter( ) (exporter.Logs, error) { cf := cfg.(*Config) - logsExp, err := newHoneycombLogsExporter(set.TelemetrySettings, cf) + logsExp, err := newHoneycombLogsExporter(set, cf) if err != nil { return nil, err } diff --git a/exporter/honeycombmarkerexporter/go.mod b/exporter/honeycombmarkerexporter/go.mod index 21421bd624da..9de42b1de1ba 100644 --- a/exporter/honeycombmarkerexporter/go.mod +++ b/exporter/honeycombmarkerexporter/go.mod @@ -12,6 +12,8 @@ require ( go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -25,11 +27,11 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/gobwas/glob v0.2.3 // 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/uuid v1.5.0 // 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 github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.17.4 // indirect @@ -58,10 +60,8 @@ require ( go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect + golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/exporter/honeycombmarkerexporter/go.sum b/exporter/honeycombmarkerexporter/go.sum index 07e478bfa902..ebb99650195c 100644 --- a/exporter/honeycombmarkerexporter/go.sum +++ b/exporter/honeycombmarkerexporter/go.sum @@ -37,7 +37,6 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69 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= @@ -67,6 +66,8 @@ github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 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/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= @@ -174,8 +175,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= diff --git a/exporter/honeycombmarkerexporter/internal/metadata/generated_status.go b/exporter/honeycombmarkerexporter/internal/metadata/generated_status.go index bcebacec01e5..d8c0b3122036 100644 --- a/exporter/honeycombmarkerexporter/internal/metadata/generated_status.go +++ b/exporter/honeycombmarkerexporter/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "honeycombmarker" LogsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/honeycombmarker") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/honeycombmarker") +} diff --git a/exporter/honeycombmarkerexporter/logs_exporter.go b/exporter/honeycombmarkerexporter/logs_exporter.go index 07c595acbd6e..aa65d005a5ec 100644 --- a/exporter/honeycombmarkerexporter/logs_exporter.go +++ b/exporter/honeycombmarkerexporter/logs_exporter.go @@ -10,9 +10,11 @@ import ( "fmt" "io" "net/http" + "runtime" "strings" "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/pdata/plog" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter/filterottl" @@ -22,22 +24,27 @@ import ( const ( defaultDatasetSlug = "__all__" + userAgentHeaderKey = "User-Agent" + contentType = "Content-Type" + honeycombTeam = "X-Honeycomb-Team" ) type honeycombLogsExporter struct { - set component.TelemetrySettings - markers []Marker - client *http.Client - config *Config + set component.TelemetrySettings + markers []Marker + client *http.Client + config *Config + userAgentHeader string } -func newHoneycombLogsExporter(set component.TelemetrySettings, config *Config) (*honeycombLogsExporter, error) { +func newHoneycombLogsExporter(set exporter.CreateSettings, config *Config) (*honeycombLogsExporter, error) { if config == nil { return nil, fmt.Errorf("unable to create honeycombLogsExporter without config") } + telemetrySettings := set.TelemetrySettings for i, m := range config.Markers { - matchLogConditions, err := filterottl.NewBoolExprForLog(m.Rules.LogConditions, filterottl.StandardLogFuncs(), ottl.PropagateError, set) + matchLogConditions, err := filterottl.NewBoolExprForLog(m.Rules.LogConditions, filterottl.StandardLogFuncs(), ottl.PropagateError, telemetrySettings) if err != nil { return nil, fmt.Errorf("failed to parse log conditions: %w", err) } @@ -45,9 +52,10 @@ func newHoneycombLogsExporter(set component.TelemetrySettings, config *Config) ( config.Markers[i].Rules.logBoolExpr = matchLogConditions } logsExp := &honeycombLogsExporter{ - set: set, - markers: config.Markers, - config: config, + set: telemetrySettings, + markers: config.Markers, + config: config, + userAgentHeader: fmt.Sprintf("%s/%s (%s/%s)", set.BuildInfo.Description, set.BuildInfo.Version, runtime.GOOS, runtime.GOARCH), } return logsExp, nil } @@ -111,8 +119,9 @@ func (e *honeycombLogsExporter) sendMarker(ctx context.Context, marker Marker, l return err } - req.Header.Set("Content-Type", "application/json") - req.Header.Set("X-Honeycomb-Team", fmt.Sprint(e.config.APIKey)) + req.Header.Set(contentType, "application/json") + req.Header.Set(honeycombTeam, fmt.Sprint(e.config.APIKey)) + req.Header.Set(userAgentHeaderKey, e.userAgentHeader) resp, err := e.client.Do(req) if err != nil { diff --git a/exporter/honeycombmarkerexporter/logs_exporter_test.go b/exporter/honeycombmarkerexporter/logs_exporter_test.go index 4a69de22b57f..9dd716f482be 100644 --- a/exporter/honeycombmarkerexporter/logs_exporter_test.go +++ b/exporter/honeycombmarkerexporter/logs_exporter_test.go @@ -8,6 +8,7 @@ import ( "encoding/json" "net/http" "net/http/httptest" + "strings" "testing" "github.com/stretchr/testify/assert" @@ -132,9 +133,13 @@ func TestExportMarkers(t *testing.T) { } assert.Contains(t, req.URL.Path, tt.expectedURL) - apiKey := req.Header.Get("X-Honeycomb-Team") + apiKey := req.Header.Get(honeycombTeam) assert.Equal(t, apiKey, string(tt.config.APIKey)) + userAgent := req.Header.Get(userAgentHeaderKey) + assert.NotEmpty(t, userAgent) + assert.Equal(t, strings.Contains(userAgent, "OpenTelemetry Collector"), true) + rw.WriteHeader(http.StatusAccepted) })) defer markerServer.Close() diff --git a/exporter/influxdbexporter/README.md b/exporter/influxdbexporter/README.md index 8513ca5fa1bc..4dd5b8301c65 100644 --- a/exporter/influxdbexporter/README.md +++ b/exporter/influxdbexporter/README.md @@ -4,12 +4,13 @@ | Status | | | ------------- |-----------| | Stability | [beta]: traces, metrics, logs | -| Distributions | [contrib], [observiq] | +| Distributions | [contrib], [liatrio], [observiq] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aexporter%2Finfluxdb%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aexporter%2Finfluxdb) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aexporter%2Finfluxdb%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aexporter%2Finfluxdb) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@jacobmarble](https://www.github.com/jacobmarble) | [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/exporter/influxdbexporter/go.mod b/exporter/influxdbexporter/go.mod index fdd807cba378..c28edf8c0d55 100644 --- a/exporter/influxdbexporter/go.mod +++ b/exporter/influxdbexporter/go.mod @@ -14,8 +14,10 @@ require ( go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/exporter v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 - golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb + golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 ) require ( @@ -55,8 +57,6 @@ require ( go.opentelemetry.io/collector/semconv v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/exporter/influxdbexporter/go.sum b/exporter/influxdbexporter/go.sum index 3c406d34061a..bef630bb9578 100644 --- a/exporter/influxdbexporter/go.sum +++ b/exporter/influxdbexporter/go.sum @@ -190,8 +190,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= diff --git a/exporter/influxdbexporter/internal/metadata/generated_status.go b/exporter/influxdbexporter/internal/metadata/generated_status.go index 05e0acae4912..978e4fcacc45 100644 --- a/exporter/influxdbexporter/internal/metadata/generated_status.go +++ b/exporter/influxdbexporter/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/influxdb") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/influxdb") +} diff --git a/exporter/influxdbexporter/metadata.yaml b/exporter/influxdbexporter/metadata.yaml index 4d4363dff036..f6b11d5507e6 100644 --- a/exporter/influxdbexporter/metadata.yaml +++ b/exporter/influxdbexporter/metadata.yaml @@ -4,6 +4,6 @@ status: class: exporter stability: beta: [traces, metrics, logs] - distributions: [contrib, observiq] + distributions: [contrib, observiq, liatrio] codeowners: active: [jacobmarble] diff --git a/exporter/instanaexporter/go.mod b/exporter/instanaexporter/go.mod index 8687e8143e6b..8742731b56b7 100644 --- a/exporter/instanaexporter/go.mod +++ b/exporter/instanaexporter/go.mod @@ -14,6 +14,8 @@ require ( go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -52,8 +54,6 @@ require ( go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/exporter/instanaexporter/internal/metadata/generated_status.go b/exporter/instanaexporter/internal/metadata/generated_status.go index 35003719e88e..5d6a5bb5cfc9 100644 --- a/exporter/instanaexporter/internal/metadata/generated_status.go +++ b/exporter/instanaexporter/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "instana" TracesStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/instana") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/instana") +} diff --git a/exporter/kafkaexporter/go.mod b/exporter/kafkaexporter/go.mod index 16bc54c77d85..3130b5c31533 100644 --- a/exporter/kafkaexporter/go.mod +++ b/exporter/kafkaexporter/go.mod @@ -9,7 +9,7 @@ require ( github.com/jaegertracing/jaeger v1.52.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/kafka v0.91.0 - github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal v0.90.1 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.91.0 github.com/openzipkin/zipkin-go v0.4.2 @@ -21,13 +21,15 @@ require ( go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) require ( github.com/apache/thrift v0.19.0 // indirect - github.com/aws/aws-sdk-go v1.49.1 // indirect + github.com/aws/aws-sdk-go v1.49.6 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/eapache/go-resiliency v1.4.0 // indirect github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect @@ -69,9 +71,7 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect - golang.org/x/crypto v0.16.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/exporter/kafkaexporter/go.sum b/exporter/kafkaexporter/go.sum index 3532ee53f7cf..9a3e0f31d378 100644 --- a/exporter/kafkaexporter/go.sum +++ b/exporter/kafkaexporter/go.sum @@ -5,8 +5,8 @@ github.com/IBM/sarama v1.42.1 h1:wugyWa15TDEHh2kvq2gAy1IHLjEjuYOYgXz/ruC/OSQ= github.com/IBM/sarama v1.42.1/go.mod h1:Xxho9HkHd4K/MDUo/T/sOqwtX/17D33++E9Wib6hUdQ= 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.49.1 h1:Dsamcd8d/nNb3A+bZ0ucfGl0vGZsW5wlRW0vhoYGoeQ= -github.com/aws/aws-sdk-go v1.49.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= +github.com/aws/aws-sdk-go v1.49.6/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= 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= @@ -204,8 +204,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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= diff --git a/exporter/kafkaexporter/internal/metadata/generated_status.go b/exporter/kafkaexporter/internal/metadata/generated_status.go index 73c17c03bbba..25c68a3f1504 100644 --- a/exporter/kafkaexporter/internal/metadata/generated_status.go +++ b/exporter/kafkaexporter/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/kafka") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/kafka") +} diff --git a/exporter/kineticaexporter/go.mod b/exporter/kineticaexporter/go.mod index ea806660352b..6187ee128056 100644 --- a/exporter/kineticaexporter/go.mod +++ b/exporter/kineticaexporter/go.mod @@ -9,6 +9,8 @@ require ( go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -36,8 +38,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/exporter/kineticaexporter/internal/metadata/generated_status.go b/exporter/kineticaexporter/internal/metadata/generated_status.go index 8ce647f25c4b..f6e80b70a532 100644 --- a/exporter/kineticaexporter/internal/metadata/generated_status.go +++ b/exporter/kineticaexporter/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( TracesStability = component.StabilityLevelDevelopment LogsStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/kinetica") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/kinetica") +} diff --git a/exporter/loadbalancingexporter/go.mod b/exporter/loadbalancingexporter/go.mod index 2eb3f727ddca..a0ce15fa45c1 100644 --- a/exporter/loadbalancingexporter/go.mod +++ b/exporter/loadbalancingexporter/go.mod @@ -14,12 +14,14 @@ require ( go.opentelemetry.io/collector/otelcol v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 k8s.io/api v0.28.4 k8s.io/apimachinery v0.28.4 k8s.io/client-go v0.28.4 - k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 + k8s.io/utils v0.0.0-20231127182322-b307cd553661 sigs.k8s.io/controller-runtime v0.16.3 ) @@ -113,10 +115,8 @@ require ( go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.44.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/otel/sdk v1.21.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/oauth2 v0.14.0 // indirect diff --git a/exporter/loadbalancingexporter/go.sum b/exporter/loadbalancingexporter/go.sum index 82da9cbe65d2..62ab51dad3e5 100644 --- a/exporter/loadbalancingexporter/go.sum +++ b/exporter/loadbalancingexporter/go.sum @@ -2082,8 +2082,8 @@ k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ= k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM= -k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrCM8P2RJ0yroCyIk= -k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20231127182322-b307cd553661 h1:FepOBzJ0GXm8t0su67ln2wAZjbQ6RxQGZDnzuLcrUTI= +k8s.io/utils v0.0.0-20231127182322-b307cd553661/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= modernc.org/cc/v3 v3.36.0/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI= diff --git a/exporter/loadbalancingexporter/internal/metadata/generated_status.go b/exporter/loadbalancingexporter/internal/metadata/generated_status.go index 411eca7c5497..bef8141df0b6 100644 --- a/exporter/loadbalancingexporter/internal/metadata/generated_status.go +++ b/exporter/loadbalancingexporter/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( LogsStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/loadbalancing") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/loadbalancing") +} diff --git a/exporter/loadbalancingexporter/resolver_k8s.go b/exporter/loadbalancingexporter/resolver_k8s.go index 1c0b14aa9436..d8b95054ab90 100644 --- a/exporter/loadbalancingexporter/resolver_k8s.go +++ b/exporter/loadbalancingexporter/resolver_k8s.go @@ -23,7 +23,7 @@ import ( "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/cache" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" "k8s.io/utils/strings/slices" "sigs.k8s.io/controller-runtime/pkg/client/config" ) @@ -84,12 +84,12 @@ func newK8sResolver(clt kubernetes.Interface, epsListWatcher := &cache.ListWatch{ ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { options.FieldSelector = epsSelector - options.TimeoutSeconds = pointer.Int64(1) + options.TimeoutSeconds = ptr.To[int64](1) return clt.CoreV1().Endpoints(namespace).List(context.Background(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { options.FieldSelector = epsSelector - options.TimeoutSeconds = pointer.Int64(1) + options.TimeoutSeconds = ptr.To[int64](1) return clt.CoreV1().Endpoints(namespace).Watch(context.Background(), options) }, } diff --git a/exporter/logicmonitorexporter/go.mod b/exporter/logicmonitorexporter/go.mod index db6d3bb5a0ee..54391cfb6989 100644 --- a/exporter/logicmonitorexporter/go.mod +++ b/exporter/logicmonitorexporter/go.mod @@ -14,6 +14,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -54,8 +56,6 @@ require ( go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/exporter/logicmonitorexporter/internal/metadata/generated_status.go b/exporter/logicmonitorexporter/internal/metadata/generated_status.go index 0ebb1cbf0f50..500274c984d5 100644 --- a/exporter/logicmonitorexporter/internal/metadata/generated_status.go +++ b/exporter/logicmonitorexporter/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -11,3 +13,11 @@ const ( TracesStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/logicmonitor") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/logicmonitor") +} diff --git a/exporter/logzioexporter/README.md b/exporter/logzioexporter/README.md index 0c0c6ff9d62c..92454c40adc3 100644 --- a/exporter/logzioexporter/README.md +++ b/exporter/logzioexporter/README.md @@ -3,12 +3,12 @@ | Status | | | ------------- |-----------| -| Stability | [beta]: traces, logs | +| Stability | [unmaintained]: traces, logs | | Distributions | [contrib], [aws], [observiq] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aexporter%2Flogzio%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aexporter%2Flogzio) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aexporter%2Flogzio%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aexporter%2Flogzio) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@Doron-Bargo](https://www.github.com/Doron-Bargo), [@yotamloe](https://www.github.com/yotamloe) | -[beta]: https://github.com/open-telemetry/opentelemetry-collector#beta +[unmaintained]: https://github.com/open-telemetry/opentelemetry-collector#unmaintained [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib [aws]: https://github.com/aws-observability/aws-otel-collector [observiq]: https://github.com/observIQ/observiq-otel-collector diff --git a/exporter/logzioexporter/go.mod b/exporter/logzioexporter/go.mod index d89682400ee8..b933bfa84007 100644 --- a/exporter/logzioexporter/go.mod +++ b/exporter/logzioexporter/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/exporter/logzio go 1.20 require ( - github.com/hashicorp/go-hclog v1.5.0 + github.com/hashicorp/go-hclog v1.6.2 github.com/jaegertracing/jaeger v1.52.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.91.0 @@ -17,6 +17,8 @@ require ( go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 google.golang.org/protobuf v1.31.0 @@ -61,8 +63,6 @@ require ( go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/exporter/logzioexporter/go.sum b/exporter/logzioexporter/go.sum index e0e6082f97b9..44486595db49 100644 --- a/exporter/logzioexporter/go.sum +++ b/exporter/logzioexporter/go.sum @@ -63,8 +63,8 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= -github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-hclog v1.6.2 h1:NOtoftovWkDheyUM/8JW3QMiXyxJK3uHRK7wV04nD2I= +github.com/hashicorp/go-hclog v1.6.2/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= 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/jaegertracing/jaeger v1.52.0 h1:cNrp6WlcNbOY3zUdhG3Le4BOUUYSqekkMj12qHhVUB4= diff --git a/exporter/logzioexporter/internal/metadata/generated_status.go b/exporter/logzioexporter/internal/metadata/generated_status.go index 53e889139196..e3b8317919b2 100644 --- a/exporter/logzioexporter/internal/metadata/generated_status.go +++ b/exporter/logzioexporter/internal/metadata/generated_status.go @@ -4,10 +4,20 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "logzio" - TracesStability = component.StabilityLevelBeta - LogsStability = component.StabilityLevelBeta + TracesStability = component.StabilityLevelUnmaintained + LogsStability = component.StabilityLevelUnmaintained ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/logzio") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/logzio") +} diff --git a/exporter/logzioexporter/metadata.yaml b/exporter/logzioexporter/metadata.yaml index 28d24cc9d2ad..8c3b977c5950 100644 --- a/exporter/logzioexporter/metadata.yaml +++ b/exporter/logzioexporter/metadata.yaml @@ -3,7 +3,7 @@ type: logzio status: class: exporter stability: - beta: [traces, logs] + unmaintained: [traces, logs] distributions: [contrib, observiq, aws] codeowners: active: [Doron-Bargo, yotamloe] diff --git a/exporter/lokiexporter/go.mod b/exporter/lokiexporter/go.mod index d10ca72ec693..f0642793a085 100644 --- a/exporter/lokiexporter/go.mod +++ b/exporter/lokiexporter/go.mod @@ -20,6 +20,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -69,8 +71,6 @@ require ( go.opentelemetry.io/collector/semconv v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/atomic v1.11.0 // indirect golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect golang.org/x/net v0.19.0 // indirect diff --git a/exporter/lokiexporter/internal/metadata/generated_status.go b/exporter/lokiexporter/internal/metadata/generated_status.go index 8ac8d582873a..9b18cf1bd294 100644 --- a/exporter/lokiexporter/internal/metadata/generated_status.go +++ b/exporter/lokiexporter/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "loki" LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/loki") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/loki") +} diff --git a/exporter/mezmoexporter/go.mod b/exporter/mezmoexporter/go.mod index cfe6e7f5dd1e..9a4d683786cf 100644 --- a/exporter/mezmoexporter/go.mod +++ b/exporter/mezmoexporter/go.mod @@ -12,6 +12,8 @@ require ( go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -51,8 +53,6 @@ require ( go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/exporter/mezmoexporter/internal/metadata/generated_status.go b/exporter/mezmoexporter/internal/metadata/generated_status.go index 0cd555eb9901..21d69fb2ea3c 100644 --- a/exporter/mezmoexporter/internal/metadata/generated_status.go +++ b/exporter/mezmoexporter/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "mezmo" LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/mezmo") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/mezmo") +} diff --git a/exporter/opencensusexporter/go.mod b/exporter/opencensusexporter/go.mod index 117e997f30fb..a0e561a7c647 100644 --- a/exporter/opencensusexporter/go.mod +++ b/exporter/opencensusexporter/go.mod @@ -18,7 +18,9 @@ require ( go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 - google.golang.org/grpc v1.60.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 + google.golang.org/grpc v1.60.1 ) require ( @@ -62,8 +64,6 @@ require ( go.opentelemetry.io/collector/semconv v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/exporter/opencensusexporter/go.sum b/exporter/opencensusexporter/go.sum index 425f01ad418e..91b0157b722d 100644 --- a/exporter/opencensusexporter/go.sum +++ b/exporter/opencensusexporter/go.sum @@ -241,8 +241,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac 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.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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= diff --git a/exporter/opencensusexporter/internal/metadata/generated_status.go b/exporter/opencensusexporter/internal/metadata/generated_status.go index 081df994310b..115becf76053 100644 --- a/exporter/opencensusexporter/internal/metadata/generated_status.go +++ b/exporter/opencensusexporter/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -11,3 +13,11 @@ const ( TracesStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/opencensus") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/opencensus") +} diff --git a/exporter/opensearchexporter/go.mod b/exporter/opensearchexporter/go.mod index bbdd3d98eea0..3c59560e44e7 100644 --- a/exporter/opensearchexporter/go.mod +++ b/exporter/opensearchexporter/go.mod @@ -59,8 +59,8 @@ require ( go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/exporter/opensearchexporter/internal/metadata/generated_status.go b/exporter/opensearchexporter/internal/metadata/generated_status.go index 6ae2bfa847b3..c53afddec134 100644 --- a/exporter/opensearchexporter/internal/metadata/generated_status.go +++ b/exporter/opensearchexporter/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -11,3 +13,11 @@ const ( TracesStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/opensearch") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/opensearch") +} diff --git a/exporter/prometheusexporter/README.md b/exporter/prometheusexporter/README.md index 752686eba711..e2849482fcbc 100644 --- a/exporter/prometheusexporter/README.md +++ b/exporter/prometheusexporter/README.md @@ -4,7 +4,7 @@ | Status | | | ------------- |-----------| | Stability | [beta]: metrics | -| Distributions | [core], [contrib], [aws], [grafana], [observiq], [redhat], [sumo] | +| Distributions | [core], [contrib], [aws], [grafana], [liatrio], [observiq], [redhat], [sumo] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aexporter%2Fprometheus%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aexporter%2Fprometheus) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aexporter%2Fprometheus%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aexporter%2Fprometheus) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@Aneurysm9](https://www.github.com/Aneurysm9) | @@ -13,6 +13,7 @@ [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 [sumo]: https://github.com/SumoLogic/sumologic-otel-collector diff --git a/exporter/prometheusexporter/go.mod b/exporter/prometheusexporter/go.mod index aab7c5e099fe..da74980b0004 100644 --- a/exporter/prometheusexporter/go.mod +++ b/exporter/prometheusexporter/go.mod @@ -21,6 +21,8 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 gopkg.in/yaml.v2 v2.4.0 ) @@ -146,11 +148,9 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.16.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect diff --git a/exporter/prometheusexporter/go.sum b/exporter/prometheusexporter/go.sum index c423fb916509..a6d8929a988e 100644 --- a/exporter/prometheusexporter/go.sum +++ b/exporter/prometheusexporter/go.sum @@ -599,8 +599,8 @@ golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3 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-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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/exporter/prometheusexporter/internal/metadata/generated_status.go b/exporter/prometheusexporter/internal/metadata/generated_status.go index 793e897d7681..10a5927c12fc 100644 --- a/exporter/prometheusexporter/internal/metadata/generated_status.go +++ b/exporter/prometheusexporter/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "prometheus" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/prometheus") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/prometheus") +} diff --git a/exporter/prometheusexporter/metadata.yaml b/exporter/prometheusexporter/metadata.yaml index 9df66711907d..aad0b7cdebbf 100644 --- a/exporter/prometheusexporter/metadata.yaml +++ b/exporter/prometheusexporter/metadata.yaml @@ -12,5 +12,6 @@ status: - observiq - redhat - sumo + - liatrio codeowners: active: [Aneurysm9] diff --git a/exporter/prometheusremotewriteexporter/README.md b/exporter/prometheusremotewriteexporter/README.md index d230c2f9765c..ad93925d46f2 100644 --- a/exporter/prometheusremotewriteexporter/README.md +++ b/exporter/prometheusremotewriteexporter/README.md @@ -4,7 +4,7 @@ | Status | | | ------------- |-----------| | Stability | [beta]: metrics | -| Distributions | [core], [contrib], [aws], [observiq] | +| Distributions | [core], [contrib], [aws], [liatrio], [observiq] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aexporter%2Fprometheusremotewrite%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aexporter%2Fprometheusremotewrite) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aexporter%2Fprometheusremotewrite%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aexporter%2Fprometheusremotewrite) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@Aneurysm9](https://www.github.com/Aneurysm9), [@rapphil](https://www.github.com/rapphil) | @@ -12,6 +12,7 @@ [core]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib [aws]: https://github.com/aws-observability/aws-otel-collector +[liatrio]: https://github.com/liatrio/liatrio-otel-collector [observiq]: https://github.com/observIQ/observiq-otel-collector diff --git a/exporter/prometheusremotewriteexporter/go.mod b/exporter/prometheusremotewriteexporter/go.mod index 879689d1a033..b9f473ea80c9 100644 --- a/exporter/prometheusremotewriteexporter/go.mod +++ b/exporter/prometheusremotewriteexporter/go.mod @@ -22,6 +22,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -63,8 +65,6 @@ require ( go.opentelemetry.io/collector/semconv v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/exporter/prometheusremotewriteexporter/internal/metadata/generated_status.go b/exporter/prometheusremotewriteexporter/internal/metadata/generated_status.go index 2d3635acb0f4..c39a01b314d5 100644 --- a/exporter/prometheusremotewriteexporter/internal/metadata/generated_status.go +++ b/exporter/prometheusremotewriteexporter/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "prometheusremotewrite" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/prometheusremotewrite") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/prometheusremotewrite") +} diff --git a/exporter/prometheusremotewriteexporter/metadata.yaml b/exporter/prometheusremotewriteexporter/metadata.yaml index 762142015495..0ea52fc29bc0 100644 --- a/exporter/prometheusremotewriteexporter/metadata.yaml +++ b/exporter/prometheusremotewriteexporter/metadata.yaml @@ -4,6 +4,6 @@ status: class: exporter stability: beta: [metrics] - distributions: [core, contrib, aws, observiq] + distributions: [core, contrib, aws, observiq, liatrio] codeowners: active: [Aneurysm9, rapphil] diff --git a/exporter/pulsarexporter/go.mod b/exporter/pulsarexporter/go.mod index 40ef618bdc91..143187034ae5 100644 --- a/exporter/pulsarexporter/go.mod +++ b/exporter/pulsarexporter/go.mod @@ -17,6 +17,8 @@ require ( go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -72,10 +74,8 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/atomic v1.11.0 // indirect - golang.org/x/crypto v0.16.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/oauth2 v0.14.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/exporter/pulsarexporter/go.sum b/exporter/pulsarexporter/go.sum index 032b2f1a4b48..9f209a1505cf 100644 --- a/exporter/pulsarexporter/go.sum +++ b/exporter/pulsarexporter/go.sum @@ -475,8 +475,8 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 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.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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/exporter/pulsarexporter/internal/metadata/generated_status.go b/exporter/pulsarexporter/internal/metadata/generated_status.go index ca71c889e14d..8bf9ab55567d 100644 --- a/exporter/pulsarexporter/internal/metadata/generated_status.go +++ b/exporter/pulsarexporter/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/pulsar") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/pulsar") +} diff --git a/exporter/sapmexporter/go.mod b/exporter/sapmexporter/go.mod index 7afdbd007206..1c4e616c84aa 100644 --- a/exporter/sapmexporter/go.mod +++ b/exporter/sapmexporter/go.mod @@ -9,7 +9,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchperresourceattr v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.91.0 - github.com/signalfx/sapm-proto v0.13.0 + github.com/signalfx/sapm-proto v0.14.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/config/configopaque v0.91.0 @@ -17,6 +17,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -49,8 +51,6 @@ require ( go.opentelemetry.io/collector/semconv v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/exporter/sapmexporter/go.sum b/exporter/sapmexporter/go.sum index c6068daaf2ae..2f4e2913e1e7 100644 --- a/exporter/sapmexporter/go.sum +++ b/exporter/sapmexporter/go.sum @@ -96,8 +96,8 @@ github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lne github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= github.com/prometheus/statsd_exporter v0.22.7 h1:7Pji/i2GuhK6Lu7DHrtTkFmNBCudCPT1pX2CziuyQR0= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/signalfx/sapm-proto v0.13.0 h1:yEkp1+MAU4vZvnJMp56uhVlRjlvCK7KQjBg0g2Apw8k= -github.com/signalfx/sapm-proto v0.13.0/go.mod h1:C72HjeCW5v0Llk6pIVJ/ZH8A5GbiZpCCSkE1dSlpWxY= +github.com/signalfx/sapm-proto v0.14.0 h1:KWh3I5E4EkelB19aP1/54Ik8khSioC/RVRW/riOfRGg= +github.com/signalfx/sapm-proto v0.14.0/go.mod h1:Km6PskZh966cqNoUn3AmRyGRix5VfwnxVBvn2vjRC9U= 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= diff --git a/exporter/sapmexporter/internal/metadata/generated_status.go b/exporter/sapmexporter/internal/metadata/generated_status.go index b623b108ae12..f71a1a39589e 100644 --- a/exporter/sapmexporter/internal/metadata/generated_status.go +++ b/exporter/sapmexporter/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "sapm" TracesStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/sapm") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/sapm") +} diff --git a/exporter/sentryexporter/go.mod b/exporter/sentryexporter/go.mod index 5fc440243800..5aeed40948f0 100644 --- a/exporter/sentryexporter/go.mod +++ b/exporter/sentryexporter/go.mod @@ -12,6 +12,8 @@ require ( go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 ) require ( @@ -38,8 +40,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/exporter/sentryexporter/internal/metadata/generated_status.go b/exporter/sentryexporter/internal/metadata/generated_status.go index c524afd062e5..0c9c75ed831c 100644 --- a/exporter/sentryexporter/internal/metadata/generated_status.go +++ b/exporter/sentryexporter/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "sentry" TracesStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/sentry") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/sentry") +} diff --git a/exporter/signalfxexporter/go.mod b/exporter/signalfxexporter/go.mod index a80de1dbd6d6..aac4d8ba9bda 100644 --- a/exporter/signalfxexporter/go.mod +++ b/exporter/signalfxexporter/go.mod @@ -25,6 +25,8 @@ require ( go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 golang.org/x/sys v0.15.0 @@ -73,8 +75,6 @@ require ( go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect diff --git a/exporter/signalfxexporter/internal/metadata/generated_status.go b/exporter/signalfxexporter/internal/metadata/generated_status.go index 5b483082c64c..a794bb5c1a07 100644 --- a/exporter/signalfxexporter/internal/metadata/generated_status.go +++ b/exporter/signalfxexporter/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/signalfx") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/signalfx") +} diff --git a/exporter/skywalkingexporter/go.mod b/exporter/skywalkingexporter/go.mod index c93ba82333b3..e02d7e4d9220 100644 --- a/exporter/skywalkingexporter/go.mod +++ b/exporter/skywalkingexporter/go.mod @@ -16,8 +16,10 @@ require ( go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/semconv v0.91.0 - google.golang.org/grpc v1.60.0 - skywalking.apache.org/repo/goapi v0.0.0-20231026090926-09378dd56587 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 + google.golang.org/grpc v1.60.1 + skywalking.apache.org/repo/goapi v0.0.0-20231213062226-7849efc09ba3 ) require ( @@ -55,8 +57,6 @@ require ( go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/exporter/skywalkingexporter/go.sum b/exporter/skywalkingexporter/go.sum index c0025dcd6a2c..244f638a2787 100644 --- a/exporter/skywalkingexporter/go.sum +++ b/exporter/skywalkingexporter/go.sum @@ -192,6 +192,7 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk 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.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= 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= @@ -202,6 +203,7 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -217,6 +219,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -231,6 +235,7 @@ 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/sync v0.0.0-20210220032951-036812b2e83c/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.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -243,16 +248,22 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= 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.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= 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= @@ -266,6 +277,7 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= 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= @@ -289,8 +301,8 @@ google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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= @@ -314,5 +326,5 @@ 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= -skywalking.apache.org/repo/goapi v0.0.0-20231026090926-09378dd56587 h1:TY79I5Y7xRB8q5LQ+MJn7NYsYi0VL5nj1QDrUHwK7cQ= -skywalking.apache.org/repo/goapi v0.0.0-20231026090926-09378dd56587/go.mod h1:onFubXaIoY/2FTRVrLMqCTlaNq4SilAEwF/2G0IcaBw= +skywalking.apache.org/repo/goapi v0.0.0-20231213062226-7849efc09ba3 h1:rqXePgPd1SeNYl4GSHyndwNggpGdOh+9ZMSRCfesgDU= +skywalking.apache.org/repo/goapi v0.0.0-20231213062226-7849efc09ba3/go.mod h1:oD2dxcDAHVIt95Ee7kJHgZ5f64QNhrqTjQYARwfafc4= diff --git a/exporter/skywalkingexporter/internal/metadata/generated_status.go b/exporter/skywalkingexporter/internal/metadata/generated_status.go index 1f86caa24833..5d50300492f4 100644 --- a/exporter/skywalkingexporter/internal/metadata/generated_status.go +++ b/exporter/skywalkingexporter/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -11,3 +13,11 @@ const ( MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/skywalking") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/skywalking") +} diff --git a/exporter/splunkhecexporter/go.mod b/exporter/splunkhecexporter/go.mod index 0dab22fe86f5..d023a163bf3f 100644 --- a/exporter/splunkhecexporter/go.mod +++ b/exporter/splunkhecexporter/go.mod @@ -22,6 +22,8 @@ require ( go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 gopkg.in/yaml.v3 v3.0.1 @@ -91,8 +93,6 @@ require ( go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect diff --git a/exporter/splunkhecexporter/internal/metadata/generated_status.go b/exporter/splunkhecexporter/internal/metadata/generated_status.go index d3e300fe92eb..0e76454b0b83 100644 --- a/exporter/splunkhecexporter/internal/metadata/generated_status.go +++ b/exporter/splunkhecexporter/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/splunkhec") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/splunkhec") +} diff --git a/exporter/sumologicexporter/go.mod b/exporter/sumologicexporter/go.mod index 5e8023ecd67a..10f6d367d55e 100644 --- a/exporter/sumologicexporter/go.mod +++ b/exporter/sumologicexporter/go.mod @@ -9,6 +9,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 ) require ( @@ -48,8 +50,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.19.0 // indirect diff --git a/exporter/sumologicexporter/internal/metadata/generated_status.go b/exporter/sumologicexporter/internal/metadata/generated_status.go index c230f2f43bf5..93028fb0fa89 100644 --- a/exporter/sumologicexporter/internal/metadata/generated_status.go +++ b/exporter/sumologicexporter/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -11,3 +13,11 @@ const ( MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/sumologic") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/sumologic") +} diff --git a/exporter/syslogexporter/go.mod b/exporter/syslogexporter/go.mod index 002f7e379095..288257e8b944 100644 --- a/exporter/syslogexporter/go.mod +++ b/exporter/syslogexporter/go.mod @@ -41,8 +41,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/exporter/syslogexporter/internal/metadata/generated_status.go b/exporter/syslogexporter/internal/metadata/generated_status.go index 7b226c8c8706..eedc10a8c608 100644 --- a/exporter/syslogexporter/internal/metadata/generated_status.go +++ b/exporter/syslogexporter/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "syslog" LogsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/syslog") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/syslog") +} diff --git a/exporter/tanzuobservabilityexporter/go.mod b/exporter/tanzuobservabilityexporter/go.mod index c08598391272..ffa2bbd8fe4b 100644 --- a/exporter/tanzuobservabilityexporter/go.mod +++ b/exporter/tanzuobservabilityexporter/go.mod @@ -15,6 +15,8 @@ require ( go.opentelemetry.io/collector/otelcol v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -96,10 +98,8 @@ require ( go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.44.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/otel/sdk v1.21.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/exporter/tanzuobservabilityexporter/internal/metadata/generated_status.go b/exporter/tanzuobservabilityexporter/internal/metadata/generated_status.go index a5a6b8f99230..16776d5cb790 100644 --- a/exporter/tanzuobservabilityexporter/internal/metadata/generated_status.go +++ b/exporter/tanzuobservabilityexporter/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -11,3 +13,11 @@ const ( TracesStability = component.StabilityLevelDeprecated MetricsStability = component.StabilityLevelDeprecated ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/tanzuobservability") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/tanzuobservability") +} diff --git a/exporter/tencentcloudlogserviceexporter/go.mod b/exporter/tencentcloudlogserviceexporter/go.mod index 9b0e109585b8..d03ef599afa4 100644 --- a/exporter/tencentcloudlogserviceexporter/go.mod +++ b/exporter/tencentcloudlogserviceexporter/go.mod @@ -6,13 +6,15 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 github.com/pierrec/lz4 v2.6.1+incompatible github.com/stretchr/testify v1.8.4 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.816 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.821 go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/config/configopaque v0.91.0 go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 google.golang.org/protobuf v1.31.0 ) @@ -42,8 +44,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/exporter/tencentcloudlogserviceexporter/go.sum b/exporter/tencentcloudlogserviceexporter/go.sum index 43269f9293bd..bf7f7c85809e 100644 --- a/exporter/tencentcloudlogserviceexporter/go.sum +++ b/exporter/tencentcloudlogserviceexporter/go.sum @@ -103,8 +103,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO 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/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.816 h1:hPkFIZPc3PKsiqm6OdS0mSgW7LISfxsR5NrQIsWPiYo= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.816/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.821 h1:WEHm7jX2S+bzFt3IbatdWKTh8oRZF2M5M9h/uymxTHQ= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.821/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= diff --git a/exporter/tencentcloudlogserviceexporter/internal/metadata/generated_status.go b/exporter/tencentcloudlogserviceexporter/internal/metadata/generated_status.go index f6b1e640367d..caf09d25481d 100644 --- a/exporter/tencentcloudlogserviceexporter/internal/metadata/generated_status.go +++ b/exporter/tencentcloudlogserviceexporter/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "tencentcloud_logservice" LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/tencentcloudlogservice") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/tencentcloudlogservice") +} diff --git a/exporter/zipkinexporter/README.md b/exporter/zipkinexporter/README.md index eb48214da361..fb6e02134a26 100644 --- a/exporter/zipkinexporter/README.md +++ b/exporter/zipkinexporter/README.md @@ -4,13 +4,14 @@ | Status | | | ------------- |-----------| | Stability | [beta]: traces | -| Distributions | [core], [contrib], [observiq] | +| Distributions | [core], [contrib], [liatrio], [observiq] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aexporter%2Fzipkin%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aexporter%2Fzipkin) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aexporter%2Fzipkin%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aexporter%2Fzipkin) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@MovieStoreGuy](https://www.github.com/MovieStoreGuy), [@astencel-sumo](https://www.github.com/astencel-sumo), [@crobert-1](https://www.github.com/crobert-1) | [beta]: https://github.com/open-telemetry/opentelemetry-collector#beta [core]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib +[liatrio]: https://github.com/liatrio/liatrio-otel-collector [observiq]: https://github.com/observIQ/observiq-otel-collector diff --git a/exporter/zipkinexporter/config.go b/exporter/zipkinexporter/config.go index 0b9438cb0d12..ea3b8f1f8fdf 100644 --- a/exporter/zipkinexporter/config.go +++ b/exporter/zipkinexporter/config.go @@ -4,6 +4,8 @@ package zipkinexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/zipkinexporter" import ( + "errors" + "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/exporter/exporterhelper" @@ -27,5 +29,8 @@ var _ component.Config = (*Config)(nil) // Validate checks if the exporter configuration is valid func (cfg *Config) Validate() error { + if cfg.HTTPClientSettings.Endpoint == "" { + return errors.New("endpoint required") + } return nil } diff --git a/exporter/zipkinexporter/config_test.go b/exporter/zipkinexporter/config_test.go index fdc56c71184a..3deb988acffa 100644 --- a/exporter/zipkinexporter/config_test.go +++ b/exporter/zipkinexporter/config_test.go @@ -29,6 +29,8 @@ func TestLoadConfig(t *testing.T) { // URL doesn't have a default value so set it directly. defaultCfg := createDefaultConfig().(*Config) defaultCfg.Endpoint = "http://some.location.org:9411/api/v2/spans" + maxIdleConns := 50 + idleConnTimeout := 5 * time.Second tests := []struct { id component.ID @@ -61,6 +63,8 @@ func TestLoadConfig(t *testing.T) { TLSSetting: configtls.TLSClientSetting{ InsecureSkipVerify: true, }, + MaxIdleConns: &maxIdleConns, + IdleConnTimeout: &idleConnTimeout, }, Format: "proto", DefaultServiceName: "test_name", diff --git a/exporter/zipkinexporter/factory.go b/exporter/zipkinexporter/factory.go index 198c400ff2e2..c54a1e2fdc1e 100644 --- a/exporter/zipkinexporter/factory.go +++ b/exporter/zipkinexporter/factory.go @@ -5,7 +5,6 @@ package zipkinexporter // import "github.com/open-telemetry/opentelemetry-collec import ( "context" - "errors" "time" "go.opentelemetry.io/collector/component" @@ -33,14 +32,13 @@ func NewFactory() exporter.Factory { } func createDefaultConfig() component.Config { + defaultClientHTTPSettings := confighttp.NewDefaultHTTPClientSettings() + defaultClientHTTPSettings.Timeout = defaultTimeout + defaultClientHTTPSettings.WriteBufferSize = 512 * 1024 return &Config{ - RetrySettings: exporterhelper.NewDefaultRetrySettings(), - QueueSettings: exporterhelper.NewDefaultQueueSettings(), - HTTPClientSettings: confighttp.HTTPClientSettings{ - Timeout: defaultTimeout, - // We almost read 0 bytes, so no need to tune ReadBufferSize. - WriteBufferSize: 512 * 1024, - }, + RetrySettings: exporterhelper.NewDefaultRetrySettings(), + QueueSettings: exporterhelper.NewDefaultQueueSettings(), + HTTPClientSettings: defaultClientHTTPSettings, Format: defaultFormat, DefaultServiceName: defaultServiceName, } @@ -53,11 +51,6 @@ func createTracesExporter( ) (exporter.Traces, error) { zc := cfg.(*Config) - if zc.Endpoint == "" { - // TODO https://github.com/open-telemetry/opentelemetry-collector/issues/215 - return nil, errors.New("exporter config requires a non-empty 'endpoint'") - } - ze, err := createZipkinExporter(zc, set.TelemetrySettings) if err != nil { return nil, err diff --git a/exporter/zipkinexporter/factory_test.go b/exporter/zipkinexporter/factory_test.go index b20ed9ababe0..808e02eef52d 100644 --- a/exporter/zipkinexporter/factory_test.go +++ b/exporter/zipkinexporter/factory_test.go @@ -21,16 +21,10 @@ func TestCreateDefaultConfig(t *testing.T) { func TestCreateInstanceViaFactory(t *testing.T) { cfg := createDefaultConfig() - // Default config doesn't have default endpoint so creating from it should - // fail. - ze, err := createTracesExporter(context.Background(), exportertest.NewNopCreateSettings(), cfg) - assert.Error(t, err) - assert.Nil(t, ze) - // URL doesn't have a default value so set it directly. zeCfg := cfg.(*Config) zeCfg.Endpoint = "http://some.location.org:9411/api/v2/spans" - ze, err = createTracesExporter(context.Background(), exportertest.NewNopCreateSettings(), cfg) + ze, err := createTracesExporter(context.Background(), exportertest.NewNopCreateSettings(), cfg) assert.NoError(t, err) assert.NotNil(t, ze) } diff --git a/exporter/zipkinexporter/go.mod b/exporter/zipkinexporter/go.mod index b480b21ce192..6cac2514af9e 100644 --- a/exporter/zipkinexporter/go.mod +++ b/exporter/zipkinexporter/go.mod @@ -17,6 +17,8 @@ require ( go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 ) require ( @@ -57,8 +59,6 @@ require ( go.opentelemetry.io/collector/semconv v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.19.0 // indirect diff --git a/exporter/zipkinexporter/internal/metadata/generated_status.go b/exporter/zipkinexporter/internal/metadata/generated_status.go index 7304d293cd3f..5b0e3c11bcd4 100644 --- a/exporter/zipkinexporter/internal/metadata/generated_status.go +++ b/exporter/zipkinexporter/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "zipkin" TracesStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/zipkin") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/zipkin") +} diff --git a/exporter/zipkinexporter/metadata.yaml b/exporter/zipkinexporter/metadata.yaml index cbc06d45c8ca..a08f2e7b720a 100644 --- a/exporter/zipkinexporter/metadata.yaml +++ b/exporter/zipkinexporter/metadata.yaml @@ -4,7 +4,7 @@ status: class: exporter stability: beta: [traces] - distributions: [core, contrib, observiq] + distributions: [core, contrib, observiq, liatrio] codeowners: active: [MovieStoreGuy, astencel-sumo, crobert-1] diff --git a/exporter/zipkinexporter/testdata/config.yaml b/exporter/zipkinexporter/testdata/config.yaml index 0ee2f186907d..33466c2f2298 100644 --- a/exporter/zipkinexporter/testdata/config.yaml +++ b/exporter/zipkinexporter/testdata/config.yaml @@ -4,6 +4,8 @@ zipkin/2: endpoint: "https://somedest:1234/api/v2/spans" format: proto default_service_name: test_name + idle_conn_timeout: 5s + max_idle_conns: 50 sending_queue: enabled: true num_consumers: 2 diff --git a/extension/asapauthextension/go.mod b/extension/asapauthextension/go.mod index 305e0ff6dbe7..15b6c1c26183 100644 --- a/extension/asapauthextension/go.mod +++ b/extension/asapauthextension/go.mod @@ -11,8 +11,10 @@ require ( go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/extension v0.91.0 go.opentelemetry.io/collector/extension/auth v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 - google.golang.org/grpc v1.60.0 + google.golang.org/grpc v1.60.1 ) require ( @@ -34,8 +36,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/pdata v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.14.0 // indirect diff --git a/extension/asapauthextension/go.sum b/extension/asapauthextension/go.sum index ee68db0f0b49..a4db266aea3d 100644 --- a/extension/asapauthextension/go.sum +++ b/extension/asapauthextension/go.sum @@ -111,8 +111,8 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0= google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= diff --git a/extension/asapauthextension/internal/metadata/generated_status.go b/extension/asapauthextension/internal/metadata/generated_status.go index ae4abcd49b64..e08bdeb8f9c4 100644 --- a/extension/asapauthextension/internal/metadata/generated_status.go +++ b/extension/asapauthextension/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "asapclient" ExtensionStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/asapauth") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/asapauth") +} diff --git a/extension/awsproxy/go.mod b/extension/awsproxy/go.mod index 74b945bc9c4d..772ce77dd137 100644 --- a/extension/awsproxy/go.mod +++ b/extension/awsproxy/go.mod @@ -11,11 +11,13 @@ require ( go.opentelemetry.io/collector/config/configtls v0.91.0 go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/extension v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) require ( - github.com/aws/aws-sdk-go v1.49.1 // indirect + github.com/aws/aws-sdk-go v1.49.6 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -34,8 +36,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/pdata v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.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 diff --git a/extension/awsproxy/go.sum b/extension/awsproxy/go.sum index af99224a85e9..5412c2086103 100644 --- a/extension/awsproxy/go.sum +++ b/extension/awsproxy/go.sum @@ -1,5 +1,5 @@ -github.com/aws/aws-sdk-go v1.49.1 h1:Dsamcd8d/nNb3A+bZ0ucfGl0vGZsW5wlRW0vhoYGoeQ= -github.com/aws/aws-sdk-go v1.49.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= +github.com/aws/aws-sdk-go v1.49.6/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= diff --git a/extension/awsproxy/internal/metadata/generated_status.go b/extension/awsproxy/internal/metadata/generated_status.go index 8c305a556020..6433c1a6ae78 100644 --- a/extension/awsproxy/internal/metadata/generated_status.go +++ b/extension/awsproxy/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "awsproxy" ExtensionStability = component.StabilityLevelBeta ) + +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/basicauthextension/README.md b/extension/basicauthextension/README.md index b53d78dc061f..52459eb72290 100644 --- a/extension/basicauthextension/README.md +++ b/extension/basicauthextension/README.md @@ -3,13 +3,14 @@ | Status | | | ------------- |-----------| | Stability | [beta] | -| Distributions | [contrib], [grafana], [observiq], [redhat], [splunk], [sumo] | +| Distributions | [contrib], [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%3Aextension%2Fbasicauth%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aextension%2Fbasicauth) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aextension%2Fbasicauth%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aextension%2Fbasicauth) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@jpkrohling](https://www.github.com/jpkrohling), [@svrakitin](https://www.github.com/svrakitin), [@frzifus](https://www.github.com/frzifus) | [beta]: https://github.com/open-telemetry/opentelemetry-collector#beta [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib [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 [splunk]: https://github.com/signalfx/splunk-otel-collector diff --git a/extension/basicauthextension/go.mod b/extension/basicauthextension/go.mod index 9f0ab31c74ab..cdb1360f6ab5 100644 --- a/extension/basicauthextension/go.mod +++ b/extension/basicauthextension/go.mod @@ -4,14 +4,16 @@ go 1.20 require ( github.com/stretchr/testify v1.8.4 - github.com/tg123/go-htpasswd v1.2.1 + github.com/tg123/go-htpasswd v1.2.2 go.opentelemetry.io/collector v0.91.0 go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/config/configopaque v0.91.0 go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/extension v0.91.0 go.opentelemetry.io/collector/extension/auth v0.91.0 - google.golang.org/grpc v1.60.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 + google.golang.org/grpc v1.60.1 ) require ( @@ -31,11 +33,9 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/pdata v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect - golang.org/x/crypto v0.15.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/extension/basicauthextension/go.sum b/extension/basicauthextension/go.sum index 0004ea290b56..cd281387ed00 100644 --- a/extension/basicauthextension/go.sum +++ b/extension/basicauthextension/go.sum @@ -37,8 +37,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= 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/tg123/go-htpasswd v1.2.1 h1:i4wfsX1KvvkyoMiHZzjS0VzbAPWfxzI8INcZAKtutoU= -github.com/tg123/go-htpasswd v1.2.1/go.mod h1:erHp1B86KXdwQf1X5ZrLb7erXZnWueEQezb2dql4q58= +github.com/tg123/go-htpasswd v1.2.2 h1:tmNccDsQ+wYsoRfiONzIhDm5OkVHQzN3w4FOBAlN6BY= +github.com/tg123/go-htpasswd v1.2.2/go.mod h1:FcIrK0J+6zptgVwK1JDlqyajW/1B4PtuJ/FLWl7nx8A= 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.91.0 h1:C7sGUJDJ5nwm+CkWpAaVP3lNsuYpwSRbkmLncFjkmO8= @@ -74,8 +74,8 @@ 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.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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= @@ -106,8 +106,8 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0= google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= diff --git a/extension/basicauthextension/internal/metadata/generated_status.go b/extension/basicauthextension/internal/metadata/generated_status.go index 5b11a88fbacf..18ba36c75092 100644 --- a/extension/basicauthextension/internal/metadata/generated_status.go +++ b/extension/basicauthextension/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "basicauth" ExtensionStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/basicauth") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/basicauth") +} diff --git a/extension/basicauthextension/metadata.yaml b/extension/basicauthextension/metadata.yaml index 4949c241e720..d3c86bc403b7 100644 --- a/extension/basicauthextension/metadata.yaml +++ b/extension/basicauthextension/metadata.yaml @@ -7,6 +7,7 @@ status: distributions: - contrib - grafana + - liatrio - observiq - redhat - splunk diff --git a/extension/bearertokenauthextension/README.md b/extension/bearertokenauthextension/README.md index 0454851fab9b..9fcf613ce77d 100644 --- a/extension/bearertokenauthextension/README.md +++ b/extension/bearertokenauthextension/README.md @@ -3,7 +3,7 @@ | Status | | | ------------- |-----------| | Stability | [beta] | -| Distributions | [contrib], [grafana], [observiq], [redhat], [sumo] | +| Distributions | [contrib], [grafana], [liatrio], [observiq], [redhat], [sumo] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aextension%2Fbearertokenauth%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aextension%2Fbearertokenauth) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aextension%2Fbearertokenauth%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aextension%2Fbearertokenauth) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@jpkrohling](https://www.github.com/jpkrohling), [@frzifus](https://www.github.com/frzifus) | | Emeritus | [@pavankrish123](https://www.github.com/pavankrish123) | @@ -11,6 +11,7 @@ [beta]: https://github.com/open-telemetry/opentelemetry-collector#beta [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib [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 [sumo]: https://github.com/SumoLogic/sumologic-otel-collector diff --git a/extension/bearertokenauthextension/go.mod b/extension/bearertokenauthextension/go.mod index e1619b68a3d4..2dcc088ef0af 100644 --- a/extension/bearertokenauthextension/go.mod +++ b/extension/bearertokenauthextension/go.mod @@ -10,8 +10,10 @@ require ( go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/extension v0.91.0 go.opentelemetry.io/collector/extension/auth v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 - google.golang.org/grpc v1.60.0 + google.golang.org/grpc v1.60.1 ) require ( @@ -30,8 +32,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/pdata v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.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 diff --git a/extension/bearertokenauthextension/go.sum b/extension/bearertokenauthextension/go.sum index d8fba591f721..b7139c2cce45 100644 --- a/extension/bearertokenauthextension/go.sum +++ b/extension/bearertokenauthextension/go.sum @@ -96,8 +96,8 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0= google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= diff --git a/extension/bearertokenauthextension/internal/metadata/generated_status.go b/extension/bearertokenauthextension/internal/metadata/generated_status.go index 0017ef5c73f8..66d374e7df67 100644 --- a/extension/bearertokenauthextension/internal/metadata/generated_status.go +++ b/extension/bearertokenauthextension/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "bearertokenauth" ExtensionStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/bearertokenauth") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/bearertokenauth") +} diff --git a/extension/bearertokenauthextension/metadata.yaml b/extension/bearertokenauthextension/metadata.yaml index 1d21f125da00..9c3c230ef84e 100644 --- a/extension/bearertokenauthextension/metadata.yaml +++ b/extension/bearertokenauthextension/metadata.yaml @@ -7,6 +7,7 @@ status: distributions: - contrib - grafana + - liatrio - observiq - redhat - sumo diff --git a/extension/encoding/jaegerencodingextension/go.mod b/extension/encoding/jaegerencodingextension/go.mod index ef5282421a26..0e77240ed54b 100644 --- a/extension/encoding/jaegerencodingextension/go.mod +++ b/extension/encoding/jaegerencodingextension/go.mod @@ -10,6 +10,8 @@ require ( go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/extension v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 ) require ( @@ -34,8 +36,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/semconv v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.19.0 // indirect diff --git a/extension/encoding/jaegerencodingextension/internal/metadata/generated_status.go b/extension/encoding/jaegerencodingextension/internal/metadata/generated_status.go index f04bd76b80c4..37d988f4f22f 100644 --- a/extension/encoding/jaegerencodingextension/internal/metadata/generated_status.go +++ b/extension/encoding/jaegerencodingextension/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "jaeger_encoding" ExtensionStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/jaegerencoding") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/jaegerencoding") +} diff --git a/extension/encoding/otlpencodingextension/go.mod b/extension/encoding/otlpencodingextension/go.mod index 681b4ee6bb10..1e3d8d2d01ee 100644 --- a/extension/encoding/otlpencodingextension/go.mod +++ b/extension/encoding/otlpencodingextension/go.mod @@ -8,6 +8,8 @@ require ( go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/extension v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 ) require ( @@ -29,8 +31,6 @@ require ( go.opentelemetry.io/collector/confmap v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/extension/encoding/otlpencodingextension/internal/metadata/generated_status.go b/extension/encoding/otlpencodingextension/internal/metadata/generated_status.go index a0b350bda0c2..dcc396955595 100644 --- a/extension/encoding/otlpencodingextension/internal/metadata/generated_status.go +++ b/extension/encoding/otlpencodingextension/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "otlp_encoding" ExtensionStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/otlpencoding") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/otlpencoding") +} diff --git a/extension/encoding/textencodingextension/go.mod b/extension/encoding/textencodingextension/go.mod index 6e6fe3160040..15a0a7bdda38 100644 --- a/extension/encoding/textencodingextension/go.mod +++ b/extension/encoding/textencodingextension/go.mod @@ -9,6 +9,8 @@ require ( go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/extension v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 ) require ( @@ -30,8 +32,6 @@ require ( go.opentelemetry.io/collector/confmap v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/extension/encoding/textencodingextension/internal/metadata/generated_status.go b/extension/encoding/textencodingextension/internal/metadata/generated_status.go index 5b0c8d846c36..5f6d4fa6ad26 100644 --- a/extension/encoding/textencodingextension/internal/metadata/generated_status.go +++ b/extension/encoding/textencodingextension/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "text_encoding" ExtensionStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/textencoding") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/textencoding") +} diff --git a/extension/encoding/zipkinencodingextension/go.mod b/extension/encoding/zipkinencodingextension/go.mod index 83563d9ebd29..aafb79104720 100644 --- a/extension/encoding/zipkinencodingextension/go.mod +++ b/extension/encoding/zipkinencodingextension/go.mod @@ -9,6 +9,8 @@ require ( go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/extension v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 ) require ( @@ -35,8 +37,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/semconv v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.19.0 // indirect diff --git a/extension/encoding/zipkinencodingextension/internal/metadata/generated_status.go b/extension/encoding/zipkinencodingextension/internal/metadata/generated_status.go index 5c297f34b405..66313c4e7459 100644 --- a/extension/encoding/zipkinencodingextension/internal/metadata/generated_status.go +++ b/extension/encoding/zipkinencodingextension/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "zipkin_encoding" ExtensionStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/zipkinencoding") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/zipkinencoding") +} diff --git a/extension/headerssetterextension/generated_component_test.go b/extension/headerssetterextension/generated_component_test.go new file mode 100644 index 000000000000..36048913dbe1 --- /dev/null +++ b/extension/headerssetterextension/generated_component_test.go @@ -0,0 +1,68 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package headerssetterextension + +import ( + "context" + "testing" + + "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/extension/extensiontest" + + "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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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(), newAssertNoErrorHost(t))) + 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(), newAssertNoErrorHost(t))) + require.NoError(t, secondExt.Shutdown(context.Background())) + }) +} diff --git a/extension/headerssetterextension/go.mod b/extension/headerssetterextension/go.mod index 95685d7fdb3e..be5b0d9d4b79 100644 --- a/extension/headerssetterextension/go.mod +++ b/extension/headerssetterextension/go.mod @@ -9,8 +9,10 @@ require ( go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/extension v0.91.0 go.opentelemetry.io/collector/extension/auth v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 - google.golang.org/grpc v1.60.0 + google.golang.org/grpc v1.60.1 ) require ( @@ -29,8 +31,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/pdata v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/extension/headerssetterextension/go.sum b/extension/headerssetterextension/go.sum index a0b795d65488..13d05ce46634 100644 --- a/extension/headerssetterextension/go.sum +++ b/extension/headerssetterextension/go.sum @@ -98,8 +98,8 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0= google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= diff --git a/extension/headerssetterextension/internal/metadata/generated_status.go b/extension/headerssetterextension/internal/metadata/generated_status.go index 2c4aab24ea27..735e095cc297 100644 --- a/extension/headerssetterextension/internal/metadata/generated_status.go +++ b/extension/headerssetterextension/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "headers_setter" ExtensionStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/headerssetter") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/headerssetter") +} diff --git a/extension/headerssetterextension/metadata.yaml b/extension/headerssetterextension/metadata.yaml index 9382e6c68779..55300683f038 100644 --- a/extension/headerssetterextension/metadata.yaml +++ b/extension/headerssetterextension/metadata.yaml @@ -10,3 +10,5 @@ status: - sumo codeowners: active: [jpkrohling] +tests: + config: diff --git a/extension/healthcheckextension/README.md b/extension/healthcheckextension/README.md index 633f1f57114d..c139f9487b01 100644 --- a/extension/healthcheckextension/README.md +++ b/extension/healthcheckextension/README.md @@ -13,7 +13,7 @@ | Status | | | ------------- |-----------| | Stability | [beta] | -| Distributions | [core], [contrib], [aws], [observiq], [redhat], [splunk], [sumo] | +| Distributions | [core], [contrib], [aws], [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%3Aextension%2Fhealthcheck%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aextension%2Fhealthcheck) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aextension%2Fhealthcheck%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aextension%2Fhealthcheck) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@jpkrohling](https://www.github.com/jpkrohling) | @@ -21,6 +21,7 @@ [core]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib [aws]: https://github.com/aws-observability/aws-otel-collector +[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 [splunk]: https://github.com/signalfx/splunk-otel-collector diff --git a/extension/healthcheckextension/go.mod b/extension/healthcheckextension/go.mod index 90870246b9ba..4f2eba7324ce 100644 --- a/extension/healthcheckextension/go.mod +++ b/extension/healthcheckextension/go.mod @@ -4,6 +4,7 @@ go 1.20 require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.91.0 + github.com/open-telemetry/opentelemetry-collector-contrib/testbed v0.91.0 github.com/stretchr/testify v1.8.4 go.opencensus.io v0.24.0 go.opentelemetry.io/collector/component v0.91.0 @@ -11,48 +12,142 @@ require ( go.opentelemetry.io/collector/config/configtls v0.91.0 go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/extension v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) require ( - github.com/davecgh/go-spew v1.1.1 // indirect + cloud.google.com/go/compute/metadata v0.2.4-0.20230617002413-005d2dfb6b68 // indirect + contrib.go.opencensus.io/exporter/prometheus v0.4.2 // indirect + github.com/apache/thrift v0.19.0 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/cenkalti/backoff/v4 v4.2.1 // indirect + github.com/census-instrumentation/opencensus-proto v0.4.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/expr-lang/expr v1.15.7 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/go-kit/log v0.2.1 // indirect + github.com/go-logfmt/logfmt v0.6.0 // indirect github.com/go-logr/logr v1.3.0 // indirect github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-ole/go-ole v1.2.6 // indirect + github.com/gogo/googleapis v1.4.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/uuid v1.4.0 // indirect + github.com/gorilla/mux v1.8.1 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 // indirect github.com/hashicorp/go-version v1.6.0 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/influxdata/go-syslog/v3 v3.0.1-0.20230911200830-875f5bc594a4 // indirect + github.com/jaegertracing/jaeger v1.52.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.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.0.1 // indirect + github.com/leodido/ragel-machinery v0.0.0-20181214104525-299bdde78165 // indirect + github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect + github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect - github.com/pmezard/go-difflib v1.0.0 // 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/open-telemetry/opentelemetry-collector-contrib/exporter/opencensusexporter v0.91.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/exporter/syslogexporter v0.91.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/exporter/zipkinexporter v0.91.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.91.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.91.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.91.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.91.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.91.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/opencensus v0.91.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.91.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.91.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver v0.91.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver v0.91.0 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.91.0 // indirect + github.com/openzipkin/zipkin-go v0.4.2 // 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.17.0 // indirect + github.com/prometheus/client_model v0.5.0 // indirect + github.com/prometheus/common v0.45.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/statsd_exporter v0.22.7 // indirect github.com/rs/cors v1.10.1 // indirect + github.com/shirou/gopsutil/v3 v3.23.11 // indirect + github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/soheilhy/cmux v0.1.5 // indirect + github.com/spf13/cobra v1.8.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/tklauser/go-sysconf v0.3.12 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect + github.com/yusufpapurcu/wmi v1.2.3 // indirect go.opentelemetry.io/collector v0.91.0 // indirect go.opentelemetry.io/collector/config/configauth v0.91.0 // indirect go.opentelemetry.io/collector/config/configcompression v0.91.0 // indirect + go.opentelemetry.io/collector/config/configgrpc v0.91.0 // indirect + go.opentelemetry.io/collector/config/confignet v0.91.0 // indirect go.opentelemetry.io/collector/config/configopaque v0.91.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/config/internal v0.91.0 // indirect + go.opentelemetry.io/collector/connector v0.91.0 // indirect + go.opentelemetry.io/collector/consumer v0.91.0 // indirect + go.opentelemetry.io/collector/exporter v0.91.0 // indirect + go.opentelemetry.io/collector/exporter/loggingexporter v0.91.0 // indirect + go.opentelemetry.io/collector/exporter/otlpexporter v0.91.0 // indirect + go.opentelemetry.io/collector/exporter/otlphttpexporter v0.91.0 // indirect go.opentelemetry.io/collector/extension/auth v0.91.0 // indirect + go.opentelemetry.io/collector/extension/ballastextension v0.91.0 // indirect + go.opentelemetry.io/collector/extension/zpagesextension v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect + go.opentelemetry.io/collector/otelcol v0.91.0 // indirect go.opentelemetry.io/collector/pdata v1.0.0 // indirect + go.opentelemetry.io/collector/processor v0.91.0 // indirect + go.opentelemetry.io/collector/processor/batchprocessor v0.91.0 // indirect + go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.91.0 // indirect + go.opentelemetry.io/collector/receiver v0.91.0 // indirect + go.opentelemetry.io/collector/receiver/otlpreceiver v0.91.0 // indirect + go.opentelemetry.io/collector/semconv v0.91.0 // indirect + go.opentelemetry.io/collector/service v0.91.0 // indirect + go.opentelemetry.io/contrib/config v0.1.1 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect + go.opentelemetry.io/contrib/propagators/b3 v1.21.1 // indirect + go.opentelemetry.io/contrib/zpages v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect + go.opentelemetry.io/otel/bridge/opencensus v0.44.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.44.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.44.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.21.0 // indirect + go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.44.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.21.0 // indirect + go.opentelemetry.io/otel/sdk v1.21.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.21.0 // indirect + go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect - google.golang.org/grpc v1.59.0 // indirect + gonum.org/v1/gonum v0.14.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 // indirect + google.golang.org/grpc v1.60.1 // indirect google.golang.org/protobuf v1.31.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) @@ -63,3 +158,81 @@ retract ( v0.76.1 v0.65.0 ) + +replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver => ../../receiver/carbonreceiver + +replace github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter => ../../exporter/sapmexporter + +replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver => ../../receiver/opencensusreceiver + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/resourcetotelemetry => ../../pkg/resourcetotelemetry + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/experimentalmetricmetadata => ../../pkg/experimentalmetricmetadata + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus => ../../pkg/translator/prometheus + +replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/splunkhecreceiver => ../../receiver/splunkhecreceiver + +replace github.com/open-telemetry/opentelemetry-collector-contrib/exporter/splunkhecexporter => ../../exporter/splunkhecexporter + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/opencensus => ../../pkg/translator/opencensus + +replace github.com/open-telemetry/opentelemetry-collector-contrib/testbed => ../../testbed + +replace github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter => ../../exporter/prometheusexporter + +replace github.com/open-telemetry/opentelemetry-collector-contrib/exporter/opencensusexporter => ../../exporter/opencensusexporter + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/signalfx => ../../pkg/translator/signalfx + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchperresourceattr => ../../pkg/batchperresourceattr + +replace github.com/open-telemetry/opentelemetry-collector-contrib/testbed/mockdatasenders/mockdatadogagentexporter => ../../testbed/mockdatasenders/mockdatadogagentexporter + +replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/signalfxreceiver => ../../receiver/signalfxreceiver + +replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/syslogreceiver => ../../receiver/syslogreceiver + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza => ../../pkg/stanza + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent => ../../internal/sharedcomponent + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk => ../../internal/splunk + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../storage + +replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal => ../../internal/coreinternal + +replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/sapmreceiver => ../../receiver/sapmreceiver + +replace github.com/open-telemetry/opentelemetry-collector-contrib/exporter/signalfxexporter => ../../exporter/signalfxexporter + +replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver => ../../receiver/zipkinreceiver + +replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver => ../../receiver/jaegerreceiver + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger => ../../pkg/translator/jaeger + +replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/datadogreceiver => ../../receiver/datadogreceiver + +replace github.com/open-telemetry/opentelemetry-collector-contrib/exporter/carbonexporter => ../../exporter/carbonexporter + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheusremotewrite => ../../pkg/translator/prometheusremotewrite + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil => ../../pkg/pdatautil + +replace github.com/open-telemetry/opentelemetry-collector-contrib/exporter/syslogexporter => ../../exporter/syslogexporter + +replace github.com/open-telemetry/opentelemetry-collector-contrib/testbed/mockdatareceivers/mockawsxrayreceiver => ../../testbed/mockdatareceivers/mockawsxrayreceiver + +replace github.com/open-telemetry/opentelemetry-collector-contrib/exporter/zipkinexporter => ../../exporter/zipkinexporter + +replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver => ../../receiver/prometheusreceiver + +replace github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusremotewriteexporter => ../../exporter/prometheusremotewriteexporter + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin => ../../pkg/translator/zipkin + +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/extension/healthcheckextension/go.sum b/extension/healthcheckextension/go.sum index 198819526f8e..52483c0cb000 100644 --- a/extension/healthcheckextension/go.sum +++ b/extension/healthcheckextension/go.sum @@ -1,56 +1,213 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0 h1:Dg9iHVQfrhq82rUNu9ZxUDrJLaxFUe/HlCVaLyRruq8= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk= +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= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +contrib.go.opencensus.io/exporter/prometheus v0.4.2 h1:sqfsYl5GIY/L570iT+l93ehxaWJs2/OwXtiWwew3oAg= +contrib.go.opencensus.io/exporter/prometheus v0.4.2/go.mod h1:dvEHbiKmgvbr5pjaF9fpw1KeYcjrnC1J8B+JKjsZyRQ= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= 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/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= +github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= +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/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= +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/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g= +github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +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/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= 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/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/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/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/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= +github.com/expr-lang/expr v1.15.7 h1:BK0JcWUkoW6nrbLBo6xCKhz4BvH5DSOOu1Gx5lucyZo= +github.com/expr-lang/expr v1.15.7/go.mod h1:uCkhfG+x7fcZ5A5sXHKuQ07jGZRl6J0FCAaf2k4PtVQ= 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-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.13.0 h1:OoneCcHKHQ03LfBpoQCUfCluwd2Vt3ohz+kvbJneZAU= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= +github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= +github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= github.com/go-logr/logr v1.3.0/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-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= +github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= 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-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 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/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= 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.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= 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/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 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.4.1/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.1/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.4/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.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +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/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +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/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= +github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 h1:6UKoz5ujsI55KNpsJH3UwCq3T8kKbZwNZBNPuTTje8U= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1/go.mod h1:YvJ2f6MplWDhfxiUC3KpyTy76kYUZA4W3pTv/wdKQ9Y= 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 v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +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.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/jaegertracing/jaeger v1.52.0 h1:cNrp6WlcNbOY3zUdhG3Le4BOUUYSqekkMj12qHhVUB4= +github.com/jaegertracing/jaeger v1.52.0/go.mod h1:jLC2AtimHE86nJYzOOd9Qxg8PULaE1OblN+DVr9Z+Gc= +github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +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.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= @@ -61,32 +218,144 @@ github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPgh github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= github.com/knadh/koanf/v2 v2.0.1 h1:1dYGITt1I23x8cfx8ZnldtezdyaZtfAuRtIFOiRzK7g= github.com/knadh/koanf/v2 v2.0.1/go.mod h1:ZeiIlIDXTE7w1lMT6UVcNiRAS2/rCeLn/GdLNvY1Dus= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/leodido/ragel-machinery v0.0.0-20181214104525-299bdde78165 h1:bCiVCRCs1Heq84lurVinUPy19keqGEe4jh5vtK37jcg= +github.com/leodido/ragel-machinery v0.0.0-20181214104525-299bdde78165/go.mod h1:WZxr2/6a/Ar9bMDc2rN/LJrE/hF6bXE4LPyDSIxwAfg= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= +github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c h1:VtwQ41oftZwlMnOEbMWQtSEUgU64U4s+GHk7hZK+jtY= +github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +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/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.20220423185008-bf980b35cac4 h1:BpfhmLKZf+SjVanKKhCgf3bg+511DmU9eDQTen7LLbY= github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4/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 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +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/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/openzipkin/zipkin-go v0.4.2 h1:zjqfqHjUpPmB3c1GlCvvgsM1G4LkvqQbBDueDOCg/jA= +github.com/openzipkin/zipkin-go v0.4.2/go.mod h1:ZeVkFjuuBiSy13y8vpSDCjMi9GoI3hPpCJSBx/EYFhY= +github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c h1:NRoLoZvkBTKvR5gQLgA3e0hqjkY9u1wm+iOL45VN/qI= +github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +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.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= +github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= +github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/prometheus/client_model v0.2.0/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.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +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.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.35.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= +github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= +github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= +github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/statsd_exporter v0.22.7 h1:7Pji/i2GuhK6Lu7DHrtTkFmNBCudCPT1pX2CziuyQR0= +github.com/prometheus/statsd_exporter v0.22.7/go.mod h1:N/TevpjkIh9ccs6nuzY3jQn9dFqnUakOjnEuMPJJJnI= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/sagikazarmark/locafero v0.3.0 h1:zT7VEGWC2DTflmccN/5T1etyKvxSxpHsjb9cJvm4SvQ= +github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= +github.com/shirou/gopsutil/v3 v3.23.11 h1:i3jP9NjCPUz7FiZKxlMnODZkdSIp2gnzfrvsu9CuWEQ= +github.com/shirou/gopsutil/v3 v3.23.11/go.mod h1:1FrWgea594Jp7qmjHUUPlJDTPgcsb9mGnXDxavtikzM= +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/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/soheilhy/cmux v0.1.5 h1:jjzc5WVemNEDTLwv9tlmemhC73tI08BNOIGwBOo10Js= +github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= +github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= +github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY= +github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/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.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.6.1/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/stvp/go-udp-testing v0.0.0-20201019212854-469649b16807/go.mod h1:7jxmlfBCDBXRzr0eAQJ48XC1hBu1np4CS5+cHEYfwpc= +github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= +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.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/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= +github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= +github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +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= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= 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.91.0 h1:C7sGUJDJ5nwm+CkWpAaVP3lNsuYpwSRbkmLncFjkmO8= @@ -97,8 +366,12 @@ go.opentelemetry.io/collector/config/configauth v0.91.0 h1:SjWKimuqlpfS3sIlFpfzd go.opentelemetry.io/collector/config/configauth v0.91.0/go.mod h1:wmmMYqv6PxwY+/h7qqvd/LP0XN/wzXoECDu6PYz2Of0= go.opentelemetry.io/collector/config/configcompression v0.91.0 h1:v+jEpFhLgfJDCUCPsSF03gjoFEvm77PofTCqHKKgXTs= go.opentelemetry.io/collector/config/configcompression v0.91.0/go.mod h1:LaavoxZsro5lL7qh1g9DMifG0qixWPEecW18Qr8bpag= +go.opentelemetry.io/collector/config/configgrpc v0.91.0 h1:+2zPmgVOhKgelluGaGwE3OMKqwi56i6OiU0+7xWTetM= +go.opentelemetry.io/collector/config/configgrpc v0.91.0/go.mod h1:iWDbg9vYaayewmbKfM2zEk4YvaOOwrs0eiUffypcZFk= go.opentelemetry.io/collector/config/confighttp v0.91.0 h1:YAOyXcDaLDnF3UqPHH4kYU8lx8BqXJ7hS3Ou8GcmqpQ= go.opentelemetry.io/collector/config/confighttp v0.91.0/go.mod h1:R6y8KSJzqDe6CE6JsYwt4CTZ2B4AlqRA+V74OJPX3vE= +go.opentelemetry.io/collector/config/confignet v0.91.0 h1:3huNXh04O3wXaN4qPhmmiefyz4dYbOlNcR/OKMByqig= +go.opentelemetry.io/collector/config/confignet v0.91.0/go.mod h1:cpO8JYWGONaViOygKVw+Hd2UoBcn2cUiyi0WWeFTwJY= go.opentelemetry.io/collector/config/configopaque v0.91.0 h1:bQgJPyARbuXAsU2p6h2YbEm1kHb1stS6hg42ekyMZmI= go.opentelemetry.io/collector/config/configopaque v0.91.0/go.mod h1:TPCHaU+QXiEV+JXbgyr6mSErTI9chwQyasDVMdJr3eY= go.opentelemetry.io/collector/config/configtelemetry v0.91.0 h1:mEwvqrYfwUJ7LwYfpcF9M8z7LHFoYaKhEPhnERD/88E= @@ -109,90 +382,373 @@ go.opentelemetry.io/collector/config/internal v0.91.0 h1:Yx17oFdXOPnY83Jfe1oiXhv go.opentelemetry.io/collector/config/internal v0.91.0/go.mod h1:42VsQ/1kP2qnvzjNi+dfNP+KyCFRADejyrJ8m2GVL3M= go.opentelemetry.io/collector/confmap v0.91.0 h1:7U2MT+u74oEzq/WWrpXSLKB7nX5jPNC4drwtQdYfwKk= go.opentelemetry.io/collector/confmap v0.91.0/go.mod h1:uxV+fZ85kG31oovL6Cl3fAMQ3RRPwUvfAbbA9WT1Yhk= +go.opentelemetry.io/collector/connector v0.91.0 h1:p2YsgBtr26guCib99ExQHtGuNmX+awgmH1Mbz23wYGU= +go.opentelemetry.io/collector/connector v0.91.0/go.mod h1:dG34jAOATtXFdqzp8IxZJsFwFLaUIkYK69WT1WQ03ZY= go.opentelemetry.io/collector/consumer v0.91.0 h1:0nU1lUe2S0b8iOmF3w3R/9Dt24n413thRTbXz/nJgrM= +go.opentelemetry.io/collector/consumer v0.91.0/go.mod h1:phTUQmr7hpYfwXyDXo4mFHVjYrlSbZE+nZYlKlbVxGs= +go.opentelemetry.io/collector/exporter v0.91.0 h1:guWcGflFjaenp3BMxAmAKjb8RQG80jQQKjuUFouS+z8= +go.opentelemetry.io/collector/exporter v0.91.0/go.mod h1:hkOBunNNWu6CaTtkRsCJ/OJ509REJZg+DDElevFIQCQ= +go.opentelemetry.io/collector/exporter/loggingexporter v0.91.0 h1:mwKepKvfGciI6n/jLBYYH4bkbAVTr9RsNfzB3x66bCQ= +go.opentelemetry.io/collector/exporter/loggingexporter v0.91.0/go.mod h1:7UTIR8N+Aw/8lT6mJWLqtbum8Yu/ZFznUq6fdNtPxxM= +go.opentelemetry.io/collector/exporter/otlpexporter v0.91.0 h1:PEVJgEZIUMQ/M2/aQ9uuEfjptW4t0bmm91LeeNpa8mc= +go.opentelemetry.io/collector/exporter/otlpexporter v0.91.0/go.mod h1:ebWRIZhk6zere5QnvUpPHjfTvbapscwI6QfCial/X0Y= +go.opentelemetry.io/collector/exporter/otlphttpexporter v0.91.0 h1:rjRSdUn4hmEtupjFjzp6z59dOgx2tH8dyYXyTSEheJY= +go.opentelemetry.io/collector/exporter/otlphttpexporter v0.91.0/go.mod h1:bETucYAkbcUjsNQSZ1ulwD7amKZWiWXAkWV1zCR2Bts= go.opentelemetry.io/collector/extension v0.91.0 h1:bkoSLgnWm4g6n+RLmyKG6Up7dr8KmJy68quonoLZnr0= go.opentelemetry.io/collector/extension v0.91.0/go.mod h1:F3r0fVTTh4sYR0GVv51Qez8lk8v77kTDPdyMOp6A2kg= go.opentelemetry.io/collector/extension/auth v0.91.0 h1:28Hv5W0GZgv2jR5IiFdJzutTs91KmXFh8DUfVTjwwmI= go.opentelemetry.io/collector/extension/auth v0.91.0/go.mod h1:diY6Sw7cOAn2qivKipZk4niBFzCCFBj7swAXiG2h9ro= +go.opentelemetry.io/collector/extension/ballastextension v0.91.0 h1:/Ihh4FXFQH3LiDcQc28I5vqRzy8FMDMifRUQ4Tr15lc= +go.opentelemetry.io/collector/extension/ballastextension v0.91.0/go.mod h1:D37HFnuhMtrCINliIoz2KzWid1wQQjEacT8CSIF3KwY= +go.opentelemetry.io/collector/extension/zpagesextension v0.91.0 h1:d787uZ6cNHN1uaJ3pIgFlcrkHVB4ML6AlXBiCQRJ9t0= +go.opentelemetry.io/collector/extension/zpagesextension v0.91.0/go.mod h1:S1T9YKuxRqCKFENC+GuEZhz0fzuUBACOrScNY13Y96w= go.opentelemetry.io/collector/featuregate v1.0.0 h1:5MGqe2v5zxaoo73BUOvUTunftX5J8RGrbFsC2Ha7N3g= go.opentelemetry.io/collector/featuregate v1.0.0/go.mod h1:xGbRuw+GbutRtVVSEy3YR2yuOlEyiUMhN2M9DJljgqY= +go.opentelemetry.io/collector/otelcol v0.91.0 h1:gq/PY/tHgkTr2fuMLp+F+NAm+03iiU+j/Eilvx38p5w= +go.opentelemetry.io/collector/otelcol v0.91.0/go.mod h1:9j8gKdZvuEgZoeUhz5f5D/fwCxx7M7Tg+6D207/KjNs= go.opentelemetry.io/collector/pdata v1.0.0 h1:ECP2jnLztewsHmL1opL8BeMtWVc7/oSlKNhfY9jP8ec= go.opentelemetry.io/collector/pdata v1.0.0/go.mod h1:TsDFgs4JLNG7t6x9D8kGswXUz4mme+MyNChHx8zSF6k= +go.opentelemetry.io/collector/processor v0.91.0 h1:Xi52gYMXTG4zYmNhsqJ8ly/9f7b0n0crMhKxVVI9HpY= +go.opentelemetry.io/collector/processor v0.91.0/go.mod h1:naTuusZNfzM5MSqoTVzkKbR1MaJ8oD8v5ginR5JreDE= +go.opentelemetry.io/collector/processor/batchprocessor v0.91.0 h1:YuPG52D7otNr4lNd8KGsIIBHvawAAaOqGoNTK9799ko= +go.opentelemetry.io/collector/processor/batchprocessor v0.91.0/go.mod h1:U2ZVSMwgr4OsaKKMfvX9OGaurG83zAPKjVdpTgmj0ok= +go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.91.0 h1:7QVCd9NzpC0DMDeX5ZNhcUOS8qO5sRM1Cj8h5na3a4Y= +go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.91.0/go.mod h1:O1hcC0DZv5ak3eWML2NphwdLl5PESVeHN6QIi5j2bwU= +go.opentelemetry.io/collector/receiver v0.91.0 h1:0TZF/0OXoJtxgm+mvOinRRXo9LgVyOsOgCQfWkNGXJA= +go.opentelemetry.io/collector/receiver v0.91.0/go.mod h1:d5qo2mpovqKoi47hrMxj5BLdLzOXM0mUHL5CKrjfWNM= +go.opentelemetry.io/collector/receiver/otlpreceiver v0.91.0 h1:1Eyc1uR8yr3heKkC4YXFoZip0JqgOXuOiN/tXvl9WUo= +go.opentelemetry.io/collector/receiver/otlpreceiver v0.91.0/go.mod h1:7am8EW0xmHLxeeGIb0xTcsoVc6+1LfNCGdc+b7OvE8k= +go.opentelemetry.io/collector/semconv v0.91.0 h1:TRd+yDDfKQl+aNtS24wmEbJp1/QE/xAFV9SB5zWGxpE= +go.opentelemetry.io/collector/semconv v0.91.0/go.mod h1:j/8THcqVxFna1FpvA2zYIsUperEtOaRaqoLYIN4doWw= +go.opentelemetry.io/collector/service v0.91.0 h1:AQS6YAiZO6V+ohcMX4upfyp/Ydi6y862yQEbFt8t+fQ= +go.opentelemetry.io/collector/service v0.91.0/go.mod h1:8Pf8mPo3YqcTNwOzXa0Ok/o+g2+d8hSCaGxRqR/c6CY= +go.opentelemetry.io/contrib/config v0.1.1 h1:lIUTrMWkfDE0GvzBLhwv6ATDB1vntrnTsRvUMkZKnfQ= +go.opentelemetry.io/contrib/config v0.1.1/go.mod h1:rDrK4+PS6Cs+WIphU/GO5Sk4TGV36lEQqk/Z1vZkaLI= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 h1:SpGay3w+nEwMpfVnbqOLH5gY52/foP8RE8UzTZ1pdSE= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1/go.mod h1:4UoMYEZOC0yN/sPGH76KPkkU7zgiEWYWL9vwmbnTJPE= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 h1:aFJWCqJMNjENlcleuuOkGAPH82y0yULBScfXcIEdS24= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1/go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo= +go.opentelemetry.io/contrib/propagators/b3 v1.21.1 h1:WPYiUgmw3+b7b3sQ1bFBFAf0q+Di9dvNc3AtYfnT4RQ= +go.opentelemetry.io/contrib/propagators/b3 v1.21.1/go.mod h1:EmzokPoSqsYMBVK4nRnhsfm5mbn8J1eDuz/U1UaQaWg= +go.opentelemetry.io/contrib/zpages v0.46.1 h1:U8Hh84dc+vJTVgRnL+QKWtWD2iqTSKibrQ85EeQqsNg= +go.opentelemetry.io/contrib/zpages v0.46.1/go.mod h1:1Wq9YTzkhr3Jkyi/sVrasFSppVzJQcvFf2Vc2ExZd6c= go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= +go.opentelemetry.io/otel/bridge/opencensus v0.44.0 h1:/inELPJztkn6Xx3ap9qw8i8XdeWF0B/OjGHOdRTePZ8= +go.opentelemetry.io/otel/bridge/opencensus v0.44.0/go.mod h1:dQTBJVBx1xahrXEFBV1BGPAnGuXC92LCj55fxIrtj7I= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.44.0 h1:jd0+5t/YynESZqsSyPz+7PAFdEop0dlN0+PkyHYo8oI= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.44.0/go.mod h1:U707O40ee1FpQGyhvqnzmCJm1Wh6OX6GGBVn0E6Uyyk= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.44.0 h1:bflGWrfYyuulcdxf14V6n9+CoQcu5SAAdHmDPAJnlps= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.44.0/go.mod h1:qcTO4xHAxZLaLxPd60TdE88rxtItPHgHWqOhOGRr0as= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 h1:cl5P5/GIfFh4t6xyruOgJP5QiA1pw4fYYdv6nc6CBWw= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0/go.mod h1:zgBdWWAu7oEEMC06MMKc5NLbA/1YDXV1sMpSqEeLQLg= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 h1:tIqheXEFWAZ7O8A7m+J0aPTmpJN3YQ7qetUAdkkkKpk= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0/go.mod h1:nUeKExfxAQVbiVFn32YXpXZZHZ61Cc3s3Rn1pDBGAb0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.21.0 h1:digkEZCJWobwBqMwC0cwCq8/wkkRy/OowZg5OArWZrM= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.21.0/go.mod h1:/OpE/y70qVkndM0TrxT4KBoN3RsFZP0QaofcfYrj76I= +go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 h1:TnhkxGJ5qPHAMIMI4r+HPT/BbpoHxqn4xONJrok054o= +go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2/go.mod h1:ERL2uIeBtg4TxZdojHUwzZfIFlUIjZtxubT5p4h1Gjg= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.44.0 h1:dEZWPjVN22urgYCza3PXRUGEyCB++y1sAqm6guWFesk= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.44.0/go.mod h1:sTt30Evb7hJB/gEk27qLb1+l9n4Tb8HvHkR0Wx3S6CU= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.21.0 h1:VhlEQAPp9R1ktYfrPk5SOryw1e9LDDTZCbIPFrho0ec= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.21.0/go.mod h1:kB3ufRbfU+CQ4MlUcqtW8Z7YEOBeK2DJ6CmR5rYYF3E= go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= +go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= +go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= +go.opentelemetry.io/otel/sdk/metric v1.21.0 h1:smhI5oD714d6jHE6Tie36fPx4WDFIg+Y6RfAY4ICcR0= +go.opentelemetry.io/otel/sdk/metric v1.21.0/go.mod h1:FJ8RAsoPGv/wYMgBdUJXOm+6pzFY3YdljnXtv1SBE8Q= go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= -go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= +go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= +go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= +go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= 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-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= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 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/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= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= 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-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 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-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/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-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/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-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 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-20201202161906-c7110b5ffcbb/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-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= +golang.org/x/oauth2 v0.14.0 h1:P0Vrf/2538nmC0H+pEQ3MNFRRnVR7RlqyVw+bvm26z0= 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-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/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-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/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-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/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-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/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-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/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-20220708085239-5a0f0661e09d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/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.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.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.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +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.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 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-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= 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= +gonum.org/v1/gonum v0.14.0 h1:2NiG67LD1tEH0D7kM+ps2V+fXmsAnpUeec7n8tcr4S0= +gonum.org/v1/gonum v0.14.0/go.mod h1:AoWeoz0becf9QMWtE8iWXNXc27fK4fNeHNf/oMejGfU= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f h1:Vn+VyHU5guc9KjB5KrjI2q0wCOWEOIh0OEsleqakHJg= +google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1:JpwMPBpFN3uKhdaekDpiNlImDdkUAyiJ6ez/uxGaUSo= +google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 h1:DC7wcm+i+P1rN3Ff07vL+OndGg5OhNddHyTA+ocPqYE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4/go.mod h1:eJVxU6o+4G1PSczBr85xmyvSNYAKvAYgkub40YGomFM= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= 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.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= -google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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= @@ -201,15 +757,38 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi 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.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= 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.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/extension/healthcheckextension/healthcheckextension.go b/extension/healthcheckextension/healthcheckextension.go index b3c0634bec97..df8c40ece692 100644 --- a/extension/healthcheckextension/healthcheckextension.go +++ b/extension/healthcheckextension/healthcheckextension.go @@ -54,7 +54,7 @@ func (hc *healthCheckExtension) Start(_ context.Context, host component.Host) er // The listener ownership goes to the server. if err = hc.server.Serve(ln); !errors.Is(err, http.ErrServerClosed) && err != nil { - host.ReportFatalError(err) + _ = hc.settings.ReportComponentStatus(component.NewFatalErrorEvent(err)) } }() } else { diff --git a/extension/healthcheckextension/integration_test.go b/extension/healthcheckextension/integration_test.go new file mode 100644 index 000000000000..76c96022d995 --- /dev/null +++ b/extension/healthcheckextension/integration_test.go @@ -0,0 +1,50 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package healthcheckextension + +import ( + "bytes" + "context" + "fmt" + "io" + "net/http" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/extension/extensiontest" + + "github.com/open-telemetry/opentelemetry-collector-contrib/testbed/testbed" +) + +func Test_SimpleHealthCheck(t *testing.T) { + f := NewFactory() + port := testbed.GetAvailablePort(t) + cfg := f.CreateDefaultConfig().(*Config) + cfg.Endpoint = fmt.Sprintf("localhost:%d", port) + e, err := f.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + err = e.Start(context.Background(), componenttest.NewNopHost()) + require.NoError(t, err) + t.Cleanup(func() { + require.NoError(t, e.Shutdown(context.Background())) + }) + resp, err := http.DefaultClient.Get(fmt.Sprintf("http://localhost:%d/", port)) + require.NoError(t, err) + assert.Equal(t, "503 Service Unavailable", resp.Status) + var buf bytes.Buffer + _, err = io.Copy(&buf, resp.Body) + require.NoError(t, err) + assert.Equal(t, `{"status":"Server not available","upSince":"0001-01-01T00:00:00Z","uptime":""}`, buf.String()) + err = e.(*healthCheckExtension).Ready() + require.NoError(t, err) + resp, err = http.DefaultClient.Get(fmt.Sprintf("http://localhost:%d/", port)) + require.NoError(t, err) + assert.Equal(t, "200 OK", resp.Status) + buf.Reset() + _, err = io.Copy(&buf, resp.Body) + require.NoError(t, err) + assert.Contains(t, buf.String(), `{"status":"Server available","upSince":"`) +} diff --git a/extension/healthcheckextension/internal/metadata/generated_status.go b/extension/healthcheckextension/internal/metadata/generated_status.go index ea6c8c94e349..6c3782ef60fd 100644 --- a/extension/healthcheckextension/internal/metadata/generated_status.go +++ b/extension/healthcheckextension/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "health_check" ExtensionStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/healthcheck") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/healthcheck") +} diff --git a/extension/healthcheckextension/metadata.yaml b/extension/healthcheckextension/metadata.yaml index b92081833048..799aca0fbcad 100644 --- a/extension/healthcheckextension/metadata.yaml +++ b/extension/healthcheckextension/metadata.yaml @@ -4,6 +4,6 @@ status: class: extension stability: beta: [extension] - distributions: [core, contrib, splunk, observiq, sumo, aws, redhat] + distributions: [core, contrib, splunk, observiq, sumo, aws, redhat, liatrio] codeowners: active: [jpkrohling] diff --git a/extension/httpforwarder/go.mod b/extension/httpforwarder/go.mod index 1ae0f793f89b..55a4a70b012f 100644 --- a/extension/httpforwarder/go.mod +++ b/extension/httpforwarder/go.mod @@ -11,6 +11,8 @@ require ( go.opentelemetry.io/collector/config/configtls v0.91.0 go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/extension v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -43,8 +45,6 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/extension/httpforwarder/internal/metadata/generated_status.go b/extension/httpforwarder/internal/metadata/generated_status.go index 652f394f99f8..3432bfd95132 100644 --- a/extension/httpforwarder/internal/metadata/generated_status.go +++ b/extension/httpforwarder/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "http_forwarder" ExtensionStability = component.StabilityLevelBeta ) + +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/jaegerremotesampling/go.mod b/extension/jaegerremotesampling/go.mod index e3ed1c833f6a..5cedafd6699a 100644 --- a/extension/jaegerremotesampling/go.mod +++ b/extension/jaegerremotesampling/go.mod @@ -16,8 +16,10 @@ require ( go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/extension v0.91.0 go.opentelemetry.io/collector/featuregate v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 - google.golang.org/grpc v1.60.0 + google.golang.org/grpc v1.60.1 ) require ( @@ -63,8 +65,6 @@ require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect golang.org/x/net v0.19.0 // indirect diff --git a/extension/jaegerremotesampling/go.sum b/extension/jaegerremotesampling/go.sum index 7d118769ac3c..f4763254d986 100644 --- a/extension/jaegerremotesampling/go.sum +++ b/extension/jaegerremotesampling/go.sum @@ -584,8 +584,8 @@ google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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= diff --git a/extension/jaegerremotesampling/internal/http.go b/extension/jaegerremotesampling/internal/http.go index 9f848d0106d5..bdb8e6356936 100644 --- a/extension/jaegerremotesampling/internal/http.go +++ b/extension/jaegerremotesampling/internal/http.go @@ -72,7 +72,7 @@ func (h *SamplingHTTPServer) Start(_ context.Context, host component.Host) error defer h.shutdownWG.Done() if err := h.srv.Serve(hln); err != nil && !errors.Is(err, http.ErrServerClosed) { - host.ReportFatalError(err) + _ = h.telemetry.ReportComponentStatus(component.NewFatalErrorEvent(err)) } }() diff --git a/extension/jaegerremotesampling/internal/metadata/generated_status.go b/extension/jaegerremotesampling/internal/metadata/generated_status.go index 7a0b3224ccbc..0d7d1103a074 100644 --- a/extension/jaegerremotesampling/internal/metadata/generated_status.go +++ b/extension/jaegerremotesampling/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "jaegerremotesampling" ExtensionStability = component.StabilityLevelAlpha ) + +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/oauth2clientauthextension/go.mod b/extension/oauth2clientauthextension/go.mod index bca7d757855d..ec11a9398f74 100644 --- a/extension/oauth2clientauthextension/go.mod +++ b/extension/oauth2clientauthextension/go.mod @@ -11,10 +11,12 @@ require ( go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/extension v0.91.0 go.opentelemetry.io/collector/extension/auth v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 golang.org/x/oauth2 v0.15.0 - google.golang.org/grpc v1.60.0 + google.golang.org/grpc v1.60.1 ) require ( @@ -47,8 +49,6 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/extension/oauth2clientauthextension/go.sum b/extension/oauth2clientauthextension/go.sum index 51863eee519c..4352699edefe 100644 --- a/extension/oauth2clientauthextension/go.sum +++ b/extension/oauth2clientauthextension/go.sum @@ -149,8 +149,8 @@ google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAs google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0= google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= diff --git a/extension/oauth2clientauthextension/internal/metadata/generated_status.go b/extension/oauth2clientauthextension/internal/metadata/generated_status.go index 47de0aaab60f..131f64f8b661 100644 --- a/extension/oauth2clientauthextension/internal/metadata/generated_status.go +++ b/extension/oauth2clientauthextension/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "oauth2client" ExtensionStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/oauth2clientauth") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/oauth2clientauth") +} diff --git a/extension/observer/dockerobserver/go.mod b/extension/observer/dockerobserver/go.mod index 636393bf8894..1e1a3eeec14b 100644 --- a/extension/observer/dockerobserver/go.mod +++ b/extension/observer/dockerobserver/go.mod @@ -13,6 +13,8 @@ require ( go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/extension v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -63,8 +65,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/pdata v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/goleak v1.3.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea // indirect diff --git a/extension/observer/dockerobserver/internal/metadata/generated_status.go b/extension/observer/dockerobserver/internal/metadata/generated_status.go index 37cb96c3ff7b..cae5dd01f61d 100644 --- a/extension/observer/dockerobserver/internal/metadata/generated_status.go +++ b/extension/observer/dockerobserver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "docker_observer" ExtensionStability = component.StabilityLevelBeta ) + +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/observer/ecsobserver/extension.go b/extension/observer/ecsobserver/extension.go index b3f832544f84..02db6fff56cc 100644 --- a/extension/observer/ecsobserver/extension.go +++ b/extension/observer/ecsobserver/extension.go @@ -15,31 +15,31 @@ var _ extension.Extension = (*ecsObserver)(nil) // ecsObserver implements component.ServiceExtension interface. type ecsObserver struct { - logger *zap.Logger - sd *serviceDiscovery + telemetrySettings component.TelemetrySettings + sd *serviceDiscovery // for Shutdown cancel func() } // Start runs the service discovery in background -func (e *ecsObserver) Start(_ context.Context, host component.Host) error { - e.logger.Info("Starting ECSDiscovery") +func (e *ecsObserver) Start(_ context.Context, _ component.Host) error { + e.telemetrySettings.Logger.Info("Starting ECSDiscovery") // Ignore the ctx parameter as it is not for long running operation ctx, cancel := context.WithCancel(context.Background()) e.cancel = cancel go func() { if err := e.sd.runAndWriteFile(ctx); err != nil { - e.logger.Error("ECSDiscovery stopped by error", zap.Error(err)) + e.telemetrySettings.Logger.Error("ECSDiscovery stopped by error", zap.Error(err)) // Stop the collector - host.ReportFatalError(err) + _ = e.telemetrySettings.ReportComponentStatus(component.NewFatalErrorEvent(err)) } }() return nil } func (e *ecsObserver) Shutdown(_ context.Context) error { - e.logger.Info("Stopping ECSDiscovery") + e.telemetrySettings.Logger.Info("Stopping ECSDiscovery") e.cancel() return nil } diff --git a/extension/observer/ecsobserver/extension_test.go b/extension/observer/ecsobserver/extension_test.go index 28b69ea3b628..72db6137f30b 100644 --- a/extension/observer/ecsobserver/extension_test.go +++ b/extension/observer/ecsobserver/extension_test.go @@ -97,12 +97,23 @@ func TestExtensionStartStop(t *testing.T) { t.Run("critical error", func(t *testing.T) { c := ecsmock.NewClusterWithName("different than default config") - ext := createTestExt(c, "testdata/ut_ext_critical_error.actual.yaml") - host := newInspectErrorHost() - require.NoError(t, ext.Start(context.TODO(), host)) - time.Sleep(waitDuration) - err := host.(*inspectErrorHost).getError() - require.Error(t, err) - require.Error(t, hasCriticalError(zap.NewExample(), err)) + f := newTestTaskFetcher(t, c) + cfg := createDefaultConfig() + sdCfg := cfg.(*Config) + sdCfg.RefreshInterval = 100 * time.Millisecond + sdCfg.ResultFile = "testdata/ut_ext_critical_error.actual.yaml" + cs := extensiontest.NewNopCreateSettings() + statusEventChan := make(chan *component.StatusEvent) + cs.TelemetrySettings.ReportComponentStatus = func(e *component.StatusEvent) error { + statusEventChan <- e + return nil + } + ext, err := createExtensionWithFetcher(cs, sdCfg, f) + require.NoError(t, err) + err = ext.Start(context.Background(), componenttest.NewNopHost()) + require.NoError(t, err) + e := <-statusEventChan + require.Error(t, e.Err()) + require.Error(t, hasCriticalError(zap.NewExample(), e.Err())) }) } diff --git a/extension/observer/ecsobserver/factory.go b/extension/observer/ecsobserver/factory.go index 7e444f7c3c82..615136d0f6f8 100644 --- a/extension/observer/ecsobserver/factory.go +++ b/extension/observer/ecsobserver/factory.go @@ -44,7 +44,7 @@ func createExtensionWithFetcher(params extension.CreateSettings, sdCfg *Config, return nil, err } return &ecsObserver{ - logger: params.Logger, - sd: sd, + telemetrySettings: params.TelemetrySettings, + sd: sd, }, nil } diff --git a/extension/observer/ecsobserver/go.mod b/extension/observer/ecsobserver/go.mod index b4e53c2fffe5..9b9522fe88f3 100644 --- a/extension/observer/ecsobserver/go.mod +++ b/extension/observer/ecsobserver/go.mod @@ -3,12 +3,14 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/extension/obser go 1.20 require ( - github.com/aws/aws-sdk-go v1.49.1 + github.com/aws/aws-sdk-go v1.49.6 github.com/hashicorp/golang-lru v1.0.2 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/extension v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 gopkg.in/yaml.v2 v2.4.0 @@ -31,8 +33,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/pdata v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.14.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/extension/observer/ecsobserver/go.sum b/extension/observer/ecsobserver/go.sum index 04cef70064a8..ff45a15f1633 100644 --- a/extension/observer/ecsobserver/go.sum +++ b/extension/observer/ecsobserver/go.sum @@ -1,5 +1,5 @@ -github.com/aws/aws-sdk-go v1.49.1 h1:Dsamcd8d/nNb3A+bZ0ucfGl0vGZsW5wlRW0vhoYGoeQ= -github.com/aws/aws-sdk-go v1.49.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= +github.com/aws/aws-sdk-go v1.49.6/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= diff --git a/extension/observer/ecsobserver/internal/metadata/generated_status.go b/extension/observer/ecsobserver/internal/metadata/generated_status.go index 6379aea62869..1b625e1518d8 100644 --- a/extension/observer/ecsobserver/internal/metadata/generated_status.go +++ b/extension/observer/ecsobserver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "ecs_observer" ExtensionStability = component.StabilityLevelBeta ) + +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/observer/ecstaskobserver/go.mod b/extension/observer/ecstaskobserver/go.mod index b7b3f3f1ec45..841eb3449a83 100644 --- a/extension/observer/ecstaskobserver/go.mod +++ b/extension/observer/ecstaskobserver/go.mod @@ -11,6 +11,8 @@ require ( go.opentelemetry.io/collector/config/confighttp v0.91.0 go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/extension v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -45,8 +47,6 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/extension/observer/ecstaskobserver/internal/metadata/generated_status.go b/extension/observer/ecstaskobserver/internal/metadata/generated_status.go index 809117881999..f974af534ae0 100644 --- a/extension/observer/ecstaskobserver/internal/metadata/generated_status.go +++ b/extension/observer/ecstaskobserver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "ecs_task_observer" ExtensionStability = component.StabilityLevelBeta ) + +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/observer/hostobserver/go.mod b/extension/observer/hostobserver/go.mod index 4ca3c2d5dcc2..d245d3735042 100644 --- a/extension/observer/hostobserver/go.mod +++ b/extension/observer/hostobserver/go.mod @@ -9,6 +9,8 @@ require ( go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/extension v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -35,8 +37,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/pdata v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/extension/observer/hostobserver/internal/metadata/generated_status.go b/extension/observer/hostobserver/internal/metadata/generated_status.go index 0a782df70f39..3ee2f0a00785 100644 --- a/extension/observer/hostobserver/internal/metadata/generated_status.go +++ b/extension/observer/hostobserver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "host_observer" ExtensionStability = component.StabilityLevelBeta ) + +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/observer/k8sobserver/go.mod b/extension/observer/k8sobserver/go.mod index 93ffa994cc5a..ccd3d86e9a36 100644 --- a/extension/observer/k8sobserver/go.mod +++ b/extension/observer/k8sobserver/go.mod @@ -9,6 +9,8 @@ require ( go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/extension v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 k8s.io/api v0.28.4 k8s.io/apimachinery v0.28.4 @@ -50,8 +52,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/pdata v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/oauth2 v0.14.0 // indirect diff --git a/extension/observer/k8sobserver/internal/metadata/generated_status.go b/extension/observer/k8sobserver/internal/metadata/generated_status.go index 43b785971030..16bedcf3b84d 100644 --- a/extension/observer/k8sobserver/internal/metadata/generated_status.go +++ b/extension/observer/k8sobserver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "k8s_observer" ExtensionStability = component.StabilityLevelAlpha ) + +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/oidcauthextension/go.mod b/extension/oidcauthextension/go.mod index f10b54ca7757..c8f5695d3184 100644 --- a/extension/oidcauthextension/go.mod +++ b/extension/oidcauthextension/go.mod @@ -9,6 +9,8 @@ require ( go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/extension v0.91.0 go.opentelemetry.io/collector/extension/auth v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -30,10 +32,8 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/pdata v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.15.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/oauth2 v0.14.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/extension/oidcauthextension/go.sum b/extension/oidcauthextension/go.sum index c3a6777d1269..fcf1e900e622 100644 --- a/extension/oidcauthextension/go.sum +++ b/extension/oidcauthextension/go.sum @@ -76,8 +76,8 @@ 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.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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= diff --git a/extension/oidcauthextension/internal/metadata/generated_status.go b/extension/oidcauthextension/internal/metadata/generated_status.go index 066f76118d5a..1de474710847 100644 --- a/extension/oidcauthextension/internal/metadata/generated_status.go +++ b/extension/oidcauthextension/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "oidc" ExtensionStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/oidcauth") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/oidcauth") +} diff --git a/extension/opampextension/go.mod b/extension/opampextension/go.mod index a880ddcfab12..500381d6a02a 100644 --- a/extension/opampextension/go.mod +++ b/extension/opampextension/go.mod @@ -14,6 +14,8 @@ require ( go.opentelemetry.io/collector/extension v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -36,8 +38,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/goleak v1.3.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/extension/opampextension/internal/metadata/generated_status.go b/extension/opampextension/internal/metadata/generated_status.go index cf21386a85ea..e77772cbb7cf 100644 --- a/extension/opampextension/internal/metadata/generated_status.go +++ b/extension/opampextension/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "opamp" ExtensionStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/opamp") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/opamp") +} diff --git a/extension/pprofextension/README.md b/extension/pprofextension/README.md index 2f7a4a061a3c..d1e60b7cd80d 100644 --- a/extension/pprofextension/README.md +++ b/extension/pprofextension/README.md @@ -4,7 +4,7 @@ | Status | | | ------------- |-----------| | Stability | [beta] | -| Distributions | [core], [contrib], [aws], [observiq], [redhat], [splunk], [sumo] | +| Distributions | [core], [contrib], [aws], [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%3Aextension%2Fpprof%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aextension%2Fpprof) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aextension%2Fpprof%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aextension%2Fpprof) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@MovieStoreGuy](https://www.github.com/MovieStoreGuy) | @@ -12,6 +12,7 @@ [core]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib [aws]: https://github.com/aws-observability/aws-otel-collector +[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 [splunk]: https://github.com/signalfx/splunk-otel-collector diff --git a/extension/pprofextension/go.mod b/extension/pprofextension/go.mod index 75dd7bc0b83e..9ba53e199c7f 100644 --- a/extension/pprofextension/go.mod +++ b/extension/pprofextension/go.mod @@ -9,6 +9,8 @@ require ( go.opentelemetry.io/collector/config/confignet v0.91.0 go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/extension v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -28,8 +30,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/pdata v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.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 diff --git a/extension/pprofextension/internal/metadata/generated_status.go b/extension/pprofextension/internal/metadata/generated_status.go index 2eee7f5e63dc..e46176baca68 100644 --- a/extension/pprofextension/internal/metadata/generated_status.go +++ b/extension/pprofextension/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "pprof" ExtensionStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/pprof") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/pprof") +} diff --git a/extension/pprofextension/metadata.yaml b/extension/pprofextension/metadata.yaml index e96abd2d0738..3694bbd99618 100644 --- a/extension/pprofextension/metadata.yaml +++ b/extension/pprofextension/metadata.yaml @@ -4,6 +4,6 @@ status: class: extension stability: beta: [extension] - distributions: [core, contrib, splunk, observiq, sumo, aws, redhat] + distributions: [core, contrib, splunk, observiq, sumo, aws, redhat, liatrio] codeowners: active: [MovieStoreGuy] diff --git a/extension/remotetapextension/go.mod b/extension/remotetapextension/go.mod index 125f5a3ec603..12c156855e0f 100644 --- a/extension/remotetapextension/go.mod +++ b/extension/remotetapextension/go.mod @@ -6,6 +6,8 @@ require ( go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/config/confighttp v0.91.0 go.opentelemetry.io/collector/extension v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 ) require ( @@ -38,8 +40,6 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.19.0 // indirect diff --git a/extension/remotetapextension/internal/metadata/generated_status.go b/extension/remotetapextension/internal/metadata/generated_status.go index 28b063c935ab..b1c23d73c7d3 100644 --- a/extension/remotetapextension/internal/metadata/generated_status.go +++ b/extension/remotetapextension/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "remotetap" ExtensionStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/remotetap") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/remotetap") +} diff --git a/extension/sigv4authextension/README.md b/extension/sigv4authextension/README.md index f4b5fc979e26..7c7723d92c42 100644 --- a/extension/sigv4authextension/README.md +++ b/extension/sigv4authextension/README.md @@ -3,7 +3,7 @@ | Status | | | ------------- |-----------| | Stability | [beta] | -| Distributions | [contrib], [aws], [grafana], [sumo] | +| Distributions | [contrib], [aws], [grafana], [liatrio], [sumo] | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aextension%2Fsigv4auth%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aextension%2Fsigv4auth) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aextension%2Fsigv4auth%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aextension%2Fsigv4auth) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@Aneurysm9](https://www.github.com/Aneurysm9), [@erichsueh3](https://www.github.com/erichsueh3) | @@ -11,6 +11,7 @@ [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 [sumo]: https://github.com/SumoLogic/sumologic-otel-collector diff --git a/extension/sigv4authextension/go.mod b/extension/sigv4authextension/go.mod index 41e94e389e5b..ee9b8104e1e8 100644 --- a/extension/sigv4authextension/go.mod +++ b/extension/sigv4authextension/go.mod @@ -12,8 +12,10 @@ require ( go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/extension v0.91.0 go.opentelemetry.io/collector/extension/auth v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 - google.golang.org/grpc v1.60.0 + google.golang.org/grpc v1.60.1 ) require ( @@ -41,8 +43,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/pdata v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.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 diff --git a/extension/sigv4authextension/go.sum b/extension/sigv4authextension/go.sum index 3eaa9e2dec02..954f3e5bfc10 100644 --- a/extension/sigv4authextension/go.sum +++ b/extension/sigv4authextension/go.sum @@ -118,8 +118,8 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0= google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97/go.mod h1:v7nGkzlmW8P3n/bKmWBn2WpBjpOEx8Q6gMueudAmKfY= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= diff --git a/extension/sigv4authextension/internal/metadata/generated_status.go b/extension/sigv4authextension/internal/metadata/generated_status.go index dc66d270b99e..7c9413ae0959 100644 --- a/extension/sigv4authextension/internal/metadata/generated_status.go +++ b/extension/sigv4authextension/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "sigv4auth" ExtensionStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/sigv4auth") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/sigv4auth") +} diff --git a/extension/sigv4authextension/metadata.yaml b/extension/sigv4authextension/metadata.yaml index e96cc55e7afc..b65c4819c64b 100644 --- a/extension/sigv4authextension/metadata.yaml +++ b/extension/sigv4authextension/metadata.yaml @@ -9,5 +9,6 @@ status: - aws - grafana - sumo + - liatrio codeowners: active: [Aneurysm9, erichsueh3] diff --git a/extension/storage/dbstorage/internal/metadata/generated_status.go b/extension/storage/dbstorage/internal/metadata/generated_status.go index 057cd7cd31a2..0aa21eec2fb2 100644 --- a/extension/storage/dbstorage/internal/metadata/generated_status.go +++ b/extension/storage/dbstorage/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "db_storage" ExtensionStability = component.StabilityLevelAlpha ) + +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/storage/filestorage/internal/metadata/generated_status.go b/extension/storage/filestorage/internal/metadata/generated_status.go index 90881ccc1de1..2d1aafeea932 100644 --- a/extension/storage/filestorage/internal/metadata/generated_status.go +++ b/extension/storage/filestorage/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "file_storage" ExtensionStability = component.StabilityLevelBeta ) + +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/storage/go.mod b/extension/storage/go.mod index 3affee7b965a..c250f9a9a63f 100644 --- a/extension/storage/go.mod +++ b/extension/storage/go.mod @@ -4,13 +4,15 @@ go 1.20 require ( github.com/jackc/pgx/v4 v4.18.1 - github.com/mattn/go-sqlite3 v1.14.18 + github.com/mattn/go-sqlite3 v1.14.19 github.com/stretchr/testify v1.8.4 go.etcd.io/bbolt v1.3.8 go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/extension v0.91.0 go.opentelemetry.io/collector/featuregate v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -36,12 +38,10 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/pdata v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.15.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/net v0.18.0 // indirect - golang.org/x/sys v0.14.0 // indirect + golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect google.golang.org/grpc v1.59.0 // indirect diff --git a/extension/storage/go.sum b/extension/storage/go.sum index 5a3c4997e569..f7de491e4059 100644 --- a/extension/storage/go.sum +++ b/extension/storage/go.sum @@ -100,8 +100,8 @@ github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-sqlite3 v1.14.18 h1:JL0eqdCOq6DJVNPSvArO/bIV9/P7fbGrV00LZHc+5aI= -github.com/mattn/go-sqlite3 v1.14.18/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= +github.com/mattn/go-sqlite3 v1.14.19 h1:fhGleo2h1p8tVChob4I9HpmVFIAkKGpiukdrgQbWfGI= +github.com/mattn/go-sqlite3 v1.14.19/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= 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.20220423185008-bf980b35cac4 h1:BpfhmLKZf+SjVanKKhCgf3bg+511DmU9eDQTen7LLbY= @@ -189,8 +189,8 @@ golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= @@ -228,8 +228,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= diff --git a/go.mod b/go.mod index 5b8b1dbbf764..4769c745689e 100644 --- a/go.mod +++ b/go.mod @@ -199,7 +199,7 @@ require ( cloud.google.com/go/longrunning v0.5.4 // indirect cloud.google.com/go/monitoring v1.16.3 // indirect cloud.google.com/go/pubsub v1.33.0 // indirect - cloud.google.com/go/spanner v1.53.1 // indirect + cloud.google.com/go/spanner v1.54.0 // indirect cloud.google.com/go/trace v1.10.4 // indirect code.cloudfoundry.org/clock v1.0.0 // indirect code.cloudfoundry.org/go-diodes v0.0.0-20211115184647-b584dd5df32c // indirect @@ -221,7 +221,7 @@ 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/network/armnetwork/v2 v2.2.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 // indirect - github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.1 // indirect github.com/Azure/azure-storage-queue-go v0.0.0-20230531184854-c06a8eff66fe // indirect github.com/Azure/go-amqp v1.0.2 // indirect github.com/Azure/go-autorest v14.2.0+incompatible // indirect @@ -236,25 +236,25 @@ require ( github.com/AzureAD/microsoft-authentication-library-for-go v1.2.0 // indirect github.com/ClickHouse/ch-go v0.58.2 // indirect github.com/ClickHouse/clickhouse-go/v2 v2.16.0 // indirect - github.com/DataDog/agent-payload/v5 v5.0.101 // indirect - github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/trace v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0-rc.7 // indirect + github.com/DataDog/agent-payload/v5 v5.0.102 // indirect + github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/proto v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/trace v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0 // indirect github.com/DataDog/datadog-api-client-go/v2 v2.20.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-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.9.0 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.9.0 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.9.0 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.9.0 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.9.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.10.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.10.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.10.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.10.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.10.0 // indirect github.com/DataDog/sketches-go v1.4.3 // indirect github.com/DataDog/zstd v1.5.2 // indirect github.com/GehirnInc/crypt v0.0.0-20200316065508-bb7000b8a962 // indirect @@ -268,7 +268,7 @@ require ( github.com/Masterminds/semver/v3 v3.2.0 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/ReneKroon/ttlcache/v2 v2.11.0 // indirect - github.com/SAP/go-hdb v1.6.5 // indirect + github.com/SAP/go-hdb v1.6.6 // indirect github.com/SermoDigital/jose v0.9.2-0.20180104203859-803625baeddc // indirect github.com/Showmax/go-fqdn v1.0.0 // indirect github.com/aerospike/aerospike-client-go/v6 v6.13.0 // indirect @@ -282,7 +282,7 @@ 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.49.1 // indirect + github.com/aws/aws-sdk-go v1.49.6 // indirect github.com/aws/aws-sdk-go-v2 v1.24.0 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4 // indirect github.com/aws/aws-sdk-go-v2/config v1.26.1 // indirect @@ -412,7 +412,7 @@ require ( github.com/hashicorp/cronexpr v1.1.2 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-hclog v1.5.0 // indirect + github.com/hashicorp/go-hclog v1.6.2 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-retryablehttp v0.7.4 // indirect @@ -420,6 +420,7 @@ require ( github.com/hashicorp/go-uuid v1.0.3 // indirect github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/nomad/api v0.0.0-20230721134942-515895c7690c // indirect github.com/hashicorp/serf v0.10.1 // indirect @@ -476,7 +477,7 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-ieproxy v0.0.11 // indirect github.com/mattn/go-isatty v0.0.19 // indirect - github.com/mattn/go-sqlite3 v1.14.18 // indirect + github.com/mattn/go-sqlite3 v1.14.19 // indirect github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/microsoft/ApplicationInsights-Go v0.4.4 // indirect github.com/miekg/dns v1.1.56 // indirect @@ -569,7 +570,7 @@ require ( github.com/prometheus/prometheus v0.48.1 // indirect github.com/prometheus/statsd_exporter v0.22.7 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/redis/go-redis/v9 v9.3.0 // indirect + github.com/redis/go-redis/v9 v9.3.1 // indirect github.com/relvacode/iso8601 v1.3.0 // indirect github.com/rs/cors v1.10.1 // indirect github.com/sagikazarmark/locafero v0.3.0 // indirect @@ -584,7 +585,7 @@ require ( github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/shopspring/decimal v1.3.1 // indirect github.com/signalfx/com_signalfx_metrics_protobuf v0.0.3 // indirect - github.com/signalfx/sapm-proto v0.13.0 // indirect + github.com/signalfx/sapm-proto v0.14.0 // indirect github.com/sijms/go-ora/v2 v2.7.26 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/snowflakedb/gosnowflake v1.7.1 // indirect @@ -600,8 +601,8 @@ require ( github.com/stretchr/testify v1.8.4 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.816 // indirect - github.com/tg123/go-htpasswd v1.2.1 // indirect + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.821 // indirect + github.com/tg123/go-htpasswd v1.2.2 // indirect github.com/tidwall/gjson v1.14.3 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.0 // indirect @@ -615,7 +616,7 @@ require ( github.com/vishvananda/netlink v1.2.1-beta.2 // indirect github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f // indirect github.com/vmware/go-vmware-nsxt v0.0.0-20230223012718-d31b8a1ca05e // indirect - github.com/vmware/govmomi v0.34.0 // indirect + github.com/vmware/govmomi v0.34.1 // indirect github.com/vultr/govultr/v2 v2.17.2 // indirect github.com/wavefronthq/wavefront-sdk-go v0.15.0 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect @@ -670,8 +671,8 @@ require ( 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.16.0 // indirect - golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect + golang.org/x/crypto v0.17.0 // indirect + golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/oauth2 v0.15.0 // indirect @@ -679,16 +680,16 @@ require ( golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/time v0.4.0 // indirect + golang.org/x/time v0.5.0 // indirect golang.org/x/tools v0.16.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect gonum.org/v1/gonum v0.14.0 // indirect - google.golang.org/api v0.151.0 // indirect + google.golang.org/api v0.154.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect - google.golang.org/grpc v1.60.0 // indirect + google.golang.org/grpc v1.60.1 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect @@ -702,15 +703,15 @@ require ( k8s.io/apimachinery v0.28.4 // indirect k8s.io/client-go v0.28.4 // indirect k8s.io/klog v1.0.0 // indirect - k8s.io/klog/v2 v2.100.1 // indirect + k8s.io/klog/v2 v2.110.1 // indirect k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect k8s.io/kubelet v0.28.4 // indirect - k8s.io/utils v0.0.0-20230711102312-30195339c3c7 // indirect + k8s.io/utils v0.0.0-20231127182322-b307cd553661 // indirect sigs.k8s.io/controller-runtime v0.16.3 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect sigs.k8s.io/yaml v1.3.0 // indirect - skywalking.apache.org/repo/goapi v0.0.0-20231026090926-09378dd56587 // indirect + skywalking.apache.org/repo/goapi v0.0.0-20231213062226-7849efc09ba3 // indirect ) // Replace references to modules that are in this repository with their relateive paths @@ -1158,3 +1159,11 @@ replace ( github.com/open-telemetry/opentelemetry-collector-contrib/connector/servicegraphconnector => ./connector/servicegraphconnector github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector => ./connector/spanmetricsconnector ) + +replace github.com/open-telemetry/opentelemetry-collector-contrib/testbed/mockdatareceivers/mockawsxrayreceiver => ./testbed/mockdatareceivers/mockawsxrayreceiver + +replace github.com/open-telemetry/opentelemetry-collector-contrib/testbed/mockdatasenders/mockdatadogagentexporter => ./testbed/mockdatasenders/mockdatadogagentexporter + +replace github.com/open-telemetry/opentelemetry-collector-contrib/testbed => ./testbed + +replace github.com/open-telemetry/opentelemetry-collector-contrib/exporter/syslogexporter => ./exporter/syslogexporter diff --git a/go.sum b/go.sum index dbca2c750c4b..849257fde941 100644 --- a/go.sum +++ b/go.sum @@ -51,8 +51,8 @@ cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIA cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= cloud.google.com/go/pubsub v1.33.0 h1:6SPCPvWav64tj0sVX/+npCBKhUi/UjJehy9op/V3p2g= cloud.google.com/go/pubsub v1.33.0/go.mod h1:f+w71I33OMyxf9VpMVcZbnG5KSUkCOUHYpFd5U1GdRc= -cloud.google.com/go/spanner v1.53.1 h1:xNmE0SXMSxNBuk7lRZ5G/S+A49X91zkSTt7Jn5Ptlvw= -cloud.google.com/go/spanner v1.53.1/go.mod h1:liG4iCeLqm5L3fFLU5whFITqP0e0orsAW1uUSrd4rws= +cloud.google.com/go/spanner v1.54.0 h1:ttU+lhARPF/iZE3OkCpmfsemCz9mLaqBhGPd3Qub2sQ= +cloud.google.com/go/spanner v1.54.0/go.mod h1:wZvSQVBgngF0Gq86fKup6KIYmN2be7uOKjtK97X+bQU= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= @@ -113,9 +113,9 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2 v2.2 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2 v2.2.1/go.mod h1:Bzf34hhAE9NSxailk8xVeLEZbUjOXcC+GnU1mMKdhLw= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 h1:Dd+RhdJn0OTtVGaeDLZpcumkIVCtA/3/Fo42+eoYvVM= 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.2.0 h1:Ma67P/GGprNwsslzEH6+Kb8nybI8jpDTm4Wmzu2ReK8= -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/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0 h1:AifHbc4mg0x9zW52WOpKbsHaDKuRhlI7TVl47thgQ70= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.1 h1:AMf7YbZOZIW5b66cXNHMWWT/zkjhz5+a+k/3x40EO7E= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.1/go.mod h1:uwfk06ZBcvL/g4VHNjurPfVln9NMbsk2XIZxJ+hu81k= github.com/Azure/azure-storage-queue-go v0.0.0-20230531184854-c06a8eff66fe h1:HGuouUM1533rBXmMtR7qh5pYNSSjUZG90b/MgJAnb/A= github.com/Azure/azure-storage-queue-go v0.0.0-20230531184854-c06a8eff66fe/go.mod h1:K6am8mT+5iFXgingS9LUc7TmbsW6XBw3nxaRyaMyWc8= github.com/Azure/go-amqp v1.0.2 h1:zHCHId+kKC7fO8IkwyZJnWMvtRXhYC0VJtD0GYkHc6M= @@ -159,24 +159,24 @@ github.com/ClickHouse/ch-go v0.58.2/go.mod h1:Ap/0bEmiLa14gYjCiRkYGbXvbe8vwdrfTY github.com/ClickHouse/clickhouse-go/v2 v2.16.0 h1:rhMfnPewXPnY4Q4lQRGdYuTLRBRKJEIEYHtbUMrzmvI= github.com/ClickHouse/clickhouse-go/v2 v2.16.0/go.mod h1:J7SPfIxwR+x4mQ+o8MLSe0oY50NNntEqCIjFe/T1VPM= github.com/DATA-DOG/go-sqlmock v1.5.1 h1:FK6RCIUSfmbnI/imIICmboyQBkOckutaa6R5YYlLZyo= -github.com/DataDog/agent-payload/v5 v5.0.101 h1:/MjtenucwoRzv1cafv46fcvserECivPKEWDsemT2Grg= -github.com/DataDog/agent-payload/v5 v5.0.101/go.mod h1:COngtbYYCncpIPiE5D93QlXDH/3VAKk10jDNwGHcMRE= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0-rc.7 h1:ULN8UQqgtmEgWvOEIDzWgxLZ3TEZJ9MXBUpVGE8PPBc= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0-rc.7/go.mod h1:A4nLJvxlg6BO/8/zg81til9yT0uRPuXDFMAzDMpmgn4= -github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7 h1:qJuxmeIiXZNML5/Y9KEf7QKEKKIeliiTIxgRGvGAQBc= -github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7/go.mod h1:HvK26YCxg6MfYvPJgpHC7nSjw6DTpNhd75Wlb0GAvis= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0-rc.7 h1:pQh4uZnc9mQbGMJ1R8C88GlseqmdFIKftDZLrQW71Ss= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0-rc.7/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= -github.com/DataDog/datadog-agent/pkg/trace v0.50.0-rc.7 h1:qWKAINgUtyuJQOCcthjPST8PzigPP8Pr0EtHdTgJVoA= -github.com/DataDog/datadog-agent/pkg/trace v0.50.0-rc.7/go.mod h1:i6OrrkHDlgCB4vUaPfM4FxVij2QdA/t07Ykwu74ySGA= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0-rc.7 h1:J7ocZItHWrUEvGWVqFa7wsghotcF53oFn1qH7Tlh7VM= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0-rc.7/go.mod h1:b0I5L9Eegsq3kca9pQCAVt1rQHI05sza7LVHKGzC+ms= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.0-rc.7 h1:vBo+iVlLpjrvJkX88mbFDtWFy0F6tEi865p+N4RTf7A= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.0-rc.7/go.mod h1:/fGZteE4rr3iz6y30a0A3MuebJ6Jckx+AiKcyYgT87k= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0-rc.7 h1:eM+GcYjk4sSik8tFgf8zNT1KViZZM4F4I580SZnTs7s= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0-rc.7/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0-rc.7 h1:QByjh+uLdnYjqIjdYP9XyEgObD9o8ydL4jBy4sEPlbU= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0-rc.7/go.mod h1:EOGgNrSPskIxY3+KgCl+yEggMjrGqrA2oL5va+/p2jM= +github.com/DataDog/agent-payload/v5 v5.0.102 h1:X8EZQeOewahQ7N/arllAP7hCGHNScdThnGjPg5/ErN8= +github.com/DataDog/agent-payload/v5 v5.0.102/go.mod h1:COngtbYYCncpIPiE5D93QlXDH/3VAKk10jDNwGHcMRE= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0 h1:WOyRfsLPYO24Z6Q+s1jcjoOFYJUJ4PgiNaGz/qJCba0= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0/go.mod h1:A4nLJvxlg6BO/8/zg81til9yT0uRPuXDFMAzDMpmgn4= +github.com/DataDog/datadog-agent/pkg/proto v0.50.0 h1:FAzs/Hofs9CN7jYYd2P4l8/igdcDPc7q9amIXSje/3A= +github.com/DataDog/datadog-agent/pkg/proto v0.50.0/go.mod h1:HvK26YCxg6MfYvPJgpHC7nSjw6DTpNhd75Wlb0GAvis= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0 h1:/V/WtjIQCDNJpRVJ/wSfmUakLhBhxJ7joqwM7DXc9hI= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= +github.com/DataDog/datadog-agent/pkg/trace v0.50.0 h1:gZt7YTwtptMNYUN/Z5QHnabOz0ILHvSKC0jpTqqiXBo= +github.com/DataDog/datadog-agent/pkg/trace v0.50.0/go.mod h1:fV11a6fzBAbzgF8ie5Bk51rvLS5kMcsXjwaCzPAfsrk= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0 h1:jSAW27LAnpdZGEe8B0FzSbVT8YdmvPGxV/l8SDUKzYY= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0/go.mod h1:QO56TX/gJf9yZ8q+ix0EEjck6kJu+oirAvJPk8xpFa0= +github.com/DataDog/datadog-agent/pkg/util/log v0.50.0 h1:qIqqLKov9yjoHuoOK//a49vFiBZyduswcJz7jwgKuuo= +github.com/DataDog/datadog-agent/pkg/util/log v0.50.0/go.mod h1:byH8to7LKxTK5m7jf1n222QMeL55iiVszk+OA7Qxfao= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0 h1:MXYW7B+OamUkSBGVsLkPQt7bjQhO52Q6qym3VluB8IM= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0 h1:0QrqgObZkmv2Fcr10CN+pONfIeoul5loof3t20B1AAA= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0/go.mod h1:EOGgNrSPskIxY3+KgCl+yEggMjrGqrA2oL5va+/p2jM= github.com/DataDog/datadog-api-client-go/v2 v2.20.0 h1:80T+UuTh+28qODc2vw+HxzMoIu0dYBT7/RCHXxdYpJE= github.com/DataDog/datadog-api-client-go/v2 v2.20.0/go.mod h1:oD5Lx8Li3oPRa/BSBenkn4i48z+91gwYORF/+6ph71g= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= @@ -188,17 +188,17 @@ github.com/DataDog/go-tuf v1.0.2-0.5.2 h1:EeZr937eKAWPxJ26IykAdWA4A0jQXJgkhUjqEI 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.9.0 h1:y8rL7rCty4VhPFJi6TgOZXI7MrGRVYNV0oqbNblWi/c= -github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.9.0/go.mod h1:x+QjxvvVxewuyNymMjR+2fm0LAQSMF2mhw7Yhx61jp4= -github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.9.0 h1:oT5B12H+tLtAEEH0YqgmppofM/yRBzyI9+ykS9OQvIs= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.9.0 h1:Y+CllChr2yfE2RLd+c5hvK56DDGVEdDrhAl1OyzuuwU= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.9.0/go.mod h1:naFq9h+fQpgI7AKJ+YkWlAAYDU8/FB8LyfA39bmRNHs= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.9.0 h1:FbqbNsZ3179TUV+y932rKhhTxHMS5adlBb+9om1heGY= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.9.0/go.mod h1:v0FMEai3NccZjZr2jmX4t8Nobh3R8KxoRuj6PExoTRo= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.9.0 h1:WsCPJS+a34kw1gj46WpJjQBHrLVwh1ubCdHUx9nf1ec= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.9.0/go.mod h1:m61Tq6DA2U+PjNTX6WD3TH2U7QnA49+7IGaYK4bu7fQ= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.9.0 h1:U93rYuk3ChT/I+2r36JI8agi1AwdH8vRiHh+bCSXZeU= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.9.0/go.mod h1:KOzWHRj2AcJPmP1hm4WQUfzEIYRBP4NaTX9Iu+D3UNs= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.10.0 h1:kiPtYAgzvlOc6HV0qwS8xNeA39cYyAJs6q9dIRDpCFk= +github.com/DataDog/opentelemetry-mapping-go/pkg/inframetadata v0.10.0/go.mod h1:MV/L0ESKjLGGE4JPDIDtz6H5u+9w0UKp1Wsw2lLREII= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.10.0 h1:O2PYvgTQA+31NuepzQqLexEpUX8FWsdNgq+0241OtH0= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.10.0 h1:56vp8vflG6lmhTO+YldUBTe0cIjStOC1neW1dIHYm5s= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.10.0/go.mod h1:naFq9h+fQpgI7AKJ+YkWlAAYDU8/FB8LyfA39bmRNHs= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.10.0 h1:+LxQNTpRM57lfcbGV7s+PVQ2B2Pegabfpf3yGJUXcgM= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/logs v0.10.0/go.mod h1:WYm0DRBxBrKrmZrwoAJhcyJ7bGAFZbVQFcrrwwaGozU= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.10.0 h1:XwGT7/2NnO1RGxS5WD4BTsLWqO+z8234XBccUGhP8tM= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.10.0/go.mod h1:1fYkFs2pUyqBUUVDsjn1cKVEI79R+NluYhqX+pDTkSY= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.10.0 h1:mEao3xEP7iCfCd+teps0oM8U+ZRPVz02W6aE5cfi2Sc= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.10.0/go.mod h1:vPjlCjTrBzzZpVJbbVpox8x9nRYx5giCl/9Zy8oWFw0= github.com/DataDog/sketches-go v1.4.3 h1:ZB9nijteJRFUQixkQfatCqASartGNfiolIlMiEv3u/w= github.com/DataDog/sketches-go v1.4.3/go.mod h1:XR0ns2RtEEF09mDKXiKZiQg+nfZStrq1ZuL1eezeZe0= github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= @@ -238,8 +238,8 @@ github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/ReneKroon/ttlcache/v2 v2.11.0 h1:OvlcYFYi941SBN3v9dsDcC2N8vRxyHcCmJb3Vl4QMoM= github.com/ReneKroon/ttlcache/v2 v2.11.0/go.mod h1:mBxvsNY+BT8qLLd6CuAJubbKo6r0jh3nb5et22bbfGY= -github.com/SAP/go-hdb v1.6.5 h1:MmlBKJPV82HyVGJQr2PIC1g0HK+90qyUPuf7yPNSKZ8= -github.com/SAP/go-hdb v1.6.5/go.mod h1:RESA/tq6gO9jnSKeXokpnlWOYGmJ2jmCat+rC+AhRCI= +github.com/SAP/go-hdb v1.6.6 h1:n0uqv+omYcz01sLXQ4bK7vDj76x5ELU0qJ/8PPgri08= +github.com/SAP/go-hdb v1.6.6/go.mod h1:RESA/tq6gO9jnSKeXokpnlWOYGmJ2jmCat+rC+AhRCI= github.com/SermoDigital/jose v0.9.2-0.20161205224733-f6df55f235c2/go.mod h1:ARgCUhI1MHQH+ONky/PAtmVHQrP5JlGY0F3poXOp/fA= github.com/SermoDigital/jose v0.9.2-0.20180104203859-803625baeddc h1:MhBvG7RLaLqlyjxMR6of35vt6MVQ+eXMcgn9X/sy0FE= github.com/SermoDigital/jose v0.9.2-0.20180104203859-803625baeddc/go.mod h1:ARgCUhI1MHQH+ONky/PAtmVHQrP5JlGY0F3poXOp/fA= @@ -324,8 +324,8 @@ 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.49.1 h1:Dsamcd8d/nNb3A+bZ0ucfGl0vGZsW5wlRW0vhoYGoeQ= -github.com/aws/aws-sdk-go v1.49.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= +github.com/aws/aws-sdk-go v1.49.6/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= @@ -499,7 +499,6 @@ 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/deepmap/oapi-codegen v1.12.4 h1:pPmn6qI9MuOtCz82WY2Xaw46EQjgvxednXXrP7g5Q2s= github.com/denisenkom/go-mssqldb v0.12.3 h1:pBSGx9Tq67pBOTLmxNuirNTeB8Vjmf886Kx+8Y+8shw= github.com/denisenkom/go-mssqldb v0.12.3/go.mod h1:k0mtMFOnU+AihqFxPMiF05rtiDrorD1Vrm1KEz5hxDo= github.com/dennwc/varint v1.0.0 h1:kGNFFSSw8ToIy3obO/kKr8U9GZYUAxQEVuix4zfDWzE= @@ -630,7 +629,6 @@ github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KE github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -863,8 +861,8 @@ github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= -github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-hclog v1.6.2 h1:NOtoftovWkDheyUM/8JW3QMiXyxJK3uHRK7wV04nD2I= +github.com/hashicorp/go-hclog v1.6.2/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= @@ -896,6 +894,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 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/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= @@ -926,7 +926,7 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2 github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= 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.12.4 h1:9qJLqetEmhIlqaF/N9KUtdmRKSbNy6IohggyS3bxWlE= +github.com/influxdata/influxdb-client-go/v2 v2.13.0 h1:ioBbLmR5NMbAjP4UVA5r9b5xGjpABD7j65pI8kFphDM= github.com/influxdata/influxdb-observability/common v0.5.8 h1:nyk4dqnKbPGIyr1vAs6oEsFQEHWi5jkSQ7PtP4v//lc= github.com/influxdata/influxdb-observability/common v0.5.8/go.mod h1:aG8A2gbtXbl/P2FePd6QNsCUSOkcvz1n+NL5dJLUO1s= github.com/influxdata/influxdb-observability/influx2otel v0.5.8 h1:pHkeImZksXNNQbbH/w1qPuC/u6e7cK3kTG12otQHDuE= @@ -1135,8 +1135,8 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/ github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-sqlite3 v1.14.18 h1:JL0eqdCOq6DJVNPSvArO/bIV9/P7fbGrV00LZHc+5aI= -github.com/mattn/go-sqlite3 v1.14.18/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= +github.com/mattn/go-sqlite3 v1.14.19 h1:fhGleo2h1p8tVChob4I9HpmVFIAkKGpiukdrgQbWfGI= +github.com/mattn/go-sqlite3 v1.14.19/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= 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= @@ -1223,6 +1223,7 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oapi-codegen/runtime v1.0.0 h1:P4rqFX5fMFWqRzY9M/3YF9+aPSPPB06IzP2P7oOxrWo= github.com/observiq/nanojack v0.0.0-20201106172433-343928847ebc h1:49ewVBwLcy+eYqI4R0ICilCI4dPjddpFXWv3liXzUxM= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= @@ -1383,8 +1384,8 @@ github.com/prometheus/statsd_exporter v0.22.7/go.mod h1:N/TevpjkIh9ccs6nuzY3jQn9 github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/redis/go-redis/v9 v9.3.0 h1:RiVDjmig62jIWp7Kk4XVLs0hzV6pI3PyTnnL0cnn0u0= -github.com/redis/go-redis/v9 v9.3.0/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= +github.com/redis/go-redis/v9 v9.3.1 h1:KqdY8U+3X6z+iACvumCNxnoluToB+9Me+TvyFa21Mds= +github.com/redis/go-redis/v9 v9.3.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= github.com/relvacode/iso8601 v1.3.0 h1:HguUjsGpIMh/zsTczGN3DVJFxTU/GX+MMmzcKoMO7ko= github.com/relvacode/iso8601 v1.3.0/go.mod h1:FlNp+jz+TXpyRqgmM7tnzHHzBnz776kmAH2h3sZCn0I= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= @@ -1433,8 +1434,8 @@ github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFR github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/signalfx/com_signalfx_metrics_protobuf v0.0.3 h1:32k2QLgsKhcEs55q4REPKyIadvid5FPy2+VMgvbmKJ0= github.com/signalfx/com_signalfx_metrics_protobuf v0.0.3/go.mod h1:gJrXWi7wSGXfiC7+VheQaz+ypdCt5SmZNL+BRxUe7y4= -github.com/signalfx/sapm-proto v0.13.0 h1:yEkp1+MAU4vZvnJMp56uhVlRjlvCK7KQjBg0g2Apw8k= -github.com/signalfx/sapm-proto v0.13.0/go.mod h1:C72HjeCW5v0Llk6pIVJ/ZH8A5GbiZpCCSkE1dSlpWxY= +github.com/signalfx/sapm-proto v0.14.0 h1:KWh3I5E4EkelB19aP1/54Ik8khSioC/RVRW/riOfRGg= +github.com/signalfx/sapm-proto v0.14.0/go.mod h1:Km6PskZh966cqNoUn3AmRyGRix5VfwnxVBvn2vjRC9U= github.com/sijms/go-ora/v2 v2.7.26 h1:+o/1ej7znA/Wpklv9eTiyp4Jqn2DU9Urw9YHrtPRP64= github.com/sijms/go-ora/v2 v2.7.26/go.mod h1:EHxlY6x7y9HAsdfumurRfTd+v8NrEOTR3Xl4FWlH6xk= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -1507,11 +1508,11 @@ github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSW github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tedsuo/ifrit v0.0.0-20180802180643-bea94bb476cc/go.mod h1:eyZnKCc955uh98WQvzOm0dgAeLnf2O0Rz0LPoC5ze+0= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.816 h1:hPkFIZPc3PKsiqm6OdS0mSgW7LISfxsR5NrQIsWPiYo= -github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.816/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.821 h1:WEHm7jX2S+bzFt3IbatdWKTh8oRZF2M5M9h/uymxTHQ= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.821/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/testcontainers/testcontainers-go v0.26.0 h1:uqcYdoOHBy1ca7gKODfBd9uTHVK3a7UL848z09MVZ0c= -github.com/tg123/go-htpasswd v1.2.1 h1:i4wfsX1KvvkyoMiHZzjS0VzbAPWfxzI8INcZAKtutoU= -github.com/tg123/go-htpasswd v1.2.1/go.mod h1:erHp1B86KXdwQf1X5ZrLb7erXZnWueEQezb2dql4q58= +github.com/tg123/go-htpasswd v1.2.2 h1:tmNccDsQ+wYsoRfiONzIhDm5OkVHQzN3w4FOBAlN6BY= +github.com/tg123/go-htpasswd v1.2.2/go.mod h1:FcIrK0J+6zptgVwK1JDlqyajW/1B4PtuJ/FLWl7nx8A= github.com/tidwall/gjson v1.10.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.14.3 h1:9jvXn7olKEHU1S9vwoMGliaT8jq1vJ7IH/n9zD9Dnlw= github.com/tidwall/gjson v1.14.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= @@ -1552,8 +1553,8 @@ github.com/vmihailenco/msgpack/v4 v4.3.13 h1:A2wsiTbvp63ilDaWmsk2wjx6xZdxQOvpiNl github.com/vmihailenco/tagparser v0.1.2 h1:gnjoVuB/kljJ5wICEEOpx98oXMWPLj22G67Vbd1qPqc= github.com/vmware/go-vmware-nsxt v0.0.0-20230223012718-d31b8a1ca05e h1:Vu41Q0Pv3yMdd+tcDW6QeEUIK2L+9ZrPrq8NAMrKSLc= github.com/vmware/go-vmware-nsxt v0.0.0-20230223012718-d31b8a1ca05e/go.mod h1:aRq5pxwgdJpAuP97SCjX1+Db32z/b0dggQ07FDF+fqE= -github.com/vmware/govmomi v0.34.0 h1:Aun71BDf1t8r3jNeUWJ3ZM+7kHbIuuNzIuxRVo5LYYU= -github.com/vmware/govmomi v0.34.0/go.mod h1:qWWT6n9mdCr/T9vySsoUqcI04sSEj4CqHXxtk/Y+Los= +github.com/vmware/govmomi v0.34.1 h1:Hqu2Uke2itC+cNoIcFQBLEZvX9wBRTTOP04J7V1fqRw= +github.com/vmware/govmomi v0.34.1/go.mod h1:qWWT6n9mdCr/T9vySsoUqcI04sSEj4CqHXxtk/Y+Los= github.com/vultr/govultr/v2 v2.17.2 h1:gej/rwr91Puc/tgh+j33p/BLR16UrIPnSr+AIwYWZQs= github.com/vultr/govultr/v2 v2.17.2/go.mod h1:ZFOKGWmgjytfyjeyAdhQlSWwTjh2ig+X49cAp50dzXI= github.com/wavefronthq/wavefront-sdk-go v0.15.0 h1:po9E3vh/0y7kOx8D9EtFp7kbSLLLKbmu/w/s1xGJAQU= @@ -1769,8 +1770,9 @@ golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= 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.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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= @@ -1781,8 +1783,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1810,6 +1812,7 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1874,6 +1877,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1905,6 +1910,7 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/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.1.0/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-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -2008,6 +2014,7 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.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.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= @@ -2016,6 +2023,8 @@ golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9sn golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -2030,6 +2039,8 @@ 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.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= 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.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -2037,8 +2048,8 @@ golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.4.0 h1:Z81tqI5ddIoXDPvVQ7/7CC9TnLM7ubaFG2qXYd5BbYY= -golang.org/x/time v0.4.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +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-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -2108,6 +2119,7 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.16.0 h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM= golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2143,8 +2155,8 @@ google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjR google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= -google.golang.org/api v0.151.0 h1:FhfXLO/NFdJIzQtCqjpysWwqKk8AzGWBUhMIx67cVDU= -google.golang.org/api v0.151.0/go.mod h1:ccy+MJ6nrYFgE3WgRx/AMXOxOmU8Q4hSa+jjibzhxcg= +google.golang.org/api v0.154.0 h1:X7QkVKZBskztmpPKWQXgjJRPA2dJYrL6r+sYPRLj050= +google.golang.org/api v0.154.0/go.mod h1:qhSMkM85hgqiokIYsrRyKxrjfBeIhgl4Z2JmeRkYylc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -2232,8 +2244,8 @@ google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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= @@ -2325,16 +2337,16 @@ k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= -k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= +k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ= k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM= k8s.io/kubelet v0.28.4 h1:Ypxy1jaFlSXFXbg/yVtFOU2ZxErBVRJfLu8+t4s7Dtw= k8s.io/kubelet v0.28.4/go.mod h1:w1wPI12liY/aeC70nqKYcNNkr6/nbyvdMB7P7wmww2o= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20230711102312-30195339c3c7 h1:ZgnF1KZsYxWIifwSNZFZgNtWE89WI5yiP5WwlfDoIyc= -k8s.io/utils v0.0.0-20230711102312-30195339c3c7/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= +k8s.io/utils v0.0.0-20231127182322-b307cd553661 h1:FepOBzJ0GXm8t0su67ln2wAZjbQ6RxQGZDnzuLcrUTI= +k8s.io/utils v0.0.0-20231127182322-b307cd553661/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= @@ -2350,6 +2362,6 @@ sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= -skywalking.apache.org/repo/goapi v0.0.0-20231026090926-09378dd56587 h1:TY79I5Y7xRB8q5LQ+MJn7NYsYi0VL5nj1QDrUHwK7cQ= -skywalking.apache.org/repo/goapi v0.0.0-20231026090926-09378dd56587/go.mod h1:onFubXaIoY/2FTRVrLMqCTlaNq4SilAEwF/2G0IcaBw= +skywalking.apache.org/repo/goapi v0.0.0-20231213062226-7849efc09ba3 h1:rqXePgPd1SeNYl4GSHyndwNggpGdOh+9ZMSRCfesgDU= +skywalking.apache.org/repo/goapi v0.0.0-20231213062226-7849efc09ba3/go.mod h1:oD2dxcDAHVIt95Ee7kJHgZ5f64QNhrqTjQYARwfafc4= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/internal/aws/awsutil/go.mod b/internal/aws/awsutil/go.mod index 389a469b4fca..71265b3f24cd 100644 --- a/internal/aws/awsutil/go.mod +++ b/internal/aws/awsutil/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/aw go 1.20 require ( - github.com/aws/aws-sdk-go v1.49.1 + github.com/aws/aws-sdk-go v1.49.6 github.com/stretchr/testify v1.8.4 go.uber.org/zap v1.26.0 golang.org/x/net v0.19.0 diff --git a/internal/aws/awsutil/go.sum b/internal/aws/awsutil/go.sum index 9eaa86b391ae..259dee3ed63e 100644 --- a/internal/aws/awsutil/go.sum +++ b/internal/aws/awsutil/go.sum @@ -1,5 +1,5 @@ -github.com/aws/aws-sdk-go v1.49.1 h1:Dsamcd8d/nNb3A+bZ0ucfGl0vGZsW5wlRW0vhoYGoeQ= -github.com/aws/aws-sdk-go v1.49.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= +github.com/aws/aws-sdk-go v1.49.6/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= diff --git a/internal/aws/cwlogs/go.mod b/internal/aws/cwlogs/go.mod index df9c04324191..6861b0a77205 100644 --- a/internal/aws/cwlogs/go.mod +++ b/internal/aws/cwlogs/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/cw go 1.20 require ( - github.com/aws/aws-sdk-go v1.49.1 + github.com/aws/aws-sdk-go v1.49.6 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.91.0 go.uber.org/zap v1.26.0 diff --git a/internal/aws/cwlogs/go.sum b/internal/aws/cwlogs/go.sum index f6d2a17b62eb..a3a78124ae48 100644 --- a/internal/aws/cwlogs/go.sum +++ b/internal/aws/cwlogs/go.sum @@ -1,5 +1,5 @@ -github.com/aws/aws-sdk-go v1.49.1 h1:Dsamcd8d/nNb3A+bZ0ucfGl0vGZsW5wlRW0vhoYGoeQ= -github.com/aws/aws-sdk-go v1.49.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= +github.com/aws/aws-sdk-go v1.49.6/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= diff --git a/internal/aws/k8s/go.mod b/internal/aws/k8s/go.mod index 43c3a459476a..00726ebecf99 100644 --- a/internal/aws/k8s/go.mod +++ b/internal/aws/k8s/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/k8 go 1.20 require ( - github.com/aws/aws-sdk-go v1.49.1 + github.com/aws/aws-sdk-go v1.49.6 github.com/stretchr/testify v1.8.4 go.uber.org/zap v1.26.0 k8s.io/api v0.28.4 diff --git a/internal/aws/k8s/go.sum b/internal/aws/k8s/go.sum index b117c79edfa2..41d77231c2d5 100644 --- a/internal/aws/k8s/go.sum +++ b/internal/aws/k8s/go.sum @@ -1,5 +1,5 @@ -github.com/aws/aws-sdk-go v1.49.1 h1:Dsamcd8d/nNb3A+bZ0ucfGl0vGZsW5wlRW0vhoYGoeQ= -github.com/aws/aws-sdk-go v1.49.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= +github.com/aws/aws-sdk-go v1.49.6/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= diff --git a/internal/aws/proxy/go.mod b/internal/aws/proxy/go.mod index 3dd418df80b3..f35c54c0c3f3 100644 --- a/internal/aws/proxy/go.mod +++ b/internal/aws/proxy/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/pr go 1.20 require ( - github.com/aws/aws-sdk-go v1.49.1 + github.com/aws/aws-sdk-go v1.49.6 github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.91.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/config/confignet v0.91.0 diff --git a/internal/aws/proxy/go.sum b/internal/aws/proxy/go.sum index 9356776e310e..c35faa67f49b 100644 --- a/internal/aws/proxy/go.sum +++ b/internal/aws/proxy/go.sum @@ -1,5 +1,5 @@ -github.com/aws/aws-sdk-go v1.49.1 h1:Dsamcd8d/nNb3A+bZ0ucfGl0vGZsW5wlRW0vhoYGoeQ= -github.com/aws/aws-sdk-go v1.49.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= +github.com/aws/aws-sdk-go v1.49.6/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= diff --git a/internal/aws/xray/go.mod b/internal/aws/xray/go.mod index 0945421d0525..c1f9be931f58 100644 --- a/internal/aws/xray/go.mod +++ b/internal/aws/xray/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/xr go 1.20 require ( - github.com/aws/aws-sdk-go v1.49.1 + github.com/aws/aws-sdk-go v1.49.6 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/awsutil v0.91.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.91.0 diff --git a/internal/aws/xray/go.sum b/internal/aws/xray/go.sum index 9d0342b635f4..4954ad60fa07 100644 --- a/internal/aws/xray/go.sum +++ b/internal/aws/xray/go.sum @@ -1,5 +1,5 @@ -github.com/aws/aws-sdk-go v1.49.1 h1:Dsamcd8d/nNb3A+bZ0ucfGl0vGZsW5wlRW0vhoYGoeQ= -github.com/aws/aws-sdk-go v1.49.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= +github.com/aws/aws-sdk-go v1.49.6/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= diff --git a/internal/aws/xray/testdata/sampleapp/go.mod b/internal/aws/xray/testdata/sampleapp/go.mod index fa1808d8e440..953dad5dfd35 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.20 require ( - github.com/aws/aws-sdk-go v1.49.1 + github.com/aws/aws-sdk-go v1.49.6 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 cb43749a2aa9..22ef6a5f3703 100644 --- a/internal/aws/xray/testdata/sampleapp/go.sum +++ b/internal/aws/xray/testdata/sampleapp/go.sum @@ -1,8 +1,8 @@ github.com/DATA-DOG/go-sqlmock v1.4.1 h1:ThlnYciV1iM/V0OSF/dtkqWb6xo5qITT1TJBG1MRDJM= 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.49.1 h1:Dsamcd8d/nNb3A+bZ0ucfGl0vGZsW5wlRW0vhoYGoeQ= -github.com/aws/aws-sdk-go v1.49.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= +github.com/aws/aws-sdk-go v1.49.6/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/datadog/go.mod b/internal/datadog/go.mod index 7b4c875f312b..7c9d7c17a721 100644 --- a/internal/datadog/go.mod +++ b/internal/datadog/go.mod @@ -3,25 +3,25 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/internal/datado go 1.20 require ( - github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7 - github.com/DataDog/datadog-agent/pkg/trace v0.50.0-rc.7 - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.9.0 + github.com/DataDog/datadog-agent/pkg/proto v0.50.0 + github.com/DataDog/datadog-agent/pkg/trace v0.50.0 + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.10.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/pdata v1.0.0 ) require ( - github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0-rc.7 // indirect + github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.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-tuf v1.0.2-0.5.2 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.9.0 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.9.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.10.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.10.0 // indirect github.com/DataDog/sketches-go v1.4.3 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect diff --git a/internal/datadog/go.sum b/internal/datadog/go.sum index 1c428d730d0f..21b1924ee64f 100644 --- a/internal/datadog/go.sum +++ b/internal/datadog/go.sum @@ -1,32 +1,32 @@ -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0-rc.7 h1:ULN8UQqgtmEgWvOEIDzWgxLZ3TEZJ9MXBUpVGE8PPBc= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0-rc.7/go.mod h1:A4nLJvxlg6BO/8/zg81til9yT0uRPuXDFMAzDMpmgn4= -github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7 h1:qJuxmeIiXZNML5/Y9KEf7QKEKKIeliiTIxgRGvGAQBc= -github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7/go.mod h1:HvK26YCxg6MfYvPJgpHC7nSjw6DTpNhd75Wlb0GAvis= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0-rc.7 h1:pQh4uZnc9mQbGMJ1R8C88GlseqmdFIKftDZLrQW71Ss= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0-rc.7/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= -github.com/DataDog/datadog-agent/pkg/trace v0.50.0-rc.7 h1:qWKAINgUtyuJQOCcthjPST8PzigPP8Pr0EtHdTgJVoA= -github.com/DataDog/datadog-agent/pkg/trace v0.50.0-rc.7/go.mod h1:i6OrrkHDlgCB4vUaPfM4FxVij2QdA/t07Ykwu74ySGA= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0-rc.7 h1:J7ocZItHWrUEvGWVqFa7wsghotcF53oFn1qH7Tlh7VM= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0-rc.7/go.mod h1:b0I5L9Eegsq3kca9pQCAVt1rQHI05sza7LVHKGzC+ms= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.0-rc.7 h1:vBo+iVlLpjrvJkX88mbFDtWFy0F6tEi865p+N4RTf7A= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.0-rc.7/go.mod h1:/fGZteE4rr3iz6y30a0A3MuebJ6Jckx+AiKcyYgT87k= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0-rc.7 h1:eM+GcYjk4sSik8tFgf8zNT1KViZZM4F4I580SZnTs7s= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0-rc.7/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0-rc.7 h1:QByjh+uLdnYjqIjdYP9XyEgObD9o8ydL4jBy4sEPlbU= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0-rc.7/go.mod h1:EOGgNrSPskIxY3+KgCl+yEggMjrGqrA2oL5va+/p2jM= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0 h1:WOyRfsLPYO24Z6Q+s1jcjoOFYJUJ4PgiNaGz/qJCba0= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0/go.mod h1:A4nLJvxlg6BO/8/zg81til9yT0uRPuXDFMAzDMpmgn4= +github.com/DataDog/datadog-agent/pkg/proto v0.50.0 h1:FAzs/Hofs9CN7jYYd2P4l8/igdcDPc7q9amIXSje/3A= +github.com/DataDog/datadog-agent/pkg/proto v0.50.0/go.mod h1:HvK26YCxg6MfYvPJgpHC7nSjw6DTpNhd75Wlb0GAvis= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0 h1:/V/WtjIQCDNJpRVJ/wSfmUakLhBhxJ7joqwM7DXc9hI= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= +github.com/DataDog/datadog-agent/pkg/trace v0.50.0 h1:gZt7YTwtptMNYUN/Z5QHnabOz0ILHvSKC0jpTqqiXBo= +github.com/DataDog/datadog-agent/pkg/trace v0.50.0/go.mod h1:fV11a6fzBAbzgF8ie5Bk51rvLS5kMcsXjwaCzPAfsrk= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0 h1:jSAW27LAnpdZGEe8B0FzSbVT8YdmvPGxV/l8SDUKzYY= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0/go.mod h1:QO56TX/gJf9yZ8q+ix0EEjck6kJu+oirAvJPk8xpFa0= +github.com/DataDog/datadog-agent/pkg/util/log v0.50.0 h1:qIqqLKov9yjoHuoOK//a49vFiBZyduswcJz7jwgKuuo= +github.com/DataDog/datadog-agent/pkg/util/log v0.50.0/go.mod h1:byH8to7LKxTK5m7jf1n222QMeL55iiVszk+OA7Qxfao= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0 h1:MXYW7B+OamUkSBGVsLkPQt7bjQhO52Q6qym3VluB8IM= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0 h1:0QrqgObZkmv2Fcr10CN+pONfIeoul5loof3t20B1AAA= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0/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/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.9.0 h1:oT5B12H+tLtAEEH0YqgmppofM/yRBzyI9+ykS9OQvIs= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.9.0 h1:Y+CllChr2yfE2RLd+c5hvK56DDGVEdDrhAl1OyzuuwU= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.9.0/go.mod h1:naFq9h+fQpgI7AKJ+YkWlAAYDU8/FB8LyfA39bmRNHs= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.9.0 h1:WsCPJS+a34kw1gj46WpJjQBHrLVwh1ubCdHUx9nf1ec= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.9.0/go.mod h1:m61Tq6DA2U+PjNTX6WD3TH2U7QnA49+7IGaYK4bu7fQ= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.9.0 h1:U93rYuk3ChT/I+2r36JI8agi1AwdH8vRiHh+bCSXZeU= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.9.0/go.mod h1:KOzWHRj2AcJPmP1hm4WQUfzEIYRBP4NaTX9Iu+D3UNs= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.10.0 h1:O2PYvgTQA+31NuepzQqLexEpUX8FWsdNgq+0241OtH0= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.10.0 h1:56vp8vflG6lmhTO+YldUBTe0cIjStOC1neW1dIHYm5s= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.10.0/go.mod h1:naFq9h+fQpgI7AKJ+YkWlAAYDU8/FB8LyfA39bmRNHs= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.10.0 h1:XwGT7/2NnO1RGxS5WD4BTsLWqO+z8234XBccUGhP8tM= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.10.0/go.mod h1:1fYkFs2pUyqBUUVDsjn1cKVEI79R+NluYhqX+pDTkSY= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.10.0 h1:mEao3xEP7iCfCd+teps0oM8U+ZRPVz02W6aE5cfi2Sc= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.10.0/go.mod h1:vPjlCjTrBzzZpVJbbVpox8x9nRYx5giCl/9Zy8oWFw0= github.com/DataDog/sketches-go v1.4.3 h1:ZB9nijteJRFUQixkQfatCqASartGNfiolIlMiEv3u/w= github.com/DataDog/sketches-go v1.4.3/go.mod h1:XR0ns2RtEEF09mDKXiKZiQg+nfZStrq1ZuL1eezeZe0= github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= diff --git a/internal/filter/filterset/regexp/regexpfilterset.go b/internal/filter/filterset/regexp/regexpfilterset.go index 00f4640f9426..f8ff39c85591 100644 --- a/internal/filter/filterset/regexp/regexpfilterset.go +++ b/internal/filter/filterset/regexp/regexpfilterset.go @@ -4,9 +4,10 @@ package regexp // import "github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter/filterset/regexp" import ( + "math" "regexp" - "github.com/golang/groupcache/lru" + lru "github.com/hashicorp/golang-lru/v2" ) // FilterSet encapsulates a set of filters and caches match results. @@ -16,9 +17,8 @@ import ( // FilterSet satisfies the FilterSet interface from // "go.opentelemetry.io/collector/internal/processor/filterset" type FilterSet struct { - regexes []*regexp.Regexp - cacheEnabled bool - cache *lru.Cache + regexes []*regexp.Regexp + cache *lru.Cache[string, bool] } // NewFilterSet constructs a FilterSet of re2 regex strings. @@ -28,37 +28,45 @@ func NewFilterSet(filters []string, cfg *Config) (*FilterSet, error) { regexes: make([]*regexp.Regexp, 0, len(filters)), } - if cfg != nil && cfg.CacheEnabled { - fs.cacheEnabled = true - fs.cache = lru.New(cfg.CacheMaxNumEntries) - } - if err := fs.addFilters(filters); err != nil { return nil, err } + if cfg != nil && cfg.CacheEnabled { + // Because of legacy behavior, CacheMaxNumEntries == 0 means unbounded cache. + numEntries := cfg.CacheMaxNumEntries + if numEntries == 0 { + numEntries = math.MaxInt + } + var err error + fs.cache, err = lru.New[string, bool](numEntries) + if err != nil { + return nil, err + } + } + return fs, nil } // Matches returns true if the given string matches any of the FilterSet's filters. // The given string must be fully matched by at least one filter's re2 regex. func (rfs *FilterSet) Matches(toMatch string) bool { - if rfs.cacheEnabled { + if rfs.cache != nil { if v, ok := rfs.cache.Get(toMatch); ok { - return v.(bool) + return v } } for _, r := range rfs.regexes { if r.MatchString(toMatch) { - if rfs.cacheEnabled { + if rfs.cache != nil { rfs.cache.Add(toMatch, true) } return true } } - if rfs.cacheEnabled { + if rfs.cache != nil { rfs.cache.Add(toMatch, false) } return false diff --git a/internal/filter/filterset/regexp/regexpfilterset_test.go b/internal/filter/filterset/regexp/regexpfilterset_test.go index 0f0a9b4f5db0..cfb616430662 100644 --- a/internal/filter/filterset/regexp/regexpfilterset_test.go +++ b/internal/filter/filterset/regexp/regexpfilterset_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) var ( @@ -64,7 +65,7 @@ func TestRegexpMatches(t *testing.T) { fs, err := NewFilterSet(validRegexpFilters, &Config{}) assert.NotNil(t, fs) assert.NoError(t, err) - assert.False(t, fs.cacheEnabled) + assert.Nil(t, fs.cache) matches := []string{ "full/name/match", @@ -105,9 +106,9 @@ func TestRegexpDeDup(t *testing.T) { "prefix/.*", } fs, err := NewFilterSet(dupRegexpFilters, &Config{}) + require.NoError(t, err) assert.NotNil(t, fs) - assert.NoError(t, err) - assert.False(t, fs.cacheEnabled) + assert.Nil(t, fs.cache) assert.EqualValues(t, 1, len(fs.regexes)) } @@ -117,9 +118,9 @@ func TestRegexpMatchesCaches(t *testing.T) { CacheEnabled: true, CacheMaxNumEntries: 0, }) + require.NoError(t, err) assert.NotNil(t, fs) - assert.NoError(t, err) - assert.True(t, fs.cacheEnabled) + assert.NotNil(t, fs.cache) matches := []string{ "full/name/match", @@ -140,7 +141,7 @@ func TestRegexpMatchesCaches(t *testing.T) { assert.True(t, fs.Matches(m)) matched, ok := fs.cache.Get(m) - assert.True(t, matched.(bool) && ok) + assert.True(t, matched && ok) }) } @@ -155,7 +156,7 @@ func TestRegexpMatchesCaches(t *testing.T) { assert.False(t, fs.Matches(m)) matched, ok := fs.cache.Get(m) - assert.True(t, !matched.(bool) && ok) + assert.True(t, !matched && ok) }) } } @@ -166,8 +167,9 @@ func TestWithCacheSize(t *testing.T) { CacheEnabled: true, CacheMaxNumEntries: size, }) + require.NoError(t, err) assert.NotNil(t, fs) - assert.NoError(t, err) + assert.NotNil(t, fs.cache) matches := []string{ "prefix/test/match", diff --git a/internal/filter/go.mod b/internal/filter/go.mod index 098329815a5c..437ef6345e7a 100644 --- a/internal/filter/go.mod +++ b/internal/filter/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/expr-lang/expr v1.15.7 - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da + github.com/hashicorp/golang-lru/v2 v2.0.7 github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.91.0 @@ -42,7 +42,7 @@ require ( go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect + golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/internal/filter/go.sum b/internal/filter/go.sum index 1393e2d08588..8a6394242dcf 100644 --- a/internal/filter/go.sum +++ b/internal/filter/go.sum @@ -15,8 +15,6 @@ github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -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/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= @@ -27,6 +25,8 @@ github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 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/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= @@ -88,8 +88,8 @@ 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/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= diff --git a/internal/k8stest/go.mod b/internal/k8stest/go.mod index b989b2948e75..17879954fcc0 100644 --- a/internal/k8stest/go.mod +++ b/internal/k8stest/go.mod @@ -5,6 +5,7 @@ go 1.20 require ( github.com/docker/docker v24.0.7+incompatible github.com/stretchr/testify v1.8.4 + k8s.io/api v0.28.4 k8s.io/apimachinery v0.28.4 k8s.io/client-go v0.28.4 ) @@ -20,7 +21,6 @@ require ( github.com/golang/protobuf v1.5.3 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/kr/text v0.2.0 // 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 @@ -39,7 +39,6 @@ require ( golang.org/x/tools v0.15.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.31.0 // indirect - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/internal/k8stest/go.sum b/internal/k8stest/go.sum index 046c73d6b153..3b2a5b65ba42 100644 --- a/internal/k8stest/go.sum +++ b/internal/k8stest/go.sum @@ -1,7 +1,6 @@ github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -38,12 +37,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/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= @@ -125,7 +120,6 @@ google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= 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/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -136,6 +130,7 @@ gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= k8s.io/api v0.28.4 h1:8ZBrLjwosLl/NYgv1P7EQLqoO8MGQApnbgH8tu3BMzY= +k8s.io/api v0.28.4/go.mod h1:axWTGrY88s/5YE+JSt4uUi6NMM+gur1en2REMR7IRj0= k8s.io/apimachinery v0.28.4 h1:zOSJe1mc+GxuMnFzD4Z/U1wst50X28ZNsn5bhgIIao8= k8s.io/apimachinery v0.28.4/go.mod h1:wI37ncBvfAoswfq626yPTe6Bz1c22L7uaJ8dho83mgg= k8s.io/client-go v0.28.4 h1:Np5ocjlZcTrkyRJ3+T3PkXDpe4UpatQxj85+xjaD2wY= diff --git a/internal/k8stest/k8s_collector.go b/internal/k8stest/k8s_collector.go index ebfe5035b28e..0530e9caeac3 100644 --- a/internal/k8stest/k8s_collector.go +++ b/internal/k8stest/k8s_collector.go @@ -13,8 +13,10 @@ import ( "time" "github.com/stretchr/testify/require" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/dynamic" ) @@ -36,7 +38,8 @@ func CreateCollectorObjects(t *testing.T, client *dynamic.DynamicClient, testID })) obj, err := CreateObject(client, manifest.Bytes()) require.NoErrorf(t, err, "failed to create collector object from manifest %s", manifestFile.Name()) - if obj.GetKind() == "Deployment" { + objKind := obj.GetKind() + if objKind == "Deployment" || objKind == "DaemonSet" { podNamespace = obj.GetNamespace() selector := obj.Object["spec"].(map[string]any)["selector"] podLabels = selector.(map[string]any)["matchLabels"].(map[string]any) @@ -53,15 +56,49 @@ func WaitForCollectorToStart(t *testing.T, client *dynamic.DynamicClient, podNam podGVR := schema.GroupVersionResource{Version: "v1", Resource: "pods"} listOptions := metav1.ListOptions{LabelSelector: SelectorFromMap(podLabels).String()} podTimeoutMinutes := 3 - var podPhase string - require.Eventually(t, func() bool { + t.Logf("waiting for collector pods to be ready") + require.Eventuallyf(t, func() bool { list, err := client.Resource(podGVR).Namespace(podNamespace).List(context.Background(), listOptions) require.NoError(t, err, "failed to list collector pods") - if len(list.Items) == 0 { + podsNotReady := len(list.Items) + if podsNotReady == 0 { + t.Log("did not find collector pods") return false } - podPhase = list.Items[0].Object["status"].(map[string]any)["phase"].(string) - return podPhase == "Running" - }, time.Duration(podTimeoutMinutes)*time.Minute, 50*time.Millisecond, - "collector pod haven't started within %d minutes, latest pod phase is %s", podTimeoutMinutes, podPhase) + + var pods v1.PodList + err = runtime.DefaultUnstructuredConverter.FromUnstructured(list.UnstructuredContent(), &pods) + require.NoError(t, err, "failed to convert unstructured to podList") + + for _, pod := range pods.Items { + podReady := false + if pod.Status.Phase != v1.PodRunning { + t.Logf("pod %v is not running, current phase: %v", pod.Name, pod.Status.Phase) + continue + } + for _, cond := range pod.Status.Conditions { + if cond.Type == v1.PodReady && cond.Status == v1.ConditionTrue { + podsNotReady-- + podReady = true + } + } + // Add some debug logs for crashing pods + if !podReady { + for _, cs := range pod.Status.ContainerStatuses { + restartCount := cs.RestartCount + if restartCount > 0 && cs.LastTerminationState.Terminated != nil { + t.Logf("restart count = %d for container %s in pod %s, last terminated reason: %s", restartCount, cs.Name, pod.Name, cs.LastTerminationState.Terminated.Reason) + t.Logf("termination message: %s", cs.LastTerminationState.Terminated.Message) + } + } + } + } + if podsNotReady == 0 { + t.Logf("collector pods are ready") + return true + } + return false + + }, time.Duration(podTimeoutMinutes)*time.Minute, 2*time.Second, + "collector pods were not ready within %d minutes", podTimeoutMinutes) } diff --git a/internal/k8stest/k8s_objects.go b/internal/k8stest/k8s_objects.go index e3e4455e9ba8..bbbff8d6e56b 100644 --- a/internal/k8stest/k8s_objects.go +++ b/internal/k8stest/k8s_objects.go @@ -36,5 +36,12 @@ func DeleteObject(client *dynamic.DynamicClient, obj *unstructured.Unstructured) Version: gvk.Version, Resource: strings.ToLower(gvk.Kind + "s"), } - return client.Resource(gvr).Namespace(obj.GetNamespace()).Delete(context.Background(), obj.GetName(), metav1.DeleteOptions{}) + + options := metav1.DeleteOptions{} + policy := metav1.DeletePropagationBackground + if gvk.Kind == "Job" { + options.PropagationPolicy = &policy + } + + return client.Resource(gvr).Namespace(obj.GetNamespace()).Delete(context.Background(), obj.GetName(), options) } diff --git a/internal/kafka/go.mod b/internal/kafka/go.mod index 58139ed90047..7011c463625c 100644 --- a/internal/kafka/go.mod +++ b/internal/kafka/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/IBM/sarama v1.42.1 - github.com/aws/aws-sdk-go v1.49.1 + github.com/aws/aws-sdk-go v1.49.6 github.com/stretchr/testify v1.8.4 github.com/xdg-go/scram v1.1.2 go.opentelemetry.io/collector/config/configtls v0.91.0 @@ -34,9 +34,9 @@ require ( github.com/xdg-go/pbkdf2 v1.0.0 // indirect github.com/xdg-go/stringprep v1.0.4 // indirect go.opentelemetry.io/collector/config/configopaque v0.91.0 // indirect - golang.org/x/crypto v0.15.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/net v0.18.0 // indirect - golang.org/x/sys v0.14.0 // indirect + golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/internal/kafka/go.sum b/internal/kafka/go.sum index 7f7d863efea0..8ffcd7748ff3 100644 --- a/internal/kafka/go.sum +++ b/internal/kafka/go.sum @@ -1,7 +1,7 @@ github.com/IBM/sarama v1.42.1 h1:wugyWa15TDEHh2kvq2gAy1IHLjEjuYOYgXz/ruC/OSQ= github.com/IBM/sarama v1.42.1/go.mod h1:Xxho9HkHd4K/MDUo/T/sOqwtX/17D33++E9Wib6hUdQ= -github.com/aws/aws-sdk-go v1.49.1 h1:Dsamcd8d/nNb3A+bZ0ucfGl0vGZsW5wlRW0vhoYGoeQ= -github.com/aws/aws-sdk-go v1.49.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= +github.com/aws/aws-sdk-go v1.49.6/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= @@ -80,8 +80,8 @@ go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN8 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -100,8 +100,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= diff --git a/internal/metadataproviders/go.mod b/internal/metadataproviders/go.mod index 25dd8258781b..5f24700ea582 100644 --- a/internal/metadataproviders/go.mod +++ b/internal/metadataproviders/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/Showmax/go-fqdn v1.0.0 - github.com/aws/aws-sdk-go v1.49.1 + github.com/aws/aws-sdk-go v1.49.6 github.com/docker/docker v24.0.7+incompatible github.com/hashicorp/consul/api v1.26.1 github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.91.0 diff --git a/internal/metadataproviders/go.sum b/internal/metadataproviders/go.sum index ae234041d095..7171096fdf05 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.49.1 h1:Dsamcd8d/nNb3A+bZ0ucfGl0vGZsW5wlRW0vhoYGoeQ= -github.com/aws/aws-sdk-go v1.49.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= +github.com/aws/aws-sdk-go v1.49.6/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/tools/go.mod b/internal/tools/go.mod index fe11f5685fb6..fb2575503f7b 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -14,9 +14,9 @@ require ( go.opentelemetry.io/build-tools/chloggen v0.12.0 go.opentelemetry.io/build-tools/crosslink v0.12.0 go.opentelemetry.io/build-tools/issuegenerator v0.12.0 - go.opentelemetry.io/build-tools/multimod v0.12.1-0.20231211155609-fa0413b9dbf9 + go.opentelemetry.io/build-tools/multimod v0.12.1-0.20231212150647-815fbfc7b190 go.opentelemetry.io/collector/cmd/builder v0.91.0 - golang.org/x/tools v0.15.0 + golang.org/x/tools v0.16.1 golang.org/x/vuln v1.0.1 ) @@ -218,7 +218,7 @@ require ( go.tmz.dev/musttag v0.7.2 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect - golang.org/x/crypto v0.16.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 // indirect golang.org/x/mod v0.14.0 // indirect diff --git a/internal/tools/go.sum b/internal/tools/go.sum index 4b487ea5e123..b6d31dad99b2 100644 --- a/internal/tools/go.sum +++ b/internal/tools/go.sum @@ -652,8 +652,8 @@ go.opentelemetry.io/build-tools/crosslink v0.12.0 h1:GNJQURuabE5rAkIbnrqndIKyXrr go.opentelemetry.io/build-tools/crosslink v0.12.0/go.mod h1:QE8Kxf4Ygg2ltSHE+Vdys/67jtQM26j7spJLyjNA2DU= go.opentelemetry.io/build-tools/issuegenerator v0.12.0 h1:KRP7aSUR9JoqNwv+Pp595vj9NtyTlkgi+vKrYM6ZnhA= go.opentelemetry.io/build-tools/issuegenerator v0.12.0/go.mod h1:G71Og7dZJoIC+MjuY1InQ/oeAOkM1S5Nv6CCnlOdqns= -go.opentelemetry.io/build-tools/multimod v0.12.1-0.20231211155609-fa0413b9dbf9 h1:YntecbwyIMIacUsZtrEcvx2zI1/fKcKQv7HH3H2KKzg= -go.opentelemetry.io/build-tools/multimod v0.12.1-0.20231211155609-fa0413b9dbf9/go.mod h1:qDGDKPq0CcFcqwlBo3EHQJ/uxTE1NIgH9OVZIcgMHf8= +go.opentelemetry.io/build-tools/multimod v0.12.1-0.20231212150647-815fbfc7b190 h1:tbQ8exrhY+53k1IRy9UOisZZhtNHNGIipUzwyq8w1VU= +go.opentelemetry.io/build-tools/multimod v0.12.1-0.20231212150647-815fbfc7b190/go.mod h1:qDGDKPq0CcFcqwlBo3EHQJ/uxTE1NIgH9OVZIcgMHf8= go.opentelemetry.io/collector/cmd/builder v0.91.0 h1:+XleULVc+kfCMIjVBDVru9x5dIjTG1EfDY8nZxBqK/o= go.opentelemetry.io/collector/cmd/builder v0.91.0/go.mod h1:wcxXrQyLrzvYKXCG3CqDkFpbL35cBCHke6wk2RFvmZk= go.tmz.dev/musttag v0.7.2 h1:1J6S9ipDbalBSODNT5jCep8dhZyMr4ttnjQagmGYR5s= @@ -674,8 +674,8 @@ golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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= @@ -930,8 +930,8 @@ golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.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/vuln v1.0.1 h1:KUas02EjQK5LTuIx1OylBQdKKZ9jeugs+HiqO5HormU= golang.org/x/vuln v1.0.1/go.mod h1:bb2hMwln/tqxg32BNY4CcxHWtHXuYa3SbIBmtsyjxtM= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/pkg/ottl/boolean_value_test.go b/pkg/ottl/boolean_value_test.go index a7843429406f..ad42555e192f 100644 --- a/pkg/ottl/boolean_value_test.go +++ b/pkg/ottl/boolean_value_test.go @@ -28,8 +28,8 @@ func valueFor(x any) value { case v == "NAME": // if the string is NAME construct a path of "name". val.Literal = &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -38,11 +38,11 @@ func valueFor(x any) value { } case strings.Contains(v, "ENUM"): // if the string contains ENUM construct an EnumSymbol from it. - val.Enum = (*EnumSymbol)(ottltest.Strp(v)) + val.Enum = (*enumSymbol)(ottltest.Strp(v)) case v == "dur1" || v == "dur2": val.Literal = &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: v, }, @@ -51,8 +51,8 @@ func valueFor(x any) value { } case v == "time1" || v == "time2": val.Literal = &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: v, }, @@ -93,7 +93,7 @@ func comparisonHelper(left any, right any, op string) *comparison { func Test_newComparisonEvaluator(t *testing.T) { p, _ := NewParser( defaultFunctionsForTests(), - testParsePath, + testParsePath[any], componenttest.NewNopTelemetrySettings(), WithEnumParser[any](testParseEnum), ) @@ -185,7 +185,7 @@ func Test_newComparisonEvaluator(t *testing.T) { func Test_newConditionEvaluator_invalid(t *testing.T) { p, _ := NewParser( defaultFunctionsForTests(), - testParsePath, + testParsePath[any], componenttest.NewNopTelemetrySettings(), WithEnumParser[any](testParseEnum), ) @@ -195,12 +195,12 @@ func Test_newConditionEvaluator_invalid(t *testing.T) { comparison *comparison }{ { - name: "unknown Path", + name: "unknown path", comparison: &comparison{ Left: value{ - Enum: (*EnumSymbol)(ottltest.Strp("SYMBOL_NOT_FOUND")), + Enum: (*enumSymbol)(ottltest.Strp("SYMBOL_NOT_FOUND")), }, - Op: EQ, + Op: eq, Right: value{ String: ottltest.Strp("trash"), }, @@ -233,7 +233,7 @@ func Test_newBooleanExpressionEvaluator(t *testing.T) { p, _ := NewParser( functions, - testParsePath, + testParsePath[any], componenttest.NewNopTelemetrySettings(), WithEnumParser[any](testParseEnum), ) @@ -488,7 +488,7 @@ func Test_newBooleanExpressionEvaluator(t *testing.T) { Left: value{ String: ottltest.Strp("test"), }, - Op: EQ, + Op: eq, Right: value{ String: ottltest.Strp("not test"), }, @@ -616,7 +616,7 @@ func Test_newBooleanExpressionEvaluator_invalid(t *testing.T) { p, _ := NewParser( functions, - testParsePath, + testParsePath[any], componenttest.NewNopTelemetrySettings(), WithEnumParser[any](testParseEnum), ) diff --git a/pkg/ottl/compare.go b/pkg/ottl/compare.go index fc93186c4985..50d1109f00ca 100644 --- a/pkg/ottl/compare.go +++ b/pkg/ottl/compare.go @@ -15,29 +15,29 @@ import ( // values of type any, which for the purposes of OTTL mean values that are one of // int, float, string, bool, or pointers to those, or []byte, or nil. -// invalidComparison returns false for everything except NE (where it returns true to indicate that the +// invalidComparison returns false for everything except ne (where it returns true to indicate that the // objects were definitely not equivalent). // It also gives us an opportunity to log something. func (p *Parser[K]) invalidComparison(msg string, op compareOp) bool { p.telemetrySettings.Logger.Debug(msg, zap.Any("op", op)) - return op == NE + return op == ne } // comparePrimitives implements a generic comparison helper for all Ordered types (derived from Float, Int, or string). // According to benchmarks, it's faster than explicit comparison functions for these types. func comparePrimitives[T constraints.Ordered](a T, b T, op compareOp) bool { switch op { - case EQ: + case eq: return a == b - case NE: + case ne: return a != b - case LT: + case lt: return a < b - case LTE: + case lte: return a <= b - case GTE: + case gte: return a >= b - case GT: + case gt: return a > b default: return false @@ -46,17 +46,17 @@ func comparePrimitives[T constraints.Ordered](a T, b T, op compareOp) bool { func compareBools(a bool, b bool, op compareOp) bool { switch op { - case EQ: + case eq: return a == b - case NE: + case ne: return a != b - case LT: + case lt: return !a && b - case LTE: + case lte: return !a || b - case GTE: + case gte: return a || !b - case GT: + case gt: return a && !b default: return false @@ -65,17 +65,17 @@ func compareBools(a bool, b bool, op compareOp) bool { func compareBytes(a []byte, b []byte, op compareOp) bool { switch op { - case EQ: + case eq: return bytes.Equal(a, b) - case NE: + case ne: return !bytes.Equal(a, b) - case LT: + case lt: return bytes.Compare(a, b) < 0 - case LTE: + case lte: return bytes.Compare(a, b) <= 0 - case GTE: + case gte: return bytes.Compare(a, b) >= 0 - case GT: + case gt: return bytes.Compare(a, b) > 0 default: return false @@ -103,10 +103,10 @@ func (p *Parser[K]) compareString(a string, b any, op compareOp) bool { func (p *Parser[K]) compareByte(a []byte, b any, op compareOp) bool { switch v := b.(type) { case nil: - return op == NE + return op == ne case []byte: if v == nil { - return op == NE + return op == ne } return compareBytes(a, v, op) default: @@ -151,17 +151,17 @@ func (p *Parser[K]) compareTime(a time.Time, b any, op compareOp) bool { switch v := b.(type) { case time.Time: switch op { - case EQ: + case eq: return a.Equal(v) - case NE: + case ne: return !a.Equal(v) - case LT: + case lt: return a.Before(v) - case LTE: + case lte: return a.Before(v) || a.Equal(v) - case GTE: + case gte: return a.After(v) || a.Equal(v) - case GT: + case gt: return a.After(v) default: return p.invalidComparison("invalid comparison operator", op) @@ -177,7 +177,7 @@ func (p *Parser[K]) compare(a any, b any, op compareOp) bool { // nils are equal to each other and never equal to anything else, // so if they're both nil, report equality. if a == nil && b == nil { - return op == EQ || op == LTE || op == GTE + return op == eq || op == lte || op == gte } // Anything else, we switch on the left side first. switch v := a.(type) { @@ -206,9 +206,9 @@ func (p *Parser[K]) compare(a any, b any, op compareOp) bool { // If we don't know what type it is, we can't do inequalities yet. So we can fall back to the old behavior where we just // use Go's standard equality. switch op { - case EQ: + case eq: return a == b - case NE: + case ne: return a != b default: return p.invalidComparison("unsupported type for inequality on left", op) diff --git a/pkg/ottl/compare_test.go b/pkg/ottl/compare_test.go index b2dffba38a4f..e051ececb739 100644 --- a/pkg/ottl/compare_test.go +++ b/pkg/ottl/compare_test.go @@ -45,7 +45,7 @@ func Test_compare(t *testing.T) { name string a any b any - want []bool // in order of EQ, NE, LT, LTE, GTE, GT. + want []bool // in order of eq, ne, lt, lte, gte, gt. }{ {"identity string", sa, sa, []bool{true, false, false, true, true, false}}, {"identity int64", i64a, i64a, []bool{true, false, false, true, true, false}}, @@ -101,7 +101,7 @@ func Test_compare(t *testing.T) { {"non-prim, int type", testA{"hi"}, 5, []bool{false, true, false, false, false, false}}, {"int, non-prim", 5, testA{"hi"}, []bool{false, true, false, false, false, false}}, } - ops := []compareOp{EQ, NE, LT, LTE, GTE, GT} + ops := []compareOp{eq, ne, lt, lte, gte, gt} for _, tt := range tests { for _, op := range ops { t.Run(fmt.Sprintf("%s %v", tt.name, op), func(t *testing.T) { @@ -123,7 +123,7 @@ func BenchmarkCompareEQInt64(b *testing.B) { b.ReportAllocs() b.ResetTimer() for i := 0; i < b.N; i++ { - testParser.compare(i64a, i64b, EQ) + testParser.compare(i64a, i64b, eq) } } @@ -132,7 +132,7 @@ func BenchmarkCompareEQFloat(b *testing.B) { b.ReportAllocs() b.ResetTimer() for i := 0; i < b.N; i++ { - testParser.compare(f64a, f64b, EQ) + testParser.compare(f64a, f64b, eq) } } @@ -141,7 +141,7 @@ func BenchmarkCompareEQString(b *testing.B) { b.ReportAllocs() b.ResetTimer() for i := 0; i < b.N; i++ { - testParser.compare(sa, sb, EQ) + testParser.compare(sa, sb, eq) } } @@ -150,7 +150,7 @@ func BenchmarkCompareEQPString(b *testing.B) { b.ReportAllocs() b.ResetTimer() for i := 0; i < b.N; i++ { - testParser.compare(&sa, &sb, EQ) + testParser.compare(&sa, &sb, eq) } } @@ -159,7 +159,7 @@ func BenchmarkCompareEQBytes(b *testing.B) { b.ReportAllocs() b.ResetTimer() for i := 0; i < b.N; i++ { - testParser.compare(ba, bb, EQ) + testParser.compare(ba, bb, eq) } } @@ -168,7 +168,7 @@ func BenchmarkCompareEQNil(b *testing.B) { b.ReportAllocs() b.ResetTimer() for i := 0; i < b.N; i++ { - testParser.compare(nil, nil, EQ) + testParser.compare(nil, nil, eq) } } @@ -177,7 +177,7 @@ func BenchmarkCompareNEInt(b *testing.B) { b.ReportAllocs() b.ResetTimer() for i := 0; i < b.N; i++ { - testParser.compare(i64a, i64b, NE) + testParser.compare(i64a, i64b, ne) } } @@ -186,7 +186,7 @@ func BenchmarkCompareNEFloat(b *testing.B) { b.ReportAllocs() b.ResetTimer() for i := 0; i < b.N; i++ { - testParser.compare(f64a, f64b, NE) + testParser.compare(f64a, f64b, ne) } } @@ -195,7 +195,7 @@ func BenchmarkCompareNEString(b *testing.B) { b.ReportAllocs() b.ResetTimer() for i := 0; i < b.N; i++ { - testParser.compare(sa, sb, NE) + testParser.compare(sa, sb, ne) } } @@ -204,7 +204,7 @@ func BenchmarkCompareLTFloat(b *testing.B) { b.ReportAllocs() b.ResetTimer() for i := 0; i < b.N; i++ { - testParser.compare(f64a, f64b, LT) + testParser.compare(f64a, f64b, lt) } } @@ -213,7 +213,7 @@ func BenchmarkCompareLTString(b *testing.B) { b.ReportAllocs() b.ResetTimer() for i := 0; i < b.N; i++ { - testParser.compare(sa, sb, LT) + testParser.compare(sa, sb, lt) } } @@ -222,17 +222,17 @@ func BenchmarkCompareLTNil(b *testing.B) { b.ReportAllocs() b.ResetTimer() for i := 0; i < b.N; i++ { - testParser.compare(nil, nil, LT) + testParser.compare(nil, nil, lt) } } // this is only used for benchmarking, and is a rough equivalent of the original compare function -// before adding LT, LTE, GTE, and GT. +// before adding lt, lte, gte, and gt. func compareEq(a any, b any, op compareOp) bool { switch op { - case EQ: + case eq: return a == b - case NE: + case ne: return a != b default: return false @@ -241,6 +241,6 @@ func compareEq(a any, b any, op compareOp) bool { func BenchmarkCompareEQFunction(b *testing.B) { for i := 0; i < b.N; i++ { - compareEq(sa, sb, EQ) + compareEq(sa, sb, eq) } } diff --git a/pkg/ottl/contexts/internal/map.go b/pkg/ottl/contexts/internal/map.go index b45d61c177d6..a3dea84a0e0c 100644 --- a/pkg/ottl/contexts/internal/map.go +++ b/pkg/ottl/contexts/internal/map.go @@ -4,6 +4,7 @@ package internal // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/internal" import ( + "context" "fmt" "go.opentelemetry.io/collector/pdata/pcommon" @@ -11,33 +12,43 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" ) -func GetMapValue(m pcommon.Map, keys []ottl.Key) (any, error) { - if len(keys) == 0 { +func GetMapValue[K any](ctx context.Context, tCtx K, m pcommon.Map, key ottl.Key[K]) (any, error) { + if key == nil { return nil, fmt.Errorf("cannot get map value without key") } - if keys[0].String == nil { + + s, err := key.String(ctx, tCtx) + if err != nil { + return nil, err + } + if s == nil { return nil, fmt.Errorf("non-string indexing is not supported") } - val, ok := m.Get(*keys[0].String) + val, ok := m.Get(*s) if !ok { return nil, nil } - return getIndexableValue(val, keys[1:]) + + return getIndexableValue[K](ctx, tCtx, val, key.Next()) } -func SetMapValue(m pcommon.Map, keys []ottl.Key, val any) error { - if len(keys) == 0 { +func SetMapValue[K any](ctx context.Context, tCtx K, m pcommon.Map, key ottl.Key[K], val any) error { + if key == nil { return fmt.Errorf("cannot set map value without key") } - if keys[0].String == nil { + + s, err := key.String(ctx, tCtx) + if err != nil { + return err + } + if s == nil { return fmt.Errorf("non-string indexing is not supported") } - currentValue, ok := m.Get(*keys[0].String) + currentValue, ok := m.Get(*s) if !ok { - currentValue = m.PutEmpty(*keys[0].String) + currentValue = m.PutEmpty(*s) } - - return setIndexableValue(currentValue, val, keys[1:]) + return setIndexableValue[K](ctx, tCtx, currentValue, val, key.Next()) } diff --git a/pkg/ottl/contexts/internal/map_test.go b/pkg/ottl/contexts/internal/map_test.go index 582167559186..ca51dfe73a7b 100644 --- a/pkg/ottl/contexts/internal/map_test.go +++ b/pkg/ottl/contexts/internal/map_test.go @@ -4,92 +4,76 @@ package internal import ( + "context" "fmt" "testing" "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/pcommon" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/ottltest" ) func Test_GetMapValue_Invalid(t *testing.T) { tests := []struct { name string - keys []ottl.Key + keys *TestKey[any] err error }{ - { - name: "no keys", - keys: []ottl.Key{}, - err: fmt.Errorf("cannot get map value without key"), - }, { name: "first key not a string", - keys: []ottl.Key{ - { - Int: ottltest.Intp(0), - }, + keys: &TestKey[any]{ + I: ottltest.Intp(0), }, err: fmt.Errorf("non-string indexing is not supported"), }, { name: "index map with int", - keys: []ottl.Key{ - { - String: ottltest.Strp("map"), - }, - { - Int: ottltest.Intp(0), + keys: &TestKey[any]{ + S: ottltest.Strp("map"), + NextKey: &TestKey[any]{ + I: ottltest.Intp(0), }, }, err: fmt.Errorf("map must be indexed by a string"), }, { name: "index slice with string", - keys: []ottl.Key{ - { - String: ottltest.Strp("slice"), - }, - { - String: ottltest.Strp("invalid"), + keys: &TestKey[any]{ + + S: ottltest.Strp("slice"), + NextKey: &TestKey[any]{ + S: ottltest.Strp("invalid"), }, }, err: fmt.Errorf("slice must be indexed by an int"), }, { name: "index too large", - keys: []ottl.Key{ - { - String: ottltest.Strp("slice"), - }, - { - Int: ottltest.Intp(1), + keys: &TestKey[any]{ + S: ottltest.Strp("slice"), + NextKey: &TestKey[any]{ + I: ottltest.Intp(1), }, }, err: fmt.Errorf("index 1 out of bounds"), }, { name: "index too small", - keys: []ottl.Key{ - { - String: ottltest.Strp("slice"), - }, - { - Int: ottltest.Intp(-1), + keys: &TestKey[any]{ + S: ottltest.Strp("slice"), + NextKey: &TestKey[any]{ + I: ottltest.Intp(-1), }, }, err: fmt.Errorf("index -1 out of bounds"), }, { name: "invalid type", - keys: []ottl.Key{ - { - String: ottltest.Strp("string"), - }, - { - String: ottltest.Strp("string"), + keys: &TestKey[any]{ + S: ottltest.Strp("string"), + NextKey: &TestKey[any]{ + S: ottltest.Strp("string"), }, }, err: fmt.Errorf("type Str does not support string indexing"), @@ -105,7 +89,7 @@ func Test_GetMapValue_Invalid(t *testing.T) { s := m.PutEmptySlice("slice") s.AppendEmpty() - _, err := GetMapValue(m, tt.keys) + _, err := GetMapValue[any](context.Background(), nil, m, tt.keys) assert.Equal(t, tt.err, err) }) } @@ -114,95 +98,81 @@ func Test_GetMapValue_Invalid(t *testing.T) { func Test_GetMapValue_MissingKey(t *testing.T) { m := pcommon.NewMap() m.PutEmptyMap("map1").PutEmptyMap("map2") - keys := []ottl.Key{ - { - String: ottltest.Strp("map1"), - }, - { - String: ottltest.Strp("unknown key"), + keys := TestKey[any]{ + S: ottltest.Strp("map1"), + NextKey: &TestKey[any]{ + S: ottltest.Strp("unknown key"), }, } - result, err := GetMapValue(m, keys) + result, err := GetMapValue[any](context.Background(), nil, m, &keys) assert.Nil(t, err) assert.Nil(t, result) } +func Test_GetMapValue_NilKey(t *testing.T) { + _, err := GetMapValue[any](context.Background(), nil, pcommon.NewMap(), nil) + assert.Error(t, err) +} + func Test_SetMapValue_Invalid(t *testing.T) { tests := []struct { name string - keys []ottl.Key + keys *TestKey[any] err error }{ - { - name: "no keys", - keys: []ottl.Key{}, - err: fmt.Errorf("cannot set map value without key"), - }, { name: "first key not a string", - keys: []ottl.Key{ - { - Int: ottltest.Intp(0), - }, + keys: &TestKey[any]{ + I: ottltest.Intp(0), }, err: fmt.Errorf("non-string indexing is not supported"), }, { name: "index map with int", - keys: []ottl.Key{ - { - String: ottltest.Strp("map"), - }, - { - Int: ottltest.Intp(0), + keys: &TestKey[any]{ + S: ottltest.Strp("map"), + NextKey: &TestKey[any]{ + I: ottltest.Intp(0), }, }, err: fmt.Errorf("map must be indexed by a string"), }, { name: "index slice with string", - keys: []ottl.Key{ - { - String: ottltest.Strp("slice"), - }, - { - String: ottltest.Strp("map"), + keys: &TestKey[any]{ + S: ottltest.Strp("slice"), + NextKey: &TestKey[any]{ + S: ottltest.Strp("map"), }, }, err: fmt.Errorf("slice must be indexed by an int"), }, { name: "slice index too large", - keys: []ottl.Key{ - { - String: ottltest.Strp("slice"), - }, - { - Int: ottltest.Intp(1), + keys: &TestKey[any]{ + S: ottltest.Strp("slice"), + NextKey: &TestKey[any]{ + I: ottltest.Intp(1), }, }, err: fmt.Errorf("index 1 out of bounds"), }, { name: "slice index too small", - keys: []ottl.Key{ - { - String: ottltest.Strp("slice"), - }, - { - Int: ottltest.Intp(-1), + keys: &TestKey[any]{ + S: ottltest.Strp("slice"), + NextKey: &TestKey[any]{ + I: ottltest.Intp(-1), }, }, err: fmt.Errorf("index -1 out of bounds"), }, { name: "slice index too small", - keys: []ottl.Key{ - { - String: ottltest.Strp("string"), - }, - { - String: ottltest.Strp("string"), + keys: &TestKey[any]{ + S: ottltest.Strp("string"), + NextKey: &TestKey[any]{ + S: ottltest.Strp("string"), }, }, err: fmt.Errorf("type Str does not support string indexing"), @@ -218,7 +188,7 @@ func Test_SetMapValue_Invalid(t *testing.T) { s := m.PutEmptySlice("slice") s.AppendEmpty() - err := SetMapValue(m, tt.keys, "value") + err := SetMapValue[any](context.Background(), nil, m, tt.keys, "value") assert.Equal(t, tt.err, err) }) } @@ -227,18 +197,16 @@ func Test_SetMapValue_Invalid(t *testing.T) { func Test_SetMapValue_AddingNewSubMap(t *testing.T) { m := pcommon.NewMap() m.PutEmptyMap("map1").PutStr("test", "test") - keys := []ottl.Key{ - { - String: ottltest.Strp("map1"), - }, - { - String: ottltest.Strp("map2"), - }, - { - String: ottltest.Strp("foo"), + keys := TestKey[any]{ + S: ottltest.Strp("map1"), + NextKey: &TestKey[any]{ + S: ottltest.Strp("map2"), + NextKey: &TestKey[any]{ + S: ottltest.Strp("foo"), + }, }, } - err := SetMapValue(m, keys, "bar") + err := SetMapValue[any](context.Background(), nil, m, &keys, "bar") assert.Nil(t, err) expected := pcommon.NewMap() @@ -251,18 +219,16 @@ func Test_SetMapValue_AddingNewSubMap(t *testing.T) { func Test_SetMapValue_EmptyMap(t *testing.T) { m := pcommon.NewMap() - keys := []ottl.Key{ - { - String: ottltest.Strp("map1"), - }, - { - String: ottltest.Strp("map2"), - }, - { - String: ottltest.Strp("foo"), + keys := TestKey[any]{ + S: ottltest.Strp("map1"), + NextKey: &TestKey[any]{ + S: ottltest.Strp("map2"), + NextKey: &TestKey[any]{ + S: ottltest.Strp("foo"), + }, }, } - err := SetMapValue(m, keys, "bar") + err := SetMapValue[any](context.Background(), nil, m, &keys, "bar") assert.Nil(t, err) expected := pcommon.NewMap() @@ -270,3 +236,8 @@ func Test_SetMapValue_EmptyMap(t *testing.T) { assert.Equal(t, expected, m) } + +func Test_SetMapValue_NilKey(t *testing.T) { + err := SetMapValue[any](context.Background(), nil, pcommon.NewMap(), nil, "bar") + assert.Error(t, err) +} diff --git a/pkg/ottl/contexts/internal/metric.go b/pkg/ottl/contexts/internal/metric.go index e34afd8854f6..d4823c71ef0f 100644 --- a/pkg/ottl/contexts/internal/metric.go +++ b/pkg/ottl/contexts/internal/metric.go @@ -28,11 +28,11 @@ var MetricSymbolTable = map[ottl.EnumSymbol]ottl.Enum{ "METRIC_DATA_TYPE_SUMMARY": ottl.Enum(pmetric.MetricTypeSummary), } -func MetricPathGetSetter[K MetricContext](path []ottl.Field) (ottl.GetSetter[K], error) { - if len(path) == 0 { +func MetricPathGetSetter[K MetricContext](path ottl.Path[K]) (ottl.GetSetter[K], error) { + if path == nil { return accessMetric[K](), nil } - switch path[0].Name { + switch path.Name() { case "name": return accessName[K](), nil case "description": @@ -47,9 +47,9 @@ func MetricPathGetSetter[K MetricContext](path []ottl.Field) (ottl.GetSetter[K], return accessIsMonotonic[K](), nil case "data_points": return accessDataPoints[K](), nil + default: + return nil, fmt.Errorf("invalid metric path expression %v", path) } - - return nil, fmt.Errorf("invalid metric path expression %v", path) } func accessMetric[K MetricContext]() ottl.StandardGetSetter[K] { @@ -177,7 +177,6 @@ func accessDataPoints[K MetricContext]() ottl.StandardGetSetter[K] { return ottl.StandardGetSetter[K]{ Getter: func(ctx context.Context, tCtx K) (any, error) { metric := tCtx.GetMetric() - //exhaustive:enforce switch metric.Type() { case pmetric.MetricTypeSum: return metric.Sum().DataPoints(), nil @@ -194,7 +193,6 @@ func accessDataPoints[K MetricContext]() ottl.StandardGetSetter[K] { }, Setter: func(ctx context.Context, tCtx K, val any) error { metric := tCtx.GetMetric() - //exhaustive:enforce switch metric.Type() { case pmetric.MetricTypeSum: if newDataPoints, ok := val.(pmetric.NumberDataPointSlice); ok { diff --git a/pkg/ottl/contexts/internal/metric_test.go b/pkg/ottl/contexts/internal/metric_test.go index 8bbcb1d7d1df..401a07705071 100644 --- a/pkg/ottl/contexts/internal/metric_test.go +++ b/pkg/ottl/contexts/internal/metric_test.go @@ -26,17 +26,15 @@ func Test_MetricPathGetSetter(t *testing.T) { tests := []struct { name string - path []ottl.Field + path ottl.Path[*metricContext] orig any newVal any modified func(metric pmetric.Metric) }{ { name: "metric name", - path: []ottl.Field{ - { - Name: "name", - }, + path: &TestPath[*metricContext]{ + N: "name", }, orig: "name", newVal: "new name", @@ -46,10 +44,8 @@ func Test_MetricPathGetSetter(t *testing.T) { }, { name: "metric description", - path: []ottl.Field{ - { - Name: "description", - }, + path: &TestPath[*metricContext]{ + N: "description", }, orig: "description", newVal: "new description", @@ -59,10 +55,8 @@ func Test_MetricPathGetSetter(t *testing.T) { }, { name: "metric unit", - path: []ottl.Field{ - { - Name: "unit", - }, + path: &TestPath[*metricContext]{ + N: "unit", }, orig: "unit", newVal: "new unit", @@ -72,10 +66,8 @@ func Test_MetricPathGetSetter(t *testing.T) { }, { name: "metric type", - path: []ottl.Field{ - { - Name: "type", - }, + path: &TestPath[*metricContext]{ + N: "type", }, orig: int64(pmetric.MetricTypeSum), newVal: int64(pmetric.MetricTypeSum), @@ -84,10 +76,8 @@ func Test_MetricPathGetSetter(t *testing.T) { }, { name: "metric aggregation_temporality", - path: []ottl.Field{ - { - Name: "aggregation_temporality", - }, + path: &TestPath[*metricContext]{ + N: "aggregation_temporality", }, orig: int64(2), newVal: int64(1), @@ -97,10 +87,8 @@ func Test_MetricPathGetSetter(t *testing.T) { }, { name: "metric is_monotonic", - path: []ottl.Field{ - { - Name: "is_monotonic", - }, + path: &TestPath[*metricContext]{ + N: "is_monotonic", }, orig: true, newVal: false, @@ -110,10 +98,8 @@ func Test_MetricPathGetSetter(t *testing.T) { }, { name: "metric data points", - path: []ottl.Field{ - { - Name: "data_points", - }, + path: &TestPath[*metricContext]{ + N: "data_points", }, orig: refMetric.Sum().DataPoints(), newVal: newDataPoints, diff --git a/pkg/ottl/contexts/internal/path.go b/pkg/ottl/contexts/internal/path.go new file mode 100644 index 000000000000..a3b909719073 --- /dev/null +++ b/pkg/ottl/contexts/internal/path.go @@ -0,0 +1,56 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package internal // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/internal" + +import ( + "context" + + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" +) + +var _ ottl.Path[any] = &TestPath[any]{} + +type TestPath[K any] struct { + N string + Keys ottl.Key[K] + NextPath *TestPath[K] +} + +func (p *TestPath[K]) Name() string { + return p.N +} + +func (p *TestPath[K]) Next() ottl.Path[K] { + if p.NextPath == nil { + return nil + } + return p.NextPath +} + +func (p *TestPath[K]) Key() ottl.Key[K] { + return p.Keys +} + +var _ ottl.Key[any] = &TestKey[any]{} + +type TestKey[K any] struct { + S *string + I *int64 + NextKey *TestKey[K] +} + +func (k *TestKey[K]) String(_ context.Context, _ K) (*string, error) { + return k.S, nil +} + +func (k *TestKey[K]) Int(_ context.Context, _ K) (*int64, error) { + return k.I, nil +} + +func (k *TestKey[K]) Next() ottl.Key[K] { + if k.NextKey == nil { + return nil + } + return k.NextKey +} diff --git a/pkg/ottl/contexts/internal/resource.go b/pkg/ottl/contexts/internal/resource.go index 0303a4acd7b7..61638996c89e 100644 --- a/pkg/ottl/contexts/internal/resource.go +++ b/pkg/ottl/contexts/internal/resource.go @@ -16,22 +16,21 @@ type ResourceContext interface { GetResource() pcommon.Resource } -func ResourcePathGetSetter[K ResourceContext](path []ottl.Field) (ottl.GetSetter[K], error) { - if len(path) == 0 { +func ResourcePathGetSetter[K ResourceContext](path ottl.Path[K]) (ottl.GetSetter[K], error) { + if path == nil { return accessResource[K](), nil } - switch path[0].Name { + switch path.Name() { case "attributes": - mapKeys := path[0].Keys - if mapKeys == nil { + if path.Key() == nil { return accessResourceAttributes[K](), nil } - return accessResourceAttributesKey[K](mapKeys), nil + return accessResourceAttributesKey[K](path.Key()), nil case "dropped_attributes_count": return accessResourceDroppedAttributesCount[K](), nil + default: + return nil, fmt.Errorf("invalid resource path expression %v", path) } - - return nil, fmt.Errorf("invalid resource path expression %v", path) } func accessResource[K ResourceContext]() ottl.StandardGetSetter[K] { @@ -62,13 +61,13 @@ func accessResourceAttributes[K ResourceContext]() ottl.StandardGetSetter[K] { } } -func accessResourceAttributesKey[K ResourceContext](keys []ottl.Key) ottl.StandardGetSetter[K] { +func accessResourceAttributesKey[K ResourceContext](keys ottl.Key[K]) ottl.StandardGetSetter[K] { return ottl.StandardGetSetter[K]{ Getter: func(ctx context.Context, tCtx K) (any, error) { - return GetMapValue(tCtx.GetResource().Attributes(), keys) + return GetMapValue[K](ctx, tCtx, tCtx.GetResource().Attributes(), keys) }, Setter: func(ctx context.Context, tCtx K, val any) error { - return SetMapValue(tCtx.GetResource().Attributes(), keys, val) + return SetMapValue[K](ctx, tCtx, tCtx.GetResource().Attributes(), keys, val) }, } } diff --git a/pkg/ottl/contexts/internal/resource_test.go b/pkg/ottl/contexts/internal/resource_test.go index 97f93c044d46..a9f689c2c234 100644 --- a/pkg/ottl/contexts/internal/resource_test.go +++ b/pkg/ottl/contexts/internal/resource_test.go @@ -22,14 +22,14 @@ func TestResourcePathGetSetter(t *testing.T) { tests := []struct { name string - path []ottl.Field + path ottl.Path[*resourceContext] orig any newVal any modified func(resource pcommon.Resource) }{ { name: "resource", - path: []ottl.Field{}, + path: nil, orig: refResource, newVal: pcommon.NewResource(), modified: func(resource pcommon.Resource) { @@ -38,10 +38,8 @@ func TestResourcePathGetSetter(t *testing.T) { }, { name: "attributes", - path: []ottl.Field{ - { - Name: "attributes", - }, + path: &TestPath[*resourceContext]{ + N: "attributes", }, orig: refResource.Attributes(), newVal: newAttrs, @@ -51,14 +49,10 @@ func TestResourcePathGetSetter(t *testing.T) { }, { name: "attributes string", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("str"), - }, - }, + path: &TestPath[*resourceContext]{ + N: "attributes", + Keys: &TestKey[*resourceContext]{ + S: ottltest.Strp("str"), }, }, orig: "val", @@ -69,14 +63,10 @@ func TestResourcePathGetSetter(t *testing.T) { }, { name: "attributes bool", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("bool"), - }, - }, + path: &TestPath[*resourceContext]{ + N: "attributes", + Keys: &TestKey[*resourceContext]{ + S: ottltest.Strp("bool"), }, }, orig: true, @@ -87,14 +77,10 @@ func TestResourcePathGetSetter(t *testing.T) { }, { name: "attributes int", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("int"), - }, - }, + path: &TestPath[*resourceContext]{ + N: "attributes", + Keys: &TestKey[*resourceContext]{ + S: ottltest.Strp("int"), }, }, orig: int64(10), @@ -105,14 +91,10 @@ func TestResourcePathGetSetter(t *testing.T) { }, { name: "attributes float", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("double"), - }, - }, + path: &TestPath[*resourceContext]{ + N: "attributes", + Keys: &TestKey[*resourceContext]{ + S: ottltest.Strp("double"), }, }, orig: 1.2, @@ -123,14 +105,10 @@ func TestResourcePathGetSetter(t *testing.T) { }, { name: "attributes bytes", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("bytes"), - }, - }, + path: &TestPath[*resourceContext]{ + N: "attributes", + Keys: &TestKey[*resourceContext]{ + S: ottltest.Strp("bytes"), }, }, orig: []byte{1, 3, 2}, @@ -141,14 +119,10 @@ func TestResourcePathGetSetter(t *testing.T) { }, { name: "attributes array empty", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_empty"), - }, - }, + path: &TestPath[*resourceContext]{ + N: "attributes", + Keys: &TestKey[*resourceContext]{ + S: ottltest.Strp("arr_empty"), }, }, orig: func() pcommon.Slice { @@ -162,14 +136,10 @@ func TestResourcePathGetSetter(t *testing.T) { }, { name: "attributes array string", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_str"), - }, - }, + path: &TestPath[*resourceContext]{ + N: "attributes", + Keys: &TestKey[*resourceContext]{ + S: ottltest.Strp("arr_str"), }, }, orig: func() pcommon.Slice { @@ -183,14 +153,10 @@ func TestResourcePathGetSetter(t *testing.T) { }, { name: "attributes array bool", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_bool"), - }, - }, + path: &TestPath[*resourceContext]{ + N: "attributes", + Keys: &TestKey[*resourceContext]{ + S: ottltest.Strp("arr_bool"), }, }, orig: func() pcommon.Slice { @@ -204,14 +170,10 @@ func TestResourcePathGetSetter(t *testing.T) { }, { name: "attributes array int", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_int"), - }, - }, + path: &TestPath[*resourceContext]{ + N: "attributes", + Keys: &TestKey[*resourceContext]{ + S: ottltest.Strp("arr_int"), }, }, orig: func() pcommon.Slice { @@ -225,14 +187,10 @@ func TestResourcePathGetSetter(t *testing.T) { }, { name: "attributes array float", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_float"), - }, - }, + path: &TestPath[*resourceContext]{ + N: "attributes", + Keys: &TestKey[*resourceContext]{ + S: ottltest.Strp("arr_float"), }, }, orig: func() pcommon.Slice { @@ -246,14 +204,10 @@ func TestResourcePathGetSetter(t *testing.T) { }, { name: "attributes array bytes", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_bytes"), - }, - }, + path: &TestPath[*resourceContext]{ + N: "attributes", + Keys: &TestKey[*resourceContext]{ + S: ottltest.Strp("arr_bytes"), }, }, orig: func() pcommon.Slice { @@ -267,18 +221,14 @@ func TestResourcePathGetSetter(t *testing.T) { }, { name: "attributes nested", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("slice"), - }, - { - Int: ottltest.Intp(0), - }, - { - String: ottltest.Strp("map"), + path: &TestPath[*resourceContext]{ + N: "attributes", + Keys: &TestKey[*resourceContext]{ + S: ottltest.Strp("slice"), + NextKey: &TestKey[*resourceContext]{ + I: ottltest.Intp(0), + NextKey: &TestKey[*resourceContext]{ + S: ottltest.Strp("map"), }, }, }, @@ -295,18 +245,14 @@ func TestResourcePathGetSetter(t *testing.T) { }, { name: "attributes nested new values", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("new"), - }, - { - Int: ottltest.Intp(2), - }, - { - Int: ottltest.Intp(0), + path: &TestPath[*resourceContext]{ + N: "attributes", + Keys: &TestKey[*resourceContext]{ + S: ottltest.Strp("new"), + NextKey: &TestKey[*resourceContext]{ + I: ottltest.Intp(2), + NextKey: &TestKey[*resourceContext]{ + I: ottltest.Intp(0), }, }, }, @@ -324,10 +270,8 @@ func TestResourcePathGetSetter(t *testing.T) { }, { name: "dropped_attributes_count", - path: []ottl.Field{ - { - Name: "dropped_attributes_count", - }, + path: &TestPath[*resourceContext]{ + N: "dropped_attributes_count", }, orig: int64(10), newVal: int64(20), diff --git a/pkg/ottl/contexts/internal/scope.go b/pkg/ottl/contexts/internal/scope.go index 3ed068602f53..dc0f44e5dd2d 100644 --- a/pkg/ottl/contexts/internal/scope.go +++ b/pkg/ottl/contexts/internal/scope.go @@ -16,27 +16,26 @@ type InstrumentationScopeContext interface { GetInstrumentationScope() pcommon.InstrumentationScope } -func ScopePathGetSetter[K InstrumentationScopeContext](path []ottl.Field) (ottl.GetSetter[K], error) { - if len(path) == 0 { +func ScopePathGetSetter[K InstrumentationScopeContext](path ottl.Path[K]) (ottl.GetSetter[K], error) { + if path == nil { return accessInstrumentationScope[K](), nil } - - switch path[0].Name { + switch path.Name() { case "name": return accessInstrumentationScopeName[K](), nil case "version": return accessInstrumentationScopeVersion[K](), nil case "attributes": - mapKeys := path[0].Keys + mapKeys := path.Key() if mapKeys == nil { return accessInstrumentationScopeAttributes[K](), nil } return accessInstrumentationScopeAttributesKey[K](mapKeys), nil case "dropped_attributes_count": return accessInstrumentationScopeDroppedAttributesCount[K](), nil + default: + return nil, fmt.Errorf("invalid scope path expression %v", path) } - - return nil, fmt.Errorf("invalid scope path expression %v", path) } func accessInstrumentationScope[K InstrumentationScopeContext]() ottl.StandardGetSetter[K] { @@ -67,13 +66,13 @@ func accessInstrumentationScopeAttributes[K InstrumentationScopeContext]() ottl. } } -func accessInstrumentationScopeAttributesKey[K InstrumentationScopeContext](keys []ottl.Key) ottl.StandardGetSetter[K] { +func accessInstrumentationScopeAttributesKey[K InstrumentationScopeContext](key ottl.Key[K]) ottl.StandardGetSetter[K] { return ottl.StandardGetSetter[K]{ Getter: func(ctx context.Context, tCtx K) (any, error) { - return GetMapValue(tCtx.GetInstrumentationScope().Attributes(), keys) + return GetMapValue[K](ctx, tCtx, tCtx.GetInstrumentationScope().Attributes(), key) }, Setter: func(ctx context.Context, tCtx K, val any) error { - return SetMapValue(tCtx.GetInstrumentationScope().Attributes(), keys, val) + return SetMapValue[K](ctx, tCtx, tCtx.GetInstrumentationScope().Attributes(), key, val) }, } } diff --git a/pkg/ottl/contexts/internal/scope_test.go b/pkg/ottl/contexts/internal/scope_test.go index 1560ddb024ca..5ac20b188e32 100644 --- a/pkg/ottl/contexts/internal/scope_test.go +++ b/pkg/ottl/contexts/internal/scope_test.go @@ -21,14 +21,14 @@ func TestScopePathGetSetter(t *testing.T) { newAttrs.PutStr("hello", "world") tests := []struct { name string - path []ottl.Field + path ottl.Path[*instrumentationScopeContext] orig any newVal any modified func(is pcommon.InstrumentationScope) }{ { name: "instrumentation_scope", - path: []ottl.Field{}, + path: nil, orig: refIS, newVal: pcommon.NewInstrumentationScope(), modified: func(is pcommon.InstrumentationScope) { @@ -37,10 +37,8 @@ func TestScopePathGetSetter(t *testing.T) { }, { name: "instrumentation_scope name", - path: []ottl.Field{ - { - Name: "name", - }, + path: &TestPath[*instrumentationScopeContext]{ + N: "name", }, orig: refIS.Name(), newVal: "newname", @@ -50,10 +48,8 @@ func TestScopePathGetSetter(t *testing.T) { }, { name: "instrumentation_scope version", - path: []ottl.Field{ - { - Name: "version", - }, + path: &TestPath[*instrumentationScopeContext]{ + N: "version", }, orig: refIS.Version(), newVal: "next", @@ -63,10 +59,8 @@ func TestScopePathGetSetter(t *testing.T) { }, { name: "attributes", - path: []ottl.Field{ - { - Name: "attributes", - }, + path: &TestPath[*instrumentationScopeContext]{ + N: "attributes", }, orig: refIS.Attributes(), newVal: newAttrs, @@ -76,14 +70,10 @@ func TestScopePathGetSetter(t *testing.T) { }, { name: "attributes string", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("str"), - }, - }, + path: &TestPath[*instrumentationScopeContext]{ + N: "attributes", + Keys: &TestKey[*instrumentationScopeContext]{ + S: ottltest.Strp("str"), }, }, orig: "val", @@ -94,10 +84,8 @@ func TestScopePathGetSetter(t *testing.T) { }, { name: "dropped_attributes_count", - path: []ottl.Field{ - { - Name: "dropped_attributes_count", - }, + path: &TestPath[*instrumentationScopeContext]{ + N: "dropped_attributes_count", }, orig: int64(10), newVal: int64(20), @@ -107,14 +95,10 @@ func TestScopePathGetSetter(t *testing.T) { }, { name: "attributes bool", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("bool"), - }, - }, + path: &TestPath[*instrumentationScopeContext]{ + N: "attributes", + Keys: &TestKey[*instrumentationScopeContext]{ + S: ottltest.Strp("bool"), }, }, orig: true, @@ -125,14 +109,10 @@ func TestScopePathGetSetter(t *testing.T) { }, { name: "attributes int", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("int"), - }, - }, + path: &TestPath[*instrumentationScopeContext]{ + N: "attributes", + Keys: &TestKey[*instrumentationScopeContext]{ + S: ottltest.Strp("int"), }, }, orig: int64(10), @@ -143,14 +123,10 @@ func TestScopePathGetSetter(t *testing.T) { }, { name: "attributes float", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("double"), - }, - }, + path: &TestPath[*instrumentationScopeContext]{ + N: "attributes", + Keys: &TestKey[*instrumentationScopeContext]{ + S: ottltest.Strp("double"), }, }, orig: 1.2, @@ -161,14 +137,10 @@ func TestScopePathGetSetter(t *testing.T) { }, { name: "attributes bytes", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("bytes"), - }, - }, + path: &TestPath[*instrumentationScopeContext]{ + N: "attributes", + Keys: &TestKey[*instrumentationScopeContext]{ + S: ottltest.Strp("bytes"), }, }, orig: []byte{1, 3, 2}, @@ -179,14 +151,10 @@ func TestScopePathGetSetter(t *testing.T) { }, { name: "attributes array empty", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_empty"), - }, - }, + path: &TestPath[*instrumentationScopeContext]{ + N: "attributes", + Keys: &TestKey[*instrumentationScopeContext]{ + S: ottltest.Strp("arr_empty"), }, }, orig: func() pcommon.Slice { @@ -200,14 +168,10 @@ func TestScopePathGetSetter(t *testing.T) { }, { name: "attributes array string", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_str"), - }, - }, + path: &TestPath[*instrumentationScopeContext]{ + N: "attributes", + Keys: &TestKey[*instrumentationScopeContext]{ + S: ottltest.Strp("arr_str"), }, }, orig: func() pcommon.Slice { @@ -222,14 +186,10 @@ func TestScopePathGetSetter(t *testing.T) { }, { name: "attributes array bool", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_bool"), - }, - }, + path: &TestPath[*instrumentationScopeContext]{ + N: "attributes", + Keys: &TestKey[*instrumentationScopeContext]{ + S: ottltest.Strp("arr_bool"), }, }, orig: func() pcommon.Slice { @@ -244,14 +204,10 @@ func TestScopePathGetSetter(t *testing.T) { }, { name: "attributes array int", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_int"), - }, - }, + path: &TestPath[*instrumentationScopeContext]{ + N: "attributes", + Keys: &TestKey[*instrumentationScopeContext]{ + S: ottltest.Strp("arr_int"), }, }, orig: func() pcommon.Slice { @@ -266,14 +222,10 @@ func TestScopePathGetSetter(t *testing.T) { }, { name: "attributes array float", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_float"), - }, - }, + path: &TestPath[*instrumentationScopeContext]{ + N: "attributes", + Keys: &TestKey[*instrumentationScopeContext]{ + S: ottltest.Strp("arr_float"), }, }, orig: func() pcommon.Slice { @@ -288,14 +240,10 @@ func TestScopePathGetSetter(t *testing.T) { }, { name: "attributes array bytes", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_bytes"), - }, - }, + path: &TestPath[*instrumentationScopeContext]{ + N: "attributes", + Keys: &TestKey[*instrumentationScopeContext]{ + S: ottltest.Strp("arr_bytes"), }, }, orig: func() pcommon.Slice { @@ -310,18 +258,14 @@ func TestScopePathGetSetter(t *testing.T) { }, { name: "attributes nested", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("slice"), - }, - { - Int: ottltest.Intp(0), - }, - { - String: ottltest.Strp("map"), + path: &TestPath[*instrumentationScopeContext]{ + N: "attributes", + Keys: &TestKey[*instrumentationScopeContext]{ + S: ottltest.Strp("slice"), + NextKey: &TestKey[*instrumentationScopeContext]{ + I: ottltest.Intp(0), + NextKey: &TestKey[*instrumentationScopeContext]{ + S: ottltest.Strp("map"), }, }, }, @@ -338,18 +282,14 @@ func TestScopePathGetSetter(t *testing.T) { }, { name: "attributes nested new values", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("new"), - }, - { - Int: ottltest.Intp(2), - }, - { - Int: ottltest.Intp(0), + path: &TestPath[*instrumentationScopeContext]{ + N: "attributes", + Keys: &TestKey[*instrumentationScopeContext]{ + S: ottltest.Strp("new"), + NextKey: &TestKey[*instrumentationScopeContext]{ + I: ottltest.Intp(2), + NextKey: &TestKey[*instrumentationScopeContext]{ + I: ottltest.Intp(0), }, }, }, diff --git a/pkg/ottl/contexts/internal/slice.go b/pkg/ottl/contexts/internal/slice.go index da846c61f05e..ed6c9ae7b322 100644 --- a/pkg/ottl/contexts/internal/slice.go +++ b/pkg/ottl/contexts/internal/slice.go @@ -4,6 +4,7 @@ package internal // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/internal" import ( + "context" "fmt" "go.opentelemetry.io/collector/pdata/pcommon" @@ -11,34 +12,46 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" ) -func GetSliceValue(s pcommon.Slice, keys []ottl.Key) (any, error) { - if len(keys) == 0 { +func GetSliceValue[K any](ctx context.Context, tCtx K, s pcommon.Slice, key ottl.Key[K]) (any, error) { + if key == nil { return nil, fmt.Errorf("cannot get slice value without key") } - if keys[0].Int == nil { + + i, err := key.Int(ctx, tCtx) + if err != nil { + return nil, err + } + if i == nil { return nil, fmt.Errorf("non-integer indexing is not supported") } - idx := int(*keys[0].Int) + + idx := int(*i) if idx < 0 || idx >= s.Len() { return nil, fmt.Errorf("index %d out of bounds", idx) } - return getIndexableValue(s.At(int(*keys[0].Int)), keys[1:]) + return getIndexableValue[K](ctx, tCtx, s.At(idx), key.Next()) } -func SetSliceValue(s pcommon.Slice, keys []ottl.Key, val any) error { - if len(keys) == 0 { +func SetSliceValue[K any](ctx context.Context, tCtx K, s pcommon.Slice, key ottl.Key[K], val any) error { + if key == nil { return fmt.Errorf("cannot set slice value without key") } - if keys[0].Int == nil { + + i, err := key.Int(ctx, tCtx) + if err != nil { + return err + } + if i == nil { return fmt.Errorf("non-integer indexing is not supported") } - idx := int(*keys[0].Int) + + idx := int(*i) if idx < 0 || idx >= s.Len() { return fmt.Errorf("index %d out of bounds", idx) } - return setIndexableValue(s.At(int(*keys[0].Int)), val, keys[1:]) + return setIndexableValue[K](ctx, tCtx, s.At(idx), val, key.Next()) } diff --git a/pkg/ottl/contexts/internal/slice_test.go b/pkg/ottl/contexts/internal/slice_test.go index b0d6d23b9997..85a7b416c2eb 100644 --- a/pkg/ottl/contexts/internal/slice_test.go +++ b/pkg/ottl/contexts/internal/slice_test.go @@ -4,6 +4,7 @@ package internal import ( + "context" "fmt" "testing" @@ -17,49 +18,36 @@ import ( func Test_GetSliceValue_Invalid(t *testing.T) { tests := []struct { name string - keys []ottl.Key + keys ottl.Key[any] err error }{ - { - name: "no keys", - keys: []ottl.Key{}, - err: fmt.Errorf("cannot get slice value without key"), - }, { name: "first key not an integer", - keys: []ottl.Key{ - { - String: ottltest.Strp("key"), - }, + keys: &TestKey[any]{ + S: ottltest.Strp("key"), }, err: fmt.Errorf("non-integer indexing is not supported"), }, { name: "index too large", - keys: []ottl.Key{ - { - Int: ottltest.Intp(1), - }, + keys: &TestKey[any]{ + I: ottltest.Intp(1), }, err: fmt.Errorf("index 1 out of bounds"), }, { name: "index too small", - keys: []ottl.Key{ - { - Int: ottltest.Intp(-1), - }, + keys: &TestKey[any]{ + I: ottltest.Intp(-1), }, err: fmt.Errorf("index -1 out of bounds"), }, { name: "invalid type", - keys: []ottl.Key{ - { - Int: ottltest.Intp(0), - }, - { - String: ottltest.Strp("string"), + keys: &TestKey[any]{ + I: ottltest.Intp(0), + NextKey: &TestKey[any]{ + S: ottltest.Strp("string"), }, }, err: fmt.Errorf("type Str does not support string indexing"), @@ -71,58 +59,50 @@ func Test_GetSliceValue_Invalid(t *testing.T) { s := pcommon.NewSlice() s.AppendEmpty().SetStr("val") - _, err := GetSliceValue(s, tt.keys) + _, err := GetSliceValue[any](context.Background(), nil, s, tt.keys) assert.Equal(t, tt.err, err) }) } } +func Test_GetSliceValue_NilKey(t *testing.T) { + _, err := GetSliceValue[any](context.Background(), nil, pcommon.NewSlice(), nil) + assert.Error(t, err) +} + func Test_SetSliceValue_Invalid(t *testing.T) { tests := []struct { name string - keys []ottl.Key + keys ottl.Key[any] err error }{ - { - name: "no keys", - keys: []ottl.Key{}, - err: fmt.Errorf("cannot set slice value without key"), - }, { name: "first key not an integer", - keys: []ottl.Key{ - { - String: ottltest.Strp("key"), - }, + keys: &TestKey[any]{ + S: ottltest.Strp("key"), }, err: fmt.Errorf("non-integer indexing is not supported"), }, { name: "index too large", - keys: []ottl.Key{ - { - Int: ottltest.Intp(1), - }, + keys: &TestKey[any]{ + I: ottltest.Intp(1), }, err: fmt.Errorf("index 1 out of bounds"), }, { name: "index too small", - keys: []ottl.Key{ - { - Int: ottltest.Intp(-1), - }, + keys: &TestKey[any]{ + I: ottltest.Intp(-1), }, err: fmt.Errorf("index -1 out of bounds"), }, { name: "invalid type", - keys: []ottl.Key{ - { - Int: ottltest.Intp(0), - }, - { - String: ottltest.Strp("string"), + keys: &TestKey[any]{ + I: ottltest.Intp(0), + NextKey: &TestKey[any]{ + S: ottltest.Strp("string"), }, }, err: fmt.Errorf("type Str does not support string indexing"), @@ -134,8 +114,13 @@ func Test_SetSliceValue_Invalid(t *testing.T) { s := pcommon.NewSlice() s.AppendEmpty().SetStr("val") - err := SetSliceValue(s, tt.keys, "value") + err := SetSliceValue[any](context.Background(), nil, s, tt.keys, "value") assert.Equal(t, tt.err, err) }) } } + +func Test_SetSliceValue_NilKey(t *testing.T) { + err := SetSliceValue[any](context.Background(), nil, pcommon.NewSlice(), nil, "value") + assert.Error(t, err) +} diff --git a/pkg/ottl/contexts/internal/span.go b/pkg/ottl/contexts/internal/span.go index 0c6c48601f71..165ce14777fd 100644 --- a/pkg/ottl/contexts/internal/span.go +++ b/pkg/ottl/contexts/internal/span.go @@ -33,51 +33,57 @@ var SpanSymbolTable = map[ottl.EnumSymbol]ottl.Enum{ "STATUS_CODE_ERROR": ottl.Enum(ptrace.StatusCodeError), } -func SpanPathGetSetter[K SpanContext](path []ottl.Field) (ottl.GetSetter[K], error) { - if len(path) == 0 { +func SpanPathGetSetter[K SpanContext](path ottl.Path[K]) (ottl.GetSetter[K], error) { + if path == nil { return accessSpan[K](), nil } - - switch path[0].Name { + switch path.Name() { case "trace_id": - if len(path) == 1 { + if path.Next() != nil { + if path.Next().Name() == "string" { + return accessStringTraceID[K](), nil + } + } else { return accessTraceID[K](), nil } - if path[1].Name == "string" { - return accessStringTraceID[K](), nil - } case "span_id": - if len(path) == 1 { + if path.Next() != nil { + if path.Next().Name() == "string" { + return accessStringSpanID[K](), nil + } + } else { return accessSpanID[K](), nil } - if path[1].Name == "string" { - return accessStringSpanID[K](), nil - } case "trace_state": - mapKey := path[0].Keys + mapKey := path.Key() if mapKey == nil { return accessTraceState[K](), nil } return accessTraceStateKey[K](mapKey) case "parent_span_id": - if len(path) == 1 { + if path.Next() != nil { + if path.Next().Name() == "string" { + return accessStringParentSpanID[K](), nil + } + } else { return accessParentSpanID[K](), nil } - if path[1].Name == "string" { - return accessStringParentSpanID[K](), nil - } case "name": return accessSpanName[K](), nil case "kind": - if len(path) == 1 { + nextPath := path.Next() + if nextPath != nil { + switch nextPath.Name() { + case "string": + return accessStringKind[K](), nil + case "deprecated_string": + return accessDeprecatedStringKind[K](), nil + default: + return nil, fmt.Errorf("invalid span path expression %v", nextPath.Name()) + } + } else { return accessKind[K](), nil } - if path[1].Name == "string" { - return accessStringKind[K](), nil - } - if path[1].Name == "deprecated_string" { - return accessDeprecatedStringKind[K](), nil - } case "start_time_unix_nano": return accessStartTimeUnixNano[K](), nil case "end_time_unix_nano": @@ -87,7 +93,7 @@ func SpanPathGetSetter[K SpanContext](path []ottl.Field) (ottl.GetSetter[K], err case "end_time": return accessEndTime[K](), nil case "attributes": - mapKeys := path[0].Keys + mapKeys := path.Key() if mapKeys == nil { return accessAttributes[K](), nil } @@ -103,17 +109,20 @@ func SpanPathGetSetter[K SpanContext](path []ottl.Field) (ottl.GetSetter[K], err case "dropped_links_count": return accessDroppedLinksCount[K](), nil case "status": - if len(path) == 1 { + nextPath := path.Next() + if nextPath != nil { + switch nextPath.Name() { + case "code": + return accessStatusCode[K](), nil + case "message": + return accessStatusMessage[K](), nil + default: + return nil, fmt.Errorf("invalid span path expression %v", nextPath.Name()) + } + } else { return accessStatus[K](), nil } - switch path[1].Name { - case "code": - return accessStatusCode[K](), nil - case "message": - return accessStatusMessage[K](), nil - } } - return nil, fmt.Errorf("invalid span path expression %v", path) } @@ -211,27 +220,35 @@ func accessTraceState[K SpanContext]() ottl.StandardGetSetter[K] { } } -func accessTraceStateKey[K SpanContext](keys []ottl.Key) (ottl.StandardGetSetter[K], error) { - if len(keys) != 1 { +func accessTraceStateKey[K SpanContext](keys ottl.Key[K]) (ottl.StandardGetSetter[K], error) { + if keys.Next() != nil { return ottl.StandardGetSetter[K]{}, fmt.Errorf("must provide exactly 1 key when accessing trace_state") } - if keys[0].String == nil { - return ottl.StandardGetSetter[K]{}, fmt.Errorf("trace_state indexing type must be a string") - } return ottl.StandardGetSetter[K]{ Getter: func(ctx context.Context, tCtx K) (any, error) { if ts, err := trace.ParseTraceState(tCtx.GetSpan().TraceState().AsRaw()); err == nil { - if keys[0].String == nil { + s, err := keys.String(ctx, tCtx) + if err != nil { return nil, err } - return ts.Get(*keys[0].String), nil + if s == nil { + return nil, fmt.Errorf("trace_state indexing type must be a string") + } + return ts.Get(*s), nil } return nil, nil }, Setter: func(ctx context.Context, tCtx K, val any) error { if str, ok := val.(string); ok { if ts, err := trace.ParseTraceState(tCtx.GetSpan().TraceState().AsRaw()); err == nil { - if updated, err := ts.Insert(*keys[0].String, str); err == nil { + s, err := keys.String(ctx, tCtx) + if err != nil { + return err + } + if s == nil { + return fmt.Errorf("trace_state indexing type must be a string") + } + if updated, err := ts.Insert(*s, str); err == nil { tCtx.GetSpan().TraceState().FromRaw(updated.String()) } } @@ -434,13 +451,13 @@ func accessAttributes[K SpanContext]() ottl.StandardGetSetter[K] { } } -func accessAttributesKey[K SpanContext](keys []ottl.Key) ottl.StandardGetSetter[K] { +func accessAttributesKey[K SpanContext](keys ottl.Key[K]) ottl.StandardGetSetter[K] { return ottl.StandardGetSetter[K]{ Getter: func(ctx context.Context, tCtx K) (any, error) { - return GetMapValue(tCtx.GetSpan().Attributes(), keys) + return GetMapValue[K](ctx, tCtx, tCtx.GetSpan().Attributes(), keys) }, Setter: func(ctx context.Context, tCtx K, val any) error { - return SetMapValue(tCtx.GetSpan().Attributes(), keys, val) + return SetMapValue[K](ctx, tCtx, tCtx.GetSpan().Attributes(), keys, val) }, } } diff --git a/pkg/ottl/contexts/internal/span_test.go b/pkg/ottl/contexts/internal/span_test.go index 6ccbf92e4a93..a0c695944d4d 100644 --- a/pkg/ottl/contexts/internal/span_test.go +++ b/pkg/ottl/contexts/internal/span_test.go @@ -41,17 +41,15 @@ func TestSpanPathGetSetter(t *testing.T) { tests := []struct { name string - path []ottl.Field + path ottl.Path[*spanContext] orig any newVal any modified func(span ptrace.Span) }{ { name: "trace_id", - path: []ottl.Field{ - { - Name: "trace_id", - }, + path: &TestPath[*spanContext]{ + N: "trace_id", }, orig: pcommon.TraceID(traceID), newVal: pcommon.TraceID(traceID2), @@ -61,10 +59,8 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "span_id", - path: []ottl.Field{ - { - Name: "span_id", - }, + path: &TestPath[*spanContext]{ + N: "span_id", }, orig: pcommon.SpanID(spanID), newVal: pcommon.SpanID(spanID2), @@ -74,12 +70,10 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "trace_id string", - path: []ottl.Field{ - { - Name: "trace_id", - }, - { - Name: "string", + path: &TestPath[*spanContext]{ + N: "trace_id", + NextPath: &TestPath[*spanContext]{ + N: "string", }, }, orig: hex.EncodeToString(traceID[:]), @@ -90,12 +84,10 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "span_id string", - path: []ottl.Field{ - { - Name: "span_id", - }, - { - Name: "string", + path: &TestPath[*spanContext]{ + N: "span_id", + NextPath: &TestPath[*spanContext]{ + N: "string", }, }, orig: hex.EncodeToString(spanID[:]), @@ -106,10 +98,8 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "trace_state", - path: []ottl.Field{ - { - Name: "trace_state", - }, + path: &TestPath[*spanContext]{ + N: "trace_state", }, orig: "key1=val1,key2=val2", newVal: "key=newVal", @@ -119,14 +109,10 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "trace_state key", - path: []ottl.Field{ - { - Name: "trace_state", - Keys: []ottl.Key{ - { - String: ottltest.Strp("key1"), - }, - }, + path: &TestPath[*spanContext]{ + N: "trace_state", + Keys: &TestKey[*spanContext]{ + S: ottltest.Strp("key1"), }, }, orig: "val1", @@ -137,10 +123,8 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "parent_span_id", - path: []ottl.Field{ - { - Name: "parent_span_id", - }, + path: &TestPath[*spanContext]{ + N: "parent_span_id", }, orig: pcommon.SpanID(spanID2), newVal: pcommon.SpanID(spanID), @@ -150,12 +134,10 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "parent_span_id string", - path: []ottl.Field{ - { - Name: "parent_span_id", - }, - { - Name: "string", + path: &TestPath[*spanContext]{ + N: "parent_span_id", + NextPath: &TestPath[*spanContext]{ + N: "string", }, }, orig: hex.EncodeToString(spanID2[:]), @@ -166,10 +148,8 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "name", - path: []ottl.Field{ - { - Name: "name", - }, + path: &TestPath[*spanContext]{ + N: "name", }, orig: "bear", newVal: "cat", @@ -179,10 +159,8 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "kind", - path: []ottl.Field{ - { - Name: "kind", - }, + path: &TestPath[*spanContext]{ + N: "kind", }, orig: int64(2), newVal: int64(3), @@ -192,12 +170,10 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "string kind", - path: []ottl.Field{ - { - Name: "kind", - }, - { - Name: "string", + path: &TestPath[*spanContext]{ + N: "kind", + NextPath: &TestPath[*spanContext]{ + N: "string", }, }, orig: "Server", @@ -208,12 +184,10 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "deprecated string kind", - path: []ottl.Field{ - { - Name: "kind", - }, - { - Name: "deprecated_string", + path: &TestPath[*spanContext]{ + N: "kind", + NextPath: &TestPath[*spanContext]{ + N: "deprecated_string", }, }, orig: "SPAN_KIND_SERVER", @@ -224,10 +198,8 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "start_time_unix_nano", - path: []ottl.Field{ - { - Name: "start_time_unix_nano", - }, + path: &TestPath[*spanContext]{ + N: "start_time_unix_nano", }, orig: int64(100_000_000), newVal: int64(200_000_000), @@ -237,10 +209,8 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "end_time_unix_nano", - path: []ottl.Field{ - { - Name: "end_time_unix_nano", - }, + path: &TestPath[*spanContext]{ + N: "end_time_unix_nano", }, orig: int64(500_000_000), newVal: int64(200_000_000), @@ -250,10 +220,8 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "attributes", - path: []ottl.Field{ - { - Name: "attributes", - }, + path: &TestPath[*spanContext]{ + N: "attributes", }, orig: refSpan.Attributes(), newVal: newAttrs, @@ -263,14 +231,10 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "attributes string", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("str"), - }, - }, + path: &TestPath[*spanContext]{ + N: "attributes", + Keys: &TestKey[*spanContext]{ + S: ottltest.Strp("str"), }, }, orig: "val", @@ -281,14 +245,10 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "attributes bool", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("bool"), - }, - }, + path: &TestPath[*spanContext]{ + N: "attributes", + Keys: &TestKey[*spanContext]{ + S: ottltest.Strp("bool"), }, }, orig: true, @@ -299,14 +259,10 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "attributes int", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("int"), - }, - }, + path: &TestPath[*spanContext]{ + N: "attributes", + Keys: &TestKey[*spanContext]{ + S: ottltest.Strp("int"), }, }, orig: int64(10), @@ -317,14 +273,10 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "attributes float", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("double"), - }, - }, + path: &TestPath[*spanContext]{ + N: "attributes", + Keys: &TestKey[*spanContext]{ + S: ottltest.Strp("double"), }, }, orig: float64(1.2), @@ -335,14 +287,10 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "attributes bytes", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("bytes"), - }, - }, + path: &TestPath[*spanContext]{ + N: "attributes", + Keys: &TestKey[*spanContext]{ + S: ottltest.Strp("bytes"), }, }, orig: []byte{1, 3, 2}, @@ -353,14 +301,10 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "attributes array empty", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_empty"), - }, - }, + path: &TestPath[*spanContext]{ + N: "attributes", + Keys: &TestKey[*spanContext]{ + S: ottltest.Strp("arr_empty"), }, }, orig: func() pcommon.Slice { @@ -374,14 +318,10 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "attributes array string", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_str"), - }, - }, + path: &TestPath[*spanContext]{ + N: "attributes", + Keys: &TestKey[*spanContext]{ + S: ottltest.Strp("arr_str"), }, }, orig: func() pcommon.Slice { @@ -395,14 +335,10 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "attributes array bool", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_bool"), - }, - }, + path: &TestPath[*spanContext]{ + N: "attributes", + Keys: &TestKey[*spanContext]{ + S: ottltest.Strp("arr_bool"), }, }, orig: func() pcommon.Slice { @@ -416,14 +352,10 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "attributes array int", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_int"), - }, - }, + path: &TestPath[*spanContext]{ + N: "attributes", + Keys: &TestKey[*spanContext]{ + S: ottltest.Strp("arr_int"), }, }, orig: func() pcommon.Slice { @@ -437,14 +369,10 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "attributes array float", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_float"), - }, - }, + path: &TestPath[*spanContext]{ + N: "attributes", + Keys: &TestKey[*spanContext]{ + S: ottltest.Strp("arr_float"), }, }, orig: func() pcommon.Slice { @@ -458,14 +386,10 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "attributes array bytes", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_bytes"), - }, - }, + path: &TestPath[*spanContext]{ + N: "attributes", + Keys: &TestKey[*spanContext]{ + S: ottltest.Strp("arr_bytes"), }, }, orig: func() pcommon.Slice { @@ -479,18 +403,14 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "attributes nested", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("slice"), - }, - { - Int: ottltest.Intp(0), - }, - { - String: ottltest.Strp("map"), + path: &TestPath[*spanContext]{ + N: "attributes", + Keys: &TestKey[*spanContext]{ + S: ottltest.Strp("slice"), + NextKey: &TestKey[*spanContext]{ + I: ottltest.Intp(0), + NextKey: &TestKey[*spanContext]{ + S: ottltest.Strp("map"), }, }, }, @@ -507,18 +427,14 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "attributes nested new values", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("new"), - }, - { - Int: ottltest.Intp(2), - }, - { - Int: ottltest.Intp(0), + path: &TestPath[*spanContext]{ + N: "attributes", + Keys: &TestKey[*spanContext]{ + S: ottltest.Strp("new"), + NextKey: &TestKey[*spanContext]{ + I: ottltest.Intp(2), + NextKey: &TestKey[*spanContext]{ + I: ottltest.Intp(0), }, }, }, @@ -536,10 +452,8 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "dropped_attributes_count", - path: []ottl.Field{ - { - Name: "dropped_attributes_count", - }, + path: &TestPath[*spanContext]{ + N: "dropped_attributes_count", }, orig: int64(10), newVal: int64(20), @@ -549,10 +463,8 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "events", - path: []ottl.Field{ - { - Name: "events", - }, + path: &TestPath[*spanContext]{ + N: "events", }, orig: refSpan.Events(), newVal: newEvents, @@ -565,10 +477,8 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "dropped_events_count", - path: []ottl.Field{ - { - Name: "dropped_events_count", - }, + path: &TestPath[*spanContext]{ + N: "dropped_events_count", }, orig: int64(20), newVal: int64(30), @@ -578,10 +488,8 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "links", - path: []ottl.Field{ - { - Name: "links", - }, + path: &TestPath[*spanContext]{ + N: "links", }, orig: refSpan.Links(), newVal: newLinks, @@ -594,10 +502,8 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "dropped_links_count", - path: []ottl.Field{ - { - Name: "dropped_links_count", - }, + path: &TestPath[*spanContext]{ + N: "dropped_links_count", }, orig: int64(30), newVal: int64(40), @@ -607,10 +513,8 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "status", - path: []ottl.Field{ - { - Name: "status", - }, + path: &TestPath[*spanContext]{ + N: "status", }, orig: refSpan.Status(), newVal: newStatus, @@ -620,12 +524,10 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "status code", - path: []ottl.Field{ - { - Name: "status", - }, - { - Name: "code", + path: &TestPath[*spanContext]{ + N: "status", + NextPath: &TestPath[*spanContext]{ + N: "code", }, }, orig: int64(ptrace.StatusCodeOk), @@ -636,12 +538,10 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "status message", - path: []ottl.Field{ - { - Name: "status", - }, - { - Name: "message", + path: &TestPath[*spanContext]{ + N: "status", + NextPath: &TestPath[*spanContext]{ + N: "message", }, }, orig: "good span", @@ -652,10 +552,8 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "start_time", - path: []ottl.Field{ - { - Name: "start_time", - }, + path: &TestPath[*spanContext]{ + N: "start_time", }, orig: time.Date(1970, 1, 1, 0, 0, 0, 100000000, time.UTC), newVal: time.Date(1970, 1, 1, 0, 0, 0, 200000000, time.UTC), @@ -665,10 +563,8 @@ func TestSpanPathGetSetter(t *testing.T) { }, { name: "end_time", - path: []ottl.Field{ - { - Name: "end_time", - }, + path: &TestPath[*spanContext]{ + N: "end_time", }, orig: time.Date(1970, 1, 1, 0, 0, 0, 500000000, time.UTC), newVal: time.Date(1970, 1, 1, 0, 0, 0, 200000000, time.UTC), diff --git a/pkg/ottl/contexts/internal/value.go b/pkg/ottl/contexts/internal/value.go index 24df36d9783a..ccd96f2befc2 100644 --- a/pkg/ottl/contexts/internal/value.go +++ b/pkg/ottl/contexts/internal/value.go @@ -4,6 +4,7 @@ package internal // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/internal" import ( + "context" "errors" "fmt" @@ -62,43 +63,49 @@ func SetValue(value pcommon.Value, val any) error { case pcommon.Map: v.CopyTo(value.SetEmptyMap()) case map[string]any: - value.SetEmptyMap() - for mk, mv := range v { - err = SetMapValue(value.Map(), []ottl.Key{{String: &mk}}, mv) - } + err = value.FromRaw(v) } return err } -func getIndexableValue(value pcommon.Value, keys []ottl.Key) (any, error) { - val := value +func getIndexableValue[K any](ctx context.Context, tCtx K, value pcommon.Value, key ottl.Key[K]) (any, error) { + val, currentKey := value, key var ok bool - for i := 0; i < len(keys); i++ { + for currentKey != nil { switch val.Type() { case pcommon.ValueTypeMap: - if keys[i].String == nil { + s, err := currentKey.String(ctx, tCtx) + if err != nil { + return nil, err + } + if s == nil { return nil, fmt.Errorf("map must be indexed by a string") } - val, ok = val.Map().Get(*keys[i].String) + val, ok = val.Map().Get(*s) if !ok { return nil, nil } case pcommon.ValueTypeSlice: - if keys[i].Int == nil { + i, err := currentKey.Int(ctx, tCtx) + if err != nil { + return nil, err + } + if i == nil { return nil, fmt.Errorf("slice must be indexed by an int") } - if int(*keys[i].Int) >= val.Slice().Len() || int(*keys[i].Int) < 0 { - return nil, fmt.Errorf("index %v out of bounds", *keys[i].Int) + if int(*i) >= val.Slice().Len() || int(*i) < 0 { + return nil, fmt.Errorf("index %v out of bounds", *i) } - val = val.Slice().At(int(*keys[i].Int)) + val = val.Slice().At(int(*i)) default: return nil, fmt.Errorf("type %v does not support string indexing", val.Type()) } + currentKey = currentKey.Next() } return ottlcommon.GetValue(val), nil } -func setIndexableValue(currentValue pcommon.Value, val any, keys []ottl.Key) error { +func setIndexableValue[K any](ctx context.Context, tCtx K, currentValue pcommon.Value, val any, key ottl.Key[K]) error { var newValue pcommon.Value switch val.(type) { case []string, []bool, []int64, []float64, [][]byte, []any: @@ -111,33 +118,50 @@ func setIndexableValue(currentValue pcommon.Value, val any, keys []ottl.Key) err return err } - for i := 0; i < len(keys); i++ { + currentKey := key + for currentKey != nil { switch currentValue.Type() { case pcommon.ValueTypeMap: - if keys[i].String == nil { + s, err := currentKey.String(ctx, tCtx) + if err != nil { + return err + } + if s == nil { return errors.New("map must be indexed by a string") } - potentialValue, ok := currentValue.Map().Get(*keys[i].String) + potentialValue, ok := currentValue.Map().Get(*s) if !ok { - currentValue = currentValue.Map().PutEmpty(*keys[i].String) + currentValue = currentValue.Map().PutEmpty(*s) } else { currentValue = potentialValue } case pcommon.ValueTypeSlice: - if keys[i].Int == nil { + i, err := currentKey.Int(ctx, tCtx) + if err != nil { + return err + } + if i == nil { return errors.New("slice must be indexed by an int") } - if int(*keys[i].Int) >= currentValue.Slice().Len() || int(*keys[i].Int) < 0 { - return fmt.Errorf("index %v out of bounds", *keys[i].Int) + if int(*i) >= currentValue.Slice().Len() || int(*i) < 0 { + return fmt.Errorf("index %v out of bounds", *i) } - currentValue = currentValue.Slice().At(int(*keys[i].Int)) + currentValue = currentValue.Slice().At(int(*i)) case pcommon.ValueTypeEmpty: + s, err := currentKey.String(ctx, tCtx) + if err != nil { + return err + } + i, err := currentKey.Int(ctx, tCtx) + if err != nil { + return err + } switch { - case keys[i].String != nil: - currentValue = currentValue.SetEmptyMap().PutEmpty(*keys[i].String) - case keys[i].Int != nil: + case s != nil: + currentValue = currentValue.SetEmptyMap().PutEmpty(*s) + case i != nil: currentValue.SetEmptySlice() - for k := 0; k < int(*keys[i].Int); k++ { + for k := 0; k < int(*i); k++ { currentValue.Slice().AppendEmpty() } currentValue = currentValue.Slice().AppendEmpty() @@ -147,6 +171,7 @@ func setIndexableValue(currentValue pcommon.Value, val any, keys []ottl.Key) err default: return fmt.Errorf("type %v does not support string indexing", currentValue.Type()) } + currentKey = currentKey.Next() } newValue.CopyTo(currentValue) return nil diff --git a/pkg/ottl/contexts/internal/value_test.go b/pkg/ottl/contexts/internal/value_test.go index ca3aa95442c7..df7c77362a02 100644 --- a/pkg/ottl/contexts/internal/value_test.go +++ b/pkg/ottl/contexts/internal/value_test.go @@ -4,18 +4,15 @@ package internal // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/internal" import ( + "context" "testing" "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/pcommon" - - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" ) func Test_SetIndexableValue_EmptyValueNoIndex(t *testing.T) { - keys := []ottl.Key{ - {}, - } - err := setIndexableValue(pcommon.NewValueEmpty(), nil, keys) + keys := TestKey[any]{} + err := setIndexableValue[any](context.Background(), nil, pcommon.NewValueEmpty(), nil, &keys) assert.Error(t, err) } diff --git a/pkg/ottl/contexts/ottldatapoint/datapoint.go b/pkg/ottl/contexts/ottldatapoint/datapoint.go index d2f432a2bb20..c977abfff037 100644 --- a/pkg/ottl/contexts/ottldatapoint/datapoint.go +++ b/pkg/ottl/contexts/ottldatapoint/datapoint.go @@ -66,10 +66,10 @@ func (tCtx TransformContext) getCache() pcommon.Map { } func NewParser(functions map[string]ottl.Factory[TransformContext], telemetrySettings component.TelemetrySettings, options ...Option) (ottl.Parser[TransformContext], error) { - pathExpressionParser := pathExpressionParser{telemetrySettings} + pep := pathExpressionParser{telemetrySettings} p, err := ottl.NewParser[TransformContext]( functions, - pathExpressionParser.parsePath, + pep.parsePath, telemetrySettings, ottl.WithEnumParser[TransformContext](parseEnum), ) @@ -139,33 +139,27 @@ type pathExpressionParser struct { telemetrySettings component.TelemetrySettings } -func (pep *pathExpressionParser) parsePath(val *ottl.Path) (ottl.GetSetter[TransformContext], error) { - if val != nil && len(val.Fields) > 0 { - return newPathGetSetter(val.Fields) +func (pep *pathExpressionParser) parsePath(path ottl.Path[TransformContext]) (ottl.GetSetter[TransformContext], error) { + if path == nil { + return nil, fmt.Errorf("path cannot be nil") } - return nil, fmt.Errorf("bad path %v", val) -} - -func newPathGetSetter(path []ottl.Field) (ottl.GetSetter[TransformContext], error) { - switch path[0].Name { + switch path.Name() { case "cache": - mapKey := path[0].Keys - if mapKey == nil { + if path.Key() == nil { return accessCache(), nil } - return accessCacheKey(mapKey), nil + return accessCacheKey(path.Key()), nil case "resource": - return internal.ResourcePathGetSetter[TransformContext](path[1:]) + return internal.ResourcePathGetSetter[TransformContext](path.Next()) case "instrumentation_scope": - return internal.ScopePathGetSetter[TransformContext](path[1:]) + return internal.ScopePathGetSetter[TransformContext](path.Next()) case "metric": - return internal.MetricPathGetSetter[TransformContext](path[1:]) + return internal.MetricPathGetSetter[TransformContext](path.Next()) case "attributes": - mapKey := path[0].Keys - if mapKey == nil { + if path.Key() == nil { return accessAttributes(), nil } - return accessAttributesKey(mapKey), nil + return accessAttributesKey(path.Key()), nil case "start_time_unix_nano": return accessStartTimeUnixNano(), nil case "time_unix_nano": @@ -195,25 +189,33 @@ func newPathGetSetter(path []ottl.Field) (ottl.GetSetter[TransformContext], erro case "zero_count": return accessZeroCount(), nil case "positive": - if len(path) == 1 { + nextPath := path.Next() + if nextPath != nil { + switch nextPath.Name() { + case "offset": + return accessPositiveOffset(), nil + case "bucket_counts": + return accessPositiveBucketCounts(), nil + default: + return nil, fmt.Errorf("invalid span path expression %v", nextPath.Name()) + } + } else { return accessPositive(), nil } - switch path[1].Name { - case "offset": - return accessPositiveOffset(), nil - case "bucket_counts": - return accessPositiveBucketCounts(), nil - } case "negative": - if len(path) == 1 { + nextPath := path.Next() + if nextPath != nil { + switch nextPath.Name() { + case "offset": + return accessNegativeOffset(), nil + case "bucket_counts": + return accessNegativeBucketCounts(), nil + default: + return nil, fmt.Errorf("invalid span path expression %v", nextPath.Name()) + } + } else { return accessNegative(), nil } - switch path[1].Name { - case "offset": - return accessNegativeOffset(), nil - case "bucket_counts": - return accessNegativeBucketCounts(), nil - } case "quantile_values": return accessQuantileValues(), nil } @@ -234,13 +236,13 @@ func accessCache() ottl.StandardGetSetter[TransformContext] { } } -func accessCacheKey(keys []ottl.Key) ottl.StandardGetSetter[TransformContext] { +func accessCacheKey(key ottl.Key[TransformContext]) ottl.StandardGetSetter[TransformContext] { return ottl.StandardGetSetter[TransformContext]{ Getter: func(ctx context.Context, tCtx TransformContext) (any, error) { - return internal.GetMapValue(tCtx.getCache(), keys) + return internal.GetMapValue[TransformContext](ctx, tCtx, tCtx.getCache(), key) }, Setter: func(ctx context.Context, tCtx TransformContext, val any) error { - return internal.SetMapValue(tCtx.getCache(), keys, val) + return internal.SetMapValue[TransformContext](ctx, tCtx, tCtx.getCache(), key, val) }, } } @@ -284,31 +286,31 @@ func accessAttributes() ottl.StandardGetSetter[TransformContext] { } } -func accessAttributesKey(keys []ottl.Key) ottl.StandardGetSetter[TransformContext] { +func accessAttributesKey(key ottl.Key[TransformContext]) ottl.StandardGetSetter[TransformContext] { return ottl.StandardGetSetter[TransformContext]{ Getter: func(ctx context.Context, tCtx TransformContext) (any, error) { switch tCtx.GetDataPoint().(type) { case pmetric.NumberDataPoint: - return internal.GetMapValue(tCtx.GetDataPoint().(pmetric.NumberDataPoint).Attributes(), keys) + return internal.GetMapValue[TransformContext](ctx, tCtx, tCtx.GetDataPoint().(pmetric.NumberDataPoint).Attributes(), key) case pmetric.HistogramDataPoint: - return internal.GetMapValue(tCtx.GetDataPoint().(pmetric.HistogramDataPoint).Attributes(), keys) + return internal.GetMapValue[TransformContext](ctx, tCtx, tCtx.GetDataPoint().(pmetric.HistogramDataPoint).Attributes(), key) case pmetric.ExponentialHistogramDataPoint: - return internal.GetMapValue(tCtx.GetDataPoint().(pmetric.ExponentialHistogramDataPoint).Attributes(), keys) + return internal.GetMapValue[TransformContext](ctx, tCtx, tCtx.GetDataPoint().(pmetric.ExponentialHistogramDataPoint).Attributes(), key) case pmetric.SummaryDataPoint: - return internal.GetMapValue(tCtx.GetDataPoint().(pmetric.SummaryDataPoint).Attributes(), keys) + return internal.GetMapValue[TransformContext](ctx, tCtx, tCtx.GetDataPoint().(pmetric.SummaryDataPoint).Attributes(), key) } return nil, nil }, Setter: func(ctx context.Context, tCtx TransformContext, val any) error { switch tCtx.GetDataPoint().(type) { case pmetric.NumberDataPoint: - return internal.SetMapValue(tCtx.GetDataPoint().(pmetric.NumberDataPoint).Attributes(), keys, val) + return internal.SetMapValue[TransformContext](ctx, tCtx, tCtx.GetDataPoint().(pmetric.NumberDataPoint).Attributes(), key, val) case pmetric.HistogramDataPoint: - return internal.SetMapValue(tCtx.GetDataPoint().(pmetric.HistogramDataPoint).Attributes(), keys, val) + return internal.SetMapValue[TransformContext](ctx, tCtx, tCtx.GetDataPoint().(pmetric.HistogramDataPoint).Attributes(), key, val) case pmetric.ExponentialHistogramDataPoint: - return internal.SetMapValue(tCtx.GetDataPoint().(pmetric.ExponentialHistogramDataPoint).Attributes(), keys, val) + return internal.SetMapValue[TransformContext](ctx, tCtx, tCtx.GetDataPoint().(pmetric.ExponentialHistogramDataPoint).Attributes(), key, val) case pmetric.SummaryDataPoint: - return internal.SetMapValue(tCtx.GetDataPoint().(pmetric.SummaryDataPoint).Attributes(), keys, val) + return internal.SetMapValue[TransformContext](ctx, tCtx, tCtx.GetDataPoint().(pmetric.SummaryDataPoint).Attributes(), key, val) } return nil }, diff --git a/pkg/ottl/contexts/ottldatapoint/datapoint_test.go b/pkg/ottl/contexts/ottldatapoint/datapoint_test.go index bac2de90d839..3c26db075b25 100644 --- a/pkg/ottl/contexts/ottldatapoint/datapoint_test.go +++ b/pkg/ottl/contexts/ottldatapoint/datapoint_test.go @@ -13,6 +13,7 @@ import ( "go.opentelemetry.io/collector/pdata/pmetric" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/ottltest" ) @@ -22,19 +23,16 @@ func Test_newPathGetSetter_Cache(t *testing.T) { tests := []struct { name string - path []ottl.Field + path ottl.Path[TransformContext] orig any newVal any modified func(cache pcommon.Map) valueType pmetric.NumberDataPointValueType }{ - { name: "cache", - path: []ottl.Field{ - { - Name: "cache", - }, + path: &internal.TestPath[TransformContext]{ + N: "cache", }, orig: pcommon.NewMap(), newVal: newCache, @@ -44,14 +42,10 @@ func Test_newPathGetSetter_Cache(t *testing.T) { }, { name: "cache access", - path: []ottl.Field{ - { - Name: "cache", - Keys: []ottl.Key{ - { - String: ottltest.Strp("temp"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "cache", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("temp"), }, }, orig: nil, @@ -63,7 +57,8 @@ func Test_newPathGetSetter_Cache(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - accessor, err := newPathGetSetter(tt.path) + pep := pathExpressionParser{} + accessor, err := pep.parsePath(tt.path) assert.NoError(t, err) numberDataPoint := createNumberDataPointTelemetry(tt.valueType) @@ -101,7 +96,7 @@ func Test_newPathGetSetter_NumberDataPoint(t *testing.T) { tests := []struct { name string - path []ottl.Field + path ottl.Path[TransformContext] orig any newVal any modified func(pmetric.NumberDataPoint) @@ -109,10 +104,8 @@ func Test_newPathGetSetter_NumberDataPoint(t *testing.T) { }{ { name: "start_time_unix_nano", - path: []ottl.Field{ - { - Name: "start_time_unix_nano", - }, + path: &internal.TestPath[TransformContext]{ + N: "start_time_unix_nano", }, orig: int64(100_000_000), newVal: int64(200_000_000), @@ -122,10 +115,8 @@ func Test_newPathGetSetter_NumberDataPoint(t *testing.T) { }, { name: "start_time", - path: []ottl.Field{ - { - Name: "start_time", - }, + path: &internal.TestPath[TransformContext]{ + N: "start_time", }, orig: time.Date(1970, 1, 1, 0, 0, 0, 100000000, time.UTC), newVal: time.Date(1970, 1, 1, 0, 0, 0, 86400000000000, time.UTC), @@ -135,10 +126,8 @@ func Test_newPathGetSetter_NumberDataPoint(t *testing.T) { }, { name: "time", - path: []ottl.Field{ - { - Name: "time", - }, + path: &internal.TestPath[TransformContext]{ + N: "time", }, orig: time.Date(1970, 1, 1, 0, 0, 0, 500000000, time.UTC), newVal: time.Date(1970, 1, 1, 0, 0, 0, 200000000, time.UTC), @@ -148,10 +137,8 @@ func Test_newPathGetSetter_NumberDataPoint(t *testing.T) { }, { name: "time_unix_nano", - path: []ottl.Field{ - { - Name: "time_unix_nano", - }, + path: &internal.TestPath[TransformContext]{ + N: "time_unix_nano", }, orig: int64(500_000_000), newVal: int64(200_000_000), @@ -161,10 +148,8 @@ func Test_newPathGetSetter_NumberDataPoint(t *testing.T) { }, { name: "value_double", - path: []ottl.Field{ - { - Name: "value_double", - }, + path: &internal.TestPath[TransformContext]{ + N: "value_double", }, orig: 1.1, newVal: 2.2, @@ -175,10 +160,8 @@ func Test_newPathGetSetter_NumberDataPoint(t *testing.T) { }, { name: "value_int", - path: []ottl.Field{ - { - Name: "value_int", - }, + path: &internal.TestPath[TransformContext]{ + N: "value_int", }, orig: int64(1), newVal: int64(2), @@ -188,10 +171,8 @@ func Test_newPathGetSetter_NumberDataPoint(t *testing.T) { }, { name: "flags", - path: []ottl.Field{ - { - Name: "flags", - }, + path: &internal.TestPath[TransformContext]{ + N: "flags", }, orig: int64(0), newVal: int64(1), @@ -201,10 +182,8 @@ func Test_newPathGetSetter_NumberDataPoint(t *testing.T) { }, { name: "exemplars", - path: []ottl.Field{ - { - Name: "exemplars", - }, + path: &internal.TestPath[TransformContext]{ + N: "exemplars", }, orig: refNumberDataPoint.Exemplars(), newVal: newExemplars, @@ -214,10 +193,8 @@ func Test_newPathGetSetter_NumberDataPoint(t *testing.T) { }, { name: "attributes", - path: []ottl.Field{ - { - Name: "attributes", - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", }, orig: refNumberDataPoint.Attributes(), newVal: newAttrs, @@ -227,14 +204,10 @@ func Test_newPathGetSetter_NumberDataPoint(t *testing.T) { }, { name: "attributes string", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("str"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("str"), }, }, orig: "val", @@ -245,14 +218,10 @@ func Test_newPathGetSetter_NumberDataPoint(t *testing.T) { }, { name: "attributes bool", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("bool"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("bool"), }, }, orig: true, @@ -263,14 +232,10 @@ func Test_newPathGetSetter_NumberDataPoint(t *testing.T) { }, { name: "attributes int", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("int"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("int"), }, }, orig: int64(10), @@ -281,14 +246,10 @@ func Test_newPathGetSetter_NumberDataPoint(t *testing.T) { }, { name: "attributes float", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("double"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("double"), }, }, orig: float64(1.2), @@ -299,14 +260,10 @@ func Test_newPathGetSetter_NumberDataPoint(t *testing.T) { }, { name: "attributes bytes", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("bytes"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("bytes"), }, }, orig: []byte{1, 3, 2}, @@ -317,14 +274,10 @@ func Test_newPathGetSetter_NumberDataPoint(t *testing.T) { }, { name: "attributes array string", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_str"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_str"), }, }, orig: func() pcommon.Slice { @@ -338,14 +291,10 @@ func Test_newPathGetSetter_NumberDataPoint(t *testing.T) { }, { name: "attributes array bool", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_bool"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_bool"), }, }, orig: func() pcommon.Slice { @@ -359,14 +308,10 @@ func Test_newPathGetSetter_NumberDataPoint(t *testing.T) { }, { name: "attributes array int", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_int"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_int"), }, }, orig: func() pcommon.Slice { @@ -380,14 +325,10 @@ func Test_newPathGetSetter_NumberDataPoint(t *testing.T) { }, { name: "attributes array float", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_float"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_float"), }, }, orig: func() pcommon.Slice { @@ -401,14 +342,10 @@ func Test_newPathGetSetter_NumberDataPoint(t *testing.T) { }, { name: "attributes array bytes", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_bytes"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_bytes"), }, }, orig: func() pcommon.Slice { @@ -422,14 +359,10 @@ func Test_newPathGetSetter_NumberDataPoint(t *testing.T) { }, { name: "attributes pcommon.Map", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("pMap"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("pMap"), }, }, orig: func() pcommon.Map { @@ -445,14 +378,10 @@ func Test_newPathGetSetter_NumberDataPoint(t *testing.T) { }, { name: "attributes map[string]any", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("map"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("map"), }, }, orig: func() pcommon.Map { @@ -468,18 +397,14 @@ func Test_newPathGetSetter_NumberDataPoint(t *testing.T) { }, { name: "attributes nested", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("slice"), - }, - { - Int: ottltest.Intp(0), - }, - { - String: ottltest.Strp("map"), + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("slice"), + NextKey: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(0), + NextKey: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("map"), }, }, }, @@ -496,18 +421,14 @@ func Test_newPathGetSetter_NumberDataPoint(t *testing.T) { }, { name: "attributes nested new values", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("new"), - }, - { - Int: ottltest.Intp(2), - }, - { - Int: ottltest.Intp(0), + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("new"), + NextKey: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(2), + NextKey: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(0), }, }, }, @@ -526,7 +447,8 @@ func Test_newPathGetSetter_NumberDataPoint(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - accessor, err := newPathGetSetter(tt.path) + pep := pathExpressionParser{} + accessor, err := pep.parsePath(tt.path) assert.NoError(t, err) numberDataPoint := createNumberDataPointTelemetry(tt.valueType) @@ -583,17 +505,15 @@ func Test_newPathGetSetter_HistogramDataPoint(t *testing.T) { tests := []struct { name string - path []ottl.Field + path ottl.Path[TransformContext] orig any newVal any modified func(pmetric.HistogramDataPoint) }{ { name: "start_time_unix_nano", - path: []ottl.Field{ - { - Name: "start_time_unix_nano", - }, + path: &internal.TestPath[TransformContext]{ + N: "start_time_unix_nano", }, orig: int64(100_000_000), newVal: int64(200_000_000), @@ -603,10 +523,8 @@ func Test_newPathGetSetter_HistogramDataPoint(t *testing.T) { }, { name: "time_unix_nano", - path: []ottl.Field{ - { - Name: "time_unix_nano", - }, + path: &internal.TestPath[TransformContext]{ + N: "time_unix_nano", }, orig: int64(500_000_000), newVal: int64(200_000_000), @@ -616,10 +534,8 @@ func Test_newPathGetSetter_HistogramDataPoint(t *testing.T) { }, { name: "flags", - path: []ottl.Field{ - { - Name: "flags", - }, + path: &internal.TestPath[TransformContext]{ + N: "flags", }, orig: int64(0), newVal: int64(1), @@ -629,10 +545,8 @@ func Test_newPathGetSetter_HistogramDataPoint(t *testing.T) { }, { name: "count", - path: []ottl.Field{ - { - Name: "count", - }, + path: &internal.TestPath[TransformContext]{ + N: "count", }, orig: int64(2), newVal: int64(3), @@ -642,10 +556,8 @@ func Test_newPathGetSetter_HistogramDataPoint(t *testing.T) { }, { name: "sum", - path: []ottl.Field{ - { - Name: "sum", - }, + path: &internal.TestPath[TransformContext]{ + N: "sum", }, orig: 10.1, newVal: 10.2, @@ -655,10 +567,8 @@ func Test_newPathGetSetter_HistogramDataPoint(t *testing.T) { }, { name: "bucket_counts", - path: []ottl.Field{ - { - Name: "bucket_counts", - }, + path: &internal.TestPath[TransformContext]{ + N: "bucket_counts", }, orig: []uint64{1, 1}, newVal: []uint64{1, 2}, @@ -668,10 +578,8 @@ func Test_newPathGetSetter_HistogramDataPoint(t *testing.T) { }, { name: "explicit_bounds", - path: []ottl.Field{ - { - Name: "explicit_bounds", - }, + path: &internal.TestPath[TransformContext]{ + N: "explicit_bounds", }, orig: []float64{1, 2}, newVal: []float64{1, 2, 3}, @@ -681,10 +589,8 @@ func Test_newPathGetSetter_HistogramDataPoint(t *testing.T) { }, { name: "exemplars", - path: []ottl.Field{ - { - Name: "exemplars", - }, + path: &internal.TestPath[TransformContext]{ + N: "exemplars", }, orig: refHistogramDataPoint.Exemplars(), newVal: newExemplars, @@ -694,10 +600,8 @@ func Test_newPathGetSetter_HistogramDataPoint(t *testing.T) { }, { name: "attributes", - path: []ottl.Field{ - { - Name: "attributes", - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", }, orig: refHistogramDataPoint.Attributes(), newVal: newAttrs, @@ -707,14 +611,10 @@ func Test_newPathGetSetter_HistogramDataPoint(t *testing.T) { }, { name: "attributes string", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("str"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("str"), }, }, orig: "val", @@ -725,14 +625,10 @@ func Test_newPathGetSetter_HistogramDataPoint(t *testing.T) { }, { name: "attributes bool", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("bool"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("bool"), }, }, orig: true, @@ -743,14 +639,10 @@ func Test_newPathGetSetter_HistogramDataPoint(t *testing.T) { }, { name: "attributes int", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("int"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("int"), }, }, orig: int64(10), @@ -761,14 +653,10 @@ func Test_newPathGetSetter_HistogramDataPoint(t *testing.T) { }, { name: "attributes float", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("double"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("double"), }, }, orig: float64(1.2), @@ -779,14 +667,10 @@ func Test_newPathGetSetter_HistogramDataPoint(t *testing.T) { }, { name: "attributes bytes", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("bytes"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("bytes"), }, }, orig: []byte{1, 3, 2}, @@ -797,14 +681,10 @@ func Test_newPathGetSetter_HistogramDataPoint(t *testing.T) { }, { name: "attributes array string", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_str"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_str"), }, }, orig: func() pcommon.Slice { @@ -818,14 +698,10 @@ func Test_newPathGetSetter_HistogramDataPoint(t *testing.T) { }, { name: "attributes array bool", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_bool"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_bool"), }, }, orig: func() pcommon.Slice { @@ -839,14 +715,10 @@ func Test_newPathGetSetter_HistogramDataPoint(t *testing.T) { }, { name: "attributes array int", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_int"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_int"), }, }, orig: func() pcommon.Slice { @@ -860,14 +732,10 @@ func Test_newPathGetSetter_HistogramDataPoint(t *testing.T) { }, { name: "attributes array float", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_float"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_float"), }, }, orig: func() pcommon.Slice { @@ -881,14 +749,10 @@ func Test_newPathGetSetter_HistogramDataPoint(t *testing.T) { }, { name: "attributes array bytes", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_bytes"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_bytes"), }, }, orig: func() pcommon.Slice { @@ -902,14 +766,10 @@ func Test_newPathGetSetter_HistogramDataPoint(t *testing.T) { }, { name: "attributes pcommon.Map", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("pMap"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("pMap"), }, }, orig: func() pcommon.Map { @@ -925,14 +785,10 @@ func Test_newPathGetSetter_HistogramDataPoint(t *testing.T) { }, { name: "attributes map[string]any", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("map"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("map"), }, }, orig: func() pcommon.Map { @@ -948,18 +804,14 @@ func Test_newPathGetSetter_HistogramDataPoint(t *testing.T) { }, { name: "attributes nested", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("slice"), - }, - { - Int: ottltest.Intp(0), - }, - { - String: ottltest.Strp("map"), + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("slice"), + NextKey: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(0), + NextKey: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("map"), }, }, }, @@ -976,18 +828,14 @@ func Test_newPathGetSetter_HistogramDataPoint(t *testing.T) { }, { name: "attributes nested new values", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("new"), - }, - { - Int: ottltest.Intp(2), - }, - { - Int: ottltest.Intp(0), + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("new"), + NextKey: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(2), + NextKey: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(0), }, }, }, @@ -1006,7 +854,8 @@ func Test_newPathGetSetter_HistogramDataPoint(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - accessor, err := newPathGetSetter(tt.path) + pep := pathExpressionParser{} + accessor, err := pep.parsePath(tt.path) assert.NoError(t, err) histogramDataPoint := createHistogramDataPointTelemetry() @@ -1068,17 +917,15 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { tests := []struct { name string - path []ottl.Field + path ottl.Path[TransformContext] orig any newVal any modified func(pmetric.ExponentialHistogramDataPoint) }{ { name: "start_time_unix_nano", - path: []ottl.Field{ - { - Name: "start_time_unix_nano", - }, + path: &internal.TestPath[TransformContext]{ + N: "start_time_unix_nano", }, orig: int64(100_000_000), newVal: int64(200_000_000), @@ -1088,10 +935,8 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "time_unix_nano", - path: []ottl.Field{ - { - Name: "time_unix_nano", - }, + path: &internal.TestPath[TransformContext]{ + N: "time_unix_nano", }, orig: int64(500_000_000), newVal: int64(200_000_000), @@ -1101,10 +946,8 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "flags", - path: []ottl.Field{ - { - Name: "flags", - }, + path: &internal.TestPath[TransformContext]{ + N: "flags", }, orig: int64(0), newVal: int64(1), @@ -1114,10 +957,8 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "count", - path: []ottl.Field{ - { - Name: "count", - }, + path: &internal.TestPath[TransformContext]{ + N: "count", }, orig: int64(2), newVal: int64(3), @@ -1127,10 +968,8 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "sum", - path: []ottl.Field{ - { - Name: "sum", - }, + path: &internal.TestPath[TransformContext]{ + N: "sum", }, orig: 10.1, newVal: 10.2, @@ -1140,10 +979,8 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "scale", - path: []ottl.Field{ - { - Name: "scale", - }, + path: &internal.TestPath[TransformContext]{ + N: "scale", }, orig: int64(1), newVal: int64(2), @@ -1153,10 +990,8 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "zero_count", - path: []ottl.Field{ - { - Name: "zero_count", - }, + path: &internal.TestPath[TransformContext]{ + N: "zero_count", }, orig: int64(1), newVal: int64(2), @@ -1166,10 +1001,8 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "positive", - path: []ottl.Field{ - { - Name: "positive", - }, + path: &internal.TestPath[TransformContext]{ + N: "positive", }, orig: refExpoHistogramDataPoint.Positive(), newVal: newPositive, @@ -1179,12 +1012,10 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "positive offset", - path: []ottl.Field{ - { - Name: "positive", - }, - { - Name: "offset", + path: &internal.TestPath[TransformContext]{ + N: "positive", + NextPath: &internal.TestPath[TransformContext]{ + N: "offset", }, }, orig: int64(1), @@ -1195,12 +1026,10 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "positive bucket_counts", - path: []ottl.Field{ - { - Name: "positive", - }, - { - Name: "bucket_counts", + path: &internal.TestPath[TransformContext]{ + N: "positive", + NextPath: &internal.TestPath[TransformContext]{ + N: "bucket_counts", }, }, orig: []uint64{1, 1}, @@ -1211,10 +1040,8 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "negative", - path: []ottl.Field{ - { - Name: "negative", - }, + path: &internal.TestPath[TransformContext]{ + N: "negative", }, orig: refExpoHistogramDataPoint.Negative(), newVal: newPositive, @@ -1224,12 +1051,10 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "negative offset", - path: []ottl.Field{ - { - Name: "negative", - }, - { - Name: "offset", + path: &internal.TestPath[TransformContext]{ + N: "negative", + NextPath: &internal.TestPath[TransformContext]{ + N: "offset", }, }, orig: int64(1), @@ -1240,12 +1065,10 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "negative bucket_counts", - path: []ottl.Field{ - { - Name: "negative", - }, - { - Name: "bucket_counts", + path: &internal.TestPath[TransformContext]{ + N: "negative", + NextPath: &internal.TestPath[TransformContext]{ + N: "bucket_counts", }, }, orig: []uint64{1, 1}, @@ -1256,10 +1079,8 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "exemplars", - path: []ottl.Field{ - { - Name: "exemplars", - }, + path: &internal.TestPath[TransformContext]{ + N: "exemplars", }, orig: refExpoHistogramDataPoint.Exemplars(), newVal: newExemplars, @@ -1269,10 +1090,8 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "attributes", - path: []ottl.Field{ - { - Name: "attributes", - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", }, orig: refExpoHistogramDataPoint.Attributes(), newVal: newAttrs, @@ -1282,14 +1101,10 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "attributes string", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("str"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("str"), }, }, orig: "val", @@ -1300,14 +1115,10 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "attributes bool", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("bool"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("bool"), }, }, orig: true, @@ -1318,14 +1129,10 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "attributes int", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("int"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("int"), }, }, orig: int64(10), @@ -1336,14 +1143,10 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "attributes float", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("double"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("double"), }, }, orig: 1.2, @@ -1354,14 +1157,10 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "attributes bytes", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("bytes"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("bytes"), }, }, orig: []byte{1, 3, 2}, @@ -1372,14 +1171,10 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "attributes array string", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_str"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_str"), }, }, orig: func() pcommon.Slice { @@ -1393,14 +1188,10 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "attributes array bool", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_bool"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_bool"), }, }, orig: func() pcommon.Slice { @@ -1414,14 +1205,10 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "attributes array int", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_int"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_int"), }, }, orig: func() pcommon.Slice { @@ -1435,14 +1222,10 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "attributes array float", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_float"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_float"), }, }, orig: func() pcommon.Slice { @@ -1456,14 +1239,10 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "attributes array bytes", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_bytes"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_bytes"), }, }, orig: func() pcommon.Slice { @@ -1477,14 +1256,10 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "attributes pcommon.Map", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("pMap"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("pMap"), }, }, orig: func() pcommon.Map { @@ -1500,14 +1275,10 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "attributes map[string]any", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("map"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("map"), }, }, orig: func() pcommon.Map { @@ -1523,18 +1294,14 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "attributes nested", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("slice"), - }, - { - Int: ottltest.Intp(0), - }, - { - String: ottltest.Strp("map"), + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("slice"), + NextKey: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(0), + NextKey: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("map"), }, }, }, @@ -1551,18 +1318,14 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { }, { name: "attributes nested new values", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("new"), - }, - { - Int: ottltest.Intp(2), - }, - { - Int: ottltest.Intp(0), + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("new"), + NextKey: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(2), + NextKey: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(0), }, }, }, @@ -1581,7 +1344,8 @@ func Test_newPathGetSetter_ExpoHistogramDataPoint(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - accessor, err := newPathGetSetter(tt.path) + pep := pathExpressionParser{} + accessor, err := pep.parsePath(tt.path) assert.NoError(t, err) expoHistogramDataPoint := createExpoHistogramDataPointTelemetry() @@ -1644,17 +1408,15 @@ func Test_newPathGetSetter_SummaryDataPoint(t *testing.T) { tests := []struct { name string - path []ottl.Field + path ottl.Path[TransformContext] orig any newVal any modified func(pmetric.SummaryDataPoint) }{ { name: "start_time_unix_nano", - path: []ottl.Field{ - { - Name: "start_time_unix_nano", - }, + path: &internal.TestPath[TransformContext]{ + N: "start_time_unix_nano", }, orig: int64(100_000_000), newVal: int64(200_000_000), @@ -1664,10 +1426,8 @@ func Test_newPathGetSetter_SummaryDataPoint(t *testing.T) { }, { name: "time_unix_nano", - path: []ottl.Field{ - { - Name: "time_unix_nano", - }, + path: &internal.TestPath[TransformContext]{ + N: "time_unix_nano", }, orig: int64(500_000_000), newVal: int64(200_000_000), @@ -1677,10 +1437,8 @@ func Test_newPathGetSetter_SummaryDataPoint(t *testing.T) { }, { name: "flags", - path: []ottl.Field{ - { - Name: "flags", - }, + path: &internal.TestPath[TransformContext]{ + N: "flags", }, orig: int64(0), newVal: int64(1), @@ -1690,10 +1448,8 @@ func Test_newPathGetSetter_SummaryDataPoint(t *testing.T) { }, { name: "count", - path: []ottl.Field{ - { - Name: "count", - }, + path: &internal.TestPath[TransformContext]{ + N: "count", }, orig: int64(2), newVal: int64(3), @@ -1703,10 +1459,8 @@ func Test_newPathGetSetter_SummaryDataPoint(t *testing.T) { }, { name: "sum", - path: []ottl.Field{ - { - Name: "sum", - }, + path: &internal.TestPath[TransformContext]{ + N: "sum", }, orig: 10.1, newVal: 10.2, @@ -1716,10 +1470,8 @@ func Test_newPathGetSetter_SummaryDataPoint(t *testing.T) { }, { name: "quantile_values", - path: []ottl.Field{ - { - Name: "quantile_values", - }, + path: &internal.TestPath[TransformContext]{ + N: "quantile_values", }, orig: refSummaryDataPoint.QuantileValues(), newVal: newQuartileValues, @@ -1729,10 +1481,8 @@ func Test_newPathGetSetter_SummaryDataPoint(t *testing.T) { }, { name: "attributes", - path: []ottl.Field{ - { - Name: "attributes", - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", }, orig: refSummaryDataPoint.Attributes(), newVal: newAttrs, @@ -1742,14 +1492,10 @@ func Test_newPathGetSetter_SummaryDataPoint(t *testing.T) { }, { name: "attributes string", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("str"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("str"), }, }, orig: "val", @@ -1760,14 +1506,10 @@ func Test_newPathGetSetter_SummaryDataPoint(t *testing.T) { }, { name: "attributes bool", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("bool"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("bool"), }, }, orig: true, @@ -1778,14 +1520,10 @@ func Test_newPathGetSetter_SummaryDataPoint(t *testing.T) { }, { name: "attributes int", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("int"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("int"), }, }, orig: int64(10), @@ -1796,14 +1534,10 @@ func Test_newPathGetSetter_SummaryDataPoint(t *testing.T) { }, { name: "attributes float", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("double"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("double"), }, }, orig: 1.2, @@ -1814,14 +1548,10 @@ func Test_newPathGetSetter_SummaryDataPoint(t *testing.T) { }, { name: "attributes bytes", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("bytes"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("bytes"), }, }, orig: []byte{1, 3, 2}, @@ -1832,14 +1562,10 @@ func Test_newPathGetSetter_SummaryDataPoint(t *testing.T) { }, { name: "attributes array string", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_str"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_str"), }, }, orig: func() pcommon.Slice { @@ -1853,14 +1579,10 @@ func Test_newPathGetSetter_SummaryDataPoint(t *testing.T) { }, { name: "attributes array bool", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_bool"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_bool"), }, }, orig: func() pcommon.Slice { @@ -1874,14 +1596,10 @@ func Test_newPathGetSetter_SummaryDataPoint(t *testing.T) { }, { name: "attributes array int", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_int"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_int"), }, }, orig: func() pcommon.Slice { @@ -1895,14 +1613,10 @@ func Test_newPathGetSetter_SummaryDataPoint(t *testing.T) { }, { name: "attributes array float", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_float"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_float"), }, }, orig: func() pcommon.Slice { @@ -1916,14 +1630,10 @@ func Test_newPathGetSetter_SummaryDataPoint(t *testing.T) { }, { name: "attributes array bytes", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_bytes"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_bytes"), }, }, orig: func() pcommon.Slice { @@ -1937,14 +1647,10 @@ func Test_newPathGetSetter_SummaryDataPoint(t *testing.T) { }, { name: "attributes pcommon.Map", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("pMap"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("pMap"), }, }, orig: func() pcommon.Map { @@ -1960,14 +1666,10 @@ func Test_newPathGetSetter_SummaryDataPoint(t *testing.T) { }, { name: "attributes map[string]any", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("map"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("map"), }, }, orig: func() pcommon.Map { @@ -1983,18 +1685,14 @@ func Test_newPathGetSetter_SummaryDataPoint(t *testing.T) { }, { name: "attributes nested", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("slice"), - }, - { - Int: ottltest.Intp(0), - }, - { - String: ottltest.Strp("map"), + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("slice"), + NextKey: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(0), + NextKey: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("map"), }, }, }, @@ -2011,18 +1709,14 @@ func Test_newPathGetSetter_SummaryDataPoint(t *testing.T) { }, { name: "attributes nested new values", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("new"), - }, - { - Int: ottltest.Intp(2), - }, - { - Int: ottltest.Intp(0), + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("new"), + NextKey: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(2), + NextKey: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(0), }, }, }, @@ -2041,7 +1735,8 @@ func Test_newPathGetSetter_SummaryDataPoint(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - accessor, err := newPathGetSetter(tt.path) + pep := pathExpressionParser{} + accessor, err := pep.parsePath(tt.path) assert.NoError(t, err) summaryDataPoint := createSummaryDataPointTelemetry() @@ -2122,17 +1817,15 @@ func Test_newPathGetSetter_Metric(t *testing.T) { tests := []struct { name string - path []ottl.Field + path ottl.Path[TransformContext] orig any newVal any modified func(metric pmetric.Metric) }{ { name: "metric", - path: []ottl.Field{ - { - Name: "metric", - }, + path: &internal.TestPath[TransformContext]{ + N: "metric", }, orig: refMetric, newVal: newMetric, @@ -2142,12 +1835,10 @@ func Test_newPathGetSetter_Metric(t *testing.T) { }, { name: "metric name", - path: []ottl.Field{ - { - Name: "metric", - }, - { - Name: "name", + path: &internal.TestPath[TransformContext]{ + N: "metric", + NextPath: &internal.TestPath[TransformContext]{ + N: "name", }, }, orig: "name", @@ -2158,12 +1849,10 @@ func Test_newPathGetSetter_Metric(t *testing.T) { }, { name: "metric description", - path: []ottl.Field{ - { - Name: "metric", - }, - { - Name: "description", + path: &internal.TestPath[TransformContext]{ + N: "metric", + NextPath: &internal.TestPath[TransformContext]{ + N: "description", }, }, orig: "description", @@ -2174,12 +1863,10 @@ func Test_newPathGetSetter_Metric(t *testing.T) { }, { name: "metric unit", - path: []ottl.Field{ - { - Name: "metric", - }, - { - Name: "unit", + path: &internal.TestPath[TransformContext]{ + N: "metric", + NextPath: &internal.TestPath[TransformContext]{ + N: "unit", }, }, orig: "unit", @@ -2190,12 +1877,10 @@ func Test_newPathGetSetter_Metric(t *testing.T) { }, { name: "metric type", - path: []ottl.Field{ - { - Name: "metric", - }, - { - Name: "type", + path: &internal.TestPath[TransformContext]{ + N: "metric", + NextPath: &internal.TestPath[TransformContext]{ + N: "type", }, }, orig: int64(pmetric.MetricTypeSum), @@ -2205,12 +1890,10 @@ func Test_newPathGetSetter_Metric(t *testing.T) { }, { name: "metric aggregation_temporality", - path: []ottl.Field{ - { - Name: "metric", - }, - { - Name: "aggregation_temporality", + path: &internal.TestPath[TransformContext]{ + N: "metric", + NextPath: &internal.TestPath[TransformContext]{ + N: "aggregation_temporality", }, }, orig: int64(2), @@ -2221,12 +1904,10 @@ func Test_newPathGetSetter_Metric(t *testing.T) { }, { name: "metric is_monotonic", - path: []ottl.Field{ - { - Name: "metric", - }, - { - Name: "is_monotonic", + path: &internal.TestPath[TransformContext]{ + N: "metric", + NextPath: &internal.TestPath[TransformContext]{ + N: "is_monotonic", }, }, orig: true, @@ -2238,7 +1919,8 @@ func Test_newPathGetSetter_Metric(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - accessor, err := newPathGetSetter(tt.path) + pep := pathExpressionParser{} + accessor, err := pep.parsePath(tt.path) assert.NoError(t, err) metric := createMetricTelemetry() diff --git a/pkg/ottl/contexts/ottllog/log.go b/pkg/ottl/contexts/ottllog/log.go index bc7954ea6614..a1eeed624364 100644 --- a/pkg/ottl/contexts/ottllog/log.go +++ b/pkg/ottl/contexts/ottllog/log.go @@ -56,10 +56,10 @@ func (tCtx TransformContext) getCache() pcommon.Map { } func NewParser(functions map[string]ottl.Factory[TransformContext], telemetrySettings component.TelemetrySettings, options ...Option) (ottl.Parser[TransformContext], error) { - pathExpressionParser := pathExpressionParser{telemetrySettings} + pep := pathExpressionParser{telemetrySettings} p, err := ottl.NewParser[TransformContext]( functions, - pathExpressionParser.parsePath, + pep.parsePath, telemetrySettings, ottl.WithEnumParser[TransformContext](parseEnum), ) @@ -146,25 +146,20 @@ type pathExpressionParser struct { telemetrySettings component.TelemetrySettings } -func (pep *pathExpressionParser) parsePath(val *ottl.Path) (ottl.GetSetter[TransformContext], error) { - if val != nil && len(val.Fields) > 0 { - return newPathGetSetter(val.Fields) +func (pep *pathExpressionParser) parsePath(path ottl.Path[TransformContext]) (ottl.GetSetter[TransformContext], error) { + if path == nil { + return nil, fmt.Errorf("path cannot be nil") } - return nil, fmt.Errorf("bad path %v", val) -} - -func newPathGetSetter(path []ottl.Field) (ottl.GetSetter[TransformContext], error) { - switch path[0].Name { + switch path.Name() { case "cache": - mapKey := path[0].Keys - if mapKey == nil { + if path.Key() == nil { return accessCache(), nil } - return accessCacheKey(mapKey), nil + return accessCacheKey(path.Key()), nil case "resource": - return internal.ResourcePathGetSetter[TransformContext](path[1:]) + return internal.ResourcePathGetSetter[TransformContext](path.Next()) case "instrumentation_scope": - return internal.ScopePathGetSetter[TransformContext](path[1:]) + return internal.ScopePathGetSetter[TransformContext](path.Next()) case "time_unix_nano": return accessTimeUnixNano(), nil case "observed_time_unix_nano": @@ -178,42 +173,42 @@ func newPathGetSetter(path []ottl.Field) (ottl.GetSetter[TransformContext], erro case "severity_text": return accessSeverityText(), nil case "body": - if len(path) == 1 { - keys := path[0].Keys - if keys == nil { + if path.Next() != nil { + if path.Next().Name() == "string" { + return accessStringBody(), nil + } + } else { + if path.Key() == nil { return accessBody(), nil } - return accessBodyKey(keys), nil - } - if path[1].Name == "string" { - return accessStringBody(), nil + return accessBodyKey(path.Key()), nil } case "attributes": - mapKey := path[0].Keys - if mapKey == nil { + if path.Key() == nil { return accessAttributes(), nil } - return accessAttributesKey(mapKey), nil + return accessAttributesKey(path.Key()), nil case "dropped_attributes_count": return accessDroppedAttributesCount(), nil case "flags": return accessFlags(), nil case "trace_id": - if len(path) == 1 { + if path.Next() != nil { + if path.Next().Name() == "string" { + return accessStringTraceID(), nil + } + } else { return accessTraceID(), nil } - if path[1].Name == "string" { - return accessStringTraceID(), nil - } case "span_id": - if len(path) == 1 { + if path.Next() != nil { + if path.Next().Name() == "string" { + return accessStringSpanID(), nil + } + } else { return accessSpanID(), nil } - if path[1].Name == "string" { - return accessStringSpanID(), nil - } } - return nil, fmt.Errorf("invalid path expression %v", path) } @@ -231,13 +226,13 @@ func accessCache() ottl.StandardGetSetter[TransformContext] { } } -func accessCacheKey(keys []ottl.Key) ottl.StandardGetSetter[TransformContext] { +func accessCacheKey(key ottl.Key[TransformContext]) ottl.StandardGetSetter[TransformContext] { return ottl.StandardGetSetter[TransformContext]{ Getter: func(ctx context.Context, tCtx TransformContext) (any, error) { - return internal.GetMapValue(tCtx.getCache(), keys) + return internal.GetMapValue[TransformContext](ctx, tCtx, tCtx.getCache(), key) }, Setter: func(ctx context.Context, tCtx TransformContext, val any) error { - return internal.SetMapValue(tCtx.getCache(), keys, val) + return internal.SetMapValue[TransformContext](ctx, tCtx, tCtx.getCache(), key, val) }, } } @@ -337,15 +332,15 @@ func accessBody() ottl.StandardGetSetter[TransformContext] { } } -func accessBodyKey(keys []ottl.Key) ottl.StandardGetSetter[TransformContext] { +func accessBodyKey(key ottl.Key[TransformContext]) ottl.StandardGetSetter[TransformContext] { return ottl.StandardGetSetter[TransformContext]{ Getter: func(ctx context.Context, tCtx TransformContext) (any, error) { body := tCtx.GetLogRecord().Body() switch body.Type() { case pcommon.ValueTypeMap: - return internal.GetMapValue(tCtx.GetLogRecord().Body().Map(), keys) + return internal.GetMapValue[TransformContext](ctx, tCtx, tCtx.GetLogRecord().Body().Map(), key) case pcommon.ValueTypeSlice: - return internal.GetSliceValue(tCtx.GetLogRecord().Body().Slice(), keys) + return internal.GetSliceValue[TransformContext](ctx, tCtx, tCtx.GetLogRecord().Body().Slice(), key) default: return nil, fmt.Errorf("log bodies of type %s cannot be indexed", body.Type().String()) } @@ -354,9 +349,9 @@ func accessBodyKey(keys []ottl.Key) ottl.StandardGetSetter[TransformContext] { body := tCtx.GetLogRecord().Body() switch body.Type() { case pcommon.ValueTypeMap: - return internal.SetMapValue(tCtx.GetLogRecord().Body().Map(), keys, val) + return internal.SetMapValue[TransformContext](ctx, tCtx, tCtx.GetLogRecord().Body().Map(), key, val) case pcommon.ValueTypeSlice: - return internal.SetSliceValue(tCtx.GetLogRecord().Body().Slice(), keys, val) + return internal.SetSliceValue[TransformContext](ctx, tCtx, tCtx.GetLogRecord().Body().Slice(), key, val) default: return fmt.Errorf("log bodies of type %s cannot be indexed", body.Type().String()) } @@ -392,13 +387,13 @@ func accessAttributes() ottl.StandardGetSetter[TransformContext] { } } -func accessAttributesKey(keys []ottl.Key) ottl.StandardGetSetter[TransformContext] { +func accessAttributesKey(key ottl.Key[TransformContext]) ottl.StandardGetSetter[TransformContext] { return ottl.StandardGetSetter[TransformContext]{ Getter: func(ctx context.Context, tCtx TransformContext) (any, error) { - return internal.GetMapValue(tCtx.GetLogRecord().Attributes(), keys) + return internal.GetMapValue[TransformContext](ctx, tCtx, tCtx.GetLogRecord().Attributes(), key) }, Setter: func(ctx context.Context, tCtx TransformContext, val any) error { - return internal.SetMapValue(tCtx.GetLogRecord().Attributes(), keys, val) + return internal.SetMapValue[TransformContext](ctx, tCtx, tCtx.GetLogRecord().Attributes(), key, val) }, } } diff --git a/pkg/ottl/contexts/ottllog/log_test.go b/pkg/ottl/contexts/ottllog/log_test.go index 6a1b7fbbebc7..1a9a214aa430 100644 --- a/pkg/ottl/contexts/ottllog/log_test.go +++ b/pkg/ottl/contexts/ottllog/log_test.go @@ -15,6 +15,7 @@ import ( "go.opentelemetry.io/collector/pdata/plog" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/ottltest" ) @@ -51,7 +52,7 @@ func Test_newPathGetSetter(t *testing.T) { tests := []struct { name string - path []ottl.Field + path ottl.Path[TransformContext] orig any newVal any modified func(log plog.LogRecord, il pcommon.InstrumentationScope, resource pcommon.Resource, cache pcommon.Map) @@ -59,10 +60,8 @@ func Test_newPathGetSetter(t *testing.T) { }{ { name: "time", - path: []ottl.Field{ - { - Name: "time", - }, + path: &internal.TestPath[TransformContext]{ + N: "time", }, orig: time.Date(1970, 1, 1, 0, 0, 0, 100000000, time.UTC), newVal: time.Date(1970, 1, 1, 0, 0, 0, 200000000, time.UTC), @@ -72,10 +71,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "time_unix_nano", - path: []ottl.Field{ - { - Name: "time_unix_nano", - }, + path: &internal.TestPath[TransformContext]{ + N: "time_unix_nano", }, orig: int64(100_000_000), newVal: int64(200_000_000), @@ -85,10 +82,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "observed_time_unix_nano", - path: []ottl.Field{ - { - Name: "observed_time_unix_nano", - }, + path: &internal.TestPath[TransformContext]{ + N: "observed_time_unix_nano", }, orig: int64(500_000_000), newVal: int64(200_000_000), @@ -98,10 +93,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "observed time", - path: []ottl.Field{ - { - Name: "observed_time", - }, + path: &internal.TestPath[TransformContext]{ + N: "observed_time", }, orig: time.Date(1970, 1, 1, 0, 0, 0, 500000000, time.UTC), newVal: time.Date(1970, 1, 1, 0, 0, 0, 200000000, time.UTC), @@ -111,10 +104,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "severity_number", - path: []ottl.Field{ - { - Name: "severity_number", - }, + path: &internal.TestPath[TransformContext]{ + N: "severity_number", }, orig: int64(plog.SeverityNumberFatal), newVal: int64(3), @@ -124,10 +115,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "severity_text", - path: []ottl.Field{ - { - Name: "severity_text", - }, + path: &internal.TestPath[TransformContext]{ + N: "severity_text", }, orig: "blue screen of death", newVal: "black screen of death", @@ -137,10 +126,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "body", - path: []ottl.Field{ - { - Name: "body", - }, + path: &internal.TestPath[TransformContext]{ + N: "body", }, orig: "body", newVal: "head", @@ -150,10 +137,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "map body", - path: []ottl.Field{ - { - Name: "body", - }, + path: &internal.TestPath[TransformContext]{ + N: "body", }, orig: func() pcommon.Map { log, _, _ := createTelemetry("map") @@ -167,14 +152,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "map body index", - path: []ottl.Field{ - { - Name: "body", - Keys: []ottl.Key{ - { - String: ottltest.Strp("key"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "body", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("key"), }, }, orig: "val", @@ -186,10 +167,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "slice body", - path: []ottl.Field{ - { - Name: "body", - }, + path: &internal.TestPath[TransformContext]{ + N: "body", }, orig: func() pcommon.Slice { log, _, _ := createTelemetry("slice") @@ -206,14 +185,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "slice body index", - path: []ottl.Field{ - { - Name: "body", - Keys: []ottl.Key{ - { - Int: ottltest.Intp(0), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "body", + Keys: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(0), }, }, orig: "body", @@ -225,12 +200,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "body string", - path: []ottl.Field{ - { - Name: "body", - }, - { - Name: "string", + path: &internal.TestPath[TransformContext]{ + N: "body", + NextPath: &internal.TestPath[TransformContext]{ + N: "string", }, }, orig: "1", @@ -242,10 +215,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "flags", - path: []ottl.Field{ - { - Name: "flags", - }, + path: &internal.TestPath[TransformContext]{ + N: "flags", }, orig: int64(4), newVal: int64(5), @@ -255,10 +226,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "trace_id", - path: []ottl.Field{ - { - Name: "trace_id", - }, + path: &internal.TestPath[TransformContext]{ + N: "trace_id", }, orig: pcommon.TraceID(traceID), newVal: pcommon.TraceID(traceID2), @@ -268,10 +237,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "span_id", - path: []ottl.Field{ - { - Name: "span_id", - }, + path: &internal.TestPath[TransformContext]{ + N: "span_id", }, orig: pcommon.SpanID(spanID), newVal: pcommon.SpanID(spanID2), @@ -281,12 +248,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "trace_id string", - path: []ottl.Field{ - { - Name: "trace_id", - }, - { - Name: "string", + path: &internal.TestPath[TransformContext]{ + N: "trace_id", + NextPath: &internal.TestPath[TransformContext]{ + N: "string", }, }, orig: hex.EncodeToString(traceID[:]), @@ -297,12 +262,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "span_id string", - path: []ottl.Field{ - { - Name: "span_id", - }, - { - Name: "string", + path: &internal.TestPath[TransformContext]{ + N: "span_id", + NextPath: &internal.TestPath[TransformContext]{ + N: "string", }, }, orig: hex.EncodeToString(spanID[:]), @@ -313,10 +276,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "cache", - path: []ottl.Field{ - { - Name: "cache", - }, + path: &internal.TestPath[TransformContext]{ + N: "cache", }, orig: pcommon.NewMap(), newVal: newCache, @@ -326,14 +287,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "cache access", - path: []ottl.Field{ - { - Name: "cache", - Keys: []ottl.Key{ - { - String: ottltest.Strp("temp"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "cache", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("temp"), }, }, orig: nil, @@ -344,10 +301,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes", - path: []ottl.Field{ - { - Name: "attributes", - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", }, orig: refLog.Attributes(), newVal: newAttrs, @@ -357,14 +312,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes string", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("str"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("str"), }, }, orig: "val", @@ -375,14 +326,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes bool", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("bool"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("bool"), }, }, orig: true, @@ -393,14 +340,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes int", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("int"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("int"), }, }, orig: int64(10), @@ -411,14 +354,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes float", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("double"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("double"), }, }, orig: float64(1.2), @@ -429,14 +368,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes bytes", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("bytes"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("bytes"), }, }, orig: []byte{1, 3, 2}, @@ -447,14 +382,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes array string", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_str"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_str"), }, }, orig: func() pcommon.Slice { @@ -468,14 +399,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes array bool", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_bool"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_bool"), }, }, orig: func() pcommon.Slice { @@ -489,14 +416,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes array int", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_int"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_int"), }, }, orig: func() pcommon.Slice { @@ -510,14 +433,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes array float", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_float"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_float"), }, }, orig: func() pcommon.Slice { @@ -531,14 +450,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes array bytes", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_bytes"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_bytes"), }, }, orig: func() pcommon.Slice { @@ -552,14 +467,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes pcommon.Map", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("pMap"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("pMap"), }, }, orig: func() pcommon.Map { @@ -575,14 +486,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes map[string]any", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("map"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("map"), }, }, orig: func() pcommon.Map { @@ -598,18 +505,14 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes nested", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("slice"), - }, - { - Int: ottltest.Intp(0), - }, - { - String: ottltest.Strp("map"), + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("slice"), + NextKey: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(0), + NextKey: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("map"), }, }, }, @@ -626,18 +529,14 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes nested new values", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("new"), - }, - { - Int: ottltest.Intp(2), - }, - { - Int: ottltest.Intp(0), + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("new"), + NextKey: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(2), + NextKey: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(0), }, }, }, @@ -655,10 +554,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "dropped_attributes_count", - path: []ottl.Field{ - { - Name: "dropped_attributes_count", - }, + path: &internal.TestPath[TransformContext]{ + N: "dropped_attributes_count", }, orig: int64(10), newVal: int64(20), @@ -668,10 +565,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "instrumentation_scope", - path: []ottl.Field{ - { - Name: "instrumentation_scope", - }, + path: &internal.TestPath[TransformContext]{ + N: "instrumentation_scope", }, orig: refIS, newVal: pcommon.NewInstrumentationScope(), @@ -681,10 +576,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "resource", - path: []ottl.Field{ - { - Name: "resource", - }, + path: &internal.TestPath[TransformContext]{ + N: "resource", }, orig: refResource, newVal: pcommon.NewResource(), @@ -695,7 +588,8 @@ func Test_newPathGetSetter(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - accessor, err := newPathGetSetter(tt.path) + pep := pathExpressionParser{} + accessor, err := pep.parsePath(tt.path) assert.NoError(t, err) log, il, resource := createTelemetry(tt.bodyType) @@ -793,18 +687,15 @@ func createTelemetry(bodyType string) (plog.LogRecord, pcommon.InstrumentationSc } func Test_InvalidBodyIndexing(t *testing.T) { - path := []ottl.Field{ - { - Name: "body", - Keys: []ottl.Key{ - { - String: ottltest.Strp("key"), - }, - }, + path := internal.TestPath[TransformContext]{ + N: "body", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("key"), }, } - accessor, err := newPathGetSetter(path) + pep := pathExpressionParser{} + accessor, err := pep.parsePath(&path) assert.NoError(t, err) log, il, resource := createTelemetry("string") diff --git a/pkg/ottl/contexts/ottlmetric/metrics.go b/pkg/ottl/contexts/ottlmetric/metrics.go index db3cbb625107..d17a6640f6f4 100644 --- a/pkg/ottl/contexts/ottlmetric/metrics.go +++ b/pkg/ottl/contexts/ottlmetric/metrics.go @@ -60,10 +60,10 @@ func (tCtx TransformContext) getCache() pcommon.Map { } func NewParser(functions map[string]ottl.Factory[TransformContext], telemetrySettings component.TelemetrySettings, options ...Option) (ottl.Parser[TransformContext], error) { - pathExpressionParser := pathExpressionParser{telemetrySettings} + pep := pathExpressionParser{telemetrySettings} p, err := ottl.NewParser[TransformContext]( functions, - pathExpressionParser.parsePath, + pep.parsePath, telemetrySettings, ottl.WithEnumParser[TransformContext](parseEnum), ) @@ -124,25 +124,20 @@ type pathExpressionParser struct { telemetrySettings component.TelemetrySettings } -func (pep *pathExpressionParser) parsePath(val *ottl.Path) (ottl.GetSetter[TransformContext], error) { - if val != nil && len(val.Fields) > 0 { - return newPathGetSetter(val.Fields) +func (pep *pathExpressionParser) parsePath(path ottl.Path[TransformContext]) (ottl.GetSetter[TransformContext], error) { + if path == nil { + return nil, fmt.Errorf("path cannot be nil") } - return nil, fmt.Errorf("bad path %v", val) -} - -func newPathGetSetter(path []ottl.Field) (ottl.GetSetter[TransformContext], error) { - switch path[0].Name { + switch path.Name() { case "cache": - mapKey := path[0].Keys - if mapKey == nil { + if path.Key() == nil { return accessCache(), nil } - return accessCacheKey(mapKey), nil + return accessCacheKey(path.Key()), nil case "resource": - return internal.ResourcePathGetSetter[TransformContext](path[1:]) + return internal.ResourcePathGetSetter[TransformContext](path.Next()) case "instrumentation_scope": - return internal.ScopePathGetSetter[TransformContext](path[1:]) + return internal.ScopePathGetSetter[TransformContext](path.Next()) default: return internal.MetricPathGetSetter[TransformContext](path) } @@ -162,13 +157,13 @@ func accessCache() ottl.StandardGetSetter[TransformContext] { } } -func accessCacheKey(keys []ottl.Key) ottl.StandardGetSetter[TransformContext] { +func accessCacheKey(key ottl.Key[TransformContext]) ottl.StandardGetSetter[TransformContext] { return ottl.StandardGetSetter[TransformContext]{ Getter: func(ctx context.Context, tCtx TransformContext) (any, error) { - return internal.GetMapValue(tCtx.getCache(), keys) + return internal.GetMapValue[TransformContext](ctx, tCtx, tCtx.getCache(), key) }, Setter: func(ctx context.Context, tCtx TransformContext, val any) error { - return internal.SetMapValue(tCtx.getCache(), keys, val) + return internal.SetMapValue[TransformContext](ctx, tCtx, tCtx.getCache(), key, val) }, } } diff --git a/pkg/ottl/contexts/ottlmetric/metrics_test.go b/pkg/ottl/contexts/ottlmetric/metrics_test.go index f2480ac51ced..8735573b9790 100644 --- a/pkg/ottl/contexts/ottlmetric/metrics_test.go +++ b/pkg/ottl/contexts/ottlmetric/metrics_test.go @@ -12,6 +12,7 @@ import ( "go.opentelemetry.io/collector/pdata/pmetric" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/ottltest" ) @@ -31,17 +32,15 @@ func Test_newPathGetSetter(t *testing.T) { tests := []struct { name string - path []ottl.Field + path ottl.Path[TransformContext] orig any newVal any modified func(metric pmetric.Metric, cache pcommon.Map) }{ { name: "metric name", - path: []ottl.Field{ - { - Name: "name", - }, + path: &internal.TestPath[TransformContext]{ + N: "name", }, orig: "name", newVal: "new name", @@ -51,10 +50,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "metric description", - path: []ottl.Field{ - { - Name: "description", - }, + path: &internal.TestPath[TransformContext]{ + N: "description", }, orig: "description", newVal: "new description", @@ -64,10 +61,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "metric unit", - path: []ottl.Field{ - { - Name: "unit", - }, + path: &internal.TestPath[TransformContext]{ + N: "unit", }, orig: "unit", newVal: "new unit", @@ -77,10 +72,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "metric type", - path: []ottl.Field{ - { - Name: "type", - }, + path: &internal.TestPath[TransformContext]{ + N: "type", }, orig: int64(pmetric.MetricTypeSum), newVal: int64(pmetric.MetricTypeSum), @@ -89,10 +82,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "metric aggregation_temporality", - path: []ottl.Field{ - { - Name: "aggregation_temporality", - }, + path: &internal.TestPath[TransformContext]{ + N: "aggregation_temporality", }, orig: int64(2), newVal: int64(1), @@ -102,10 +93,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "metric is_monotonic", - path: []ottl.Field{ - { - Name: "is_monotonic", - }, + path: &internal.TestPath[TransformContext]{ + N: "is_monotonic", }, orig: true, newVal: false, @@ -115,10 +104,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "metric data points", - path: []ottl.Field{ - { - Name: "data_points", - }, + path: &internal.TestPath[TransformContext]{ + N: "data_points", }, orig: refMetric.Sum().DataPoints(), newVal: newDataPoints, @@ -128,10 +115,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "cache", - path: []ottl.Field{ - { - Name: "cache", - }, + path: &internal.TestPath[TransformContext]{ + N: "cache", }, orig: pcommon.NewMap(), newVal: newCache, @@ -141,14 +126,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "cache access", - path: []ottl.Field{ - { - Name: "cache", - Keys: []ottl.Key{ - { - String: ottltest.Strp("temp"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "cache", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("temp"), }, }, orig: nil, @@ -160,7 +141,8 @@ func Test_newPathGetSetter(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - accessor, err := newPathGetSetter(tt.path) + pep := pathExpressionParser{} + accessor, err := pep.parsePath(tt.path) assert.NoError(t, err) metric := createMetricTelemetry() diff --git a/pkg/ottl/contexts/ottlresource/resource.go b/pkg/ottl/contexts/ottlresource/resource.go index 552c192e8b56..99d55a02314a 100644 --- a/pkg/ottl/contexts/ottlresource/resource.go +++ b/pkg/ottl/contexts/ottlresource/resource.go @@ -39,10 +39,10 @@ func (tCtx TransformContext) getCache() pcommon.Map { } func NewParser(functions map[string]ottl.Factory[TransformContext], telemetrySettings component.TelemetrySettings, options ...Option) (ottl.Parser[TransformContext], error) { - pathExpressionParser := pathExpressionParser{telemetrySettings} + pep := pathExpressionParser{telemetrySettings} p, err := ottl.NewParser[TransformContext]( functions, - pathExpressionParser.parsePath, + pep.parsePath, telemetrySettings, ottl.WithEnumParser[TransformContext](parseEnum), ) @@ -95,21 +95,16 @@ type pathExpressionParser struct { telemetrySettings component.TelemetrySettings } -func (pep *pathExpressionParser) parsePath(val *ottl.Path) (ottl.GetSetter[TransformContext], error) { - if val != nil && len(val.Fields) > 0 { - return newPathGetSetter(val.Fields) +func (pep *pathExpressionParser) parsePath(path ottl.Path[TransformContext]) (ottl.GetSetter[TransformContext], error) { + if path == nil { + return nil, fmt.Errorf("path cannot be nil") } - return nil, fmt.Errorf("bad path %v", val) -} - -func newPathGetSetter(path []ottl.Field) (ottl.GetSetter[TransformContext], error) { - switch path[0].Name { + switch path.Name() { case "cache": - mapKey := path[0].Keys - if mapKey == nil { + if path.Key() == nil { return accessCache(), nil } - return accessCacheKey(mapKey), nil + return accessCacheKey(path.Key()), nil default: return internal.ResourcePathGetSetter[TransformContext](path) } @@ -129,13 +124,13 @@ func accessCache() ottl.StandardGetSetter[TransformContext] { } } -func accessCacheKey(keys []ottl.Key) ottl.StandardGetSetter[TransformContext] { +func accessCacheKey(key ottl.Key[TransformContext]) ottl.StandardGetSetter[TransformContext] { return ottl.StandardGetSetter[TransformContext]{ Getter: func(ctx context.Context, tCtx TransformContext) (any, error) { - return internal.GetMapValue(tCtx.getCache(), keys) + return internal.GetMapValue[TransformContext](ctx, tCtx, tCtx.getCache(), key) }, Setter: func(ctx context.Context, tCtx TransformContext, val any) error { - return internal.SetMapValue(tCtx.getCache(), keys, val) + return internal.SetMapValue[TransformContext](ctx, tCtx, tCtx.getCache(), key, val) }, } } diff --git a/pkg/ottl/contexts/ottlresource/resource_test.go b/pkg/ottl/contexts/ottlresource/resource_test.go index 87d8cb397f2c..a891835d2cc4 100644 --- a/pkg/ottl/contexts/ottlresource/resource_test.go +++ b/pkg/ottl/contexts/ottlresource/resource_test.go @@ -11,6 +11,7 @@ import ( "go.opentelemetry.io/collector/pdata/pcommon" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/ottltest" ) @@ -34,17 +35,15 @@ func Test_newPathGetSetter(t *testing.T) { tests := []struct { name string - path []ottl.Field + path ottl.Path[TransformContext] orig any newVal any modified func(resource pcommon.Resource, cache pcommon.Map) }{ { name: "cache", - path: []ottl.Field{ - { - Name: "cache", - }, + path: &internal.TestPath[TransformContext]{ + N: "cache", }, orig: pcommon.NewMap(), newVal: newCache, @@ -54,14 +53,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "cache access", - path: []ottl.Field{ - { - Name: "cache", - Keys: []ottl.Key{ - { - String: ottltest.Strp("temp"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "cache", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("temp"), }, }, orig: nil, @@ -72,10 +67,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes", - path: []ottl.Field{ - { - Name: "attributes", - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", }, orig: refResource.Attributes(), newVal: newAttrs, @@ -85,14 +78,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes string", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("str"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("str"), }, }, orig: "val", @@ -103,14 +92,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes bool", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("bool"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("bool"), }, }, orig: true, @@ -121,14 +106,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes int", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("int"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("int"), }, }, orig: int64(10), @@ -139,14 +120,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes float", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("double"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("double"), }, }, orig: float64(1.2), @@ -157,14 +134,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes bytes", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("bytes"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("bytes"), }, }, orig: []byte{1, 3, 2}, @@ -175,14 +148,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes array string", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_str"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_str"), }, }, orig: func() pcommon.Slice { @@ -196,14 +165,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes array bool", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_bool"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_bool"), }, }, orig: func() pcommon.Slice { @@ -217,14 +182,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes array int", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_int"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_int"), }, }, orig: func() pcommon.Slice { @@ -238,14 +199,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes array float", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_float"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_float"), }, }, orig: func() pcommon.Slice { @@ -259,14 +216,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes array bytes", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_bytes"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_bytes"), }, }, orig: func() pcommon.Slice { @@ -280,14 +233,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes pcommon.Map", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("pMap"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("pMap"), }, }, orig: func() pcommon.Map { @@ -303,14 +252,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes mpa[string]interface", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("map"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("map"), }, }, orig: func() pcommon.Map { @@ -326,18 +271,14 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes nested", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("slice"), - }, - { - Int: ottltest.Intp(0), - }, - { - String: ottltest.Strp("map"), + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("slice"), + NextKey: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(0), + NextKey: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("map"), }, }, }, @@ -354,18 +295,14 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes nested new values", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("new"), - }, - { - Int: ottltest.Intp(2), - }, - { - Int: ottltest.Intp(0), + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("new"), + NextKey: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(2), + NextKey: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(0), }, }, }, @@ -383,10 +320,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "dropped_attributes_count", - path: []ottl.Field{ - { - Name: "dropped_attributes_count", - }, + path: &internal.TestPath[TransformContext]{ + N: "dropped_attributes_count", }, orig: int64(10), newVal: int64(20), @@ -397,7 +332,8 @@ func Test_newPathGetSetter(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - accessor, err := newPathGetSetter(tt.path) + pep := pathExpressionParser{} + accessor, err := pep.parsePath(tt.path) assert.NoError(t, err) resource := createTelemetry() diff --git a/pkg/ottl/contexts/ottlscope/scope.go b/pkg/ottl/contexts/ottlscope/scope.go index 1ac78993a646..c175c80400ea 100644 --- a/pkg/ottl/contexts/ottlscope/scope.go +++ b/pkg/ottl/contexts/ottlscope/scope.go @@ -46,10 +46,10 @@ func (tCtx TransformContext) getCache() pcommon.Map { } func NewParser(functions map[string]ottl.Factory[TransformContext], telemetrySettings component.TelemetrySettings, options ...Option) (ottl.Parser[TransformContext], error) { - pathExpressionParser := pathExpressionParser{telemetrySettings} + pep := pathExpressionParser{telemetrySettings} p, err := ottl.NewParser[TransformContext]( functions, - pathExpressionParser.parsePath, + pep.parsePath, telemetrySettings, ottl.WithEnumParser[TransformContext](parseEnum), ) @@ -102,23 +102,18 @@ type pathExpressionParser struct { telemetrySettings component.TelemetrySettings } -func (pep *pathExpressionParser) parsePath(val *ottl.Path) (ottl.GetSetter[TransformContext], error) { - if val != nil && len(val.Fields) > 0 { - return newPathGetSetter(val.Fields) +func (pep *pathExpressionParser) parsePath(path ottl.Path[TransformContext]) (ottl.GetSetter[TransformContext], error) { + if path == nil { + return nil, fmt.Errorf("path cannot be nil") } - return nil, fmt.Errorf("bad path %v", val) -} - -func newPathGetSetter(path []ottl.Field) (ottl.GetSetter[TransformContext], error) { - switch path[0].Name { + switch path.Name() { case "cache": - mapKey := path[0].Keys - if mapKey == nil { + if path.Key() == nil { return accessCache(), nil } - return accessCacheKey(mapKey), nil + return accessCacheKey(path.Key()), nil case "resource": - return internal.ResourcePathGetSetter[TransformContext](path[1:]) + return internal.ResourcePathGetSetter[TransformContext](path.Next()) default: return internal.ScopePathGetSetter[TransformContext](path) } @@ -138,13 +133,13 @@ func accessCache() ottl.StandardGetSetter[TransformContext] { } } -func accessCacheKey(keys []ottl.Key) ottl.StandardGetSetter[TransformContext] { +func accessCacheKey(key ottl.Key[TransformContext]) ottl.StandardGetSetter[TransformContext] { return ottl.StandardGetSetter[TransformContext]{ Getter: func(ctx context.Context, tCtx TransformContext) (any, error) { - return internal.GetMapValue(tCtx.getCache(), keys) + return internal.GetMapValue[TransformContext](ctx, tCtx, tCtx.getCache(), key) }, Setter: func(ctx context.Context, tCtx TransformContext, val any) error { - return internal.SetMapValue(tCtx.getCache(), keys, val) + return internal.SetMapValue[TransformContext](ctx, tCtx, tCtx.getCache(), key, val) }, } } diff --git a/pkg/ottl/contexts/ottlscope/scope_test.go b/pkg/ottl/contexts/ottlscope/scope_test.go index 6c799558d1f2..a65d17a25a0a 100644 --- a/pkg/ottl/contexts/ottlscope/scope_test.go +++ b/pkg/ottl/contexts/ottlscope/scope_test.go @@ -11,6 +11,7 @@ import ( "go.opentelemetry.io/collector/pdata/pcommon" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/ottltest" ) @@ -34,17 +35,15 @@ func Test_newPathGetSetter(t *testing.T) { tests := []struct { name string - path []ottl.Field + path ottl.Path[TransformContext] orig any newVal any modified func(is pcommon.InstrumentationScope, resource pcommon.Resource, cache pcommon.Map) }{ { name: "cache", - path: []ottl.Field{ - { - Name: "cache", - }, + path: &internal.TestPath[TransformContext]{ + N: "cache", }, orig: pcommon.NewMap(), newVal: newCache, @@ -54,14 +53,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "cache access", - path: []ottl.Field{ - { - Name: "cache", - Keys: []ottl.Key{ - { - String: ottltest.Strp("temp"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "cache", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("temp"), }, }, orig: nil, @@ -72,10 +67,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes", - path: []ottl.Field{ - { - Name: "attributes", - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", }, orig: refIS.Attributes(), newVal: newAttrs, @@ -85,14 +78,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes string", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("str"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("str"), }, }, orig: "val", @@ -103,14 +92,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes bool", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("bool"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("bool"), }, }, orig: true, @@ -121,14 +106,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes int", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("int"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("int"), }, }, orig: int64(10), @@ -139,14 +120,11 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes float", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("double"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + + S: ottltest.Strp("double"), }, }, orig: float64(1.2), @@ -157,14 +135,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes bytes", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("bytes"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("bytes"), }, }, orig: []byte{1, 3, 2}, @@ -175,14 +149,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes array string", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_str"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_str"), }, }, orig: func() pcommon.Slice { @@ -196,14 +166,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes array bool", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_bool"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_bool"), }, }, orig: func() pcommon.Slice { @@ -217,14 +183,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes array int", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_int"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_int"), }, }, orig: func() pcommon.Slice { @@ -238,14 +200,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes array float", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_float"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_float"), }, }, orig: func() pcommon.Slice { @@ -259,14 +217,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes array bytes", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_bytes"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_bytes"), }, }, orig: func() pcommon.Slice { @@ -280,14 +234,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes pcommon.Map", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("pMap"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("pMap"), }, }, orig: func() pcommon.Map { @@ -303,14 +253,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes map[string]any", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("map"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("map"), }, }, orig: func() pcommon.Map { @@ -326,18 +272,14 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes nested", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("slice"), - }, - { - Int: ottltest.Intp(0), - }, - { - String: ottltest.Strp("map"), + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("slice"), + NextKey: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(0), + NextKey: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("map"), }, }, }, @@ -354,18 +296,14 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes nested new values", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("new"), - }, - { - Int: ottltest.Intp(2), - }, - { - Int: ottltest.Intp(0), + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("new"), + NextKey: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(2), + NextKey: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(0), }, }, }, @@ -383,10 +321,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "dropped_attributes_count", - path: []ottl.Field{ - { - Name: "dropped_attributes_count", - }, + path: &internal.TestPath[TransformContext]{ + N: "dropped_attributes_count", }, orig: int64(10), newVal: int64(20), @@ -396,10 +332,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "name", - path: []ottl.Field{ - { - Name: "name", - }, + path: &internal.TestPath[TransformContext]{ + N: "name", }, orig: refIS.Name(), newVal: "newname", @@ -409,10 +343,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "version", - path: []ottl.Field{ - { - Name: "version", - }, + path: &internal.TestPath[TransformContext]{ + N: "version", }, orig: refIS.Version(), newVal: "next", @@ -422,10 +354,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "resource", - path: []ottl.Field{ - { - Name: "resource", - }, + path: &internal.TestPath[TransformContext]{ + N: "resource", }, orig: refResource, newVal: pcommon.NewResource(), @@ -436,7 +366,8 @@ func Test_newPathGetSetter(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - accessor, err := newPathGetSetter(tt.path) + pep := pathExpressionParser{} + accessor, err := pep.parsePath(tt.path) assert.NoError(t, err) il, resource := createTelemetry() diff --git a/pkg/ottl/contexts/ottlspan/span.go b/pkg/ottl/contexts/ottlspan/span.go index df2f2ddc2623..501e9bcc2a86 100644 --- a/pkg/ottl/contexts/ottlspan/span.go +++ b/pkg/ottl/contexts/ottlspan/span.go @@ -53,10 +53,10 @@ func (tCtx TransformContext) getCache() pcommon.Map { } func NewParser(functions map[string]ottl.Factory[TransformContext], telemetrySettings component.TelemetrySettings, options ...Option) (ottl.Parser[TransformContext], error) { - pathExpressionParser := pathExpressionParser{telemetrySettings} + pep := pathExpressionParser{telemetrySettings} p, err := ottl.NewParser[TransformContext]( functions, - pathExpressionParser.parsePath, + pep.parsePath, telemetrySettings, ottl.WithEnumParser[TransformContext](parseEnum), ) @@ -115,25 +115,20 @@ type pathExpressionParser struct { telemetrySettings component.TelemetrySettings } -func (pep *pathExpressionParser) parsePath(val *ottl.Path) (ottl.GetSetter[TransformContext], error) { - if val != nil && len(val.Fields) > 0 { - return newPathGetSetter(val.Fields) +func (pep *pathExpressionParser) parsePath(path ottl.Path[TransformContext]) (ottl.GetSetter[TransformContext], error) { + if path == nil { + return nil, fmt.Errorf("path cannot be nil") } - return nil, fmt.Errorf("bad path %v", val) -} - -func newPathGetSetter(path []ottl.Field) (ottl.GetSetter[TransformContext], error) { - switch path[0].Name { + switch path.Name() { case "cache": - mapKey := path[0].Keys - if mapKey == nil { + if path.Key() == nil { return accessCache(), nil } - return accessCacheKey(mapKey), nil + return accessCacheKey(path.Key()), nil case "resource": - return internal.ResourcePathGetSetter[TransformContext](path[1:]) + return internal.ResourcePathGetSetter[TransformContext](path.Next()) case "instrumentation_scope": - return internal.ScopePathGetSetter[TransformContext](path[1:]) + return internal.ScopePathGetSetter[TransformContext](path.Next()) default: return internal.SpanPathGetSetter[TransformContext](path) } @@ -153,13 +148,13 @@ func accessCache() ottl.StandardGetSetter[TransformContext] { } } -func accessCacheKey(keys []ottl.Key) ottl.StandardGetSetter[TransformContext] { +func accessCacheKey(key ottl.Key[TransformContext]) ottl.StandardGetSetter[TransformContext] { return ottl.StandardGetSetter[TransformContext]{ Getter: func(ctx context.Context, tCtx TransformContext) (any, error) { - return internal.GetMapValue(tCtx.getCache(), keys) + return internal.GetMapValue[TransformContext](ctx, tCtx, tCtx.getCache(), key) }, Setter: func(ctx context.Context, tCtx TransformContext, val any) error { - return internal.SetMapValue(tCtx.getCache(), keys, val) + return internal.SetMapValue[TransformContext](ctx, tCtx, tCtx.getCache(), key, val) }, } } diff --git a/pkg/ottl/contexts/ottlspan/span_test.go b/pkg/ottl/contexts/ottlspan/span_test.go index 0a195fff813d..49eecc988b94 100644 --- a/pkg/ottl/contexts/ottlspan/span_test.go +++ b/pkg/ottl/contexts/ottlspan/span_test.go @@ -14,6 +14,7 @@ import ( "go.opentelemetry.io/collector/pdata/ptrace" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/ottltest" ) @@ -53,17 +54,15 @@ func Test_newPathGetSetter(t *testing.T) { tests := []struct { name string - path []ottl.Field + path ottl.Path[TransformContext] orig any newVal any modified func(span ptrace.Span, il pcommon.InstrumentationScope, resource pcommon.Resource, cache pcommon.Map) }{ { name: "cache", - path: []ottl.Field{ - { - Name: "cache", - }, + path: &internal.TestPath[TransformContext]{ + N: "cache", }, orig: pcommon.NewMap(), newVal: newCache, @@ -73,14 +72,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "cache access", - path: []ottl.Field{ - { - Name: "cache", - Keys: []ottl.Key{ - { - String: ottltest.Strp("temp"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "cache", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("temp"), }, }, orig: nil, @@ -91,10 +86,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "trace_id", - path: []ottl.Field{ - { - Name: "trace_id", - }, + path: &internal.TestPath[TransformContext]{ + N: "trace_id", }, orig: pcommon.TraceID(traceID), newVal: pcommon.TraceID(traceID2), @@ -104,10 +97,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "span_id", - path: []ottl.Field{ - { - Name: "span_id", - }, + path: &internal.TestPath[TransformContext]{ + N: "span_id", }, orig: pcommon.SpanID(spanID), newVal: pcommon.SpanID(spanID2), @@ -117,12 +108,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "trace_id string", - path: []ottl.Field{ - { - Name: "trace_id", - }, - { - Name: "string", + path: &internal.TestPath[TransformContext]{ + N: "trace_id", + NextPath: &internal.TestPath[TransformContext]{ + N: "string", }, }, orig: hex.EncodeToString(traceID[:]), @@ -133,12 +122,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "span_id string", - path: []ottl.Field{ - { - Name: "span_id", - }, - { - Name: "string", + path: &internal.TestPath[TransformContext]{ + N: "span_id", + NextPath: &internal.TestPath[TransformContext]{ + N: "string", }, }, orig: hex.EncodeToString(spanID[:]), @@ -149,10 +136,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "trace_state", - path: []ottl.Field{ - { - Name: "trace_state", - }, + path: &internal.TestPath[TransformContext]{ + N: "trace_state", }, orig: "key1=val1,key2=val2", newVal: "key=newVal", @@ -162,14 +147,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "trace_state key", - path: []ottl.Field{ - { - Name: "trace_state", - Keys: []ottl.Key{ - { - String: ottltest.Strp("key1"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "trace_state", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("key1"), }, }, orig: "val1", @@ -180,10 +161,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "parent_span_id", - path: []ottl.Field{ - { - Name: "parent_span_id", - }, + path: &internal.TestPath[TransformContext]{ + N: "parent_span_id", }, orig: pcommon.SpanID(spanID2), newVal: pcommon.SpanID(spanID), @@ -193,10 +172,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "name", - path: []ottl.Field{ - { - Name: "name", - }, + path: &internal.TestPath[TransformContext]{ + N: "name", }, orig: "bear", newVal: "cat", @@ -206,10 +183,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "kind", - path: []ottl.Field{ - { - Name: "kind", - }, + path: &internal.TestPath[TransformContext]{ + N: "kind", }, orig: int64(2), newVal: int64(3), @@ -219,12 +194,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "string kind", - path: []ottl.Field{ - { - Name: "kind", - }, - { - Name: "string", + path: &internal.TestPath[TransformContext]{ + N: "kind", + NextPath: &internal.TestPath[TransformContext]{ + N: "string", }, }, orig: "Server", @@ -235,12 +208,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "deprecated string kind", - path: []ottl.Field{ - { - Name: "kind", - }, - { - Name: "deprecated_string", + path: &internal.TestPath[TransformContext]{ + N: "kind", + NextPath: &internal.TestPath[TransformContext]{ + N: "deprecated_string", }, }, orig: "SPAN_KIND_SERVER", @@ -251,10 +222,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "start_time_unix_nano", - path: []ottl.Field{ - { - Name: "start_time_unix_nano", - }, + path: &internal.TestPath[TransformContext]{ + N: "start_time_unix_nano", }, orig: int64(100_000_000), newVal: int64(200_000_000), @@ -264,10 +233,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "end_time_unix_nano", - path: []ottl.Field{ - { - Name: "end_time_unix_nano", - }, + path: &internal.TestPath[TransformContext]{ + N: "end_time_unix_nano", }, orig: int64(500_000_000), newVal: int64(200_000_000), @@ -277,10 +244,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "start_time", - path: []ottl.Field{ - { - Name: "start_time", - }, + path: &internal.TestPath[TransformContext]{ + N: "start_time", }, orig: time.Date(1970, 1, 1, 0, 0, 0, 100000000, time.UTC), newVal: time.Date(1970, 1, 1, 0, 0, 0, 200000000, time.UTC), @@ -290,10 +255,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "end_time", - path: []ottl.Field{ - { - Name: "end_time", - }, + path: &internal.TestPath[TransformContext]{ + N: "end_time", }, orig: time.Date(1970, 1, 1, 0, 0, 0, 500000000, time.UTC), newVal: time.Date(1970, 1, 1, 0, 0, 0, 200000000, time.UTC), @@ -303,10 +266,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes", - path: []ottl.Field{ - { - Name: "attributes", - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", }, orig: refSpan.Attributes(), newVal: newAttrs, @@ -316,14 +277,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes string", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("str"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("str"), }, }, orig: "val", @@ -334,14 +291,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes bool", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("bool"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("bool"), }, }, orig: true, @@ -352,14 +305,11 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes int", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("int"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + + S: ottltest.Strp("int"), }, }, orig: int64(10), @@ -370,14 +320,12 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes float", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("double"), - }, - }, + path: &internal.TestPath[TransformContext]{ + + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + + S: ottltest.Strp("double"), }, }, orig: float64(1.2), @@ -388,14 +336,12 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes bytes", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("bytes"), - }, - }, + path: &internal.TestPath[TransformContext]{ + + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + + S: ottltest.Strp("bytes"), }, }, orig: []byte{1, 3, 2}, @@ -406,14 +352,12 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes array string", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_str"), - }, - }, + path: &internal.TestPath[TransformContext]{ + + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + + S: ottltest.Strp("arr_str"), }, }, orig: func() pcommon.Slice { @@ -427,14 +371,12 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes array bool", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_bool"), - }, - }, + path: &internal.TestPath[TransformContext]{ + + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + + S: ottltest.Strp("arr_bool"), }, }, orig: func() pcommon.Slice { @@ -448,14 +390,12 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes array int", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_int"), - }, - }, + path: &internal.TestPath[TransformContext]{ + + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + + S: ottltest.Strp("arr_int"), }, }, orig: func() pcommon.Slice { @@ -469,14 +409,12 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes array float", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_float"), - }, - }, + path: &internal.TestPath[TransformContext]{ + + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + + S: ottltest.Strp("arr_float"), }, }, orig: func() pcommon.Slice { @@ -490,14 +428,12 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes array bytes", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_bytes"), - }, - }, + path: &internal.TestPath[TransformContext]{ + + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + + S: ottltest.Strp("arr_bytes"), }, }, orig: func() pcommon.Slice { @@ -511,14 +447,12 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes pcommon.Map", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("pMap"), - }, - }, + path: &internal.TestPath[TransformContext]{ + + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + + S: ottltest.Strp("pMap"), }, }, orig: func() pcommon.Map { @@ -534,14 +468,12 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes map[string]any", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("map"), - }, - }, + path: &internal.TestPath[TransformContext]{ + + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + + S: ottltest.Strp("map"), }, }, orig: func() pcommon.Map { @@ -557,18 +489,16 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes nested", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("slice"), - }, - { - Int: ottltest.Intp(0), - }, - { - String: ottltest.Strp("map"), + path: &internal.TestPath[TransformContext]{ + + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + + S: ottltest.Strp("slice"), + NextKey: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(0), + NextKey: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("map"), }, }, }, @@ -585,18 +515,14 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes nested new values", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("new"), - }, - { - Int: ottltest.Intp(2), - }, - { - Int: ottltest.Intp(0), + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("new"), + NextKey: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(2), + NextKey: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(0), }, }, }, @@ -614,10 +540,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "dropped_attributes_count", - path: []ottl.Field{ - { - Name: "dropped_attributes_count", - }, + path: &internal.TestPath[TransformContext]{ + N: "dropped_attributes_count", }, orig: int64(10), newVal: int64(20), @@ -627,10 +551,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "events", - path: []ottl.Field{ - { - Name: "events", - }, + path: &internal.TestPath[TransformContext]{ + N: "events", }, orig: refSpan.Events(), newVal: newEvents, @@ -643,10 +565,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "dropped_events_count", - path: []ottl.Field{ - { - Name: "dropped_events_count", - }, + path: &internal.TestPath[TransformContext]{ + N: "dropped_events_count", }, orig: int64(20), newVal: int64(30), @@ -656,10 +576,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "links", - path: []ottl.Field{ - { - Name: "links", - }, + path: &internal.TestPath[TransformContext]{ + N: "links", }, orig: refSpan.Links(), newVal: newLinks, @@ -672,10 +590,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "dropped_links_count", - path: []ottl.Field{ - { - Name: "dropped_links_count", - }, + path: &internal.TestPath[TransformContext]{ + N: "dropped_links_count", }, orig: int64(30), newVal: int64(40), @@ -685,10 +601,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "status", - path: []ottl.Field{ - { - Name: "status", - }, + path: &internal.TestPath[TransformContext]{ + N: "status", }, orig: refSpan.Status(), newVal: newStatus, @@ -698,12 +612,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "status code", - path: []ottl.Field{ - { - Name: "status", - }, - { - Name: "code", + path: &internal.TestPath[TransformContext]{ + N: "status", + NextPath: &internal.TestPath[TransformContext]{ + N: "code", }, }, orig: int64(ptrace.StatusCodeOk), @@ -714,12 +626,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "status message", - path: []ottl.Field{ - { - Name: "status", - }, - { - Name: "message", + path: &internal.TestPath[TransformContext]{ + N: "status", + NextPath: &internal.TestPath[TransformContext]{ + N: "message", }, }, orig: "good span", @@ -730,10 +640,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "instrumentation_scope", - path: []ottl.Field{ - { - Name: "instrumentation_scope", - }, + path: &internal.TestPath[TransformContext]{ + N: "instrumentation_scope", }, orig: refIS, newVal: pcommon.NewInstrumentationScope(), @@ -743,10 +651,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "resource", - path: []ottl.Field{ - { - Name: "resource", - }, + path: &internal.TestPath[TransformContext]{ + N: "resource", }, orig: refResource, newVal: pcommon.NewResource(), @@ -754,36 +660,11 @@ func Test_newPathGetSetter(t *testing.T) { pcommon.NewResource().CopyTo(resource) }, }, - { - name: "start_time", - path: []ottl.Field{ - { - Name: "start_time", - }, - }, - orig: time.Date(1970, 1, 1, 0, 0, 0, 100000000, time.UTC), - newVal: time.Date(1970, 1, 1, 0, 0, 0, 200000000, time.UTC), - modified: func(span ptrace.Span, il pcommon.InstrumentationScope, resource pcommon.Resource, cache pcommon.Map) { - span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.UnixMilli(200))) - }, - }, - { - name: "end_time", - path: []ottl.Field{ - { - Name: "end_time", - }, - }, - orig: time.Date(1970, 1, 1, 0, 0, 0, 500000000, time.UTC), - newVal: time.Date(1970, 1, 1, 0, 0, 0, 200000000, time.UTC), - modified: func(span ptrace.Span, il pcommon.InstrumentationScope, resource pcommon.Resource, cache pcommon.Map) { - span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.UnixMilli(200))) - }, - }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - accessor, err := newPathGetSetter(tt.path) + pep := pathExpressionParser{} + accessor, err := pep.parsePath(tt.path) assert.NoError(t, err) span, il, resource := createTelemetry() diff --git a/pkg/ottl/contexts/ottlspanevent/span_events.go b/pkg/ottl/contexts/ottlspanevent/span_events.go index 8748ef2467c8..b16ebb1e74c4 100644 --- a/pkg/ottl/contexts/ottlspanevent/span_events.go +++ b/pkg/ottl/contexts/ottlspanevent/span_events.go @@ -61,10 +61,10 @@ func (tCtx TransformContext) getCache() pcommon.Map { } func NewParser(functions map[string]ottl.Factory[TransformContext], telemetrySettings component.TelemetrySettings, options ...Option) (ottl.Parser[TransformContext], error) { - pathExpressionParser := pathExpressionParser{telemetrySettings} + pep := pathExpressionParser{telemetrySettings} p, err := ottl.NewParser[TransformContext]( functions, - pathExpressionParser.parsePath, + pep.parsePath, telemetrySettings, ottl.WithEnumParser[TransformContext](parseEnum), ) @@ -123,27 +123,22 @@ type pathExpressionParser struct { telemetrySettings component.TelemetrySettings } -func (pep *pathExpressionParser) parsePath(val *ottl.Path) (ottl.GetSetter[TransformContext], error) { - if val != nil && len(val.Fields) > 0 { - return newPathGetSetter(val.Fields) +func (pep *pathExpressionParser) parsePath(path ottl.Path[TransformContext]) (ottl.GetSetter[TransformContext], error) { + if path == nil { + return nil, fmt.Errorf("path cannot be nil") } - return nil, fmt.Errorf("bad path %v", val) -} - -func newPathGetSetter(path []ottl.Field) (ottl.GetSetter[TransformContext], error) { - switch path[0].Name { + switch path.Name() { case "cache": - mapKey := path[0].Keys - if mapKey == nil { + if path.Key() == nil { return accessCache(), nil } - return accessCacheKey(mapKey), nil + return accessCacheKey(path.Key()), nil case "resource": - return internal.ResourcePathGetSetter[TransformContext](path[1:]) + return internal.ResourcePathGetSetter[TransformContext](path.Next()) case "instrumentation_scope": - return internal.ScopePathGetSetter[TransformContext](path[1:]) + return internal.ScopePathGetSetter[TransformContext](path.Next()) case "span": - return internal.SpanPathGetSetter[TransformContext](path[1:]) + return internal.SpanPathGetSetter[TransformContext](path.Next()) case "time_unix_nano": return accessSpanEventTimeUnixNano(), nil case "time": @@ -151,18 +146,16 @@ func newPathGetSetter(path []ottl.Field) (ottl.GetSetter[TransformContext], erro case "name": return accessSpanEventName(), nil case "attributes": - mapKey := path[0].Keys - if mapKey == nil { + if path.Key() == nil { return accessSpanEventAttributes(), nil } - return accessSpanEventAttributesKey(mapKey), nil + return accessSpanEventAttributesKey(path.Key()), nil case "dropped_attributes_count": return accessSpanEventDroppedAttributeCount(), nil } return nil, fmt.Errorf("invalid scope path expression %v", path) } - func accessCache() ottl.StandardGetSetter[TransformContext] { return ottl.StandardGetSetter[TransformContext]{ Getter: func(ctx context.Context, tCtx TransformContext) (any, error) { @@ -177,13 +170,13 @@ func accessCache() ottl.StandardGetSetter[TransformContext] { } } -func accessCacheKey(keys []ottl.Key) ottl.StandardGetSetter[TransformContext] { +func accessCacheKey(key ottl.Key[TransformContext]) ottl.StandardGetSetter[TransformContext] { return ottl.StandardGetSetter[TransformContext]{ Getter: func(ctx context.Context, tCtx TransformContext) (any, error) { - return internal.GetMapValue(tCtx.getCache(), keys) + return internal.GetMapValue[TransformContext](ctx, tCtx, tCtx.getCache(), key) }, Setter: func(ctx context.Context, tCtx TransformContext, val any) error { - return internal.SetMapValue(tCtx.getCache(), keys, val) + return internal.SetMapValue[TransformContext](ctx, tCtx, tCtx.getCache(), key, val) }, } } @@ -244,13 +237,13 @@ func accessSpanEventAttributes() ottl.StandardGetSetter[TransformContext] { } } -func accessSpanEventAttributesKey(keys []ottl.Key) ottl.StandardGetSetter[TransformContext] { +func accessSpanEventAttributesKey(key ottl.Key[TransformContext]) ottl.StandardGetSetter[TransformContext] { return ottl.StandardGetSetter[TransformContext]{ Getter: func(ctx context.Context, tCtx TransformContext) (any, error) { - return internal.GetMapValue(tCtx.GetSpanEvent().Attributes(), keys) + return internal.GetMapValue[TransformContext](ctx, tCtx, tCtx.GetSpanEvent().Attributes(), key) }, Setter: func(ctx context.Context, tCtx TransformContext, val any) error { - return internal.SetMapValue(tCtx.GetSpanEvent().Attributes(), keys, val) + return internal.SetMapValue[TransformContext](ctx, tCtx, tCtx.GetSpanEvent().Attributes(), key, val) }, } } diff --git a/pkg/ottl/contexts/ottlspanevent/span_events_test.go b/pkg/ottl/contexts/ottlspanevent/span_events_test.go index 1cb71ad73108..afa4322f7ab8 100644 --- a/pkg/ottl/contexts/ottlspanevent/span_events_test.go +++ b/pkg/ottl/contexts/ottlspanevent/span_events_test.go @@ -13,6 +13,7 @@ import ( "go.opentelemetry.io/collector/pdata/ptrace" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/internal" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/ottltest" ) @@ -49,17 +50,15 @@ func Test_newPathGetSetter(t *testing.T) { tests := []struct { name string - path []ottl.Field + path ottl.Path[TransformContext] orig any newVal any modified func(spanEvent ptrace.SpanEvent, span ptrace.Span, il pcommon.InstrumentationScope, resource pcommon.Resource, cache pcommon.Map) }{ { name: "span event time", - path: []ottl.Field{ - { - Name: "time", - }, + path: &internal.TestPath[TransformContext]{ + N: "time", }, orig: time.Date(1970, 1, 1, 0, 0, 0, 100000000, time.UTC), newVal: time.Date(1970, 1, 1, 0, 0, 0, 200000000, time.UTC), @@ -69,10 +68,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "cache", - path: []ottl.Field{ - { - Name: "cache", - }, + path: &internal.TestPath[TransformContext]{ + N: "cache", }, orig: pcommon.NewMap(), newVal: newCache, @@ -82,14 +79,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "cache access", - path: []ottl.Field{ - { - Name: "cache", - Keys: []ottl.Key{ - { - String: ottltest.Strp("temp"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "cache", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("temp"), }, }, orig: nil, @@ -100,10 +93,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "name", - path: []ottl.Field{ - { - Name: "name", - }, + path: &internal.TestPath[TransformContext]{ + N: "name", }, orig: "bear", newVal: "cat", @@ -113,10 +104,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "time_unix_nano", - path: []ottl.Field{ - { - Name: "time_unix_nano", - }, + path: &internal.TestPath[TransformContext]{ + N: "time_unix_nano", }, orig: int64(100_000_000), newVal: int64(200_000_000), @@ -126,10 +115,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes", - path: []ottl.Field{ - { - Name: "attributes", - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", }, orig: refSpanEvent.Attributes(), newVal: newAttrs, @@ -139,14 +126,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes string", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("str"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("str"), }, }, orig: "val", @@ -157,14 +140,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes bool", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("bool"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("bool"), }, }, orig: true, @@ -175,14 +154,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes int", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("int"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("int"), }, }, orig: int64(10), @@ -193,14 +168,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes float", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("double"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("double"), }, }, orig: float64(1.2), @@ -211,14 +182,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes bytes", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("bytes"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("bytes"), }, }, orig: []byte{1, 3, 2}, @@ -229,14 +196,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes array string", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_str"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_str"), }, }, orig: func() pcommon.Slice { @@ -250,14 +213,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes array bool", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_bool"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_bool"), }, }, orig: func() pcommon.Slice { @@ -271,14 +230,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes array int", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_int"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_int"), }, }, orig: func() pcommon.Slice { @@ -292,14 +247,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes array float", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_float"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_float"), }, }, orig: func() pcommon.Slice { @@ -313,14 +264,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes array bytes", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("arr_bytes"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("arr_bytes"), }, }, orig: func() pcommon.Slice { @@ -334,14 +281,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes pcommon.Map", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("pMap"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("pMap"), }, }, orig: func() pcommon.Map { @@ -357,14 +300,10 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes map[string]any", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("map"), - }, - }, + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("map"), }, }, orig: func() pcommon.Map { @@ -380,18 +319,14 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes nested", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("slice"), - }, - { - Int: ottltest.Intp(0), - }, - { - String: ottltest.Strp("map"), + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("slice"), + NextKey: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(0), + NextKey: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("map"), }, }, }, @@ -408,18 +343,14 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "attributes nested new values", - path: []ottl.Field{ - { - Name: "attributes", - Keys: []ottl.Key{ - { - String: ottltest.Strp("new"), - }, - { - Int: ottltest.Intp(2), - }, - { - Int: ottltest.Intp(0), + path: &internal.TestPath[TransformContext]{ + N: "attributes", + Keys: &internal.TestKey[TransformContext]{ + S: ottltest.Strp("new"), + NextKey: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(2), + NextKey: &internal.TestKey[TransformContext]{ + I: ottltest.Intp(0), }, }, }, @@ -437,10 +368,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "dropped_attributes_count", - path: []ottl.Field{ - { - Name: "dropped_attributes_count", - }, + path: &internal.TestPath[TransformContext]{ + N: "dropped_attributes_count", }, orig: int64(10), newVal: int64(20), @@ -450,10 +379,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "instrumentation_scope", - path: []ottl.Field{ - { - Name: "instrumentation_scope", - }, + path: &internal.TestPath[TransformContext]{ + N: "instrumentation_scope", }, orig: refIS, newVal: pcommon.NewInstrumentationScope(), @@ -463,10 +390,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "resource", - path: []ottl.Field{ - { - Name: "resource", - }, + path: &internal.TestPath[TransformContext]{ + N: "resource", }, orig: refResource, newVal: pcommon.NewResource(), @@ -476,10 +401,8 @@ func Test_newPathGetSetter(t *testing.T) { }, { name: "span", - path: []ottl.Field{ - { - Name: "span", - }, + path: &internal.TestPath[TransformContext]{ + N: "span", }, orig: refSpan, newVal: ptrace.NewSpan(), @@ -490,7 +413,8 @@ func Test_newPathGetSetter(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - accessor, err := newPathGetSetter(tt.path) + pep := pathExpressionParser{} + accessor, err := pep.parsePath(tt.path) assert.NoError(t, err) spanEvent, span, il, resource := createTelemetry() diff --git a/pkg/ottl/expression.go b/pkg/ottl/expression.go index 1c5ac3f69b17..f1adaa161e8d 100644 --- a/pkg/ottl/expression.go +++ b/pkg/ottl/expression.go @@ -63,7 +63,7 @@ func (l literal[K]) Get(context.Context, K) (any, error) { type exprGetter[K any] struct { expr Expr[K] - keys []Key + keys []key } func (g exprGetter[K]) Get(ctx context.Context, tCtx K) (any, error) { @@ -616,7 +616,7 @@ func (p *Parser[K]) newGetter(val value) (Getter[K], error) { } if val.Enum != nil { - enum, err := p.enumParser(val.Enum) + enum, err := p.enumParser((*EnumSymbol)(val.Enum)) if err != nil { return nil, err } @@ -631,7 +631,11 @@ func (p *Parser[K]) newGetter(val value) (Getter[K], error) { return &literal[K]{value: *i}, nil } if eL.Path != nil { - return p.pathParser(eL.Path) + np, err := newPath[K](eL.Path.Fields) + if err != nil { + return nil, err + } + return p.parsePath(np) } if eL.Converter != nil { return p.newGetterFromConverter(*eL.Converter) diff --git a/pkg/ottl/expression_test.go b/pkg/ottl/expression_test.go index 478d56defead..4e18958d3822 100644 --- a/pkg/ottl/expression_test.go +++ b/pkg/ottl/expression_test.go @@ -116,8 +116,8 @@ func Test_newGetter(t *testing.T) { name: "path expression", val: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -131,11 +131,11 @@ func Test_newGetter(t *testing.T) { name: "complex path expression", val: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "attributes", - Keys: []Key{ + Keys: []key{ { String: ottltest.Strp("foo"), }, @@ -167,7 +167,7 @@ func Test_newGetter(t *testing.T) { Literal: &mathExprLiteral{ Converter: &converter{ Function: "PMap", - Keys: []Key{ + Keys: []key{ { String: ottltest.Strp("foo"), }, @@ -186,7 +186,7 @@ func Test_newGetter(t *testing.T) { Literal: &mathExprLiteral{ Converter: &converter{ Function: "Map", - Keys: []Key{ + Keys: []key{ { String: ottltest.Strp("foo"), }, @@ -205,7 +205,7 @@ func Test_newGetter(t *testing.T) { Literal: &mathExprLiteral{ Converter: &converter{ Function: "PSlice", - Keys: []Key{ + Keys: []key{ { Int: ottltest.Intp(0), }, @@ -224,7 +224,7 @@ func Test_newGetter(t *testing.T) { Literal: &mathExprLiteral{ Converter: &converter{ Function: "Slice", - Keys: []Key{ + Keys: []key{ { Int: ottltest.Intp(0), }, @@ -240,7 +240,7 @@ func Test_newGetter(t *testing.T) { { name: "enum", val: value{ - Enum: (*EnumSymbol)(ottltest.Strp("TEST_ENUM_ONE")), + Enum: (*enumSymbol)(ottltest.Strp("TEST_ENUM_ONE")), }, want: int64(1), }, @@ -348,8 +348,8 @@ func Test_newGetter(t *testing.T) { Values: []value{ { Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -426,7 +426,7 @@ func Test_newGetter(t *testing.T) { p, _ := NewParser[any]( functions, - testParsePath, + testParsePath[any], componenttest.NewNopTelemetrySettings(), WithEnumParser[any](testParseEnum), ) @@ -465,7 +465,7 @@ func Test_exprGetter_Get_Invalid(t *testing.T) { Literal: &mathExprLiteral{ Converter: &converter{ Function: "PMap", - Keys: []Key{ + Keys: []key{ { String: ottltest.Strp("unknown key"), }, @@ -481,7 +481,7 @@ func Test_exprGetter_Get_Invalid(t *testing.T) { Literal: &mathExprLiteral{ Converter: &converter{ Function: "Map", - Keys: []Key{ + Keys: []key{ { String: ottltest.Strp("unknown key"), }, @@ -497,7 +497,7 @@ func Test_exprGetter_Get_Invalid(t *testing.T) { Literal: &mathExprLiteral{ Converter: &converter{ Function: "PSlice", - Keys: []Key{ + Keys: []key{ { Int: ottltest.Intp(100), }, @@ -513,7 +513,7 @@ func Test_exprGetter_Get_Invalid(t *testing.T) { Literal: &mathExprLiteral{ Converter: &converter{ Function: "PSlice", - Keys: []Key{ + Keys: []key{ { Int: ottltest.Intp(-1), }, @@ -529,7 +529,7 @@ func Test_exprGetter_Get_Invalid(t *testing.T) { Literal: &mathExprLiteral{ Converter: &converter{ Function: "Slice", - Keys: []Key{ + Keys: []key{ { Int: ottltest.Intp(100), }, @@ -545,7 +545,7 @@ func Test_exprGetter_Get_Invalid(t *testing.T) { Literal: &mathExprLiteral{ Converter: &converter{ Function: "Slice", - Keys: []Key{ + Keys: []key{ { Int: ottltest.Intp(-1), }, @@ -561,7 +561,7 @@ func Test_exprGetter_Get_Invalid(t *testing.T) { Literal: &mathExprLiteral{ Converter: &converter{ Function: "Hello", - Keys: []Key{ + Keys: []key{ { Int: ottltest.Intp(-1), }, @@ -577,7 +577,7 @@ func Test_exprGetter_Get_Invalid(t *testing.T) { Literal: &mathExprLiteral{ Converter: &converter{ Function: "Hello", - Keys: []Key{ + Keys: []key{ { String: ottltest.Strp("test"), }, @@ -599,7 +599,7 @@ func Test_exprGetter_Get_Invalid(t *testing.T) { p, _ := NewParser[any]( functions, - testParsePath, + testParsePath[any], componenttest.NewNopTelemetrySettings(), WithEnumParser[any](testParseEnum), ) diff --git a/pkg/ottl/functions.go b/pkg/ottl/functions.go index 4b48a1f6d176..6a10b915efe3 100644 --- a/pkg/ottl/functions.go +++ b/pkg/ottl/functions.go @@ -4,6 +4,7 @@ package ottl // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl" import ( + "context" "errors" "fmt" "reflect" @@ -12,48 +13,60 @@ import ( "github.com/iancoleman/strcase" ) -type PathExpressionParser[K any] func(*Path) (GetSetter[K], error) +type PathExpressionParser[K any] func(Path[K]) (GetSetter[K], error) type EnumParser func(*EnumSymbol) (*Enum, error) type Enum int64 -func newPath(fields []Field) *basePath { +type EnumSymbol string + +func newPath[K any](fields []field) (*basePath[K], error) { if len(fields) == 0 { - return nil + return nil, fmt.Errorf("cannot make a path from zero fields") } - var current *basePath + var current *basePath[K] for i := len(fields) - 1; i >= 0; i-- { - current = &basePath{ + current = &basePath[K]{ name: fields[i].Name, - key: newKey(fields[i].Keys), + key: newKey[K](fields[i].Keys), nextPath: current, } } current.fetched = true - return current + return current, nil } -type path interface { +// Path represents a chain of path parts in an OTTL statement, such as `body.string`. +// A Path has a name, and potentially a set of keys. +// If the path in the OTTL statement contains multiple parts (separated by a dot (`.`)), then the Path will have a pointer to the next Path. +type Path[K any] interface { + // Name is the name of this segment of the path. Name() string - Next() path - Key() key + + // Next provides the next path segment for this Path. + // Will return nil if there is no next path. + Next() Path[K] + + // Key provides the Key for this Path. + // Will return nil if there is no Key. + Key() Key[K] } -var _ path = &basePath{} +var _ Path[any] = &basePath[any]{} -type basePath struct { +type basePath[K any] struct { name string - key key - nextPath *basePath + key *baseKey[K] + nextPath *basePath[K] fetched bool } -func (p *basePath) Name() string { +func (p *basePath[K]) Name() string { return p.name } -func (p *basePath) Next() path { +func (p *basePath[K]) Next() Path[K] { if p.nextPath == nil { return nil } @@ -61,11 +74,14 @@ func (p *basePath) Next() path { return p.nextPath } -func (p *basePath) Key() key { +func (p *basePath[K]) Key() Key[K] { + if p.key == nil { + return nil + } return p.key } -func (p *basePath) isComplete() error { +func (p *basePath[K]) isComplete() error { if !p.fetched { return fmt.Errorf("the path section %q was not used by the context - this likely means you are using extra path sections", p.name) } @@ -75,67 +91,73 @@ func (p *basePath) isComplete() error { return p.nextPath.isComplete() } -func newKey(keys []Key) *baseKey { +func newKey[K any](keys []key) *baseKey[K] { if len(keys) == 0 { return nil } - var current *baseKey + var current *baseKey[K] for i := len(keys) - 1; i >= 0; i-- { - current = &baseKey{ + current = &baseKey[K]{ s: keys[i].String, i: keys[i].Int, nextKey: current, } } - current.fetched = true return current } -type key interface { - String() *string - Int() *int64 - Next() key +// Key represents a chain of keys in an OTTL statement, such as `attributes["foo"]["bar"]`. +// A Key has a String or Int, and potentially the next Key. +// If the path in the OTTL statement contains multiple keys, then the Key will have a pointer to the next Key. +type Key[K any] interface { + // String returns a pointer to the Key's string value. + // If the Key does not have a string value the returned value is nil. + // If Key experiences an error retrieving the value it is returned. + String(context.Context, K) (*string, error) + + // Int returns a pointer to the Key's int value. + // If the Key does not have a int value the returned value is nil. + // If Key experiences an error retrieving the value it is returned. + Int(context.Context, K) (*int64, error) + + // Next provides the next Key. + // Will return nil if there is no next Key. + Next() Key[K] } -var _ key = &baseKey{} +var _ Key[any] = &baseKey[any]{} -type baseKey struct { +type baseKey[K any] struct { s *string i *int64 - nextKey *baseKey - fetched bool + nextKey *baseKey[K] } -func (k *baseKey) String() *string { - return k.s +func (k *baseKey[K]) String(_ context.Context, _ K) (*string, error) { + return k.s, nil } -func (k *baseKey) Int() *int64 { - return k.i +func (k *baseKey[K]) Int(_ context.Context, _ K) (*int64, error) { + return k.i, nil } -func (k *baseKey) Next() key { +func (k *baseKey[K]) Next() Key[K] { if k.nextKey == nil { return nil } - k.nextKey.fetched = true return k.nextKey } -func (k *baseKey) isComplete() error { - if !k.fetched { - var val any - if k.s != nil { - val = *k.s - } else if k.i != nil { - val = *k.i - } - return fmt.Errorf("the key %q was not used by the context during indexing", val) +func (p *Parser[K]) parsePath(ip *basePath[K]) (GetSetter[K], error) { + g, err := p.pathParser(ip) + if err != nil { + return nil, err } - if k.nextKey == nil { - return nil + err = ip.isComplete() + if err != nil { + return nil, err } - return k.nextKey.isComplete() + return g, nil } func (p *Parser[K]) newFunctionCall(ed editor) (Expr[K], error) { @@ -361,9 +383,13 @@ func (p *Parser[K]) buildArg(argVal value, argType reflect.Type) (any, error) { fallthrough case strings.HasPrefix(name, "GetSetter"): if argVal.Literal == nil || argVal.Literal.Path == nil { - return nil, fmt.Errorf("must be a Path") + return nil, fmt.Errorf("must be a path") + } + np, err := newPath[K](argVal.Literal.Path.Fields) + if err != nil { + return nil, err } - arg, err := p.pathParser(argVal.Literal.Path) + arg, err := p.parsePath(np) if err != nil { return nil, err } @@ -429,7 +455,7 @@ func (p *Parser[K]) buildArg(argVal value, argType reflect.Type) (any, error) { } return StandardTimeGetter[K]{Getter: arg.Get}, nil case name == "Enum": - arg, err := p.enumParser(argVal.Enum) + arg, err := p.enumParser((*EnumSymbol)(argVal.Enum)) if err != nil { return nil, fmt.Errorf("must be an Enum") } diff --git a/pkg/ottl/functions_test.go b/pkg/ottl/functions_test.go index c03f207f9ef9..fe9c309fecb5 100644 --- a/pkg/ottl/functions_test.go +++ b/pkg/ottl/functions_test.go @@ -83,7 +83,7 @@ func Test_NewFunctionCall_invalid(t *testing.T) { p, _ := NewParser( functions, - testParsePath, + testParsePath[any], componenttest.NewNopTelemetrySettings(), WithEnumParser[any](testParseEnum), ) @@ -150,8 +150,8 @@ func Test_NewFunctionCall_invalid(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -176,8 +176,8 @@ func Test_NewFunctionCall_invalid(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -283,8 +283,8 @@ func Test_NewFunctionCall_invalid(t *testing.T) { Name: "get_setter_arg", Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -323,8 +323,8 @@ func Test_NewFunctionCall_invalid(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -368,7 +368,7 @@ func Test_NewFunctionCall_invalid(t *testing.T) { Arguments: []argument{ { Value: value{ - Enum: (*EnumSymbol)(ottltest.Strp("SYMBOL_NOT_FOUND")), + Enum: (*enumSymbol)(ottltest.Strp("SYMBOL_NOT_FOUND")), }, }, }, @@ -393,6 +393,30 @@ func Test_NewFunctionCall_invalid(t *testing.T) { Function: "non_pointer", }, }, + { + name: "path parts not all used", + inv: editor{ + Function: "testing_getsetter", + Arguments: []argument{ + { + Value: value{ + Literal: &mathExprLiteral{ + Path: &path{ + Fields: []field{ + { + Name: "name", + }, + { + Name: "not-used", + }, + }, + }, + }, + }, + }, + }, + }, + }, } for _, tt := range tests { @@ -407,7 +431,7 @@ func Test_NewFunctionCall_invalid(t *testing.T) { func Test_NewFunctionCall(t *testing.T) { p, _ := NewParser( defaultFunctionsForTests(), - testParsePath, + testParsePath[any], componenttest.NewNopTelemetrySettings(), WithEnumParser[any](testParseEnum), ) @@ -542,8 +566,8 @@ func Test_NewFunctionCall(t *testing.T) { Values: []value{ { Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -568,7 +592,7 @@ func Test_NewFunctionCall(t *testing.T) { Bool: (*boolean)(ottltest.Boolp(true)), }, { - Enum: (*EnumSymbol)(ottltest.Strp("TEST_ENUM")), + Enum: (*enumSymbol)(ottltest.Strp("TEST_ENUM")), }, { List: &list{ @@ -620,8 +644,8 @@ func Test_NewFunctionCall(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -766,8 +790,8 @@ func Test_NewFunctionCall(t *testing.T) { Values: []value{ { Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -777,8 +801,8 @@ func Test_NewFunctionCall(t *testing.T) { }, { Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -877,8 +901,8 @@ func Test_NewFunctionCall(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -899,8 +923,8 @@ func Test_NewFunctionCall(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -921,8 +945,8 @@ func Test_NewFunctionCall(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -979,8 +1003,8 @@ func Test_NewFunctionCall(t *testing.T) { }, { Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -996,8 +1020,8 @@ func Test_NewFunctionCall(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -1168,8 +1192,8 @@ func Test_NewFunctionCall(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -1264,8 +1288,8 @@ func Test_NewFunctionCall(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -1305,8 +1329,8 @@ func Test_NewFunctionCall(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -1344,8 +1368,8 @@ func Test_NewFunctionCall(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -1384,7 +1408,37 @@ func Test_NewFunctionCall(t *testing.T) { Arguments: []argument{ { Value: value{ - Enum: (*EnumSymbol)(ottltest.Strp("TEST_ENUM")), + Enum: (*enumSymbol)(ottltest.Strp("TEST_ENUM")), + }, + }, + }, + }, + want: nil, + }, + { + name: "Complex Indexing", + inv: editor{ + Function: "testing_getsetter", + Arguments: []argument{ + { + Value: value{ + Literal: &mathExprLiteral{ + Path: &path{ + Fields: []field{ + { + Name: "name", + Keys: []key{ + { + String: ottltest.Strp("foo"), + }, + { + String: ottltest.Strp("bar"), + }, + }, + }, + }, + }, + }, }, }, }, @@ -1414,7 +1468,7 @@ func Test_ArgumentsNotMutated(t *testing.T) { ) p, _ := NewParser( CreateFactoryMap[any](fact), - testParsePath, + testParsePath[any], componenttest.NewNopTelemetrySettings(), WithEnumParser[any](testParseEnum), ) @@ -1425,8 +1479,8 @@ func Test_ArgumentsNotMutated(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -1461,8 +1515,8 @@ func Test_ArgumentsNotMutated(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -2095,15 +2149,16 @@ func defaultFunctionsForTests() map[string]Factory[any] { } func Test_basePath_Name(t *testing.T) { - bp := basePath{ + bp := basePath[any]{ name: "test", } - assert.Equal(t, "test", bp.Name()) + n := bp.Name() + assert.Equal(t, "test", n) } func Test_basePath_Next(t *testing.T) { - bp := basePath{ - nextPath: &basePath{}, + bp := basePath[any]{ + nextPath: &basePath[any]{}, } next := bp.Next() assert.NotNil(t, next) @@ -2111,8 +2166,8 @@ func Test_basePath_Next(t *testing.T) { } func Test_basePath_Key(t *testing.T) { - k := &baseKey{} - bp := basePath{ + k := &baseKey[any]{} + bp := basePath[any]{ key: k, } assert.Equal(t, k, bp.Key()) @@ -2121,36 +2176,36 @@ func Test_basePath_Key(t *testing.T) { func Test_basePath_isComplete(t *testing.T) { tests := []struct { name string - p basePath + p basePath[any] expectedError bool }{ { name: "fetched no next", - p: basePath{ + p: basePath[any]{ fetched: true, }, }, { name: "fetched with next", - p: basePath{ + p: basePath[any]{ fetched: true, - nextPath: &basePath{ + nextPath: &basePath[any]{ fetched: true, }, }, }, { name: "not fetched no next", - p: basePath{ + p: basePath[any]{ fetched: false, }, expectedError: true, }, { name: "not fetched with next", - p: basePath{ + p: basePath[any]{ fetched: true, - nextPath: &basePath{ + nextPath: &basePath[any]{ fetched: false, }, }, @@ -2172,15 +2227,15 @@ func Test_basePath_isComplete(t *testing.T) { func Test_basePath_NextWithIsComplete(t *testing.T) { tests := []struct { name string - pathFunc func() *basePath + pathFunc func() *basePath[any] expectedError bool }{ { name: "fetched", - pathFunc: func() *basePath { - bp := basePath{ + pathFunc: func() *basePath[any] { + bp := basePath[any]{ fetched: true, - nextPath: &basePath{ + nextPath: &basePath[any]{ fetched: false, }, } @@ -2190,12 +2245,12 @@ func Test_basePath_NextWithIsComplete(t *testing.T) { }, { name: "not fetched enough", - pathFunc: func() *basePath { - bp := basePath{ + pathFunc: func() *basePath[any] { + bp := basePath[any]{ fetched: true, - nextPath: &basePath{ + nextPath: &basePath[any]{ fetched: false, - nextPath: &basePath{ + nextPath: &basePath[any]{ fetched: false, }, }, @@ -2219,7 +2274,7 @@ func Test_basePath_NextWithIsComplete(t *testing.T) { } func Test_newPath(t *testing.T) { - fields := []Field{ + fields := []field{ { Name: "body", }, @@ -2227,138 +2282,48 @@ func Test_newPath(t *testing.T) { Name: "string", }, } - p := newPath(fields) - assert.Equal(t, "body", p.name) - p = p.nextPath - assert.Equal(t, "string", p.name) - assert.Nil(t, p.nextPath) + np, err := newPath[any](fields) + assert.NoError(t, err) + p := Path[any](np) + assert.Equal(t, "body", p.Name()) + assert.Nil(t, p.Key()) + p = p.Next() + assert.Equal(t, "string", p.Name()) + assert.Nil(t, p.Key()) + assert.Nil(t, p.Next()) } func Test_baseKey_String(t *testing.T) { - bp := baseKey{ + bp := baseKey[any]{ s: ottltest.Strp("test"), } - assert.Equal(t, "test", *bp.String()) + s, err := bp.String(context.Background(), nil) + assert.NoError(t, err) + assert.NotNil(t, s) + assert.Equal(t, "test", *s) } func Test_baseKey_Int(t *testing.T) { - bp := baseKey{ + bp := baseKey[any]{ i: ottltest.Intp(1), } - assert.Equal(t, int64(1), *bp.Int()) + i, err := bp.Int(context.Background(), nil) + assert.NoError(t, err) + assert.NotNil(t, i) + assert.Equal(t, int64(1), *i) } func Test_baseKey_Next(t *testing.T) { - bp := baseKey{ - nextKey: &baseKey{}, + bp := baseKey[any]{ + nextKey: &baseKey[any]{}, } next := bp.Next() assert.NotNil(t, next) assert.Nil(t, next.Next()) } -func Test_baseKey_isComplete(t *testing.T) { - tests := []struct { - name string - p baseKey - expectedError bool - }{ - { - name: "fetched no next", - p: baseKey{ - fetched: true, - }, - }, - { - name: "fetched with next", - p: baseKey{ - fetched: true, - nextKey: &baseKey{ - fetched: true, - }, - }, - }, - { - name: "not fetched no next", - p: baseKey{ - fetched: false, - }, - expectedError: true, - }, - { - name: "not fetched with next", - p: baseKey{ - fetched: true, - nextKey: &baseKey{ - fetched: false, - }, - }, - expectedError: true, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - err := tt.p.isComplete() - if tt.expectedError { - assert.Error(t, err) - } else { - assert.NoError(t, err) - } - }) - } -} - -func Test_baseKey_NextWithIsComplete(t *testing.T) { - tests := []struct { - name string - keyFunc func() *baseKey - expectedError bool - }{ - { - name: "fetched", - keyFunc: func() *baseKey { - bk := baseKey{ - fetched: true, - nextKey: &baseKey{ - fetched: false, - }, - } - bk.Next() - return &bk - }, - }, - { - name: "not fetched enough", - keyFunc: func() *baseKey { - bk := baseKey{ - fetched: true, - nextKey: &baseKey{ - fetched: false, - nextKey: &baseKey{ - fetched: false, - }, - }, - } - bk.Next() - return &bk - }, - expectedError: true, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - err := tt.keyFunc().isComplete() - if tt.expectedError { - assert.Error(t, err) - } else { - assert.NoError(t, err) - } - }) - } -} - func Test_newKey(t *testing.T) { - keys := []Key{ + keys := []key{ { String: ottltest.Strp("foo"), }, @@ -2366,9 +2331,15 @@ func Test_newKey(t *testing.T) { String: ottltest.Strp("bar"), }, } - k := newKey(keys) - assert.Equal(t, "foo", *k.s) - k = k.nextKey - assert.Equal(t, "bar", *k.s) - assert.Nil(t, k.nextKey) + k := Key[any](newKey[any](keys)) + s, err := k.String(context.Background(), nil) + assert.NoError(t, err) + assert.NotNil(t, s) + assert.Equal(t, "foo", *s) + k = k.Next() + s, err = k.String(context.Background(), nil) + assert.NoError(t, err) + assert.NotNil(t, s) + assert.Equal(t, "bar", *s) + assert.Nil(t, k.Next()) } diff --git a/pkg/ottl/go.mod b/pkg/ottl/go.mod index 80761aca220f..49231201664c 100644 --- a/pkg/ottl/go.mod +++ b/pkg/ottl/go.mod @@ -14,7 +14,7 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 - golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb + golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 ) require ( diff --git a/pkg/ottl/go.sum b/pkg/ottl/go.sum index de9902d5b8cc..215e95e771a6 100644 --- a/pkg/ottl/go.sum +++ b/pkg/ottl/go.sum @@ -80,8 +80,8 @@ 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/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= diff --git a/pkg/ottl/grammar.go b/pkg/ottl/grammar.go index e8381292cc13..cbcfdf39256c 100644 --- a/pkg/ottl/grammar.go +++ b/pkg/ottl/grammar.go @@ -123,22 +123,22 @@ type compareOp int // These are the allowed values of a compareOp const ( - EQ compareOp = iota - NE - LT - LTE - GTE - GT + eq compareOp = iota + ne + lt + lte + gte + gt ) // a fast way to get from a string to a compareOp var compareOpTable = map[string]compareOp{ - "==": EQ, - "!=": NE, - "<": LT, - "<=": LTE, - ">": GT, - ">=": GTE, + "==": eq, + "!=": ne, + "<": lt, + "<=": lte, + ">": gt, + ">=": gte, } // Capture is how the parser converts an operator string to a compareOp. @@ -154,18 +154,18 @@ func (c *compareOp) Capture(values []string) error { // String() for compareOp gives us more legible test results and error messages. func (c *compareOp) String() string { switch *c { - case EQ: - return "EQ" - case NE: - return "NE" - case LT: - return "LT" - case LTE: - return "LTE" - case GTE: - return "GTE" - case GT: - return "GT" + case eq: + return "eq" + case ne: + return "ne" + case lt: + return "lt" + case lte: + return "lte" + case gte: + return "gte" + case gt: + return "gt" default: return "UNKNOWN OP!" } @@ -192,7 +192,7 @@ type editor struct { Function string `parser:"@(Lowercase(Uppercase | Lowercase)*)"` Arguments []argument `parser:"'(' ( @@ ( ',' @@ )* )? ')'"` // If keys are matched return an error - Keys []Key `parser:"( @@ )*"` + Keys []key `parser:"( @@ )*"` } func (i *editor) checkForCustomError() error { @@ -214,7 +214,7 @@ func (i *editor) checkForCustomError() error { type converter struct { Function string `parser:"@(Uppercase(Uppercase | Lowercase)*)"` Arguments []argument `parser:"'(' ( @@ ( ',' @@ )* )? ')'"` - Keys []Key `parser:"( @@ )*"` + Keys []key `parser:"( @@ )*"` } type argument struct { @@ -235,7 +235,7 @@ type value struct { Bytes *byteSlice `parser:"| @Bytes"` String *string `parser:"| @String"` Bool *boolean `parser:"| @Boolean"` - Enum *EnumSymbol `parser:"| @Uppercase (?! Lowercase)"` + Enum *enumSymbol `parser:"| @Uppercase (?! Lowercase)"` FunctionName *string `parser:"| @(Uppercase(Uppercase | Lowercase)*)"` List *list `parser:"| @@)"` } @@ -250,18 +250,18 @@ func (v *value) checkForCustomError() error { return nil } -// Path represents a telemetry path mathExpression. -type Path struct { - Fields []Field `parser:"@@ ( '.' @@ )*"` +// path represents a telemetry path mathExpression. +type path struct { + Fields []field `parser:"@@ ( '.' @@ )*"` } -// Field is an item within a Path. -type Field struct { +// field is an item within a path. +type field struct { Name string `parser:"@Lowercase"` - Keys []Key `parser:"( @@ )*"` + Keys []key `parser:"( @@ )*"` } -type Key struct { +type key struct { String *string `parser:"'[' (@String "` Int *int64 `parser:"| @Int) ']'"` } @@ -305,7 +305,7 @@ type mathExprLiteral struct { Converter *converter `parser:"| @@"` Float *float64 `parser:"| @Float"` Int *int64 `parser:"| @Int"` - Path *Path `parser:"| @@ )"` + Path *path `parser:"| @@ )"` } func (m *mathExprLiteral) checkForCustomError() error { @@ -386,17 +386,17 @@ func (m *mathExpression) checkForCustomError() error { type mathOp int const ( - ADD mathOp = iota - SUB - MULT - DIV + add mathOp = iota + sub + mult + div ) var mathOpTable = map[string]mathOp{ - "+": ADD, - "-": SUB, - "*": MULT, - "/": DIV, + "+": add, + "-": sub, + "*": mult, + "/": div, } func (m *mathOp) Capture(values []string) error { @@ -410,20 +410,20 @@ func (m *mathOp) Capture(values []string) error { func (m *mathOp) String() string { switch *m { - case ADD: + case add: return "+" - case SUB: + case sub: return "-" - case MULT: + case mult: return "*" - case DIV: + case div: return "/" default: return "UNKNOWN OP!" } } -type EnumSymbol string +type enumSymbol string // buildLexer constructs a SimpleLexer definition. // Note that the ordering of these rules matters. diff --git a/pkg/ottl/math.go b/pkg/ottl/math.go index eae661e639ef..9c9dd3dc18d6 100644 --- a/pkg/ottl/math.go +++ b/pkg/ottl/math.go @@ -113,7 +113,7 @@ func attemptMathOperation[K any](lhs Getter[K], op mathOp, rhs Getter[K]) Getter func performOpTime(x time.Time, y any, op mathOp) (any, error) { switch op { - case ADD: + case add: switch newY := y.(type) { case time.Duration: result := x.Add(newY) @@ -121,7 +121,7 @@ func performOpTime(x time.Time, y any, op mathOp) (any, error) { default: return nil, fmt.Errorf("time.Time must be added to time.Duration; found %v instead", y) } - case SUB: + case sub: switch newY := y.(type) { case time.Time: result := x.Sub(newY) @@ -138,7 +138,7 @@ func performOpTime(x time.Time, y any, op mathOp) (any, error) { func performOpDuration(x time.Duration, y any, op mathOp) (any, error) { switch op { - case ADD: + case add: switch newY := y.(type) { case time.Duration: result := x + newY @@ -149,7 +149,7 @@ func performOpDuration(x time.Duration, y any, op mathOp) (any, error) { default: return nil, fmt.Errorf("time.Duration must be added to time.Duration or time.Time; found %v instead", y) } - case SUB: + case sub: switch newY := y.(type) { case time.Duration: result := x - newY @@ -163,13 +163,13 @@ func performOpDuration(x time.Duration, y any, op mathOp) (any, error) { func performOp[N int64 | float64](x N, y N, op mathOp) (N, error) { switch op { - case ADD: + case add: return x + y, nil - case SUB: + case sub: return x - y, nil - case MULT: + case mult: return x * y, nil - case DIV: + case div: if y == 0 { return 0, fmt.Errorf("attempted to divide by 0") } diff --git a/pkg/ottl/math_test.go b/pkg/ottl/math_test.go index e993b3dd8d53..3fc73ca10c7e 100644 --- a/pkg/ottl/math_test.go +++ b/pkg/ottl/math_test.go @@ -18,29 +18,29 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/ottltest" ) -func mathParsePath(val *Path) (GetSetter[any], error) { - if val != nil && len(val.Fields) > 0 && val.Fields[0].Name == "one" { +func mathParsePath[K any](p Path[K]) (GetSetter[any], error) { + if p != nil && p.Name() == "one" { return &StandardGetSetter[any]{ Getter: func(context.Context, any) (any, error) { return int64(1), nil }, }, nil } - if val != nil && len(val.Fields) > 0 && val.Fields[0].Name == "two" { + if p != nil && p.Name() == "two" { return &StandardGetSetter[any]{ Getter: func(context.Context, any) (any, error) { return int64(2), nil }, }, nil } - if val != nil && len(val.Fields) > 0 && val.Fields[0].Name == "three" && val.Fields[1].Name == "one" { + if p != nil && p.Name() == "three" && p.Next() != nil && p.Next().Name() == "one" { return &StandardGetSetter[any]{ Getter: func(context.Context, any) (any, error) { return 3.1, nil }, }, nil } - return nil, fmt.Errorf("bad path %v", val) + return nil, fmt.Errorf("bad path %v", p) } func one[K any]() (ExprFunc[K], error) { @@ -234,7 +234,7 @@ func Test_evaluateMathExpression(t *testing.T) { p, _ := NewParser[any]( functions, - mathParsePath, + mathParsePath[any], componenttest.NewNopTelemetrySettings(), WithEnumParser[any](testParseEnum), ) @@ -269,7 +269,7 @@ func Test_evaluateMathExpression_error(t *testing.T) { input: "1 / 0", }, { - name: "time DIV time", + name: "time div time", mathExpr: &mathExpression{ Left: &addSubTerm{ Left: &mathValue{ @@ -294,7 +294,7 @@ func Test_evaluateMathExpression_error(t *testing.T) { }, Right: []*opAddSubTerm{ { - Operator: DIV, + Operator: div, Term: &addSubTerm{ Left: &mathValue{ Literal: &mathExprLiteral{ @@ -322,7 +322,7 @@ func Test_evaluateMathExpression_error(t *testing.T) { errorMsg: "only addition and subtraction supported", }, { - name: "dur MULT dur", + name: "dur mult dur", mathExpr: &mathExpression{ Left: &addSubTerm{ Left: &mathValue{ @@ -342,7 +342,7 @@ func Test_evaluateMathExpression_error(t *testing.T) { }, Right: []*opAddSubTerm{ { - Operator: MULT, + Operator: mult, Term: &addSubTerm{ Left: &mathValue{ Literal: &mathExprLiteral{ @@ -365,7 +365,7 @@ func Test_evaluateMathExpression_error(t *testing.T) { errorMsg: "only addition and subtraction supported", }, { - name: "time ADD int", + name: "time add int", mathExpr: &mathExpression{ Left: &addSubTerm{ Left: &mathValue{ @@ -390,7 +390,7 @@ func Test_evaluateMathExpression_error(t *testing.T) { }, Right: []*opAddSubTerm{ { - Operator: ADD, + Operator: add, Term: &addSubTerm{ Left: &mathValue{ Literal: &mathExprLiteral{ @@ -404,7 +404,7 @@ func Test_evaluateMathExpression_error(t *testing.T) { errorMsg: "time.Time must be added to time.Duration", }, { - name: "dur SUB int", + name: "dur sub int", mathExpr: &mathExpression{ Left: &addSubTerm{ Left: &mathValue{ @@ -424,7 +424,7 @@ func Test_evaluateMathExpression_error(t *testing.T) { }, Right: []*opAddSubTerm{ { - Operator: SUB, + Operator: sub, Term: &addSubTerm{ Left: &mathValue{ Literal: &mathExprLiteral{ @@ -438,7 +438,7 @@ func Test_evaluateMathExpression_error(t *testing.T) { errorMsg: "time.Duration must be subtracted from time.Duration", }, { - name: "time ADD time", + name: "time add time", mathExpr: &mathExpression{ Left: &addSubTerm{ Left: &mathValue{ @@ -463,7 +463,7 @@ func Test_evaluateMathExpression_error(t *testing.T) { }, Right: []*opAddSubTerm{ { - Operator: ADD, + Operator: add, Term: &addSubTerm{ Left: &mathValue{ Literal: &mathExprLiteral{ @@ -491,7 +491,7 @@ func Test_evaluateMathExpression_error(t *testing.T) { errorMsg: "time.Time must be added to time.Duration", }, { - name: "dur SUB time", + name: "dur sub time", mathExpr: &mathExpression{ Left: &addSubTerm{ Left: &mathValue{ @@ -511,7 +511,7 @@ func Test_evaluateMathExpression_error(t *testing.T) { }, Right: []*opAddSubTerm{ { - Operator: SUB, + Operator: sub, Term: &addSubTerm{ Left: &mathValue{ Literal: &mathExprLiteral{ @@ -556,7 +556,7 @@ func Test_evaluateMathExpression_error(t *testing.T) { p, _ := NewParser[any]( functions, - mathParsePath, + mathParsePath[any], componenttest.NewNopTelemetrySettings(), WithEnumParser[any](testParseEnum), ) @@ -606,7 +606,7 @@ func Test_evaluateMathExpressionTimeDuration(t *testing.T) { p, _ := NewParser( functions, - mathParsePath, + mathParsePath[any], componenttest.NewNopTelemetrySettings(), WithEnumParser[any](testParseEnum), ) @@ -629,7 +629,7 @@ func Test_evaluateMathExpressionTimeDuration(t *testing.T) { expected any }{ { - name: "time SUB time, no difference", + name: "time sub time, no difference", mathExpr: &mathExpression{ Left: &addSubTerm{ Left: &mathValue{ @@ -654,7 +654,7 @@ func Test_evaluateMathExpressionTimeDuration(t *testing.T) { }, Right: []*opAddSubTerm{ { - Operator: SUB, + Operator: sub, Term: &addSubTerm{ Left: &mathValue{ Literal: &mathExprLiteral{ @@ -682,7 +682,7 @@ func Test_evaluateMathExpressionTimeDuration(t *testing.T) { expected: zeroSecs, }, { - name: "time SUB time", + name: "time sub time", mathExpr: &mathExpression{ Left: &addSubTerm{ Left: &mathValue{ @@ -707,7 +707,7 @@ func Test_evaluateMathExpressionTimeDuration(t *testing.T) { }, Right: []*opAddSubTerm{ { - Operator: SUB, + Operator: sub, Term: &addSubTerm{ Left: &mathValue{ Literal: &mathExprLiteral{ @@ -735,7 +735,7 @@ func Test_evaluateMathExpressionTimeDuration(t *testing.T) { expected: -fourtySevenHourseFourtyTwoMinutesTwentySevenSecs, }, { - name: "dur ADD time", + name: "dur add time", mathExpr: &mathExpression{ Left: &addSubTerm{ Left: &mathValue{ @@ -755,7 +755,7 @@ func Test_evaluateMathExpressionTimeDuration(t *testing.T) { }, Right: []*opAddSubTerm{ { - Operator: ADD, + Operator: add, Term: &addSubTerm{ Left: &mathValue{ Literal: &mathExprLiteral{ @@ -783,7 +783,7 @@ func Test_evaluateMathExpressionTimeDuration(t *testing.T) { expected: time.Date(2000, 1, 1, 10, 0, 0, 0, time.Local), }, { - name: "time ADD dur", + name: "time add dur", mathExpr: &mathExpression{ Left: &addSubTerm{ Left: &mathValue{ @@ -808,7 +808,7 @@ func Test_evaluateMathExpressionTimeDuration(t *testing.T) { }, Right: []*opAddSubTerm{ { - Operator: ADD, + Operator: add, Term: &addSubTerm{ Left: &mathValue{ Literal: &mathExprLiteral{ @@ -831,7 +831,7 @@ func Test_evaluateMathExpressionTimeDuration(t *testing.T) { expected: time.Date(2023, 2, 15, 10, 0, 0, 0, time.Local), }, { - name: "time ADD dur, complex dur", + name: "time add dur, complex dur", mathExpr: &mathExpression{ Left: &addSubTerm{ Left: &mathValue{ @@ -856,7 +856,7 @@ func Test_evaluateMathExpressionTimeDuration(t *testing.T) { }, Right: []*opAddSubTerm{ { - Operator: ADD, + Operator: add, Term: &addSubTerm{ Left: &mathValue{ Literal: &mathExprLiteral{ @@ -879,7 +879,7 @@ func Test_evaluateMathExpressionTimeDuration(t *testing.T) { expected: time.Date(2023, 2, 4, 1, 2, 3, 0, time.Local), }, { - name: "time SUB dur, complex dur", + name: "time sub dur, complex dur", mathExpr: &mathExpression{ Left: &addSubTerm{ Left: &mathValue{ @@ -904,7 +904,7 @@ func Test_evaluateMathExpressionTimeDuration(t *testing.T) { }, Right: []*opAddSubTerm{ { - Operator: SUB, + Operator: sub, Term: &addSubTerm{ Left: &mathValue{ Literal: &mathExprLiteral{ @@ -927,7 +927,7 @@ func Test_evaluateMathExpressionTimeDuration(t *testing.T) { expected: time.Date(2023, 3, 14, 6, 0, 1, 0, time.Local), }, { - name: "time SUB dur, nanosecs", + name: "time sub dur, nanosecs", mathExpr: &mathExpression{ Left: &addSubTerm{ Left: &mathValue{ @@ -952,7 +952,7 @@ func Test_evaluateMathExpressionTimeDuration(t *testing.T) { }, Right: []*opAddSubTerm{ { - Operator: SUB, + Operator: sub, Term: &addSubTerm{ Left: &mathValue{ Literal: &mathExprLiteral{ @@ -975,7 +975,7 @@ func Test_evaluateMathExpressionTimeDuration(t *testing.T) { expected: time.Date(2023, 4, 30, 23, 59, 59, 999999900, time.Local), }, { - name: "dur ADD dur, complex durs", + name: "dur add dur, complex durs", mathExpr: &mathExpression{ Left: &addSubTerm{ Left: &mathValue{ @@ -995,7 +995,7 @@ func Test_evaluateMathExpressionTimeDuration(t *testing.T) { }, Right: []*opAddSubTerm{ { - Operator: ADD, + Operator: add, Term: &addSubTerm{ Left: &mathValue{ Literal: &mathExprLiteral{ @@ -1018,7 +1018,7 @@ func Test_evaluateMathExpressionTimeDuration(t *testing.T) { expected: oneHundredOne, }, { - name: "dur ADD dur, zero dur", + name: "dur add dur, zero dur", mathExpr: &mathExpression{ Left: &addSubTerm{ Left: &mathValue{ @@ -1038,7 +1038,7 @@ func Test_evaluateMathExpressionTimeDuration(t *testing.T) { }, Right: []*opAddSubTerm{ { - Operator: ADD, + Operator: add, Term: &addSubTerm{ Left: &mathValue{ Literal: &mathExprLiteral{ @@ -1061,7 +1061,7 @@ func Test_evaluateMathExpressionTimeDuration(t *testing.T) { expected: oneThousandHours, }, { - name: "dur SUB dur, zero dur", + name: "dur sub dur, zero dur", mathExpr: &mathExpression{ Left: &addSubTerm{ Left: &mathValue{ @@ -1081,7 +1081,7 @@ func Test_evaluateMathExpressionTimeDuration(t *testing.T) { }, Right: []*opAddSubTerm{ { - Operator: SUB, + Operator: sub, Term: &addSubTerm{ Left: &mathValue{ Literal: &mathExprLiteral{ @@ -1104,7 +1104,7 @@ func Test_evaluateMathExpressionTimeDuration(t *testing.T) { expected: -threeTwentyEightMins, }, { - name: "dur SUB dur, complex durs", + name: "dur sub dur, complex durs", mathExpr: &mathExpression{ Left: &addSubTerm{ Left: &mathValue{ @@ -1124,7 +1124,7 @@ func Test_evaluateMathExpressionTimeDuration(t *testing.T) { }, Right: []*opAddSubTerm{ { - Operator: SUB, + Operator: sub, Term: &addSubTerm{ Left: &mathValue{ Literal: &mathExprLiteral{ diff --git a/pkg/ottl/parser_test.go b/pkg/ottl/parser_test.go index c818203d0671..fa09f3253077 100644 --- a/pkg/ottl/parser_test.go +++ b/pkg/ottl/parser_test.go @@ -105,8 +105,8 @@ func Test_parse(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "bear", }, @@ -138,14 +138,14 @@ func Test_parse(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "foo", }, { Name: "attributes", - Keys: []Key{ + Keys: []key{ { String: ottltest.Strp("bar"), }, @@ -179,11 +179,11 @@ func Test_parse(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "attributes", - Keys: []Key{ + Keys: []key{ { String: ottltest.Strp("message"), }, @@ -202,11 +202,11 @@ func Test_parse(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "attributes", - Keys: []Key{ + Keys: []key{ { String: ottltest.Strp("device_name"), }, @@ -219,7 +219,7 @@ func Test_parse(t *testing.T) { }, { Value: value{ - Enum: (*EnumSymbol)(ottltest.Strp("SHA256")), + Enum: (*enumSymbol)(ottltest.Strp("SHA256")), }, }, }, @@ -237,11 +237,11 @@ func Test_parse(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "attributes", - Keys: []Key{ + Keys: []key{ { String: ottltest.Strp("message"), }, @@ -272,11 +272,11 @@ func Test_parse(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "attributes", - Keys: []Key{ + Keys: []key{ { String: ottltest.Strp("message"), }, @@ -289,7 +289,7 @@ func Test_parse(t *testing.T) { }, { Value: value{ - Enum: (*EnumSymbol)(ottltest.Strp("S")), + Enum: (*enumSymbol)(ottltest.Strp("S")), }, }, }, @@ -307,14 +307,14 @@ func Test_parse(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "foo", }, { Name: "bar", - Keys: []Key{ + Keys: []key{ { String: ottltest.Strp("x"), }, @@ -336,7 +336,7 @@ func Test_parse(t *testing.T) { Literal: &mathExprLiteral{ Converter: &converter{ Function: "Test", - Keys: []Key{ + Keys: []key{ { Int: ottltest.Intp(0), }, @@ -363,14 +363,14 @@ func Test_parse(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "foo", }, { Name: "attributes", - Keys: []Key{ + Keys: []key{ { String: ottltest.Strp("bar"), }, @@ -397,8 +397,8 @@ func Test_parse(t *testing.T) { Comparison: &comparison{ Left: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -406,7 +406,7 @@ func Test_parse(t *testing.T) { }, }, }, - Op: EQ, + Op: eq, Right: value{ String: ottltest.Strp("fido"), }, @@ -426,14 +426,14 @@ func Test_parse(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "foo", }, { Name: "attributes", - Keys: []Key{ + Keys: []key{ { String: ottltest.Strp("bar"), }, @@ -460,8 +460,8 @@ func Test_parse(t *testing.T) { Comparison: &comparison{ Left: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -469,7 +469,7 @@ func Test_parse(t *testing.T) { }, }, }, - Op: NE, + Op: ne, Right: value{ String: ottltest.Strp("fido"), }, @@ -489,14 +489,14 @@ func Test_parse(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "foo", }, { Name: "attributes", - Keys: []Key{ + Keys: []key{ { String: ottltest.Strp("bar"), }, @@ -523,8 +523,8 @@ func Test_parse(t *testing.T) { Comparison: &comparison{ Left: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -532,7 +532,7 @@ func Test_parse(t *testing.T) { }, }, }, - Op: EQ, + Op: eq, Right: value{ String: ottltest.Strp("fido"), }, @@ -613,11 +613,11 @@ func Test_parse(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "attributes", - Keys: []Key{ + Keys: []key{ { String: ottltest.Strp("bytes"), }, @@ -648,11 +648,11 @@ func Test_parse(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "attributes", - Keys: []Key{ + Keys: []key{ { String: ottltest.Strp("test"), }, @@ -683,11 +683,11 @@ func Test_parse(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "attributes", - Keys: []Key{ + Keys: []key{ { String: ottltest.Strp("test"), }, @@ -700,7 +700,7 @@ func Test_parse(t *testing.T) { }, { Value: value{ - Enum: (*EnumSymbol)(ottltest.Strp("TEST_ENUM")), + Enum: (*enumSymbol)(ottltest.Strp("TEST_ENUM")), }, }, }, @@ -718,11 +718,11 @@ func Test_parse(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "attributes", - Keys: []Key{ + Keys: []key{ { String: ottltest.Strp("test"), }, @@ -755,11 +755,11 @@ func Test_parse(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "attributes", - Keys: []Key{ + Keys: []key{ { String: ottltest.Strp("test"), }, @@ -796,11 +796,11 @@ func Test_parse(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "attributes", - Keys: []Key{ + Keys: []key{ { String: ottltest.Strp("test"), }, @@ -840,11 +840,11 @@ func Test_parse(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "attributes", - Keys: []Key{ + Keys: []key{ { String: ottltest.Strp("test"), }, @@ -911,11 +911,11 @@ func Test_parse(t *testing.T) { }, { Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "attributes", - Keys: []Key{ + Keys: []key{ { String: ottltest.Strp("test"), }, @@ -944,11 +944,11 @@ func Test_parse(t *testing.T) { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "attributes", - Keys: []Key{ + Keys: []key{ { String: ottltest.Strp("test"), }, @@ -971,7 +971,7 @@ func Test_parse(t *testing.T) { }, Right: []*opAddSubTerm{ { - Operator: SUB, + Operator: sub, Term: &addSubTerm{ Left: &mathValue{ Literal: &mathExprLiteral{ @@ -1001,7 +1001,7 @@ func Test_parse(t *testing.T) { }, Right: []*opAddSubTerm{ { - Operator: ADD, + Operator: add, Term: &addSubTerm{ Left: &mathValue{ Literal: &mathExprLiteral{ @@ -1010,7 +1010,7 @@ func Test_parse(t *testing.T) { }, Right: []*opMultDivValue{ { - Operator: MULT, + Operator: mult, Value: &mathValue{ Literal: &mathExprLiteral{ Int: ottltest.Intp(2), @@ -1023,14 +1023,14 @@ func Test_parse(t *testing.T) { }, }, }, - Op: EQ, + Op: eq, Right: value{ MathExpression: &mathExpression{ Left: &addSubTerm{ Left: &mathValue{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "three", }, @@ -1040,7 +1040,7 @@ func Test_parse(t *testing.T) { }, Right: []*opMultDivValue{ { - Operator: DIV, + Operator: div, Value: &mathValue{ Literal: &mathExprLiteral{ Converter: &converter{ @@ -1103,8 +1103,8 @@ func Test_parseCondition_full(t *testing.T) { Comparison: &comparison{ Left: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -1112,7 +1112,7 @@ func Test_parseCondition_full(t *testing.T) { }, }, }, - Op: EQ, + Op: eq, Right: value{ String: ottltest.Strp("fido"), }, @@ -1130,8 +1130,8 @@ func Test_parseCondition_full(t *testing.T) { Comparison: &comparison{ Left: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -1139,7 +1139,7 @@ func Test_parseCondition_full(t *testing.T) { }, }, }, - Op: NE, + Op: ne, Right: value{ String: ottltest.Strp("fido"), }, @@ -1166,7 +1166,7 @@ func Test_parseCondition_full(t *testing.T) { }, Right: []*opAddSubTerm{ { - Operator: ADD, + Operator: add, Term: &addSubTerm{ Left: &mathValue{ Literal: &mathExprLiteral{ @@ -1175,7 +1175,7 @@ func Test_parseCondition_full(t *testing.T) { }, Right: []*opMultDivValue{ { - Operator: MULT, + Operator: mult, Value: &mathValue{ Literal: &mathExprLiteral{ Int: ottltest.Intp(2), @@ -1188,14 +1188,14 @@ func Test_parseCondition_full(t *testing.T) { }, }, }, - Op: EQ, + Op: eq, Right: value{ MathExpression: &mathExpression{ Left: &addSubTerm{ Left: &mathValue{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "three", }, @@ -1205,7 +1205,7 @@ func Test_parseCondition_full(t *testing.T) { }, Right: []*opMultDivValue{ { - Operator: DIV, + Operator: div, Value: &mathValue{ Literal: &mathExprLiteral{ Converter: &converter{ @@ -1234,8 +1234,8 @@ func Test_parseCondition_full(t *testing.T) { } } -func testParsePath(val *Path) (GetSetter[any], error) { - if val != nil && len(val.Fields) > 0 && (val.Fields[0].Name == "name" || val.Fields[0].Name == "attributes") { +func testParsePath[K any](p Path[K]) (GetSetter[any], error) { + if p != nil && (p.Name() == "name" || p.Name() == "attributes") { return &StandardGetSetter[any]{ Getter: func(ctx context.Context, tCtx any) (any, error) { return tCtx, nil @@ -1246,14 +1246,14 @@ func testParsePath(val *Path) (GetSetter[any], error) { }, }, nil } - if val.Fields[0].Name == "dur1" || val.Fields[0].Name == "dur2" { + if p != nil && (p.Name() == "dur1" || p.Name() == "dur2") { return &StandardGetSetter[any]{ Getter: func(ctx context.Context, tCtx any) (any, error) { m, ok := tCtx.(map[string]time.Duration) if !ok { return nil, fmt.Errorf("unable to convert transform context to map of strings to times") } - return m[val.Fields[0].Name], nil + return m[p.Name()], nil }, Setter: func(ctx context.Context, tCtx any, val any) error { reflect.DeepEqual(tCtx, val) @@ -1261,14 +1261,14 @@ func testParsePath(val *Path) (GetSetter[any], error) { }, }, nil } - if val.Fields[0].Name == "time1" || val.Fields[0].Name == "time2" { + if p != nil && (p.Name() == "time1" || p.Name() == "time2") { return &StandardGetSetter[any]{ Getter: func(ctx context.Context, tCtx any) (any, error) { m, ok := tCtx.(map[string]time.Time) if !ok { return nil, fmt.Errorf("unable to convert transform context to map of strings to times") } - return m[val.Fields[0].Name], nil + return m[p.Name()], nil }, Setter: func(ctx context.Context, tCtx any, val any) error { reflect.DeepEqual(tCtx, val) @@ -1276,7 +1276,7 @@ func testParsePath(val *Path) (GetSetter[any], error) { }, }, nil } - return nil, fmt.Errorf("bad path %v", val) + return nil, fmt.Errorf("bad path %v", p) } // Helper for test cases where the WHERE clause is all that matters. @@ -1289,8 +1289,8 @@ func setNameTest(b *booleanExpression) *parsedStatement { { Value: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -1525,8 +1525,8 @@ func Test_parseWhere(t *testing.T) { Comparison: &comparison{ Left: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -1534,7 +1534,7 @@ func Test_parseWhere(t *testing.T) { }, }, }, - Op: NE, + Op: ne, Right: value{ String: ottltest.Strp("foo"), }, @@ -1547,8 +1547,8 @@ func Test_parseWhere(t *testing.T) { Comparison: &comparison{ Left: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -1556,7 +1556,7 @@ func Test_parseWhere(t *testing.T) { }, }, }, - Op: NE, + Op: ne, Right: value{ String: ottltest.Strp("bar"), }, @@ -1575,8 +1575,8 @@ func Test_parseWhere(t *testing.T) { Comparison: &comparison{ Left: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -1584,7 +1584,7 @@ func Test_parseWhere(t *testing.T) { }, }, }, - Op: EQ, + Op: eq, Right: value{ String: ottltest.Strp("foo"), }, @@ -1599,8 +1599,8 @@ func Test_parseWhere(t *testing.T) { Comparison: &comparison{ Left: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -1608,7 +1608,7 @@ func Test_parseWhere(t *testing.T) { }, }, }, - Op: EQ, + Op: eq, Right: value{ String: ottltest.Strp("bar"), }, @@ -1651,8 +1651,8 @@ func Test_parseWhere(t *testing.T) { Comparison: &comparison{ Left: value{ Literal: &mathExprLiteral{ - Path: &Path{ - Fields: []Field{ + Path: &path{ + Fields: []field{ { Name: "name", }, @@ -1660,7 +1660,7 @@ func Test_parseWhere(t *testing.T) { }, }, }, - Op: EQ, + Op: eq, Right: value{ String: ottltest.Strp("bar"), }, @@ -1780,7 +1780,7 @@ func Test_ParseStatements_Error(t *testing.T) { p, _ := NewParser( CreateFactoryMap[any](), - testParsePath, + testParsePath[any], componenttest.NewNopTelemetrySettings(), WithEnumParser[any](testParseEnum), ) @@ -1810,7 +1810,7 @@ func Test_ParseConditions_Error(t *testing.T) { p, _ := NewParser( CreateFactoryMap[any](), - testParsePath, + testParsePath[any], componenttest.NewNopTelemetrySettings(), WithEnumParser[any](testParseEnum), ) diff --git a/pkg/stanza/docs/operators/regex_parser.md b/pkg/stanza/docs/operators/regex_parser.md index 01eef7e59dec..9b29401209ff 100644 --- a/pkg/stanza/docs/operators/regex_parser.md +++ b/pkg/stanza/docs/operators/regex_parser.md @@ -4,7 +4,7 @@ The `regex_parser` operator parses the string-type field selected by `parse_from #### Regex Syntax -This operator makes use of [Go regular expression](https://github.com/google/re2/wiki/Syntax). When writing a regex, consider using a tool such as (regex101)[https://regex101.com/?flavor=golang]. +This operator makes use of [Go regular expression](https://github.com/google/re2/wiki/Syntax). When writing a regex, consider using a tool such as [regex101](https://regex101.com/?flavor=golang). ### Configuration Fields diff --git a/pkg/stanza/operator/input/namedpipe/config.go b/pkg/stanza/operator/input/namedpipe/config.go new file mode 100644 index 000000000000..64768b64f1c9 --- /dev/null +++ b/pkg/stanza/operator/input/namedpipe/config.go @@ -0,0 +1,41 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package namedpipe // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/input/namedpipe" + +import ( + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/split" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/trim" +) + +const ( + operatorType = "namedpipe" + DefaultMaxLogSize = 1024 * 1024 +) + +func NewConfig() *Config { + return NewConfigWithID(operatorType) +} + +// NewConfig creates a new stdin input config with default values +func NewConfigWithID(operatorID string) *Config { + return &Config{ + InputConfig: helper.NewInputConfig(operatorID, operatorType), + } +} + +// Config is the configuration of a stdin input operator. +type Config struct { + helper.InputConfig `mapstructure:",squash"` + BaseConfig `mapstructure:",squash"` +} + +type BaseConfig struct { + Path string `mapstructure:"path"` + Permissions uint32 `mapstructure:"mode"` + Encoding string `mapstructure:"encoding"` + SplitConfig split.Config `mapstructure:"multiline,omitempty"` + TrimConfig trim.Config `mapstructure:",squash"` + MaxLogSize int `mapstructure:"max_log_size"` +} diff --git a/pkg/stanza/operator/input/namedpipe/namedpipe.go b/pkg/stanza/operator/input/namedpipe/namedpipe.go index 55f479720077..a4954a9cfb1c 100644 --- a/pkg/stanza/operator/input/namedpipe/namedpipe.go +++ b/pkg/stanza/operator/input/namedpipe/namedpipe.go @@ -19,45 +19,13 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/decode" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/split" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/trim" ) -const ( - operatorType = "namedpipe" - DefaultMaxLogSize = 1024 * 1024 -) - func init() { operator.Register(operatorType, func() operator.Builder { return NewConfig() }) } -func NewConfig() *Config { - return NewConfigWithID(operatorType) -} - -// NewConfig creates a new stdin input config with default values -func NewConfigWithID(operatorID string) *Config { - return &Config{ - InputConfig: helper.NewInputConfig(operatorID, operatorType), - } -} - -// Config is the configuration of a stdin input operator. -type Config struct { - helper.InputConfig `mapstructure:",squash"` - BaseConfig `mapstructure:",squash"` -} - -type BaseConfig struct { - Path string `mapstructure:"path"` - Permissions uint32 `mapstructure:"mode"` - Encoding string `mapstructure:"encoding"` - SplitConfig split.Config `mapstructure:"multiline,omitempty"` - TrimConfig trim.Config `mapstructure:",squash"` - MaxLogSize int `mapstructure:"max_log_size"` -} - // Build will build a namedpipe input operator. func (c *Config) Build(logger *zap.SugaredLogger) (operator.Operator, error) { inputOperator, err := c.InputConfig.Build(logger) diff --git a/pkg/stanza/operator/input/namedpipe/namedpipe_nonlinux.go b/pkg/stanza/operator/input/namedpipe/namedpipe_nonlinux.go new file mode 100644 index 000000000000..a99bb1eaec41 --- /dev/null +++ b/pkg/stanza/operator/input/namedpipe/namedpipe_nonlinux.go @@ -0,0 +1,18 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +//go:build !linux +// +build !linux + +package namedpipe // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/input/namedpipe" + +import ( + "errors" + + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator" + "go.uber.org/zap" +) + +func (c *Config) Build(logger *zap.SugaredLogger) (operator.Operator, error) { + return nil, errors.New("namedpipe input operator is only supported on linux") +} diff --git a/pkg/stanza/pipeline/config.go b/pkg/stanza/pipeline/config.go index c1bd38fee07c..7165b60011d3 100644 --- a/pkg/stanza/pipeline/config.go +++ b/pkg/stanza/pipeline/config.go @@ -5,10 +5,8 @@ package pipeline // import "github.com/open-telemetry/opentelemetry-collector-co import ( "fmt" - "time" "go.uber.org/zap" - "go.uber.org/zap/zapcore" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/errors" "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator" @@ -33,17 +31,11 @@ func (c Config) Build(logger *zap.SugaredLogger) (*DirectedPipeline, error) { return nil, errors.NewError("empty pipeline not allowed", "") } - sampledLogger := logger.Desugar().WithOptions( - zap.WrapCore(func(core zapcore.Core) zapcore.Core { - return zapcore.NewSamplerWithOptions(core, time.Second, 1, 10000) - }), - ).Sugar() - dedeplucateIDs(c.Operators) ops := make([]operator.Operator, 0, len(c.Operators)) for _, opCfg := range c.Operators { - op, err := opCfg.Build(sampledLogger) + op, err := opCfg.Build(logger) if err != nil { return nil, err } diff --git a/pkg/translator/azure/go.mod b/pkg/translator/azure/go.mod index 1c6a6facdc1d..d67c2d002cb6 100644 --- a/pkg/translator/azure/go.mod +++ b/pkg/translator/azure/go.mod @@ -11,7 +11,7 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/semconv v0.91.0 go.uber.org/zap v1.26.0 - golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb + golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 ) require ( diff --git a/pkg/translator/azure/go.sum b/pkg/translator/azure/go.sum index fc20296221e8..12979b6a1d2f 100644 --- a/pkg/translator/azure/go.sum +++ b/pkg/translator/azure/go.sum @@ -75,8 +75,8 @@ 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/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= diff --git a/pkg/translator/azure/resourcelogs_to_logs.go b/pkg/translator/azure/resourcelogs_to_logs.go index 0b243d812a64..42a8c1f60655 100644 --- a/pkg/translator/azure/resourcelogs_to_logs.go +++ b/pkg/translator/azure/resourcelogs_to_logs.go @@ -6,6 +6,7 @@ package azure // import "github.com/open-telemetry/opentelemetry-collector-contr import ( "bytes" "encoding/json" + "errors" "strconv" jsoniter "github.com/json-iterator/go" @@ -36,6 +37,10 @@ const ( azureTenantID = "azure.tenant.id" ) +var ( + errMissingTimestamp = errors.New("missing timestamp") +) + // azureRecords represents an array of Azure log records // as exported via an Azure Event Hub type azureRecords struct { @@ -47,6 +52,7 @@ type azureRecords struct { // https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/resource-logs-schema type azureLogRecord struct { Time string `json:"time"` + Timestamp string `json:"timeStamp"` ResourceID string `json:"resourceId"` TenantID *string `json:"tenantId"` OperationName string `json:"operationName"` @@ -101,7 +107,7 @@ func (r ResourceLogsUnmarshaler) UnmarshalLogs(buf []byte) (plog.Logs, error) { for i := 0; i < len(logs); i++ { log := logs[i] - nanos, err := asTimestamp(log.Time) + nanos, err := getTimestamp(log) if err != nil { r.Logger.Warn("Unable to convert timestamp from log", zap.String("timestamp", log.Time)) continue @@ -125,6 +131,16 @@ func (r ResourceLogsUnmarshaler) UnmarshalLogs(buf []byte) (plog.Logs, error) { return l, nil } +func getTimestamp(record azureLogRecord) (pcommon.Timestamp, error) { + if record.Time != "" { + return asTimestamp(record.Time) + } else if record.Timestamp != "" { + return asTimestamp(record.Timestamp) + } + + return 0, errMissingTimestamp +} + // asTimestamp will parse an ISO8601 string into an OpenTelemetry // nanosecond timestamp. If the string cannot be parsed, it will // return zero and the error. @@ -133,6 +149,7 @@ func asTimestamp(s string) (pcommon.Timestamp, error) { if err != nil { return 0, err } + return pcommon.Timestamp(t.UnixNano()), nil } diff --git a/pkg/translator/azure/resourcelogs_to_logs_test.go b/pkg/translator/azure/resourcelogs_to_logs_test.go index 34535766b5a5..37bb67df9987 100644 --- a/pkg/translator/azure/resourcelogs_to_logs_test.go +++ b/pkg/translator/azure/resourcelogs_to_logs_test.go @@ -167,6 +167,49 @@ var badLevelLogRecord = func() plog.LogRecord { return lr }() +var badTimeLogRecord = func() plog.LogRecord { + lr := plog.NewLogs().ResourceLogs().AppendEmpty().ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + + ts, _ := asTimestamp("2021-10-14T22:17:11+00:00") + lr.SetTimestamp(ts) + + lr.Attributes().PutStr(azureOperationName, "ApplicationGatewayAccess") + lr.Attributes().PutStr(azureCategory, "ApplicationGatewayAccessLog") + lr.Attributes().PutStr(conventions.AttributeCloudProvider, conventions.AttributeCloudProviderAzure) + + m := lr.Attributes().PutEmptyMap(azureProperties) + m.PutStr("instanceId", "appgw_2") + m.PutStr("clientIP", "185.42.129.24") + m.PutDouble("clientPort", 45057) + m.PutStr("httpMethod", "GET") + m.PutStr("originalRequestUriWithArgs", "/") + m.PutStr("requestUri", "/") + m.PutStr("requestQuery", "") + m.PutStr("userAgent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36") + m.PutDouble("httpStatus", 200) + m.PutStr("httpVersion", "HTTP/1.1") + m.PutDouble("receivedBytes", 184) + m.PutDouble("sentBytes", 466) + m.PutDouble("clientResponseTime", 0) + m.PutDouble("timeTaken", 0.034) + m.PutStr("WAFEvaluationTime", "0.000") + m.PutStr("WAFMode", "Detection") + m.PutStr("transactionId", "592d1649f75a8d480a3c4dc6a975309d") + m.PutStr("sslEnabled", "on") + m.PutStr("sslCipher", "ECDHE-RSA-AES256-GCM-SHA384") + m.PutStr("sslProtocol", "TLSv1.2") + m.PutStr("sslClientVerify", "NONE") + m.PutStr("sslClientCertificateFingerprint", "") + m.PutStr("sslClientCertificateIssuerName", "") + m.PutStr("serverRouted", "52.239.221.65:443") + m.PutStr("serverStatus", "200") + m.PutStr("serverResponseLatency", "0.028") + m.PutStr("upstreamSourcePort", "21564") + m.PutStr("originalHost", "20.110.30.194") + m.PutStr("host", "20.110.30.194") + return lr +}() + func TestAsTimestamp(t *testing.T) { timestamp := "2022-11-11T04:48:27.6767145Z" nanos, err := asTimestamp(timestamp) @@ -371,6 +414,15 @@ func TestUnmarshalLogs(t *testing.T) { lr = scopeLogs.LogRecords().AppendEmpty() badLevelLogRecord.CopyTo(lr) + expectedBadTime := plog.NewLogs() + resourceLogs = expectedBadTime.ResourceLogs().AppendEmpty() + resourceLogs.Resource().Attributes().PutStr(azureResourceID, "/RESOURCE_ID") + scopeLogs = resourceLogs.ScopeLogs().AppendEmpty() + scopeLogs.Scope().SetName("otelcol/azureresourcelogs") + scopeLogs.Scope().SetVersion(testBuildInfo.Version) + lr = scopeLogs.LogRecords().AppendEmpty() + badTimeLogRecord.CopyTo(lr) + tests := []struct { file string expected plog.Logs @@ -391,6 +443,10 @@ func TestUnmarshalLogs(t *testing.T) { file: "log-bad-level.json", expected: expectedBadLevel, }, + { + file: "log-bad-time.json", + expected: expectedBadTime, + }, } sut := &ResourceLogsUnmarshaler{ diff --git a/pkg/translator/azure/testdata/log-bad-time.json b/pkg/translator/azure/testdata/log-bad-time.json new file mode 100644 index 000000000000..614d170378ec --- /dev/null +++ b/pkg/translator/azure/testdata/log-bad-time.json @@ -0,0 +1,45 @@ +{ + "records": [ + { + "timeStamp": "2021-10-14T22:17:11+00:00", + "resourceId": "/RESOURCE_ID", + "listenerName": "HTTP-Listener", + "ruleName": "Storage-Static-Rule", + "backendPoolName": "StaticStorageAccount", + "backendSettingName": "StorageStatic-HTTPS-Setting", + "operationName": "ApplicationGatewayAccess", + "category": "ApplicationGatewayAccessLog", + "properties": { + "instanceId": "appgw_2", + "clientIP": "185.42.129.24", + "clientPort": 45057, + "httpMethod": "GET", + "originalRequestUriWithArgs": "\/", + "requestUri": "\/", + "requestQuery": "", + "userAgent": "Mozilla\/5.0 (Windows NT 6.1; WOW64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/52.0.2743.116 Safari\/537.36", + "httpStatus": 200, + "httpVersion": "HTTP\/1.1", + "receivedBytes": 184, + "sentBytes": 466, + "clientResponseTime": 0, + "timeTaken": 0.034, + "WAFEvaluationTime": "0.000", + "WAFMode": "Detection", + "transactionId": "592d1649f75a8d480a3c4dc6a975309d", + "sslEnabled": "on", + "sslCipher": "ECDHE-RSA-AES256-GCM-SHA384", + "sslProtocol": "TLSv1.2", + "sslClientVerify": "NONE", + "sslClientCertificateFingerprint": "", + "sslClientCertificateIssuerName": "", + "serverRouted": "52.239.221.65:443", + "serverStatus": "200", + "serverResponseLatency": "0.028", + "upstreamSourcePort": "21564", + "originalHost": "20.110.30.194", + "host": "20.110.30.194" + } + } + ] +} \ No newline at end of file diff --git a/pkg/translator/skywalking/go.mod b/pkg/translator/skywalking/go.mod index e5bd4e1762b7..9137bf44a68a 100644 --- a/pkg/translator/skywalking/go.mod +++ b/pkg/translator/skywalking/go.mod @@ -7,7 +7,7 @@ require ( github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/semconv v0.91.0 - skywalking.apache.org/repo/goapi v0.0.0-20231026090926-09378dd56587 + skywalking.apache.org/repo/goapi v0.0.0-20231213062226-7849efc09ba3 ) require ( diff --git a/pkg/translator/skywalking/go.sum b/pkg/translator/skywalking/go.sum index 4d599b1f4878..6ddc087e4b31 100644 --- a/pkg/translator/skywalking/go.sum +++ b/pkg/translator/skywalking/go.sum @@ -91,6 +91,7 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk 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.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= 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= @@ -101,6 +102,7 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -115,6 +117,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -127,6 +131,7 @@ 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/sync v0.0.0-20210220032951-036812b2e83c/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.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -139,16 +144,22 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= 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.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= 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= @@ -162,6 +173,7 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= 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= @@ -206,5 +218,5 @@ 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= -skywalking.apache.org/repo/goapi v0.0.0-20231026090926-09378dd56587 h1:TY79I5Y7xRB8q5LQ+MJn7NYsYi0VL5nj1QDrUHwK7cQ= -skywalking.apache.org/repo/goapi v0.0.0-20231026090926-09378dd56587/go.mod h1:onFubXaIoY/2FTRVrLMqCTlaNq4SilAEwF/2G0IcaBw= +skywalking.apache.org/repo/goapi v0.0.0-20231213062226-7849efc09ba3 h1:rqXePgPd1SeNYl4GSHyndwNggpGdOh+9ZMSRCfesgDU= +skywalking.apache.org/repo/goapi v0.0.0-20231213062226-7849efc09ba3/go.mod h1:oD2dxcDAHVIt95Ee7kJHgZ5f64QNhrqTjQYARwfafc4= diff --git a/processor/attributesprocessor/go.mod b/processor/attributesprocessor/go.mod index 0676d7da0a25..bfde3de0078f 100644 --- a/processor/attributesprocessor/go.mod +++ b/processor/attributesprocessor/go.mod @@ -14,6 +14,8 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/processor v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -24,10 +26,10 @@ require ( github.com/expr-lang/expr v1.15.7 // indirect github.com/gobwas/glob v0.2.3 // 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/google/uuid v1.5.0 // 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 github.com/json-iterator/go v1.1.12 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect @@ -45,10 +47,8 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect + golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/processor/attributesprocessor/go.sum b/processor/attributesprocessor/go.sum index 4a99f801c407..60d93604600c 100644 --- a/processor/attributesprocessor/go.sum +++ b/processor/attributesprocessor/go.sum @@ -31,7 +31,6 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69 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= @@ -59,6 +58,8 @@ github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 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/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= @@ -144,8 +145,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= diff --git a/processor/attributesprocessor/internal/metadata/generated_status.go b/processor/attributesprocessor/internal/metadata/generated_status.go index c58df00f609a..7f25676321bb 100644 --- a/processor/attributesprocessor/internal/metadata/generated_status.go +++ b/processor/attributesprocessor/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/attributes") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/attributes") +} diff --git a/processor/cumulativetodeltaprocessor/generated_component_test.go b/processor/cumulativetodeltaprocessor/generated_component_test.go new file mode 100644 index 000000000000..6a7e376c6333 --- /dev/null +++ b/processor/cumulativetodeltaprocessor/generated_component_test.go @@ -0,0 +1,108 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package cumulativetodeltaprocessor + +import ( + "context" + "testing" + + "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/consumer/consumertest" + "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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "metrics", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsProcessor(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(), processortest.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(), processortest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + err = c.Start(context.Background(), host) + require.NoError(t, err) + assert.NotPanics(t, func() { + switch e := c.(type) { + case processor.Logs: + logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + if !e.Capabilities().MutatesData { + logs.MarkReadOnly() + } + err = e.ConsumeLogs(context.Background(), logs) + case processor.Metrics: + metrics := testdata.GenerateMetricsTwoMetrics() + if !e.Capabilities().MutatesData { + metrics.MarkReadOnly() + } + err = e.ConsumeMetrics(context.Background(), metrics) + case processor.Traces: + traces := testdata.GenerateTracesTwoSpansSameResource() + if !e.Capabilities().MutatesData { + traces.MarkReadOnly() + } + err = e.ConsumeTraces(context.Background(), traces) + } + }) + assert.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} diff --git a/processor/cumulativetodeltaprocessor/go.mod b/processor/cumulativetodeltaprocessor/go.mod index 5ce4f56308e7..f3081b71c02d 100644 --- a/processor/cumulativetodeltaprocessor/go.mod +++ b/processor/cumulativetodeltaprocessor/go.mod @@ -3,6 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumul go 1.20 require ( + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.91.0 github.com/stretchr/testify v1.8.4 @@ -11,6 +12,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/processor v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -18,9 +21,9 @@ 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/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/hashicorp/go-version v1.6.0 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect @@ -36,8 +39,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/processor/cumulativetodeltaprocessor/go.sum b/processor/cumulativetodeltaprocessor/go.sum index 924bcfb26e30..47b15c51299f 100644 --- a/processor/cumulativetodeltaprocessor/go.sum +++ b/processor/cumulativetodeltaprocessor/go.sum @@ -23,7 +23,6 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69 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= @@ -49,6 +48,8 @@ github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 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/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= 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= diff --git a/processor/cumulativetodeltaprocessor/internal/metadata/generated_status.go b/processor/cumulativetodeltaprocessor/internal/metadata/generated_status.go index 02f7c11ae467..55f2ef61b3a1 100644 --- a/processor/cumulativetodeltaprocessor/internal/metadata/generated_status.go +++ b/processor/cumulativetodeltaprocessor/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "cumulativetodelta" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/cumulativetodelta") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/cumulativetodelta") +} diff --git a/processor/cumulativetodeltaprocessor/metadata.yaml b/processor/cumulativetodeltaprocessor/metadata.yaml index 271bf37805c7..1df1b1db7906 100644 --- a/processor/cumulativetodeltaprocessor/metadata.yaml +++ b/processor/cumulativetodeltaprocessor/metadata.yaml @@ -7,4 +7,6 @@ status: distributions: [contrib, observiq, sumo, aws] warnings: [Statefulness] codeowners: - active: [TylerHelmuth] \ No newline at end of file + active: [TylerHelmuth] +tests: + config: diff --git a/processor/datadogprocessor/generated_component_test.go b/processor/datadogprocessor/generated_component_test.go new file mode 100644 index 000000000000..98e9c9027e28 --- /dev/null +++ b/processor/datadogprocessor/generated_component_test.go @@ -0,0 +1,111 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package datadogprocessor + +import ( + "context" + "testing" + + "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/consumer/consumertest" + "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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "traces", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateTracesProcessor(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(), processortest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + 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 := newAssertNoErrorHost(t) + err = c.Start(context.Background(), host) + require.NoError(t, err) + assert.NotPanics(t, func() { + switch e := c.(type) { + case processor.Logs: + logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + if !e.Capabilities().MutatesData { + logs.MarkReadOnly() + } + err = e.ConsumeLogs(context.Background(), logs) + case processor.Metrics: + metrics := testdata.GenerateMetricsTwoMetrics() + if !e.Capabilities().MutatesData { + metrics.MarkReadOnly() + } + err = e.ConsumeMetrics(context.Background(), metrics) + case processor.Traces: + traces := testdata.GenerateTracesTwoSpansSameResource() + if !e.Capabilities().MutatesData { + traces.MarkReadOnly() + } + err = e.ConsumeTraces(context.Background(), traces) + } + }) + assert.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} diff --git a/processor/datadogprocessor/go.mod b/processor/datadogprocessor/go.mod index 4030b605d479..3d8f74b6ee56 100644 --- a/processor/datadogprocessor/go.mod +++ b/processor/datadogprocessor/go.mod @@ -4,34 +4,38 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/processor/datad go 1.20 require ( - github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7 - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.9.0 + github.com/DataDog/datadog-agent/pkg/proto v0.50.0 + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.10.0 github.com/DataDog/sketches-go v1.4.3 + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog v0.91.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.91.0 + go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/extension v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/processor v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 google.golang.org/protobuf v1.31.0 ) require ( - github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/trace v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/log v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0-rc.7 // indirect - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0-rc.7 // indirect + github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/trace v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/log v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0 // indirect + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.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-tuf v1.0.2-0.5.2 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.9.0 // indirect - github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.9.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.10.0 // indirect + github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.10.0 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect @@ -66,22 +70,20 @@ 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/secure-systems-lab/go-securesystemslib v0.7.0 // indirect - github.com/shirou/gopsutil/v3 v3.23.10 // indirect + github.com/shirou/gopsutil/v3 v3.23.11 // 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 v0.91.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect - go.opentelemetry.io/collector/confmap v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/semconv v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect + golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect @@ -103,3 +105,11 @@ retract ( v0.76.2 v0.76.1 ) + +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 + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest => ../../pkg/pdatatest diff --git a/processor/datadogprocessor/go.sum b/processor/datadogprocessor/go.sum index 07b88e5baddd..fe22064596f0 100644 --- a/processor/datadogprocessor/go.sum +++ b/processor/datadogprocessor/go.sum @@ -1,32 +1,32 @@ -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0-rc.7 h1:ULN8UQqgtmEgWvOEIDzWgxLZ3TEZJ9MXBUpVGE8PPBc= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0-rc.7/go.mod h1:A4nLJvxlg6BO/8/zg81til9yT0uRPuXDFMAzDMpmgn4= -github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7 h1:qJuxmeIiXZNML5/Y9KEf7QKEKKIeliiTIxgRGvGAQBc= -github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7/go.mod h1:HvK26YCxg6MfYvPJgpHC7nSjw6DTpNhd75Wlb0GAvis= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0-rc.7 h1:pQh4uZnc9mQbGMJ1R8C88GlseqmdFIKftDZLrQW71Ss= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0-rc.7/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= -github.com/DataDog/datadog-agent/pkg/trace v0.50.0-rc.7 h1:qWKAINgUtyuJQOCcthjPST8PzigPP8Pr0EtHdTgJVoA= -github.com/DataDog/datadog-agent/pkg/trace v0.50.0-rc.7/go.mod h1:i6OrrkHDlgCB4vUaPfM4FxVij2QdA/t07Ykwu74ySGA= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0-rc.7 h1:J7ocZItHWrUEvGWVqFa7wsghotcF53oFn1qH7Tlh7VM= -github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0-rc.7/go.mod h1:b0I5L9Eegsq3kca9pQCAVt1rQHI05sza7LVHKGzC+ms= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.0-rc.7 h1:vBo+iVlLpjrvJkX88mbFDtWFy0F6tEi865p+N4RTf7A= -github.com/DataDog/datadog-agent/pkg/util/log v0.50.0-rc.7/go.mod h1:/fGZteE4rr3iz6y30a0A3MuebJ6Jckx+AiKcyYgT87k= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0-rc.7 h1:eM+GcYjk4sSik8tFgf8zNT1KViZZM4F4I580SZnTs7s= -github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0-rc.7/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0-rc.7 h1:QByjh+uLdnYjqIjdYP9XyEgObD9o8ydL4jBy4sEPlbU= -github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0-rc.7/go.mod h1:EOGgNrSPskIxY3+KgCl+yEggMjrGqrA2oL5va+/p2jM= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0 h1:WOyRfsLPYO24Z6Q+s1jcjoOFYJUJ4PgiNaGz/qJCba0= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.50.0/go.mod h1:A4nLJvxlg6BO/8/zg81til9yT0uRPuXDFMAzDMpmgn4= +github.com/DataDog/datadog-agent/pkg/proto v0.50.0 h1:FAzs/Hofs9CN7jYYd2P4l8/igdcDPc7q9amIXSje/3A= +github.com/DataDog/datadog-agent/pkg/proto v0.50.0/go.mod h1:HvK26YCxg6MfYvPJgpHC7nSjw6DTpNhd75Wlb0GAvis= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0 h1:/V/WtjIQCDNJpRVJ/wSfmUakLhBhxJ7joqwM7DXc9hI= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.50.0/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= +github.com/DataDog/datadog-agent/pkg/trace v0.50.0 h1:gZt7YTwtptMNYUN/Z5QHnabOz0ILHvSKC0jpTqqiXBo= +github.com/DataDog/datadog-agent/pkg/trace v0.50.0/go.mod h1:fV11a6fzBAbzgF8ie5Bk51rvLS5kMcsXjwaCzPAfsrk= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0 h1:jSAW27LAnpdZGEe8B0FzSbVT8YdmvPGxV/l8SDUKzYY= +github.com/DataDog/datadog-agent/pkg/util/cgroups v0.50.0/go.mod h1:QO56TX/gJf9yZ8q+ix0EEjck6kJu+oirAvJPk8xpFa0= +github.com/DataDog/datadog-agent/pkg/util/log v0.50.0 h1:qIqqLKov9yjoHuoOK//a49vFiBZyduswcJz7jwgKuuo= +github.com/DataDog/datadog-agent/pkg/util/log v0.50.0/go.mod h1:byH8to7LKxTK5m7jf1n222QMeL55iiVszk+OA7Qxfao= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0 h1:MXYW7B+OamUkSBGVsLkPQt7bjQhO52Q6qym3VluB8IM= +github.com/DataDog/datadog-agent/pkg/util/pointer v0.50.0/go.mod h1:eTXti9mx7qhkoi+Qg3mMmvVY5McghUUgsf4Hrk9zY8k= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0 h1:0QrqgObZkmv2Fcr10CN+pONfIeoul5loof3t20B1AAA= +github.com/DataDog/datadog-agent/pkg/util/scrubber v0.50.0/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/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.9.0 h1:oT5B12H+tLtAEEH0YqgmppofM/yRBzyI9+ykS9OQvIs= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.9.0 h1:Y+CllChr2yfE2RLd+c5hvK56DDGVEdDrhAl1OyzuuwU= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.9.0/go.mod h1:naFq9h+fQpgI7AKJ+YkWlAAYDU8/FB8LyfA39bmRNHs= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.9.0 h1:WsCPJS+a34kw1gj46WpJjQBHrLVwh1ubCdHUx9nf1ec= -github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.9.0/go.mod h1:m61Tq6DA2U+PjNTX6WD3TH2U7QnA49+7IGaYK4bu7fQ= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.9.0 h1:U93rYuk3ChT/I+2r36JI8agi1AwdH8vRiHh+bCSXZeU= -github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.9.0/go.mod h1:KOzWHRj2AcJPmP1hm4WQUfzEIYRBP4NaTX9Iu+D3UNs= +github.com/DataDog/opentelemetry-mapping-go/pkg/internal/sketchtest v0.10.0 h1:O2PYvgTQA+31NuepzQqLexEpUX8FWsdNgq+0241OtH0= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.10.0 h1:56vp8vflG6lmhTO+YldUBTe0cIjStOC1neW1dIHYm5s= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.10.0/go.mod h1:naFq9h+fQpgI7AKJ+YkWlAAYDU8/FB8LyfA39bmRNHs= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.10.0 h1:XwGT7/2NnO1RGxS5WD4BTsLWqO+z8234XBccUGhP8tM= +github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/metrics v0.10.0/go.mod h1:1fYkFs2pUyqBUUVDsjn1cKVEI79R+NluYhqX+pDTkSY= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.10.0 h1:mEao3xEP7iCfCd+teps0oM8U+ZRPVz02W6aE5cfi2Sc= +github.com/DataDog/opentelemetry-mapping-go/pkg/quantile v0.10.0/go.mod h1:vPjlCjTrBzzZpVJbbVpox8x9nRYx5giCl/9Zy8oWFw0= github.com/DataDog/sketches-go v1.4.3 h1:ZB9nijteJRFUQixkQfatCqASartGNfiolIlMiEv3u/w= github.com/DataDog/sketches-go v1.4.3/go.mod h1:XR0ns2RtEEF09mDKXiKZiQg+nfZStrq1ZuL1eezeZe0= github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= @@ -126,8 +126,8 @@ github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c/go.mod h1:Om github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= 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.23.11 h1:i3jP9NjCPUz7FiZKxlMnODZkdSIp2gnzfrvsu9CuWEQ= +github.com/shirou/gopsutil/v3 v3.23.11/go.mod h1:1FrWgea594Jp7qmjHUUPlJDTPgcsb9mGnXDxavtikzM= 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= @@ -158,6 +158,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= 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.91.0 h1:C7sGUJDJ5nwm+CkWpAaVP3lNsuYpwSRbkmLncFjkmO8= +go.opentelemetry.io/collector v0.91.0/go.mod h1:YhQpIDZsn+bICAAqgBwXk9wqK8GKZDv+aogfG52zUuE= go.opentelemetry.io/collector/component v0.91.0 h1:aBT1i2zGyfh9PalYJLfXVvQp+osHyalwyDFselI1CtA= go.opentelemetry.io/collector/component v0.91.0/go.mod h1:2KBHvjNFdU7oOjsObQeC4Ta2Ef607OISU5obznW00fw= go.opentelemetry.io/collector/config/configtelemetry v0.91.0 h1:mEwvqrYfwUJ7LwYfpcF9M8z7LHFoYaKhEPhnERD/88E= @@ -189,7 +191,7 @@ go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+ go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= +go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= 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= @@ -198,8 +200,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk 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.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug= -golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 h1:FqrVOBQxQ8r/UwwXibI0KMolVhvFiGobSfdE33deHJM= +golang.org/x/exp v0.0.0-20230711023510-fffb14384f22/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -230,7 +232,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.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= diff --git a/processor/datadogprocessor/internal/metadata/generated_status.go b/processor/datadogprocessor/internal/metadata/generated_status.go index be67fe78208d..8fa9cfd3f68b 100644 --- a/processor/datadogprocessor/internal/metadata/generated_status.go +++ b/processor/datadogprocessor/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "datadog" TracesStability = component.StabilityLevelDeprecated ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/datadog") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/datadog") +} diff --git a/processor/datadogprocessor/metadata.yaml b/processor/datadogprocessor/metadata.yaml index 80ff82696738..cfe9ee23f4f6 100644 --- a/processor/datadogprocessor/metadata.yaml +++ b/processor/datadogprocessor/metadata.yaml @@ -6,4 +6,7 @@ status: deprecated: [traces] distributions: [contrib] codeowners: - active: [mx-psi, gbbr, dineshg13] \ No newline at end of file + active: [mx-psi, gbbr, dineshg13] +tests: + config: + skip_lifecycle: true diff --git a/processor/deltatorateprocessor/generated_component_test.go b/processor/deltatorateprocessor/generated_component_test.go new file mode 100644 index 000000000000..44043e255536 --- /dev/null +++ b/processor/deltatorateprocessor/generated_component_test.go @@ -0,0 +1,108 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package deltatorateprocessor + +import ( + "context" + "testing" + + "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/consumer/consumertest" + "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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "metrics", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsProcessor(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(), processortest.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(), processortest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + err = c.Start(context.Background(), host) + require.NoError(t, err) + assert.NotPanics(t, func() { + switch e := c.(type) { + case processor.Logs: + logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + if !e.Capabilities().MutatesData { + logs.MarkReadOnly() + } + err = e.ConsumeLogs(context.Background(), logs) + case processor.Metrics: + metrics := testdata.GenerateMetricsTwoMetrics() + if !e.Capabilities().MutatesData { + metrics.MarkReadOnly() + } + err = e.ConsumeMetrics(context.Background(), metrics) + case processor.Traces: + traces := testdata.GenerateTracesTwoSpansSameResource() + if !e.Capabilities().MutatesData { + traces.MarkReadOnly() + } + err = e.ConsumeTraces(context.Background(), traces) + } + }) + assert.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} diff --git a/processor/deltatorateprocessor/go.mod b/processor/deltatorateprocessor/go.mod index b3193a07a0fd..c482580a1d27 100644 --- a/processor/deltatorateprocessor/go.mod +++ b/processor/deltatorateprocessor/go.mod @@ -3,12 +3,15 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/processor/delta go 1.20 require ( + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/processor v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -32,8 +35,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect @@ -49,3 +50,11 @@ 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/internal/metadata/generated_status.go b/processor/deltatorateprocessor/internal/metadata/generated_status.go index 899bb228db56..769ec74571a3 100644 --- a/processor/deltatorateprocessor/internal/metadata/generated_status.go +++ b/processor/deltatorateprocessor/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "deltatorate" MetricsStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/deltatorate") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/deltatorate") +} diff --git a/processor/deltatorateprocessor/metadata.yaml b/processor/deltatorateprocessor/metadata.yaml index 1198892cbc5f..b7d9a632c20c 100644 --- a/processor/deltatorateprocessor/metadata.yaml +++ b/processor/deltatorateprocessor/metadata.yaml @@ -6,4 +6,6 @@ status: development: [metrics] distributions: [contrib, observiq, sumo, aws] codeowners: - active: [Aneurysm9] \ No newline at end of file + active: [Aneurysm9] +tests: + config: diff --git a/processor/filterprocessor/README.md b/processor/filterprocessor/README.md index dd708cdab07f..dae15f0e8d92 100644 --- a/processor/filterprocessor/README.md +++ b/processor/filterprocessor/README.md @@ -3,7 +3,7 @@ | Status | | | ------------- |-----------| | Stability | [alpha]: traces, metrics, logs | -| Distributions | [core], [contrib], [aws], [observiq], [redhat], [splunk], [sumo] | +| Distributions | [core], [contrib], [aws], [liatrio], [observiq], [redhat], [splunk], [sumo] | | Warnings | [Orphaned Telemetry, Other](#warnings) | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aprocessor%2Ffilter%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aprocessor%2Ffilter) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aprocessor%2Ffilter%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aprocessor%2Ffilter) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@TylerHelmuth](https://www.github.com/TylerHelmuth), [@boostchicken](https://www.github.com/boostchicken) | @@ -12,6 +12,7 @@ [core]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib [aws]: https://github.com/aws-observability/aws-otel-collector +[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 [splunk]: https://github.com/signalfx/splunk-otel-collector diff --git a/processor/filterprocessor/factory.go b/processor/filterprocessor/factory.go index bf06c4548fc9..894a190b2c53 100644 --- a/processor/filterprocessor/factory.go +++ b/processor/filterprocessor/factory.go @@ -40,7 +40,7 @@ func createMetricsProcessor( cfg component.Config, nextConsumer consumer.Metrics, ) (processor.Metrics, error) { - fp, err := newFilterMetricProcessor(set.TelemetrySettings, cfg.(*Config)) + fp, err := newFilterMetricProcessor(set, cfg.(*Config)) if err != nil { return nil, err } @@ -59,7 +59,7 @@ func createLogsProcessor( cfg component.Config, nextConsumer consumer.Logs, ) (processor.Logs, error) { - fp, err := newFilterLogsProcessor(set.TelemetrySettings, cfg.(*Config)) + fp, err := newFilterLogsProcessor(set, cfg.(*Config)) if err != nil { return nil, err } @@ -78,7 +78,7 @@ func createTracesProcessor( cfg component.Config, nextConsumer consumer.Traces, ) (processor.Traces, error) { - fp, err := newFilterSpansProcessor(set.TelemetrySettings, cfg.(*Config)) + fp, err := newFilterSpansProcessor(set, cfg.(*Config)) if err != nil { return nil, err } diff --git a/processor/filterprocessor/generated_component_test.go b/processor/filterprocessor/generated_component_test.go new file mode 100644 index 000000000000..da8a1074738e --- /dev/null +++ b/processor/filterprocessor/generated_component_test.go @@ -0,0 +1,122 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package filterprocessor + +import ( + "context" + "testing" + + "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/consumer/consumertest" + "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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "logs", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateLogsProcessor(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "metrics", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsProcessor(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "traces", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateTracesProcessor(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(), processortest.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(), processortest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + err = c.Start(context.Background(), host) + require.NoError(t, err) + assert.NotPanics(t, func() { + switch e := c.(type) { + case processor.Logs: + logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + if !e.Capabilities().MutatesData { + logs.MarkReadOnly() + } + err = e.ConsumeLogs(context.Background(), logs) + case processor.Metrics: + metrics := testdata.GenerateMetricsTwoMetrics() + if !e.Capabilities().MutatesData { + metrics.MarkReadOnly() + } + err = e.ConsumeMetrics(context.Background(), metrics) + case processor.Traces: + traces := testdata.GenerateTracesTwoSpansSameResource() + if !e.Capabilities().MutatesData { + traces.MarkReadOnly() + } + err = e.ConsumeTraces(context.Background(), traces) + } + }) + assert.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} diff --git a/processor/filterprocessor/go.mod b/processor/filterprocessor/go.mod index 4e96e1843c88..67e801196e54 100644 --- a/processor/filterprocessor/go.mod +++ b/processor/filterprocessor/go.mod @@ -3,35 +3,51 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/processor/filte go 1.20 require ( + contrib.go.opencensus.io/exporter/prometheus v0.4.2 github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.91.0 + github.com/prometheus/client_golang v1.17.0 + github.com/prometheus/client_model v0.5.0 + github.com/prometheus/common v0.45.0 github.com/stretchr/testify v1.8.4 + go.opencensus.io v0.24.0 go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/processor v0.91.0 + go.opentelemetry.io/otel v1.21.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/sdk/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) require ( github.com/alecthomas/participle/v2 v2.1.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 github.com/expr-lang/expr v1.15.7 // indirect + github.com/go-kit/log v0.2.1 // indirect + github.com/go-logfmt/logfmt v0.5.1 // indirect + github.com/go-logr/logr v1.3.0 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/gobwas/glob v0.2.3 // 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/google/uuid v1.5.0 // 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 github.com/json-iterator/go v1.1.12 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect github.com/knadh/koanf/v2 v2.0.1 // indirect + github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect @@ -39,21 +55,21 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.91.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - go.opencensus.io v0.24.0 // indirect + github.com/prometheus/procfs v0.11.1 // indirect + github.com/prometheus/statsd_exporter v0.22.7 // indirect go.opentelemetry.io/collector v0.91.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/semconv v0.91.0 // indirect - go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect - golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect + go.opentelemetry.io/otel/sdk v1.21.0 // indirect + golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect google.golang.org/grpc v1.59.0 // indirect google.golang.org/protobuf v1.31.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/processor/filterprocessor/go.sum b/processor/filterprocessor/go.sum index 4a99f801c407..cb105f3f5faa 100644 --- a/processor/filterprocessor/go.sum +++ b/processor/filterprocessor/go.sum @@ -1,14 +1,62 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= contrib.go.opencensus.io/exporter/prometheus v0.4.2 h1:sqfsYl5GIY/L570iT+l93ehxaWJs2/OwXtiWwew3oAg= +contrib.go.opencensus.io/exporter/prometheus v0.4.2/go.mod h1:dvEHbiKmgvbr5pjaF9fpw1KeYcjrnC1J8B+JKjsZyRQ= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= 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/alecthomas/assert/v2 v2.3.0 h1:mAsH2wmvjsuvyBvAmCtm7zFsBlb8mIHx5ySLVdDZXL0= github.com/alecthomas/participle/v2 v2.1.1 h1:hrjKESvSqGHzRb4yW1ciisFJ4p3MGYih6icjJvbsmV8= github.com/alecthomas/participle/v2 v2.1.1/go.mod h1:Y1+hAs8DHPmc3YUFzqllV+eSQ9ljPTk0ZkPMtEdAx2c= github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= +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= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= 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/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= 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= @@ -20,50 +68,112 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/expr-lang/expr v1.15.7 h1:BK0JcWUkoW6nrbLBo6xCKhz4BvH5DSOOu1Gx5lucyZo= github.com/expr-lang/expr v1.15.7/go.mod h1:uCkhfG+x7fcZ5A5sXHKuQ07jGZRl6J0FCAaf2k4PtVQ= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= +github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= 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-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 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/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= 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.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= 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/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 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.4.1/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.1/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.4/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.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= 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 v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +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/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= @@ -72,9 +182,17 @@ github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPgh github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= github.com/knadh/koanf/v2 v2.0.1 h1:1dYGITt1I23x8cfx8ZnldtezdyaZtfAuRtIFOiRzK7g= github.com/knadh/koanf/v2 v2.0.1/go.mod h1:ZeiIlIDXTE7w1lMT6UVcNiRAS2/rCeLn/GdLNvY1Dus= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= 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/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.20220423185008-bf980b35cac4 h1:BpfhmLKZf+SjVanKKhCgf3bg+511DmU9eDQTen7LLbY= @@ -84,28 +202,79 @@ github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx 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 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 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/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +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.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= +github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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= +github.com/prometheus/client_model v0.2.0/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.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +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.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/common v0.35.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= +github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= +github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= +github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= github.com/prometheus/statsd_exporter v0.22.7 h1:7Pji/i2GuhK6Lu7DHrtTkFmNBCudCPT1pX2CziuyQR0= +github.com/prometheus/statsd_exporter v0.22.7/go.mod h1:N/TevpjkIh9ccs6nuzY3jQn9dFqnUakOjnEuMPJJJnI= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/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.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.6.1/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/stvp/go-udp-testing v0.0.0-20201019212854-469649b16807/go.mod h1:7jxmlfBCDBXRzr0eAQJ48XC1hBu1np4CS5+cHEYfwpc= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +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= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= 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.91.0 h1:C7sGUJDJ5nwm+CkWpAaVP3lNsuYpwSRbkmLncFjkmO8= @@ -132,7 +301,9 @@ go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae7 go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= +go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= go.opentelemetry.io/otel/sdk/metric v1.21.0 h1:smhI5oD714d6jHE6Tie36fPx4WDFIg+Y6RfAY4ICcR0= +go.opentelemetry.io/otel/sdk/metric v1.21.0/go.mod h1:FJ8RAsoPGv/wYMgBdUJXOm+6pzFY3YdljnXtv1SBE8Q= go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= @@ -140,67 +311,265 @@ 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-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= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +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= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= 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-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/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-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/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-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 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-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= 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-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/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-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/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-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/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-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/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-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/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-20220708085239-5a0f0661e09d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.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.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +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.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 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-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= 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/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= 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.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= @@ -212,16 +581,37 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi 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.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= 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.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/processor/filterprocessor/internal/metadata/generated_status.go b/processor/filterprocessor/internal/metadata/generated_status.go index 806ad2fabe77..bcaeadcc46d2 100644 --- a/processor/filterprocessor/internal/metadata/generated_status.go +++ b/processor/filterprocessor/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/filter") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/filter") +} diff --git a/processor/filterprocessor/logs.go b/processor/filterprocessor/logs.go index d8d2fb175930..421eea9c8b6e 100644 --- a/processor/filterprocessor/logs.go +++ b/processor/filterprocessor/logs.go @@ -7,8 +7,8 @@ import ( "context" "fmt" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processorhelper" "go.uber.org/multierr" "go.uber.org/zap" @@ -21,18 +21,26 @@ import ( ) type filterLogProcessor struct { - skipExpr expr.BoolExpr[ottllog.TransformContext] - logger *zap.Logger + skipExpr expr.BoolExpr[ottllog.TransformContext] + telemetry *filterProcessorTelemetry + logger *zap.Logger } -func newFilterLogsProcessor(set component.TelemetrySettings, cfg *Config) (*filterLogProcessor, error) { +func newFilterLogsProcessor(set processor.CreateSettings, cfg *Config) (*filterLogProcessor, error) { flp := &filterLogProcessor{ logger: set.Logger, } + + fpt, err := newfilterProcessorTelemetry(set) + if err != nil { + return nil, fmt.Errorf("error creating filter processor telemetry: %w", err) + } + flp.telemetry = fpt + if cfg.Logs.LogConditions != nil { - skipExpr, err := filterottl.NewBoolExprForLog(cfg.Logs.LogConditions, filterottl.StandardLogFuncs(), cfg.ErrorMode, set) - if err != nil { - return nil, err + skipExpr, errBoolExpr := filterottl.NewBoolExprForLog(cfg.Logs.LogConditions, filterottl.StandardLogFuncs(), cfg.ErrorMode, set.TelemetrySettings) + if errBoolExpr != nil { + return nil, errBoolExpr } flp.skipExpr = skipExpr return flp, nil @@ -61,6 +69,8 @@ func (flp *filterLogProcessor) processLogs(ctx context.Context, ld plog.Logs) (p return ld, nil } + logCountBeforeFilters := ld.LogRecordCount() + var errors error ld.ResourceLogs().RemoveIf(func(rl plog.ResourceLogs) bool { resource := rl.Resource() @@ -81,6 +91,9 @@ func (flp *filterLogProcessor) processLogs(ctx context.Context, ld plog.Logs) (p return rl.ScopeLogs().Len() == 0 }) + logCountAfterFilters := ld.LogRecordCount() + flp.telemetry.record(triggerLogsDropped, int64(logCountBeforeFilters-logCountAfterFilters)) + if errors != nil { flp.logger.Error("failed processing logs", zap.Error(errors)) return ld, errors diff --git a/processor/filterprocessor/logs_test.go b/processor/filterprocessor/logs_test.go index d53e2077058a..d20d62817522 100644 --- a/processor/filterprocessor/logs_test.go +++ b/processor/filterprocessor/logs_test.go @@ -10,7 +10,6 @@ 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/pdata/pcommon" "go.opentelemetry.io/collector/pdata/plog" @@ -748,7 +747,7 @@ func TestFilterLogProcessorWithOTTL(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - processor, err := newFilterLogsProcessor(componenttest.NewNopTelemetrySettings(), &Config{Logs: LogFilters{LogConditions: tt.conditions}}) + processor, err := newFilterLogsProcessor(processortest.NewNopCreateSettings(), &Config{Logs: LogFilters{LogConditions: tt.conditions}}) assert.NoError(t, err) got, err := processor.processLogs(context.Background(), constructLogs()) @@ -764,6 +763,22 @@ func TestFilterLogProcessorWithOTTL(t *testing.T) { } } +func TestFilterLogProcessorTelemetry(t *testing.T) { + telemetryTest(t, "FilterLogProcessorTelemetry", func(t *testing.T, tel testTelemetry) { + processor, err := newFilterLogsProcessor(processortest.NewNopCreateSettings(), &Config{ + Logs: LogFilters{LogConditions: []string{`IsMatch(body, "operationA")`}}, + }) + assert.NoError(t, err) + + _, err = processor.processLogs(context.Background(), constructLogs()) + assert.NoError(t, err) + + tel.assertMetrics(t, expectedMetrics{ + logsFiltered: 2, + }) + }) +} + func constructLogs() plog.Logs { td := plog.NewLogs() rs0 := td.ResourceLogs().AppendEmpty() diff --git a/processor/filterprocessor/metadata.yaml b/processor/filterprocessor/metadata.yaml index eb3d801a6383..aab6454e8825 100644 --- a/processor/filterprocessor/metadata.yaml +++ b/processor/filterprocessor/metadata.yaml @@ -4,7 +4,9 @@ status: class: processor stability: alpha: [traces, metrics, logs] - distributions: [core, contrib, splunk, observiq, sumo, aws, redhat] + distributions: [core, contrib, splunk, observiq, sumo, aws, redhat, liatrio] warnings: [Orphaned Telemetry, Other] codeowners: - active: [TylerHelmuth, boostchicken] \ No newline at end of file + active: [TylerHelmuth, boostchicken] +tests: + config: diff --git a/processor/filterprocessor/metrics.go b/processor/filterprocessor/metrics.go index 31fae0dfad5b..10551d3dd117 100644 --- a/processor/filterprocessor/metrics.go +++ b/processor/filterprocessor/metrics.go @@ -5,10 +5,11 @@ package filterprocessor // import "github.com/open-telemetry/opentelemetry-colle import ( "context" + "fmt" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/pmetric" + "go.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processorhelper" "go.uber.org/multierr" "go.uber.org/zap" @@ -28,24 +29,32 @@ type filterMetricProcessor struct { skipResourceExpr expr.BoolExpr[ottlresource.TransformContext] skipMetricExpr expr.BoolExpr[ottlmetric.TransformContext] skipDataPointExpr expr.BoolExpr[ottldatapoint.TransformContext] + telemetry *filterProcessorTelemetry logger *zap.Logger } -func newFilterMetricProcessor(set component.TelemetrySettings, cfg *Config) (*filterMetricProcessor, error) { +func newFilterMetricProcessor(set processor.CreateSettings, cfg *Config) (*filterMetricProcessor, error) { var err error fsp := &filterMetricProcessor{ logger: set.Logger, } + + fpt, err := newfilterProcessorTelemetry(set) + if err != nil { + return nil, fmt.Errorf("error creating filter processor telemetry: %w", err) + } + fsp.telemetry = fpt + if cfg.Metrics.MetricConditions != nil || cfg.Metrics.DataPointConditions != nil { if cfg.Metrics.MetricConditions != nil { - fsp.skipMetricExpr, err = filterottl.NewBoolExprForMetric(cfg.Metrics.MetricConditions, filterottl.StandardMetricFuncs(), cfg.ErrorMode, set) + fsp.skipMetricExpr, err = filterottl.NewBoolExprForMetric(cfg.Metrics.MetricConditions, filterottl.StandardMetricFuncs(), cfg.ErrorMode, set.TelemetrySettings) if err != nil { return nil, err } } if cfg.Metrics.DataPointConditions != nil { - fsp.skipDataPointExpr, err = filterottl.NewBoolExprForDataPoint(cfg.Metrics.DataPointConditions, filterottl.StandardDataPointFuncs(), cfg.ErrorMode, set) + fsp.skipDataPointExpr, err = filterottl.NewBoolExprForDataPoint(cfg.Metrics.DataPointConditions, filterottl.StandardDataPointFuncs(), cfg.ErrorMode, set.TelemetrySettings) if err != nil { return nil, err } @@ -107,6 +116,8 @@ func (fmp *filterMetricProcessor) processMetrics(ctx context.Context, md pmetric return md, nil } + metricDataPointCountBeforeFilters := md.DataPointCount() + var errors error md.ResourceMetrics().RemoveIf(func(rmetrics pmetric.ResourceMetrics) bool { resource := rmetrics.Resource() @@ -161,6 +172,9 @@ func (fmp *filterMetricProcessor) processMetrics(ctx context.Context, md pmetric return rmetrics.ScopeMetrics().Len() == 0 }) + metricDataPointCountAfterFilters := md.DataPointCount() + fmp.telemetry.record(triggerMetricDataPointsDropped, int64(metricDataPointCountBeforeFilters-metricDataPointCountAfterFilters)) + if errors != nil { fmp.logger.Error("failed processing metrics", zap.Error(errors)) return md, errors diff --git a/processor/filterprocessor/metrics_test.go b/processor/filterprocessor/metrics_test.go index 76708634d268..b5ce5f8a6ae4 100644 --- a/processor/filterprocessor/metrics_test.go +++ b/processor/filterprocessor/metrics_test.go @@ -11,7 +11,6 @@ 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/pdata/pcommon" "go.opentelemetry.io/collector/pdata/pmetric" @@ -366,6 +365,77 @@ func TestFilterMetricProcessor(t *testing.T) { } } +func TestFilterMetricProcessorTelemetry(t *testing.T) { + telemetryTest(t, "FilterMetricProcessorTelemetry", func(t *testing.T, tel testTelemetry) { + next := new(consumertest.MetricsSink) + cfg := &Config{ + Metrics: MetricFilters{ + MetricConditions: []string{ + "name==\"metric1\"", + }, + }, + } + factory := NewFactory() + fmp, err := factory.CreateMetricsProcessor( + context.Background(), + processortest.NewNopCreateSettings(), + cfg, + next, + ) + assert.NotNil(t, fmp) + assert.Nil(t, err) + + caps := fmp.Capabilities() + assert.True(t, caps.MutatesData) + ctx := context.Background() + assert.NoError(t, fmp.Start(ctx, nil)) + + err = fmp.ConsumeMetrics(context.Background(), testResourceMetrics([]metricWithResource{ + { + metricNames: []string{"foo", "bar"}, + resourceAttributes: map[string]any{ + "attr1": "attr1/val1", + }, + }, + })) + assert.Nil(t, err) + + tel.assertMetrics(t, expectedMetrics{ + metricDataPointsFiltered: float64(0), + }) + + err = fmp.ConsumeMetrics(context.Background(), testResourceMetrics([]metricWithResource{ + { + metricNames: []string{"metric1", "metric2"}, + resourceAttributes: map[string]any{ + "attr1": "attr1/val1", + }, + }, + })) + assert.Nil(t, err) + + tel.assertMetrics(t, expectedMetrics{ + metricDataPointsFiltered: float64(1), + }) + + err = fmp.ConsumeMetrics(context.Background(), testResourceMetrics([]metricWithResource{ + { + metricNames: []string{"metric1"}, + resourceAttributes: map[string]any{ + "attr1": "attr1/val1", + }, + }, + })) + assert.Nil(t, err) + + tel.assertMetrics(t, expectedMetrics{ + metricDataPointsFiltered: float64(2), + }) + + assert.NoError(t, fmp.Shutdown(ctx)) + }) +} + func testResourceMetrics(mwrs []metricWithResource) pmetric.Metrics { md := pmetric.NewMetrics() now := time.Now() @@ -728,7 +798,7 @@ func TestFilterMetricProcessorWithOTTL(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - processor, err := newFilterMetricProcessor(componenttest.NewNopTelemetrySettings(), &Config{Metrics: tt.conditions, ErrorMode: tt.errorMode}) + processor, err := newFilterMetricProcessor(processortest.NewNopCreateSettings(), &Config{Metrics: tt.conditions, ErrorMode: tt.errorMode}) assert.NoError(t, err) got, err := processor.processMetrics(context.Background(), constructMetrics()) diff --git a/processor/filterprocessor/telemetry.go b/processor/filterprocessor/telemetry.go new file mode 100644 index 000000000000..dbc3082e3909 --- /dev/null +++ b/processor/filterprocessor/telemetry.go @@ -0,0 +1,101 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package filterprocessor // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor" + +import ( + "context" + + "go.opencensus.io/stats" + "go.opencensus.io/stats/view" + "go.opencensus.io/tag" + "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processorhelper" + "go.opentelemetry.io/otel/attribute" + + "github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor/internal/metadata" +) + +type trigger int + +const ( + triggerMetricDataPointsDropped trigger = iota + triggerLogsDropped + triggerSpansDropped +) + +var ( + typeStr = metadata.Type + processorTagKey = tag.MustNewKey(typeStr) + statMetricDataPointsFiltered = stats.Int64("datapoints.filtered", "Number of metric data points dropped by the filter processor", stats.UnitDimensionless) + statLogsFiltered = stats.Int64("logs.filtered", "Number of logs dropped by the filter processor", stats.UnitDimensionless) + statSpansFiltered = stats.Int64("spans.filtered", "Number of spans dropped by the filter processor", stats.UnitDimensionless) +) + +func init() { + // TODO: Find a way to handle the error. + _ = view.Register(metricViews()...) +} + +func metricViews() []*view.View { + processorTagKeys := []tag.Key{processorTagKey} + + return []*view.View{ + { + Name: processorhelper.BuildCustomMetricName(typeStr, statMetricDataPointsFiltered.Name()), + Measure: statMetricDataPointsFiltered, + Description: statMetricDataPointsFiltered.Description(), + Aggregation: view.Sum(), + TagKeys: processorTagKeys, + }, + { + Name: processorhelper.BuildCustomMetricName(typeStr, statLogsFiltered.Name()), + Measure: statLogsFiltered, + Description: statLogsFiltered.Description(), + Aggregation: view.Sum(), + TagKeys: processorTagKeys, + }, + { + Name: processorhelper.BuildCustomMetricName(typeStr, statSpansFiltered.Name()), + Measure: statSpansFiltered, + Description: statSpansFiltered.Description(), + Aggregation: view.Sum(), + TagKeys: processorTagKeys, + }, + } +} + +type filterProcessorTelemetry struct { + exportCtx context.Context + + processorAttr []attribute.KeyValue +} + +func newfilterProcessorTelemetry(set processor.CreateSettings) (*filterProcessorTelemetry, error) { + processorID := set.ID.String() + + exportCtx, err := tag.New(context.Background(), tag.Insert(processorTagKey, processorID)) + if err != nil { + return nil, err + } + fpt := &filterProcessorTelemetry{ + processorAttr: []attribute.KeyValue{attribute.String(typeStr, processorID)}, + exportCtx: exportCtx, + } + + return fpt, nil +} + +func (fpt *filterProcessorTelemetry) record(trigger trigger, dropped int64) { + var triggerMeasure *stats.Int64Measure + switch trigger { + case triggerMetricDataPointsDropped: + triggerMeasure = statMetricDataPointsFiltered + case triggerLogsDropped: + triggerMeasure = statLogsFiltered + case triggerSpansDropped: + triggerMeasure = statSpansFiltered + } + + stats.Record(fpt.exportCtx, triggerMeasure.M(dropped)) +} diff --git a/processor/filterprocessor/telemetry_test.go b/processor/filterprocessor/telemetry_test.go new file mode 100644 index 000000000000..125361690022 --- /dev/null +++ b/processor/filterprocessor/telemetry_test.go @@ -0,0 +1,156 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package filterprocessor + +import ( + "fmt" + "math" + "net/http" + "net/http/httptest" + "testing" + + ocprom "contrib.go.opencensus.io/exporter/prometheus" + "github.com/prometheus/client_golang/prometheus" + io_prometheus_client "github.com/prometheus/client_model/go" + "github.com/prometheus/common/expfmt" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "go.opencensus.io/stats/view" + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processortest" + sdkmetric "go.opentelemetry.io/otel/sdk/metric" + + "github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor/internal/metadata" +) + +func TestFilterProcessorMetrics(t *testing.T) { + viewNames := []string{ + "datapoints.filtered", + "logs.filtered", + "spans.filtered", + } + views := metricViews() + for i, viewName := range viewNames { + assert.Equal(t, "processor/filter/"+viewName, views[i].Name) + } +} + +type testTelemetry struct { + meter view.Meter + promHandler http.Handler + meterProvider *sdkmetric.MeterProvider +} + +type expectedMetrics struct { + // processor_filter_metrics_filtered + metricDataPointsFiltered float64 + // processor_filter_logs_filtered + logsFiltered float64 + // processor_filter_spans_filtered + spansFiltered float64 +} + +func telemetryTest(t *testing.T, name string, testFunc func(t *testing.T, tel testTelemetry)) { + t.Run(name+"WithOC", func(t *testing.T) { + testFunc(t, setupTelemetry(t)) + }) +} + +func setupTelemetry(t *testing.T) testTelemetry { + // Unregister the views first since they are registered by the init, this way we reset them. + views := metricViews() + view.Unregister(views...) + require.NoError(t, view.Register(views...)) + + telemetry := testTelemetry{ + meter: view.NewMeter(), + } + + promReg := prometheus.NewRegistry() + + ocExporter, err := ocprom.NewExporter(ocprom.Options{Registry: promReg}) + require.NoError(t, err) + + telemetry.promHandler = ocExporter + + view.RegisterExporter(ocExporter) + t.Cleanup(func() { view.UnregisterExporter(ocExporter) }) + + return telemetry +} + +func (tt *testTelemetry) NewProcessorCreateSettings() processor.CreateSettings { + settings := processortest.NewNopCreateSettings() + settings.MeterProvider = tt.meterProvider + settings.ID = component.NewID(metadata.Type) + + return settings +} + +func (tt *testTelemetry) assertMetrics(t *testing.T, expected expectedMetrics) { + for _, v := range metricViews() { + // Forces a flush for the opencensus view data. + _, _ = view.RetrieveData(v.Name) + } + + req, err := http.NewRequest(http.MethodGet, "/metrics", nil) + require.NoError(t, err) + + rr := httptest.NewRecorder() + tt.promHandler.ServeHTTP(rr, req) + + var parser expfmt.TextParser + metrics, err := parser.TextToMetricFamilies(rr.Body) + require.NoError(t, err) + + if expected.metricDataPointsFiltered > 0 { + name := "processor_filter_datapoints_filtered" + metric := tt.getMetric(t, name, io_prometheus_client.MetricType_COUNTER, metrics) + + assertFloat(t, expected.metricDataPointsFiltered, metric.GetCounter().GetValue(), name) + } + if expected.logsFiltered > 0 { + name := "processor_filter_logs_filtered" + metric := tt.getMetric(t, name, io_prometheus_client.MetricType_COUNTER, metrics) + + assertFloat(t, expected.logsFiltered, metric.GetCounter().GetValue(), name) + } + if expected.spansFiltered > 0 { + name := "processor_filter_spans_filtered" + metric := tt.getMetric(t, name, io_prometheus_client.MetricType_COUNTER, metrics) + + assertFloat(t, expected.spansFiltered, metric.GetCounter().GetValue(), name) + } +} + +func (tt *testTelemetry) getMetric(t *testing.T, name string, mtype io_prometheus_client.MetricType, got map[string]*io_prometheus_client.MetricFamily) *io_prometheus_client.Metric { + metricFamily, ok := got[name] + require.True(t, ok, "expected metric '%s' not found", name) + require.Equal(t, mtype, metricFamily.GetType()) + + metric, err := getSingleMetric(metricFamily) + require.NoError(t, err) + + return metric +} + +func getSingleMetric(metric *io_prometheus_client.MetricFamily) (*io_prometheus_client.Metric, error) { + if l := len(metric.Metric); l != 1 { + return nil, fmt.Errorf("expected metric '%s' with one set of attributes, but found %d", metric.GetName(), l) + } + first := metric.Metric[0] + + if len(first.Label) != 1 || "filter" != first.Label[0].GetName() { + return nil, fmt.Errorf("expected metric '%s' with a single `filter=\"\"` attribute but got '%s'", metric.GetName(), first.GetLabel()) + } + + return first, nil +} + +func assertFloat(t *testing.T, expected, got float64, metric string) { + if math.Abs(expected-got) > 0.00001 { + assert.Failf(t, "unexpected metric value", "value for metric '%s' did not match, expected '%f' got '%f'", metric, expected, got) + } +} diff --git a/processor/filterprocessor/traces.go b/processor/filterprocessor/traces.go index 9ca039c5b220..ff64e85470d1 100644 --- a/processor/filterprocessor/traces.go +++ b/processor/filterprocessor/traces.go @@ -5,9 +5,10 @@ package filterprocessor // import "github.com/open-telemetry/opentelemetry-colle import ( "context" + "fmt" - "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processorhelper" "go.uber.org/multierr" "go.uber.org/zap" @@ -22,23 +23,31 @@ import ( type filterSpanProcessor struct { skipSpanExpr expr.BoolExpr[ottlspan.TransformContext] skipSpanEventExpr expr.BoolExpr[ottlspanevent.TransformContext] + telemetry *filterProcessorTelemetry logger *zap.Logger } -func newFilterSpansProcessor(set component.TelemetrySettings, cfg *Config) (*filterSpanProcessor, error) { +func newFilterSpansProcessor(set processor.CreateSettings, cfg *Config) (*filterSpanProcessor, error) { var err error fsp := &filterSpanProcessor{ logger: set.Logger, } + + fpt, err := newfilterProcessorTelemetry(set) + if err != nil { + return nil, fmt.Errorf("error creating filter processor telemetry: %w", err) + } + fsp.telemetry = fpt + if cfg.Traces.SpanConditions != nil || cfg.Traces.SpanEventConditions != nil { if cfg.Traces.SpanConditions != nil { - fsp.skipSpanExpr, err = filterottl.NewBoolExprForSpan(cfg.Traces.SpanConditions, filterottl.StandardSpanFuncs(), cfg.ErrorMode, set) + fsp.skipSpanExpr, err = filterottl.NewBoolExprForSpan(cfg.Traces.SpanConditions, filterottl.StandardSpanFuncs(), cfg.ErrorMode, set.TelemetrySettings) if err != nil { return nil, err } } if cfg.Traces.SpanEventConditions != nil { - fsp.skipSpanEventExpr, err = filterottl.NewBoolExprForSpanEvent(cfg.Traces.SpanEventConditions, filterottl.StandardSpanEventFuncs(), cfg.ErrorMode, set) + fsp.skipSpanEventExpr, err = filterottl.NewBoolExprForSpanEvent(cfg.Traces.SpanEventConditions, filterottl.StandardSpanEventFuncs(), cfg.ErrorMode, set.TelemetrySettings) if err != nil { return nil, err } @@ -75,6 +84,8 @@ func (fsp *filterSpanProcessor) processTraces(ctx context.Context, td ptrace.Tra return td, nil } + spanCountBeforeFilters := td.SpanCount() + var errors error td.ResourceSpans().RemoveIf(func(rs ptrace.ResourceSpans) bool { resource := rs.Resource() @@ -108,6 +119,9 @@ func (fsp *filterSpanProcessor) processTraces(ctx context.Context, td ptrace.Tra return rs.ScopeSpans().Len() == 0 }) + spanCountAfterFilters := td.SpanCount() + fsp.telemetry.record(triggerSpansDropped, int64(spanCountBeforeFilters-spanCountAfterFilters)) + if errors != nil { fsp.logger.Error("failed processing traces", zap.Error(errors)) return td, errors diff --git a/processor/filterprocessor/traces_test.go b/processor/filterprocessor/traces_test.go index 0f68747d1ee8..42e6640c27a6 100644 --- a/processor/filterprocessor/traces_test.go +++ b/processor/filterprocessor/traces_test.go @@ -10,7 +10,6 @@ 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/pdata/pcommon" "go.opentelemetry.io/collector/pdata/ptrace" @@ -264,7 +263,7 @@ func TestFilterTraceProcessorWithOTTL(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - processor, err := newFilterSpansProcessor(componenttest.NewNopTelemetrySettings(), &Config{Traces: tt.conditions, ErrorMode: tt.errorMode}) + processor, err := newFilterSpansProcessor(processortest.NewNopCreateSettings(), &Config{Traces: tt.conditions, ErrorMode: tt.errorMode}) assert.NoError(t, err) got, err := processor.processTraces(context.Background(), constructTraces()) @@ -281,6 +280,26 @@ func TestFilterTraceProcessorWithOTTL(t *testing.T) { } } +func TestFilterTraceProcessorTelemetry(t *testing.T) { + telemetryTest(t, "FilterTraceProcessorTelemetry", func(t *testing.T, tel testTelemetry) { + processor, err := newFilterSpansProcessor(processortest.NewNopCreateSettings(), &Config{ + Traces: TraceFilters{ + SpanConditions: []string{ + `name == "operationA"`, + }, + }, ErrorMode: ottl.IgnoreError, + }) + assert.NoError(t, err) + + _, err = processor.processTraces(context.Background(), constructTraces()) + assert.NoError(t, err) + + tel.assertMetrics(t, expectedMetrics{ + spansFiltered: 2, + }) + }) +} + func constructTraces() ptrace.Traces { td := ptrace.NewTraces() rs0 := td.ResourceSpans().AppendEmpty() diff --git a/processor/groupbyattrsprocessor/generated_component_test.go b/processor/groupbyattrsprocessor/generated_component_test.go new file mode 100644 index 000000000000..6657098dc872 --- /dev/null +++ b/processor/groupbyattrsprocessor/generated_component_test.go @@ -0,0 +1,122 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package groupbyattrsprocessor + +import ( + "context" + "testing" + + "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/consumer/consumertest" + "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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "logs", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateLogsProcessor(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "metrics", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsProcessor(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "traces", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateTracesProcessor(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(), processortest.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(), processortest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + err = c.Start(context.Background(), host) + require.NoError(t, err) + assert.NotPanics(t, func() { + switch e := c.(type) { + case processor.Logs: + logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + if !e.Capabilities().MutatesData { + logs.MarkReadOnly() + } + err = e.ConsumeLogs(context.Background(), logs) + case processor.Metrics: + metrics := testdata.GenerateMetricsTwoMetrics() + if !e.Capabilities().MutatesData { + metrics.MarkReadOnly() + } + err = e.ConsumeMetrics(context.Background(), metrics) + case processor.Traces: + traces := testdata.GenerateTracesTwoSpansSameResource() + if !e.Capabilities().MutatesData { + traces.MarkReadOnly() + } + err = e.ConsumeTraces(context.Background(), traces) + } + }) + assert.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} diff --git a/processor/groupbyattrsprocessor/go.mod b/processor/groupbyattrsprocessor/go.mod index 7caba27ccb67..6247d2b1b6aa 100644 --- a/processor/groupbyattrsprocessor/go.mod +++ b/processor/groupbyattrsprocessor/go.mod @@ -3,6 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/processor/group go 1.20 require ( + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.91.0 github.com/stretchr/testify v1.8.4 go.opencensus.io v0.24.0 @@ -11,6 +12,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/processor v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -34,8 +37,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect @@ -53,3 +54,9 @@ 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/internal/metadata/generated_status.go b/processor/groupbyattrsprocessor/internal/metadata/generated_status.go index aa4f0e185047..9dfa03f6433c 100644 --- a/processor/groupbyattrsprocessor/internal/metadata/generated_status.go +++ b/processor/groupbyattrsprocessor/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/groupbyattrs") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/groupbyattrs") +} diff --git a/processor/groupbyattrsprocessor/metadata.yaml b/processor/groupbyattrsprocessor/metadata.yaml index 665d2170653e..5697d1fcc9f7 100644 --- a/processor/groupbyattrsprocessor/metadata.yaml +++ b/processor/groupbyattrsprocessor/metadata.yaml @@ -7,4 +7,6 @@ status: distributions: [contrib, splunk, observiq, sumo] warnings: [] codeowners: - active: [rnishtala-sumo] \ No newline at end of file + active: [rnishtala-sumo] +tests: + config: diff --git a/processor/groupbytraceprocessor/generated_component_test.go b/processor/groupbytraceprocessor/generated_component_test.go new file mode 100644 index 000000000000..f62a39c1db1c --- /dev/null +++ b/processor/groupbytraceprocessor/generated_component_test.go @@ -0,0 +1,108 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package groupbytraceprocessor + +import ( + "context" + "testing" + + "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/consumer/consumertest" + "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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "traces", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateTracesProcessor(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(), processortest.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(), processortest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + err = c.Start(context.Background(), host) + require.NoError(t, err) + assert.NotPanics(t, func() { + switch e := c.(type) { + case processor.Logs: + logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + if !e.Capabilities().MutatesData { + logs.MarkReadOnly() + } + err = e.ConsumeLogs(context.Background(), logs) + case processor.Metrics: + metrics := testdata.GenerateMetricsTwoMetrics() + if !e.Capabilities().MutatesData { + metrics.MarkReadOnly() + } + err = e.ConsumeMetrics(context.Background(), metrics) + case processor.Traces: + traces := testdata.GenerateTracesTwoSpansSameResource() + if !e.Capabilities().MutatesData { + traces.MarkReadOnly() + } + err = e.ConsumeTraces(context.Background(), traces) + } + }) + assert.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} diff --git a/processor/groupbytraceprocessor/go.mod b/processor/groupbytraceprocessor/go.mod index 048dd0fe28b1..ce56886ec25b 100644 --- a/processor/groupbytraceprocessor/go.mod +++ b/processor/groupbytraceprocessor/go.mod @@ -3,13 +3,17 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/processor/group go 1.20 require ( + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal v0.91.0 github.com/stretchr/testify v1.8.4 go.opencensus.io v0.24.0 go.opentelemetry.io/collector/component v0.91.0 + go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/processor v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -31,11 +35,8 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect go.opentelemetry.io/collector v0.91.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect - go.opentelemetry.io/collector/confmap v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect @@ -52,3 +53,11 @@ 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/internal/metadata/generated_status.go b/processor/groupbytraceprocessor/internal/metadata/generated_status.go index 68ad8dd16624..86d36b72c8b5 100644 --- a/processor/groupbytraceprocessor/internal/metadata/generated_status.go +++ b/processor/groupbytraceprocessor/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "groupbytrace" TracesStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/groupbytrace") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/groupbytrace") +} diff --git a/processor/groupbytraceprocessor/metadata.yaml b/processor/groupbytraceprocessor/metadata.yaml index e24caa652793..bf9c46916f94 100644 --- a/processor/groupbytraceprocessor/metadata.yaml +++ b/processor/groupbytraceprocessor/metadata.yaml @@ -7,4 +7,6 @@ status: distributions: [contrib, observiq, sumo, aws] warnings: [Statefulness] codeowners: - active: [jpkrohling] \ No newline at end of file + active: [jpkrohling] +tests: + config: diff --git a/processor/k8sattributesprocessor/README.md b/processor/k8sattributesprocessor/README.md index 78f56039f066..edce0ed2461e 100644 --- a/processor/k8sattributesprocessor/README.md +++ b/processor/k8sattributesprocessor/README.md @@ -3,7 +3,7 @@ | Status | | | ------------- |-----------| | Stability | [beta]: logs, metrics, traces | -| Distributions | [contrib], [aws], [grafana], [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%2Fk8sattributes%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aprocessor%2Fk8sattributes) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aprocessor%2Fk8sattributes%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aprocessor%2Fk8sattributes) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@dmitryax](https://www.github.com/dmitryax), [@rmfitzpatrick](https://www.github.com/rmfitzpatrick), [@fatsheep9146](https://www.github.com/fatsheep9146), [@TylerHelmuth](https://www.github.com/TylerHelmuth) | @@ -11,6 +11,7 @@ [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 [splunk]: https://github.com/signalfx/splunk-otel-collector diff --git a/processor/k8sattributesprocessor/e2e_test.go b/processor/k8sattributesprocessor/e2e_test.go index 962ee19583a0..2f4a8cc4901b 100644 --- a/processor/k8sattributesprocessor/e2e_test.go +++ b/processor/k8sattributesprocessor/e2e_test.go @@ -57,11 +57,18 @@ func newExpectedValue(mode int, value string) *expectedValue { // make docker-otelcontribcol // KUBECONFIG=/tmp/kube-config-otelcol-e2e-testing kind load docker-image otelcontribcol:latest func TestE2E(t *testing.T) { + kubeConfig, err := clientcmd.BuildConfigFromFlags("", testKubeConfig) require.NoError(t, err) dynamicClient, err := dynamic.NewForConfig(kubeConfig) require.NoError(t, err) + metricsConsumer := new(consumertest.MetricsSink) + tracesConsumer := new(consumertest.TracesSink) + logsConsumer := new(consumertest.LogsSink) + shutdownSinks := startUpSinks(t, metricsConsumer, tracesConsumer, logsConsumer) + defer shutdownSinks() + testID := uuid.NewString()[:8] collectorObjs := k8stest.CreateCollectorObjects(t, dynamicClient, testID) telemetryGenObjs, telemetryGenObjInfos := k8stest.CreateTelemetryGenObjects(t, dynamicClient, testID) @@ -75,9 +82,6 @@ func TestE2E(t *testing.T) { k8stest.WaitForTelemetryGenToStart(t, dynamicClient, info.Namespace, info.PodLabelSelectors, info.Workload, info.DataType) } - metricsConsumer := new(consumertest.MetricsSink) - tracesConsumer := new(consumertest.TracesSink) - logsConsumer := new(consumertest.LogsSink) wantEntries := 128 // Minimal number of metrics/traces/logs to wait for. waitForData(t, wantEntries, metricsConsumer, tracesConsumer, logsConsumer) @@ -484,7 +488,7 @@ func resourceHasAttributes(resource pcommon.Resource, kvs map[string]*expectedVa return err } -func waitForData(t *testing.T, entriesNum int, mc *consumertest.MetricsSink, tc *consumertest.TracesSink, lc *consumertest.LogsSink) { +func startUpSinks(t *testing.T, mc *consumertest.MetricsSink, tc *consumertest.TracesSink, lc *consumertest.LogsSink) func() { f := otlpreceiver.NewFactory() cfg := f.CreateDefaultConfig().(*otlpreceiver.Config) @@ -495,10 +499,12 @@ func waitForData(t *testing.T, entriesNum int, mc *consumertest.MetricsSink, tc rcvr, err := f.CreateLogsReceiver(context.Background(), receivertest.NewNopCreateSettings(), cfg, lc) require.NoError(t, err, "failed creating logs receiver") require.NoError(t, rcvr.Start(context.Background(), componenttest.NewNopHost())) - defer func() { + return func() { assert.NoError(t, rcvr.Shutdown(context.Background())) - }() + } +} +func waitForData(t *testing.T, entriesNum int, mc *consumertest.MetricsSink, tc *consumertest.TracesSink, lc *consumertest.LogsSink) { timeoutMinutes := 3 require.Eventuallyf(t, func() bool { return len(mc.AllMetrics()) > entriesNum && len(tc.AllTraces()) > entriesNum && len(lc.AllLogs()) > entriesNum diff --git a/processor/k8sattributesprocessor/go.mod b/processor/k8sattributesprocessor/go.mod index 6b4f0e9741b6..60179e50d7c7 100644 --- a/processor/k8sattributesprocessor/go.mod +++ b/processor/k8sattributesprocessor/go.mod @@ -19,6 +19,8 @@ require ( go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/collector/receiver/otlpreceiver v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 k8s.io/api v0.28.4 @@ -87,8 +89,6 @@ require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/oauth2 v0.14.0 // indirect diff --git a/processor/k8sattributesprocessor/internal/metadata/generated_status.go b/processor/k8sattributesprocessor/internal/metadata/generated_status.go index b47f7c1962dc..9abe8c044b66 100644 --- a/processor/k8sattributesprocessor/internal/metadata/generated_status.go +++ b/processor/k8sattributesprocessor/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsStability = component.StabilityLevelBeta TracesStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/k8sattributes") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/k8sattributes") +} diff --git a/processor/k8sattributesprocessor/metadata.yaml b/processor/k8sattributesprocessor/metadata.yaml index e891f2a50b38..6791bb24f94a 100644 --- a/processor/k8sattributesprocessor/metadata.yaml +++ b/processor/k8sattributesprocessor/metadata.yaml @@ -4,7 +4,7 @@ status: class: processor stability: beta: [logs, metrics, traces] - distributions: [contrib, splunk, observiq, sumo, redhat, aws, grafana] + distributions: [contrib, splunk, observiq, sumo, redhat, aws, grafana, liatrio] codeowners: active: [dmitryax, rmfitzpatrick, fatsheep9146, TylerHelmuth] # resource attributes are exposed through a different configuration interface (extract::metadata). diff --git a/processor/k8sattributesprocessor/testdata/e2e/collector/deployment.yaml b/processor/k8sattributesprocessor/testdata/e2e/collector/deployment.yaml index f7f21c5d4856..841c472b04f4 100644 --- a/processor/k8sattributesprocessor/testdata/e2e/collector/deployment.yaml +++ b/processor/k8sattributesprocessor/testdata/e2e/collector/deployment.yaml @@ -37,10 +37,12 @@ spec: httpGet: path: / port: 13133 + initialDelaySeconds: 3 readinessProbe: httpGet: path: / port: 13133 + initialDelaySeconds: 3 resources: limits: cpu: 128m diff --git a/processor/logstransformprocessor/go.mod b/processor/logstransformprocessor/go.mod index 6e3a350316e3..ded2d060fba7 100644 --- a/processor/logstransformprocessor/go.mod +++ b/processor/logstransformprocessor/go.mod @@ -13,6 +13,8 @@ require ( go.opentelemetry.io/collector/extension v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/processor v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -43,8 +45,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/processor/logstransformprocessor/internal/metadata/generated_status.go b/processor/logstransformprocessor/internal/metadata/generated_status.go index 811b88331dd8..70eae1b85e34 100644 --- a/processor/logstransformprocessor/internal/metadata/generated_status.go +++ b/processor/logstransformprocessor/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "logstransform" LogsStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/logstransform") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/logstransform") +} diff --git a/processor/metricsgenerationprocessor/generated_component_test.go b/processor/metricsgenerationprocessor/generated_component_test.go new file mode 100644 index 000000000000..62c37e89b8ec --- /dev/null +++ b/processor/metricsgenerationprocessor/generated_component_test.go @@ -0,0 +1,108 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package metricsgenerationprocessor + +import ( + "context" + "testing" + + "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/consumer/consumertest" + "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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "metrics", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsProcessor(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(), processortest.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(), processortest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + err = c.Start(context.Background(), host) + require.NoError(t, err) + assert.NotPanics(t, func() { + switch e := c.(type) { + case processor.Logs: + logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + if !e.Capabilities().MutatesData { + logs.MarkReadOnly() + } + err = e.ConsumeLogs(context.Background(), logs) + case processor.Metrics: + metrics := testdata.GenerateMetricsTwoMetrics() + if !e.Capabilities().MutatesData { + metrics.MarkReadOnly() + } + err = e.ConsumeMetrics(context.Background(), metrics) + case processor.Traces: + traces := testdata.GenerateTracesTwoSpansSameResource() + if !e.Capabilities().MutatesData { + traces.MarkReadOnly() + } + err = e.ConsumeTraces(context.Background(), traces) + } + }) + assert.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} diff --git a/processor/metricsgenerationprocessor/go.mod b/processor/metricsgenerationprocessor/go.mod index 1c5ed2d66896..36c0853618e7 100644 --- a/processor/metricsgenerationprocessor/go.mod +++ b/processor/metricsgenerationprocessor/go.mod @@ -3,12 +3,15 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/processor/metri go 1.20 require ( + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/processor v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -32,8 +35,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect @@ -49,3 +50,11 @@ 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/internal/metadata/generated_status.go b/processor/metricsgenerationprocessor/internal/metadata/generated_status.go index aac624ff1064..253bfb8bd2e4 100644 --- a/processor/metricsgenerationprocessor/internal/metadata/generated_status.go +++ b/processor/metricsgenerationprocessor/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "experimental_metricsgeneration" MetricsStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/metricsgeneration") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/metricsgeneration") +} diff --git a/processor/metricsgenerationprocessor/metadata.yaml b/processor/metricsgenerationprocessor/metadata.yaml index 707bf2afe775..9be1a42fe448 100644 --- a/processor/metricsgenerationprocessor/metadata.yaml +++ b/processor/metricsgenerationprocessor/metadata.yaml @@ -6,4 +6,7 @@ status: development: [metrics] distributions: [contrib, sumo, aws] codeowners: - active: [Aneurysm9] \ No newline at end of file + active: [Aneurysm9] + +tests: + config: diff --git a/processor/metricstransformprocessor/generated_component_test.go b/processor/metricstransformprocessor/generated_component_test.go new file mode 100644 index 000000000000..990f605c4d89 --- /dev/null +++ b/processor/metricstransformprocessor/generated_component_test.go @@ -0,0 +1,108 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package metricstransformprocessor + +import ( + "context" + "testing" + + "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/consumer/consumertest" + "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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "metrics", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsProcessor(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(), processortest.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(), processortest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + err = c.Start(context.Background(), host) + require.NoError(t, err) + assert.NotPanics(t, func() { + switch e := c.(type) { + case processor.Logs: + logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + if !e.Capabilities().MutatesData { + logs.MarkReadOnly() + } + err = e.ConsumeLogs(context.Background(), logs) + case processor.Metrics: + metrics := testdata.GenerateMetricsTwoMetrics() + if !e.Capabilities().MutatesData { + metrics.MarkReadOnly() + } + err = e.ConsumeMetrics(context.Background(), metrics) + case processor.Traces: + traces := testdata.GenerateTracesTwoSpansSameResource() + if !e.Capabilities().MutatesData { + traces.MarkReadOnly() + } + err = e.ConsumeTraces(context.Background(), traces) + } + }) + assert.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} diff --git a/processor/metricstransformprocessor/go.mod b/processor/metricstransformprocessor/go.mod index 77d7c41bd623..5aac30fbd68a 100644 --- a/processor/metricstransformprocessor/go.mod +++ b/processor/metricstransformprocessor/go.mod @@ -3,6 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/processor/metri go 1.20 require ( + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.91.0 github.com/stretchr/testify v1.8.4 @@ -11,6 +12,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/processor v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -36,8 +39,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect @@ -59,3 +60,5 @@ 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/internal/metadata/generated_status.go b/processor/metricstransformprocessor/internal/metadata/generated_status.go index 3b1ac11a50e3..167c38cf3ed5 100644 --- a/processor/metricstransformprocessor/internal/metadata/generated_status.go +++ b/processor/metricstransformprocessor/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "metricstransform" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/metricstransform") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/metricstransform") +} diff --git a/processor/metricstransformprocessor/metadata.yaml b/processor/metricstransformprocessor/metadata.yaml index 8859d5492293..8680efedb6b3 100644 --- a/processor/metricstransformprocessor/metadata.yaml +++ b/processor/metricstransformprocessor/metadata.yaml @@ -6,4 +6,7 @@ status: beta: [metrics] distributions: [contrib, observiq, splunk, sumo, aws] codeowners: - active: [dmitryax] \ No newline at end of file + active: [dmitryax] + +tests: + config: diff --git a/processor/probabilisticsamplerprocessor/generated_component_test.go b/processor/probabilisticsamplerprocessor/generated_component_test.go new file mode 100644 index 000000000000..1f1858d78b8f --- /dev/null +++ b/processor/probabilisticsamplerprocessor/generated_component_test.go @@ -0,0 +1,115 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package probabilisticsamplerprocessor + +import ( + "context" + "testing" + + "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/consumer/consumertest" + "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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "logs", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateLogsProcessor(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "traces", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateTracesProcessor(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(), processortest.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(), processortest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + err = c.Start(context.Background(), host) + require.NoError(t, err) + assert.NotPanics(t, func() { + switch e := c.(type) { + case processor.Logs: + logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + if !e.Capabilities().MutatesData { + logs.MarkReadOnly() + } + err = e.ConsumeLogs(context.Background(), logs) + case processor.Metrics: + metrics := testdata.GenerateMetricsTwoMetrics() + if !e.Capabilities().MutatesData { + metrics.MarkReadOnly() + } + err = e.ConsumeMetrics(context.Background(), metrics) + case processor.Traces: + traces := testdata.GenerateTracesTwoSpansSameResource() + if !e.Capabilities().MutatesData { + traces.MarkReadOnly() + } + err = e.ConsumeTraces(context.Background(), traces) + } + }) + assert.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} diff --git a/processor/probabilisticsamplerprocessor/go.mod b/processor/probabilisticsamplerprocessor/go.mod index c257df28bfc9..10c721b53f2b 100644 --- a/processor/probabilisticsamplerprocessor/go.mod +++ b/processor/probabilisticsamplerprocessor/go.mod @@ -14,6 +14,8 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/processor v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -79,10 +81,8 @@ require ( go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.44.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/otel/sdk v1.21.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/processor/probabilisticsamplerprocessor/internal/metadata/generated_status.go b/processor/probabilisticsamplerprocessor/internal/metadata/generated_status.go index ce209dc8878e..72871b302449 100644 --- a/processor/probabilisticsamplerprocessor/internal/metadata/generated_status.go +++ b/processor/probabilisticsamplerprocessor/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -11,3 +13,11 @@ const ( LogsStability = component.StabilityLevelAlpha TracesStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/probabilisticsampler") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/probabilisticsampler") +} diff --git a/processor/probabilisticsamplerprocessor/metadata.yaml b/processor/probabilisticsamplerprocessor/metadata.yaml index ada3cb06affd..e805e633d9b1 100644 --- a/processor/probabilisticsamplerprocessor/metadata.yaml +++ b/processor/probabilisticsamplerprocessor/metadata.yaml @@ -8,3 +8,6 @@ status: distributions: [core, contrib, observiq, splunk, sumo, aws, grafana] codeowners: active: [jpkrohling] + +tests: + config: diff --git a/processor/redactionprocessor/generated_component_test.go b/processor/redactionprocessor/generated_component_test.go new file mode 100644 index 000000000000..3f74266fd44e --- /dev/null +++ b/processor/redactionprocessor/generated_component_test.go @@ -0,0 +1,108 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package redactionprocessor + +import ( + "context" + "testing" + + "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/consumer/consumertest" + "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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "traces", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateTracesProcessor(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(), processortest.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(), processortest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + err = c.Start(context.Background(), host) + require.NoError(t, err) + assert.NotPanics(t, func() { + switch e := c.(type) { + case processor.Logs: + logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + if !e.Capabilities().MutatesData { + logs.MarkReadOnly() + } + err = e.ConsumeLogs(context.Background(), logs) + case processor.Metrics: + metrics := testdata.GenerateMetricsTwoMetrics() + if !e.Capabilities().MutatesData { + metrics.MarkReadOnly() + } + err = e.ConsumeMetrics(context.Background(), metrics) + case processor.Traces: + traces := testdata.GenerateTracesTwoSpansSameResource() + if !e.Capabilities().MutatesData { + traces.MarkReadOnly() + } + err = e.ConsumeTraces(context.Background(), traces) + } + }) + assert.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} diff --git a/processor/redactionprocessor/go.mod b/processor/redactionprocessor/go.mod index d215515b8672..166727d75693 100644 --- a/processor/redactionprocessor/go.mod +++ b/processor/redactionprocessor/go.mod @@ -3,12 +3,15 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/processor/redac go 1.20 require ( + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/processor v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -32,8 +35,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect @@ -49,3 +50,11 @@ 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/internal/metadata/generated_status.go b/processor/redactionprocessor/internal/metadata/generated_status.go index 62cade813037..5b23e5082e05 100644 --- a/processor/redactionprocessor/internal/metadata/generated_status.go +++ b/processor/redactionprocessor/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "redaction" TracesStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/redaction") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/redaction") +} diff --git a/processor/redactionprocessor/metadata.yaml b/processor/redactionprocessor/metadata.yaml index 709f5d49bcb4..880f1430c39f 100644 --- a/processor/redactionprocessor/metadata.yaml +++ b/processor/redactionprocessor/metadata.yaml @@ -6,4 +6,7 @@ status: beta: [traces] distributions: [contrib, sumo] codeowners: - active: [leonsp-ai, dmitryax, mx-psi, TylerHelmuth] \ No newline at end of file + active: [leonsp-ai, dmitryax, mx-psi, TylerHelmuth] + +tests: + config: diff --git a/processor/remotetapprocessor/generated_component_test.go b/processor/remotetapprocessor/generated_component_test.go new file mode 100644 index 000000000000..bb68166c7769 --- /dev/null +++ b/processor/remotetapprocessor/generated_component_test.go @@ -0,0 +1,122 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package remotetapprocessor + +import ( + "context" + "testing" + + "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/consumer/consumertest" + "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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "logs", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateLogsProcessor(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "metrics", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsProcessor(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "traces", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateTracesProcessor(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(), processortest.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(), processortest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + err = c.Start(context.Background(), host) + require.NoError(t, err) + assert.NotPanics(t, func() { + switch e := c.(type) { + case processor.Logs: + logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + if !e.Capabilities().MutatesData { + logs.MarkReadOnly() + } + err = e.ConsumeLogs(context.Background(), logs) + case processor.Metrics: + metrics := testdata.GenerateMetricsTwoMetrics() + if !e.Capabilities().MutatesData { + metrics.MarkReadOnly() + } + err = e.ConsumeMetrics(context.Background(), metrics) + case processor.Traces: + traces := testdata.GenerateTracesTwoSpansSameResource() + if !e.Capabilities().MutatesData { + traces.MarkReadOnly() + } + err = e.ConsumeTraces(context.Background(), traces) + } + }) + assert.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} diff --git a/processor/remotetapprocessor/go.mod b/processor/remotetapprocessor/go.mod index 64e2920d31fc..6ee3fd95840b 100644 --- a/processor/remotetapprocessor/go.mod +++ b/processor/remotetapprocessor/go.mod @@ -3,13 +3,17 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/processor/remot go 1.20 require ( + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.91.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/config/confighttp v0.91.0 + go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/processor v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 golang.org/x/net v0.19.0 golang.org/x/time v0.5.0 @@ -45,14 +49,11 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/config/configtls v0.91.0 // indirect go.opentelemetry.io/collector/config/internal v0.91.0 // indirect - go.opentelemetry.io/collector/confmap v0.91.0 // indirect go.opentelemetry.io/collector/extension v0.91.0 // indirect go.opentelemetry.io/collector/extension/auth v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect @@ -63,3 +64,11 @@ 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 diff --git a/processor/remotetapprocessor/internal/metadata/generated_status.go b/processor/remotetapprocessor/internal/metadata/generated_status.go index f3b5f933c20c..ecd8d35ad65d 100644 --- a/processor/remotetapprocessor/internal/metadata/generated_status.go +++ b/processor/remotetapprocessor/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsStability = component.StabilityLevelAlpha TracesStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/remotetap") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/remotetap") +} diff --git a/processor/remotetapprocessor/metadata.yaml b/processor/remotetapprocessor/metadata.yaml index 76f1f1d17303..4ebf87005f6a 100644 --- a/processor/remotetapprocessor/metadata.yaml +++ b/processor/remotetapprocessor/metadata.yaml @@ -6,4 +6,7 @@ status: alpha: [logs, metrics, traces] distributions: [contrib] codeowners: - active: [pmcollins] \ No newline at end of file + active: [pmcollins] + +tests: + config: diff --git a/processor/resourcedetectionprocessor/README.md b/processor/resourcedetectionprocessor/README.md index b562ae629b30..843ce8813d2a 100644 --- a/processor/resourcedetectionprocessor/README.md +++ b/processor/resourcedetectionprocessor/README.md @@ -4,13 +4,14 @@ | Status | | | ------------- |-----------| | Stability | [beta]: traces, metrics, logs | -| Distributions | [contrib], [aws], [observiq], [redhat], [splunk], [sumo] | +| Distributions | [contrib], [aws], [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 +[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 [splunk]: https://github.com/signalfx/splunk-otel-collector diff --git a/processor/resourcedetectionprocessor/generated_component_test.go b/processor/resourcedetectionprocessor/generated_component_test.go new file mode 100644 index 000000000000..e5947f8a0ce7 --- /dev/null +++ b/processor/resourcedetectionprocessor/generated_component_test.go @@ -0,0 +1,122 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package resourcedetectionprocessor + +import ( + "context" + "testing" + + "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/consumer/consumertest" + "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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "logs", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateLogsProcessor(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "metrics", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsProcessor(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "traces", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateTracesProcessor(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(), processortest.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(), processortest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + err = c.Start(context.Background(), host) + require.NoError(t, err) + assert.NotPanics(t, func() { + switch e := c.(type) { + case processor.Logs: + logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + if !e.Capabilities().MutatesData { + logs.MarkReadOnly() + } + err = e.ConsumeLogs(context.Background(), logs) + case processor.Metrics: + metrics := testdata.GenerateMetricsTwoMetrics() + if !e.Capabilities().MutatesData { + metrics.MarkReadOnly() + } + err = e.ConsumeMetrics(context.Background(), metrics) + case processor.Traces: + traces := testdata.GenerateTracesTwoSpansSameResource() + if !e.Capabilities().MutatesData { + traces.MarkReadOnly() + } + err = e.ConsumeTraces(context.Background(), traces) + } + }) + assert.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} diff --git a/processor/resourcedetectionprocessor/go.mod b/processor/resourcedetectionprocessor/go.mod index 2db9e9082d20..54fd3a1e71e1 100644 --- a/processor/resourcedetectionprocessor/go.mod +++ b/processor/resourcedetectionprocessor/go.mod @@ -5,11 +5,12 @@ go 1.20 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.49.1 + github.com/aws/aws-sdk-go v1.49.6 github.com/google/go-cmp v0.6.0 github.com/hashicorp/consul/api v1.26.1 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.91.0 + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.91.0 github.com/shirou/gopsutil/v3 v3.23.11 @@ -24,6 +25,8 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/processor v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 k8s.io/apimachinery v0.28.4 @@ -32,15 +35,14 @@ require ( require ( cloud.google.com/go/compute v1.23.0 // indirect - github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect - github.com/Microsoft/go-winio v0.5.2 // indirect + github.com/Microsoft/go-winio v0.6.1 // indirect github.com/Showmax/go-fqdn v1.0.0 // indirect github.com/armon/go-metrics v0.4.1 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/docker/distribution v2.8.2+incompatible // indirect github.com/docker/docker v24.0.7+incompatible // indirect github.com/docker/go-connections v0.4.0 // indirect - github.com/docker/go-units v0.4.0 // indirect + github.com/docker/go-units v0.5.0 // indirect github.com/emicklei/go-restful/v3 v3.9.0 // indirect github.com/fatih/color v1.14.1 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect @@ -86,7 +88,7 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.0.2 // indirect + github.com/opencontainers/image-spec v1.1.0-rc5 // indirect github.com/openshift/api v3.9.0+incompatible // indirect github.com/openshift/client-go v0.0.0-20210521082421-73d9475a9142 // indirect github.com/pkg/errors v0.9.1 // indirect @@ -109,16 +111,16 @@ require ( go.opentelemetry.io/collector/extension/auth v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/otel/sdk v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect + golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/oauth2 v0.14.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.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 google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect google.golang.org/grpc v1.59.0 // indirect @@ -148,3 +150,11 @@ 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 diff --git a/processor/resourcedetectionprocessor/go.sum b/processor/resourcedetectionprocessor/go.sum index 80919d4a7cb9..7dd1eae879d4 100644 --- a/processor/resourcedetectionprocessor/go.sum +++ b/processor/resourcedetectionprocessor/go.sum @@ -27,7 +27,6 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl contrib.go.opencensus.io/exporter/prometheus v0.4.2 h1:sqfsYl5GIY/L570iT+l93ehxaWJs2/OwXtiWwew3oAg= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= 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/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= @@ -40,8 +39,8 @@ github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.21.0 h1:aNyyrkRcLMWFum5qgYbXl6Ut+MMOmfH/kLjZJ5YJP/I= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.21.0/go.mod h1:BEOBnuYVyPt9wxVRQqqpKUK9FXVcL2+LOjZ8apLa9ao= -github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= -github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= 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= @@ -58,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.49.1 h1:Dsamcd8d/nNb3A+bZ0ucfGl0vGZsW5wlRW0vhoYGoeQ= -github.com/aws/aws-sdk-go v1.49.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= +github.com/aws/aws-sdk-go v1.49.6/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= @@ -86,8 +85,8 @@ github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= +github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= @@ -336,7 +335,7 @@ github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4/go.mod h1 github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 h1:dcztxKSvZ4Id8iPpHERQBbIJfabdt4wUm5qy3wOL2Zc= +github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= 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= @@ -361,8 +360,8 @@ github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1Cpa github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= -github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI= +github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= github.com/openshift/api v0.0.0-20210521075222-e273a339932a/go.mod h1:izBmoXbUu3z5kUa4FjZhvekTsyzIWiOoaIgJiZBBMQs= github.com/openshift/api v3.9.0+incompatible h1:fJ/KsefYuZAjmrr3+5U9yZIZbTOpVkDDLDLFresAeYs= github.com/openshift/api v3.9.0+incompatible/go.mod h1:dh9o4Fs58gpFXGSYfnVxGR9PnV53I8TW84pQaJDdGiY= @@ -416,7 +415,6 @@ 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/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -546,6 +544,8 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB 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.3.1-0.20200828183125-ce943fd02449/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -591,6 +591,7 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ 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-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -626,11 +627,9 @@ 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-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 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= @@ -696,7 +695,8 @@ golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roY 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.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.12.1-0.20230815132531-74c255bcf846 h1:Vve/L0v7CXXuxUmaMGIEK/dEeq7uiqb5qBgQrZzIE7E= +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/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/processor/resourcedetectionprocessor/internal/azure/internal/metadata/generated_status.go b/processor/resourcedetectionprocessor/internal/azure/internal/metadata/generated_status.go index ce3d0625ab32..eba06df2b1ad 100644 --- a/processor/resourcedetectionprocessor/internal/azure/internal/metadata/generated_status.go +++ b/processor/resourcedetectionprocessor/internal/azure/internal/metadata/generated_status.go @@ -2,6 +2,20 @@ package metadata +import ( + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" +) + const ( Type = "resourcedetectionprocessor/azure" ) + +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/internal/metadata/generated_status.go b/processor/resourcedetectionprocessor/internal/heroku/internal/metadata/generated_status.go index b8fe4cf34870..beedf104c271 100644 --- a/processor/resourcedetectionprocessor/internal/heroku/internal/metadata/generated_status.go +++ b/processor/resourcedetectionprocessor/internal/heroku/internal/metadata/generated_status.go @@ -2,6 +2,20 @@ package metadata +import ( + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" +) + const ( Type = "resourcedetectionprocessor/heroku" ) + +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/metadata/generated_status.go b/processor/resourcedetectionprocessor/internal/metadata/generated_status.go index 25982b141b86..23d96c5f25fd 100644 --- a/processor/resourcedetectionprocessor/internal/metadata/generated_status.go +++ b/processor/resourcedetectionprocessor/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) + +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/internal/metadata/generated_status.go b/processor/resourcedetectionprocessor/internal/openshift/internal/metadata/generated_status.go index 5b551af20c6b..2a1605dc295c 100644 --- a/processor/resourcedetectionprocessor/internal/openshift/internal/metadata/generated_status.go +++ b/processor/resourcedetectionprocessor/internal/openshift/internal/metadata/generated_status.go @@ -2,6 +2,20 @@ package metadata +import ( + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" +) + const ( Type = "resourcedetectionprocessor/openshift" ) + +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/metadata.yaml b/processor/resourcedetectionprocessor/metadata.yaml index a95149e62354..9ca10b369dd9 100644 --- a/processor/resourcedetectionprocessor/metadata.yaml +++ b/processor/resourcedetectionprocessor/metadata.yaml @@ -4,6 +4,9 @@ status: class: processor stability: beta: [traces, metrics, logs] - distributions: [contrib, splunk, observiq, sumo, aws, redhat] + distributions: [contrib, splunk, observiq, sumo, aws, redhat, liatrio] codeowners: active: [Aneurysm9, dashpole] + +tests: + config: diff --git a/processor/resourceprocessor/README.md b/processor/resourceprocessor/README.md index 61881f8d3845..a95668e108e3 100644 --- a/processor/resourceprocessor/README.md +++ b/processor/resourceprocessor/README.md @@ -4,7 +4,7 @@ | Status | | | ------------- |-----------| | Stability | [beta]: traces, metrics, logs | -| Distributions | [core], [contrib], [aws], [observiq], [redhat], [splunk], [sumo] | +| Distributions | [core], [contrib], [aws], [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%2Fresource%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aprocessor%2Fresource) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aprocessor%2Fresource%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aprocessor%2Fresource) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@dmitryax](https://www.github.com/dmitryax) | @@ -12,6 +12,7 @@ [core]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib [aws]: https://github.com/aws-observability/aws-otel-collector +[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 [splunk]: https://github.com/signalfx/splunk-otel-collector diff --git a/processor/resourceprocessor/generated_component_test.go b/processor/resourceprocessor/generated_component_test.go new file mode 100644 index 000000000000..da97d9783fa9 --- /dev/null +++ b/processor/resourceprocessor/generated_component_test.go @@ -0,0 +1,122 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package resourceprocessor + +import ( + "context" + "testing" + + "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/consumer/consumertest" + "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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "logs", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateLogsProcessor(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "metrics", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsProcessor(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "traces", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateTracesProcessor(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(), processortest.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(), processortest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + err = c.Start(context.Background(), host) + require.NoError(t, err) + assert.NotPanics(t, func() { + switch e := c.(type) { + case processor.Logs: + logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + if !e.Capabilities().MutatesData { + logs.MarkReadOnly() + } + err = e.ConsumeLogs(context.Background(), logs) + case processor.Metrics: + metrics := testdata.GenerateMetricsTwoMetrics() + if !e.Capabilities().MutatesData { + metrics.MarkReadOnly() + } + err = e.ConsumeMetrics(context.Background(), metrics) + case processor.Traces: + traces := testdata.GenerateTracesTwoSpansSameResource() + if !e.Capabilities().MutatesData { + traces.MarkReadOnly() + } + err = e.ConsumeTraces(context.Background(), traces) + } + }) + assert.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} diff --git a/processor/resourceprocessor/go.mod b/processor/resourceprocessor/go.mod index 2e4ff0208433..42e3d6fa7c8e 100644 --- a/processor/resourceprocessor/go.mod +++ b/processor/resourceprocessor/go.mod @@ -11,6 +11,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/processor v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -36,8 +38,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/processor/resourceprocessor/internal/metadata/generated_status.go b/processor/resourceprocessor/internal/metadata/generated_status.go index 988d0f88154f..9ace4f7f196c 100644 --- a/processor/resourceprocessor/internal/metadata/generated_status.go +++ b/processor/resourceprocessor/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/resource") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/resource") +} diff --git a/processor/resourceprocessor/metadata.yaml b/processor/resourceprocessor/metadata.yaml index 1ed200501ccc..58db2497e371 100644 --- a/processor/resourceprocessor/metadata.yaml +++ b/processor/resourceprocessor/metadata.yaml @@ -4,6 +4,9 @@ status: class: processor stability: beta: [traces, metrics, logs] - distributions: [core, contrib, splunk, observiq, sumo, aws, redhat] + distributions: [core, contrib, splunk, observiq, sumo, aws, redhat, liatrio] codeowners: - active: [dmitryax] \ No newline at end of file + active: [dmitryax] + +tests: + config: diff --git a/processor/routingprocessor/generated_component_test.go b/processor/routingprocessor/generated_component_test.go new file mode 100644 index 000000000000..be5c78c6cbc0 --- /dev/null +++ b/processor/routingprocessor/generated_component_test.go @@ -0,0 +1,122 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package routingprocessor + +import ( + "context" + "testing" + + "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/consumer/consumertest" + "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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "logs", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateLogsProcessor(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "metrics", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsProcessor(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "traces", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateTracesProcessor(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(), processortest.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(), processortest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + err = c.Start(context.Background(), host) + require.NoError(t, err) + assert.NotPanics(t, func() { + switch e := c.(type) { + case processor.Logs: + logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + if !e.Capabilities().MutatesData { + logs.MarkReadOnly() + } + err = e.ConsumeLogs(context.Background(), logs) + case processor.Metrics: + metrics := testdata.GenerateMetricsTwoMetrics() + if !e.Capabilities().MutatesData { + metrics.MarkReadOnly() + } + err = e.ConsumeMetrics(context.Background(), metrics) + case processor.Traces: + traces := testdata.GenerateTracesTwoSpansSameResource() + if !e.Capabilities().MutatesData { + traces.MarkReadOnly() + } + err = e.ConsumeTraces(context.Background(), traces) + } + }) + assert.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} diff --git a/processor/routingprocessor/go.mod b/processor/routingprocessor/go.mod index 52783a240347..495bc3da834f 100644 --- a/processor/routingprocessor/go.mod +++ b/processor/routingprocessor/go.mod @@ -3,6 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/processor/routi go 1.20 require ( + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.91.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector v0.91.0 @@ -19,7 +20,7 @@ require ( go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 - google.golang.org/grpc v1.60.0 + google.golang.org/grpc v1.60.1 ) require ( @@ -48,7 +49,6 @@ 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.91.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector/config/configauth v0.91.0 // indirect @@ -63,7 +63,7 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect - golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect + golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/processor/routingprocessor/go.sum b/processor/routingprocessor/go.sum index 1b741b931c16..07f077a562fa 100644 --- a/processor/routingprocessor/go.sum +++ b/processor/routingprocessor/go.sum @@ -189,8 +189,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= @@ -249,8 +249,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac 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.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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= diff --git a/processor/routingprocessor/internal/metadata/generated_status.go b/processor/routingprocessor/internal/metadata/generated_status.go index 2d0ef6f6ec1b..2dc74a64d0a0 100644 --- a/processor/routingprocessor/internal/metadata/generated_status.go +++ b/processor/routingprocessor/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/routing") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/routing") +} diff --git a/processor/routingprocessor/metadata.yaml b/processor/routingprocessor/metadata.yaml index 1022640b3c38..4d7d2df5a64f 100644 --- a/processor/routingprocessor/metadata.yaml +++ b/processor/routingprocessor/metadata.yaml @@ -6,4 +6,7 @@ status: beta: [traces, metrics, logs] distributions: [contrib, observiq, splunk, sumo, redhat] codeowners: - active: [jpkrohling] \ No newline at end of file + active: [jpkrohling] + +tests: + config: diff --git a/processor/schemaprocessor/generated_component_test.go b/processor/schemaprocessor/generated_component_test.go new file mode 100644 index 000000000000..6d8651940b1f --- /dev/null +++ b/processor/schemaprocessor/generated_component_test.go @@ -0,0 +1,122 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package schemaprocessor + +import ( + "context" + "testing" + + "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/consumer/consumertest" + "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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "logs", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateLogsProcessor(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "metrics", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsProcessor(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "traces", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateTracesProcessor(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(), processortest.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(), processortest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + err = c.Start(context.Background(), host) + require.NoError(t, err) + assert.NotPanics(t, func() { + switch e := c.(type) { + case processor.Logs: + logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + if !e.Capabilities().MutatesData { + logs.MarkReadOnly() + } + err = e.ConsumeLogs(context.Background(), logs) + case processor.Metrics: + metrics := testdata.GenerateMetricsTwoMetrics() + if !e.Capabilities().MutatesData { + metrics.MarkReadOnly() + } + err = e.ConsumeMetrics(context.Background(), metrics) + case processor.Traces: + traces := testdata.GenerateTracesTwoSpansSameResource() + if !e.Capabilities().MutatesData { + traces.MarkReadOnly() + } + err = e.ConsumeTraces(context.Background(), traces) + } + }) + assert.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} diff --git a/processor/schemaprocessor/go.mod b/processor/schemaprocessor/go.mod index 6dd6236647e4..e64afdaaad00 100644 --- a/processor/schemaprocessor/go.mod +++ b/processor/schemaprocessor/go.mod @@ -3,6 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/processor/schem go 1.20 require ( + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/config/confighttp v0.91.0 @@ -10,7 +11,9 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/processor v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 go.opentelemetry.io/otel/schema v0.0.7 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -50,8 +53,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect @@ -66,3 +67,11 @@ 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/internal/metadata/generated_status.go b/processor/schemaprocessor/internal/metadata/generated_status.go index 8fed69bc2d47..e56e2c37e73a 100644 --- a/processor/schemaprocessor/internal/metadata/generated_status.go +++ b/processor/schemaprocessor/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsStability = component.StabilityLevelDevelopment LogsStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/schema") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/schema") +} diff --git a/processor/schemaprocessor/metadata.yaml b/processor/schemaprocessor/metadata.yaml index 4f1269f0c916..c8f010454265 100644 --- a/processor/schemaprocessor/metadata.yaml +++ b/processor/schemaprocessor/metadata.yaml @@ -6,4 +6,7 @@ status: development: [traces, metrics, logs] distributions: [sumo] codeowners: - active: [MovieStoreGuy] \ No newline at end of file + active: [MovieStoreGuy] + +tests: + config: diff --git a/processor/servicegraphprocessor/factory.go b/processor/servicegraphprocessor/factory.go index 219e3853321b..fb046d4baf9a 100644 --- a/processor/servicegraphprocessor/factory.go +++ b/processor/servicegraphprocessor/factory.go @@ -7,7 +7,6 @@ import ( "context" "time" - "go.opencensus.io/stats/view" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/consumer" @@ -51,9 +50,6 @@ func init() { // NewFactory creates a factory for the servicegraph processor. func NewFactory() processor.Factory { - // TODO: Handle this err - _ = view.Register(serviceGraphProcessorViews()...) - return processor.NewFactory( typeStr, createDefaultConfig, @@ -63,8 +59,6 @@ func NewFactory() processor.Factory { // NewConnectorFactoryFunc creates a function that returns a factory for the servicegraph connector. var NewConnectorFactoryFunc = func(cfgType component.Type, tracesToMetricsStability component.StabilityLevel) connector.Factory { - // TODO: Handle this err - _ = view.Register(serviceGraphProcessorViews()...) return connector.NewFactory( cfgType, createDefaultConfig, @@ -84,13 +78,13 @@ func createDefaultConfig() component.Config { } func createTracesProcessor(_ context.Context, params processor.CreateSettings, cfg component.Config, nextConsumer consumer.Traces) (processor.Traces, error) { - p := newProcessor(params.Logger, cfg) + p := newProcessor(params.TelemetrySettings, cfg) p.tracesConsumer = nextConsumer return p, nil } func createTracesToMetricsConnector(_ context.Context, params connector.CreateSettings, cfg component.Config, nextConsumer consumer.Metrics) (connector.Traces, error) { - c := newProcessor(params.Logger, cfg) + c := newProcessor(params.TelemetrySettings, cfg) c.metricsConsumer = nextConsumer return c, nil } diff --git a/processor/servicegraphprocessor/generated_component_test.go b/processor/servicegraphprocessor/generated_component_test.go new file mode 100644 index 000000000000..fa9055a0d7c4 --- /dev/null +++ b/processor/servicegraphprocessor/generated_component_test.go @@ -0,0 +1,111 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package servicegraphprocessor + +import ( + "context" + "testing" + + "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/consumer/consumertest" + "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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "traces", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateTracesProcessor(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(), processortest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + 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 := newAssertNoErrorHost(t) + err = c.Start(context.Background(), host) + require.NoError(t, err) + assert.NotPanics(t, func() { + switch e := c.(type) { + case processor.Logs: + logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + if !e.Capabilities().MutatesData { + logs.MarkReadOnly() + } + err = e.ConsumeLogs(context.Background(), logs) + case processor.Metrics: + metrics := testdata.GenerateMetricsTwoMetrics() + if !e.Capabilities().MutatesData { + metrics.MarkReadOnly() + } + err = e.ConsumeMetrics(context.Background(), metrics) + case processor.Traces: + traces := testdata.GenerateTracesTwoSpansSameResource() + if !e.Capabilities().MutatesData { + traces.MarkReadOnly() + } + err = e.ConsumeTraces(context.Background(), traces) + } + }) + assert.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} diff --git a/processor/servicegraphprocessor/go.mod b/processor/servicegraphprocessor/go.mod index 434f8b18a9be..04a8be9d3b9d 100644 --- a/processor/servicegraphprocessor/go.mod +++ b/processor/servicegraphprocessor/go.mod @@ -4,10 +4,12 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/processor/servi go 1.20 require ( + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 github.com/stretchr/testify v1.8.4 - go.opencensus.io v0.24.0 go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/config/configgrpc v0.91.0 + go.opentelemetry.io/collector/config/configtelemetry v0.91.0 + go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/connector v0.91.0 go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/exporter v0.91.0 @@ -17,6 +19,9 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/processor v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/sdk/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -67,15 +72,14 @@ require ( 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.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector v0.91.0 // indirect go.opentelemetry.io/collector/config/configauth v0.91.0 // indirect go.opentelemetry.io/collector/config/configcompression v0.91.0 // indirect go.opentelemetry.io/collector/config/confignet v0.91.0 // indirect go.opentelemetry.io/collector/config/configopaque v0.91.0 // indirect - go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/config/configtls v0.91.0 // indirect go.opentelemetry.io/collector/config/internal v0.91.0 // indirect - go.opentelemetry.io/collector/confmap v0.91.0 // indirect go.opentelemetry.io/collector/extension v0.91.0 // indirect go.opentelemetry.io/collector/extension/auth v0.91.0 // indirect go.opentelemetry.io/collector/receiver v0.91.0 // indirect @@ -93,10 +97,7 @@ require ( go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.44.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/otel/sdk v1.21.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect @@ -119,3 +120,11 @@ 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/processor/servicegraphprocessor/go.sum b/processor/servicegraphprocessor/go.sum index bbedd45c4f9a..8e53af03b557 100644 --- a/processor/servicegraphprocessor/go.sum +++ b/processor/servicegraphprocessor/go.sum @@ -1328,7 +1328,7 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= -golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug= +golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 h1:FqrVOBQxQ8r/UwwXibI0KMolVhvFiGobSfdE33deHJM= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= diff --git a/processor/servicegraphprocessor/internal/metadata/generated_status.go b/processor/servicegraphprocessor/internal/metadata/generated_status.go index d0d787773e97..8b4f1a6ffb95 100644 --- a/processor/servicegraphprocessor/internal/metadata/generated_status.go +++ b/processor/servicegraphprocessor/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "servicegraph" TracesStability = component.StabilityLevelDeprecated ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/servicegraph") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/servicegraph") +} diff --git a/processor/servicegraphprocessor/metadata.yaml b/processor/servicegraphprocessor/metadata.yaml index 92d5e0065c7f..f2fb89d91606 100644 --- a/processor/servicegraphprocessor/metadata.yaml +++ b/processor/servicegraphprocessor/metadata.yaml @@ -7,4 +7,8 @@ status: distributions: [contrib, sumo] warnings: [] codeowners: - active: [jpkrohling, mapno] \ No newline at end of file + active: [jpkrohling, mapno] + +tests: + config: + skip_lifecycle: true diff --git a/processor/servicegraphprocessor/metrics.go b/processor/servicegraphprocessor/metrics.go deleted file mode 100644 index 73d23e496ee4..000000000000 --- a/processor/servicegraphprocessor/metrics.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package servicegraphprocessor // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/servicegraphprocessor" - -import ( - "go.opencensus.io/stats" - "go.opencensus.io/stats/view" - "go.opentelemetry.io/collector/processor/processorhelper" - - "github.com/open-telemetry/opentelemetry-collector-contrib/processor/servicegraphprocessor/internal/metadata" -) - -var ( - statDroppedSpans = stats.Int64("dropped_spans", "Number of spans dropped when trying to add edges", stats.UnitDimensionless) - statTotalEdges = stats.Int64("total_edges", "Total number of unique edges", stats.UnitDimensionless) - statExpiredEdges = stats.Int64("expired_edges", "Number of edges that expired before finding its matching span", stats.UnitDimensionless) -) - -func serviceGraphProcessorViews() []*view.View { - droppedSpansView := &view.View{ - Name: processorhelper.BuildCustomMetricName(metadata.Type, statDroppedSpans.Name()), - Description: statDroppedSpans.Description(), - Measure: statDroppedSpans, - Aggregation: view.Count(), - } - totalEdgesView := &view.View{ - Name: processorhelper.BuildCustomMetricName(metadata.Type, statTotalEdges.Name()), - Description: statTotalEdges.Description(), - Measure: statTotalEdges, - Aggregation: view.Count(), - } - expiredEdgesView := &view.View{ - Name: processorhelper.BuildCustomMetricName(metadata.Type, statExpiredEdges.Name()), - Description: statExpiredEdges.Description(), - Measure: statExpiredEdges, - Aggregation: view.Count(), - } - - return []*view.View{ - droppedSpansView, - totalEdgesView, - expiredEdgesView, - } -} diff --git a/processor/servicegraphprocessor/processor.go b/processor/servicegraphprocessor/processor.go index 866b49009647..0fde2f0c5ac6 100644 --- a/processor/servicegraphprocessor/processor.go +++ b/processor/servicegraphprocessor/processor.go @@ -12,7 +12,6 @@ import ( "sync" "time" - "go.opencensus.io/stats" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/exporter" @@ -20,9 +19,12 @@ import ( "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" "go.opentelemetry.io/collector/processor" + "go.opentelemetry.io/collector/processor/processorhelper" semconv "go.opentelemetry.io/collector/semconv/v1.13.0" + "go.opentelemetry.io/otel/metric" "go.uber.org/zap" + "github.com/open-telemetry/opentelemetry-collector-contrib/processor/servicegraphprocessor/internal/metadata" "github.com/open-telemetry/opentelemetry-collector-contrib/processor/servicegraphprocessor/internal/store" ) @@ -76,10 +78,14 @@ type serviceGraphProcessor struct { metricMutex sync.RWMutex keyToMetric map[string]metricSeries + statDroppedSpans metric.Int64Counter + statTotalEdges metric.Int64Counter + statExpiredEdges metric.Int64Counter + shutdownCh chan any } -func newProcessor(logger *zap.Logger, config component.Config) *serviceGraphProcessor { +func newProcessor(set component.TelemetrySettings, config component.Config) *serviceGraphProcessor { pConfig := config.(*Config) bounds := defaultLatencyHistogramBuckets @@ -102,9 +108,27 @@ func newProcessor(logger *zap.Logger, config component.Config) *serviceGraphProc pConfig.VirtualNodePeerAttributes = defaultPeerAttributes } + meter := metadata.Meter(set) + + droppedSpan, _ := meter.Int64Counter( + processorhelper.BuildCustomMetricName(metadata.Type, "dropped_spans"), + metric.WithDescription("Number of spans dropped when trying to add edges"), + metric.WithUnit("1"), + ) + totalEdges, _ := meter.Int64Counter( + processorhelper.BuildCustomMetricName(metadata.Type, "total_edges"), + metric.WithDescription("Total number of unique edges"), + metric.WithUnit("1"), + ) + expiredEdges, _ := meter.Int64Counter( + processorhelper.BuildCustomMetricName(metadata.Type, "expired_edges"), + metric.WithDescription("Number of edges that expired before finding its matching span"), + metric.WithUnit("1"), + ) + return &serviceGraphProcessor{ config: pConfig, - logger: logger, + logger: set.Logger, startTime: time.Now(), reqTotal: make(map[string]int64), reqFailedTotal: make(map[string]int64), @@ -117,6 +141,9 @@ func newProcessor(logger *zap.Logger, config component.Config) *serviceGraphProc reqDurationBounds: bounds, keyToMetric: make(map[string]metricSeries), shutdownCh: make(chan any), + statDroppedSpans: droppedSpan, + statTotalEdges: totalEdges, + statExpiredEdges: expiredEdges, } } @@ -299,7 +326,7 @@ func (p *serviceGraphProcessor) aggregateMetrics(ctx context.Context, td ptrace. if errors.Is(err, store.ErrTooManyItems) { totalDroppedSpans++ - stats.Record(ctx, statDroppedSpans.M(1)) + p.statDroppedSpans.Add(ctx, 1) continue } @@ -309,7 +336,7 @@ func (p *serviceGraphProcessor) aggregateMetrics(ctx context.Context, td ptrace. } if isNew { - stats.Record(ctx, statTotalEdges.M(1)) + p.statTotalEdges.Add(ctx, 1) } } } @@ -354,7 +381,7 @@ func (p *serviceGraphProcessor) onExpire(e *store.Edge) { zap.Stringer("trace_id", e.TraceID), ) - stats.Record(context.Background(), statExpiredEdges.M(1)) + p.statExpiredEdges.Add(context.Background(), 1) if virtualNodeFeatureGate.IsEnabled() { e.ConnectionType = store.VirtualNode diff --git a/processor/servicegraphprocessor/processor_test.go b/processor/servicegraphprocessor/processor_test.go index ab3e3f3051dc..8057519080fb 100644 --- a/processor/servicegraphprocessor/processor_test.go +++ b/processor/servicegraphprocessor/processor_test.go @@ -15,6 +15,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/config/configgrpc" + "go.opentelemetry.io/collector/config/configtelemetry" "go.opentelemetry.io/collector/connector/connectortest" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/consumertest" @@ -27,6 +28,9 @@ import ( "go.opentelemetry.io/collector/pdata/ptrace" "go.opentelemetry.io/collector/processor/processortest" semconv "go.opentelemetry.io/collector/semconv/v1.13.0" + sdkmetric "go.opentelemetry.io/otel/sdk/metric" + "go.opentelemetry.io/otel/sdk/metric/metricdata" + "go.opentelemetry.io/otel/sdk/metric/metricdata/metricdatatest" "go.uber.org/zap/zaptest" ) @@ -99,7 +103,9 @@ func TestProcessorShutdown(t *testing.T) { // Test next := new(consumertest.TracesSink) - p := newProcessor(zaptest.NewLogger(t), cfg) + set := componenttest.NewNopTelemetrySettings() + set.Logger = zaptest.NewLogger(t) + p := newProcessor(set, cfg) p.tracesConsumer = next err := p.Shutdown(context.Background()) @@ -114,7 +120,9 @@ func TestConnectorShutdown(t *testing.T) { // Test next := new(consumertest.MetricsSink) - p := newProcessor(zaptest.NewLogger(t), cfg) + set := componenttest.NewNopTelemetrySettings() + set.Logger = zaptest.NewLogger(t) + p := newProcessor(set, cfg) p.metricsConsumer = next err := p.Shutdown(context.Background()) @@ -216,7 +224,9 @@ func TestProcessorConsume(t *testing.T) { } // Prepare - p := newProcessor(zaptest.NewLogger(t), tc.cfg) + set := componenttest.NewNopTelemetrySettings() + set.Logger = zaptest.NewLogger(t) + p := newProcessor(set, tc.cfg) p.tracesConsumer = consumertest.NewNop() metricsExporter := newMockMetricsExporter() @@ -259,7 +269,9 @@ func TestConnectorConsume(t *testing.T) { Store: StoreConfig{MaxItems: 10}, } - conn := newProcessor(zaptest.NewLogger(t), cfg) + set := componenttest.NewNopTelemetrySettings() + set.Logger = zaptest.NewLogger(t) + conn := newProcessor(set, cfg) conn.metricsConsumer = newMockMetricsExporter() assert.NoError(t, conn.Start(context.Background(), componenttest.NewNopHost())) @@ -281,7 +293,9 @@ func TestConnectorConsume(t *testing.T) { func TestProcessor_MetricsFlushInterval(t *testing.T) { // Prepare - p := newProcessor(zaptest.NewLogger(t), &Config{ + set := componenttest.NewNopTelemetrySettings() + set.Logger = zaptest.NewLogger(t) + p := newProcessor(set, &Config{ MetricsExporter: "mock", Dimensions: []string{"some-attribute", "non-existing-attribute"}, Store: StoreConfig{ @@ -599,7 +613,9 @@ func TestStaleSeriesCleanup(t *testing.T) { mockMetricsExporter := newMockMetricsExporter() - p := newProcessor(zaptest.NewLogger(t), cfg) + set := componenttest.NewNopTelemetrySettings() + set.Logger = zaptest.NewLogger(t) + p := newProcessor(set, cfg) p.tracesConsumer = consumertest.NewNop() mHost := newMockHost(map[component.DataType]map[component.ID]component.Component{ @@ -629,3 +645,76 @@ func TestStaleSeriesCleanup(t *testing.T) { // Shutdown the processor assert.NoError(t, p.Shutdown(context.Background())) } + +func setupTelemetry(reader *sdkmetric.ManualReader) component.TelemetrySettings { + settings := componenttest.NewNopTelemetrySettings() + settings.MetricsLevel = configtelemetry.LevelNormal + + settings.MeterProvider = sdkmetric.NewMeterProvider(sdkmetric.WithReader(reader)) + return settings +} + +func TestValidateOwnTelemetry(t *testing.T) { + cfg := &Config{ + MetricsExporter: "mock", + Dimensions: []string{"some-attribute", "non-existing-attribute"}, + Store: StoreConfig{ + MaxItems: 10, + TTL: time.Second, + }, + } + + mockMetricsExporter := newMockMetricsExporter() + + reader := sdkmetric.NewManualReader() + set := setupTelemetry(reader) + p := newProcessor(set, cfg) + p.tracesConsumer = consumertest.NewNop() + + mHost := newMockHost(map[component.DataType]map[component.ID]component.Component{ + component.DataTypeMetrics: { + component.NewID("mock"): mockMetricsExporter, + }, + }) + + assert.NoError(t, p.Start(context.Background(), mHost)) + + // ConsumeTraces + td := buildSampleTrace(t, "first") + assert.NoError(t, p.ConsumeTraces(context.Background(), td)) + + // Make series stale and force a cache cleanup + for key, metric := range p.keyToMetric { + metric.lastUpdated = 0 + p.keyToMetric[key] = metric + } + p.cleanCache() + assert.Equal(t, 0, len(p.keyToMetric)) + + // ConsumeTraces with a trace with different attribute value + td = buildSampleTrace(t, "second") + assert.NoError(t, p.ConsumeTraces(context.Background(), td)) + + // Shutdown the processor + assert.NoError(t, p.Shutdown(context.Background())) + + rm := metricdata.ResourceMetrics{} + assert.NoError(t, reader.Collect(context.Background(), &rm)) + require.Len(t, rm.ScopeMetrics, 1) + sm := rm.ScopeMetrics[0] + require.Len(t, sm.Metrics, 1) + got := sm.Metrics[0] + want := metricdata.Metrics{ + Name: "processor/servicegraph/total_edges", + Description: "Total number of unique edges", + Unit: "1", + Data: metricdata.Sum[int64]{ + Temporality: metricdata.CumulativeTemporality, + IsMonotonic: true, + DataPoints: []metricdata.DataPoint[int64]{ + {Value: 2}, + }, + }, + } + metricdatatest.AssertEqual(t, want, got, metricdatatest.IgnoreTimestamp()) +} diff --git a/processor/spanmetricsprocessor/generated_component_test.go b/processor/spanmetricsprocessor/generated_component_test.go new file mode 100644 index 000000000000..4ad9ec59fd2c --- /dev/null +++ b/processor/spanmetricsprocessor/generated_component_test.go @@ -0,0 +1,111 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package spanmetricsprocessor + +import ( + "context" + "testing" + + "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/consumer/consumertest" + "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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "traces", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateTracesProcessor(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(), processortest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + 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 := newAssertNoErrorHost(t) + err = c.Start(context.Background(), host) + require.NoError(t, err) + assert.NotPanics(t, func() { + switch e := c.(type) { + case processor.Logs: + logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + if !e.Capabilities().MutatesData { + logs.MarkReadOnly() + } + err = e.ConsumeLogs(context.Background(), logs) + case processor.Metrics: + metrics := testdata.GenerateMetricsTwoMetrics() + if !e.Capabilities().MutatesData { + metrics.MarkReadOnly() + } + err = e.ConsumeMetrics(context.Background(), metrics) + case processor.Traces: + traces := testdata.GenerateTracesTwoSpansSameResource() + if !e.Capabilities().MutatesData { + traces.MarkReadOnly() + } + err = e.ConsumeTraces(context.Background(), traces) + } + }) + assert.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} diff --git a/processor/spanmetricsprocessor/go.mod b/processor/spanmetricsprocessor/go.mod index 5336276d0d2c..c5f34cc16ede 100644 --- a/processor/spanmetricsprocessor/go.mod +++ b/processor/spanmetricsprocessor/go.mod @@ -18,8 +18,10 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/processor v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 - google.golang.org/grpc v1.60.0 + google.golang.org/grpc v1.60.1 ) require ( @@ -60,8 +62,6 @@ require ( go.opentelemetry.io/collector/receiver v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/processor/spanmetricsprocessor/go.sum b/processor/spanmetricsprocessor/go.sum index 1e10dc4720be..0aa417353aae 100644 --- a/processor/spanmetricsprocessor/go.sum +++ b/processor/spanmetricsprocessor/go.sum @@ -243,8 +243,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac 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.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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= diff --git a/processor/spanmetricsprocessor/internal/metadata/generated_status.go b/processor/spanmetricsprocessor/internal/metadata/generated_status.go index 737e528ab279..c10c80d870e4 100644 --- a/processor/spanmetricsprocessor/internal/metadata/generated_status.go +++ b/processor/spanmetricsprocessor/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "spanmetrics" 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 index 0317a0696c3f..eb040cf6e593 100644 --- a/processor/spanmetricsprocessor/metadata.yaml +++ b/processor/spanmetricsprocessor/metadata.yaml @@ -6,4 +6,8 @@ status: deprecated: [traces] distributions: [contrib, observiq, splunk, sumo] codeowners: - active: [albertteoh] \ No newline at end of file + active: [albertteoh] + +tests: + config: + skip_lifecycle: true diff --git a/processor/spanprocessor/generated_component_test.go b/processor/spanprocessor/generated_component_test.go new file mode 100644 index 000000000000..f439549bd444 --- /dev/null +++ b/processor/spanprocessor/generated_component_test.go @@ -0,0 +1,108 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package spanprocessor + +import ( + "context" + "testing" + + "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/consumer/consumertest" + "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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "traces", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateTracesProcessor(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(), processortest.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(), processortest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + err = c.Start(context.Background(), host) + require.NoError(t, err) + assert.NotPanics(t, func() { + switch e := c.(type) { + case processor.Logs: + logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + if !e.Capabilities().MutatesData { + logs.MarkReadOnly() + } + err = e.ConsumeLogs(context.Background(), logs) + case processor.Metrics: + metrics := testdata.GenerateMetricsTwoMetrics() + if !e.Capabilities().MutatesData { + metrics.MarkReadOnly() + } + err = e.ConsumeMetrics(context.Background(), metrics) + case processor.Traces: + traces := testdata.GenerateTracesTwoSpansSameResource() + if !e.Capabilities().MutatesData { + traces.MarkReadOnly() + } + err = e.ConsumeTraces(context.Background(), traces) + } + }) + assert.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} diff --git a/processor/spanprocessor/go.mod b/processor/spanprocessor/go.mod index ba1d75acb0d4..95d8ace10c63 100644 --- a/processor/spanprocessor/go.mod +++ b/processor/spanprocessor/go.mod @@ -14,6 +14,8 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/processor v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 ) require ( @@ -22,10 +24,10 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/gobwas/glob v0.2.3 // 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/google/uuid v1.5.0 // 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 github.com/json-iterator/go v1.1.12 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect @@ -43,11 +45,9 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect - golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect + golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/processor/spanprocessor/go.sum b/processor/spanprocessor/go.sum index 2ab5ee7f4fbe..589af0978643 100644 --- a/processor/spanprocessor/go.sum +++ b/processor/spanprocessor/go.sum @@ -29,7 +29,6 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69 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= @@ -57,6 +56,8 @@ github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 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/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= @@ -142,8 +143,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= diff --git a/processor/spanprocessor/internal/metadata/generated_status.go b/processor/spanprocessor/internal/metadata/generated_status.go index 89baf8bd5dfe..730db7bf9779 100644 --- a/processor/spanprocessor/internal/metadata/generated_status.go +++ b/processor/spanprocessor/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "span" TracesStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/span") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/span") +} diff --git a/processor/spanprocessor/metadata.yaml b/processor/spanprocessor/metadata.yaml index 8a07f7407a59..d3348fc679c7 100644 --- a/processor/spanprocessor/metadata.yaml +++ b/processor/spanprocessor/metadata.yaml @@ -6,4 +6,9 @@ status: alpha: [traces] distributions: [core, contrib, observiq, splunk, sumo, aws, redhat, grafana] codeowners: - active: [boostchicken] \ No newline at end of file + active: [boostchicken] + +tests: + config: + name: + from_attributes: [db.svc, operation, id] diff --git a/processor/sumologicprocessor/generated_component_test.go b/processor/sumologicprocessor/generated_component_test.go new file mode 100644 index 000000000000..ba1f3efadce2 --- /dev/null +++ b/processor/sumologicprocessor/generated_component_test.go @@ -0,0 +1,122 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package sumologicprocessor + +import ( + "context" + "testing" + + "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/consumer/consumertest" + "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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "logs", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateLogsProcessor(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "metrics", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsProcessor(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "traces", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateTracesProcessor(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(), processortest.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(), processortest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + err = c.Start(context.Background(), host) + require.NoError(t, err) + assert.NotPanics(t, func() { + switch e := c.(type) { + case processor.Logs: + logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + if !e.Capabilities().MutatesData { + logs.MarkReadOnly() + } + err = e.ConsumeLogs(context.Background(), logs) + case processor.Metrics: + metrics := testdata.GenerateMetricsTwoMetrics() + if !e.Capabilities().MutatesData { + metrics.MarkReadOnly() + } + err = e.ConsumeMetrics(context.Background(), metrics) + case processor.Traces: + traces := testdata.GenerateTracesTwoSpansSameResource() + if !e.Capabilities().MutatesData { + traces.MarkReadOnly() + } + err = e.ConsumeTraces(context.Background(), traces) + } + }) + assert.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} diff --git a/processor/sumologicprocessor/go.mod b/processor/sumologicprocessor/go.mod index c84571842143..3d6a7124e861 100644 --- a/processor/sumologicprocessor/go.mod +++ b/processor/sumologicprocessor/go.mod @@ -3,13 +3,17 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/processor/sumol go 1.20 require ( + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.91.0 + go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/otelcol v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/processor v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -59,7 +63,6 @@ require ( go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector v0.91.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect - go.opentelemetry.io/collector/confmap v0.91.0 // indirect go.opentelemetry.io/collector/connector v0.91.0 // indirect go.opentelemetry.io/collector/exporter v0.91.0 // indirect go.opentelemetry.io/collector/extension v0.91.0 // indirect @@ -78,10 +81,8 @@ require ( go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.44.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/otel/sdk v1.21.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect @@ -95,3 +96,11 @@ require ( gopkg.in/yaml.v2 v2.4.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 a36710981bd1..6b365325f17e 100644 --- a/processor/sumologicprocessor/go.sum +++ b/processor/sumologicprocessor/go.sum @@ -388,7 +388,7 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug= +golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 h1:FqrVOBQxQ8r/UwwXibI0KMolVhvFiGobSfdE33deHJM= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= diff --git a/processor/sumologicprocessor/internal/metadata/generated_status.go b/processor/sumologicprocessor/internal/metadata/generated_status.go index a48e8d04a401..c70c8b7fb4bd 100644 --- a/processor/sumologicprocessor/internal/metadata/generated_status.go +++ b/processor/sumologicprocessor/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/sumologic") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/sumologic") +} diff --git a/processor/sumologicprocessor/metadata.yaml b/processor/sumologicprocessor/metadata.yaml index 8730a7d08605..a917f4feb391 100644 --- a/processor/sumologicprocessor/metadata.yaml +++ b/processor/sumologicprocessor/metadata.yaml @@ -7,3 +7,6 @@ status: distributions: [contrib, sumo] codeowners: active: [aboguszewski-sumo, astencel-sumo, sumo-drosiek] + +tests: + config: diff --git a/processor/tailsamplingprocessor/generated_component_test.go b/processor/tailsamplingprocessor/generated_component_test.go new file mode 100644 index 000000000000..7a61e03ae6bc --- /dev/null +++ b/processor/tailsamplingprocessor/generated_component_test.go @@ -0,0 +1,108 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package tailsamplingprocessor + +import ( + "context" + "testing" + + "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/consumer/consumertest" + "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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "traces", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateTracesProcessor(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(), processortest.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(), processortest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + err = c.Start(context.Background(), host) + require.NoError(t, err) + assert.NotPanics(t, func() { + switch e := c.(type) { + case processor.Logs: + logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + if !e.Capabilities().MutatesData { + logs.MarkReadOnly() + } + err = e.ConsumeLogs(context.Background(), logs) + case processor.Metrics: + metrics := testdata.GenerateMetricsTwoMetrics() + if !e.Capabilities().MutatesData { + metrics.MarkReadOnly() + } + err = e.ConsumeMetrics(context.Background(), metrics) + case processor.Traces: + traces := testdata.GenerateTracesTwoSpansSameResource() + if !e.Capabilities().MutatesData { + traces.MarkReadOnly() + } + err = e.ConsumeTraces(context.Background(), traces) + } + }) + assert.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} diff --git a/processor/tailsamplingprocessor/go.mod b/processor/tailsamplingprocessor/go.mod index 4121d03c3139..00198636d72c 100644 --- a/processor/tailsamplingprocessor/go.mod +++ b/processor/tailsamplingprocessor/go.mod @@ -16,6 +16,7 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/processor v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.26.0 @@ -28,6 +29,7 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.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 github.com/json-iterator/go v1.1.12 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect @@ -42,9 +44,8 @@ require ( go.opentelemetry.io/collector v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect + golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/processor/tailsamplingprocessor/go.sum b/processor/tailsamplingprocessor/go.sum index b60c245e30b0..308bce2f2590 100644 --- a/processor/tailsamplingprocessor/go.sum +++ b/processor/tailsamplingprocessor/go.sum @@ -56,6 +56,8 @@ github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 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/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= @@ -140,8 +142,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= diff --git a/processor/tailsamplingprocessor/internal/metadata/generated_status.go b/processor/tailsamplingprocessor/internal/metadata/generated_status.go index d76db8b400e9..06c076551b9a 100644 --- a/processor/tailsamplingprocessor/internal/metadata/generated_status.go +++ b/processor/tailsamplingprocessor/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "tail_sampling" TracesStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/tailsampling") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/tailsampling") +} diff --git a/processor/tailsamplingprocessor/metadata.yaml b/processor/tailsamplingprocessor/metadata.yaml index c68c47e447ad..d9fbdcd8e206 100644 --- a/processor/tailsamplingprocessor/metadata.yaml +++ b/processor/tailsamplingprocessor/metadata.yaml @@ -13,3 +13,6 @@ status: - sumo codeowners: active: [jpkrohling] + +tests: + config: diff --git a/processor/transformprocessor/README.md b/processor/transformprocessor/README.md index 8b71a08d2bf8..111a568169c6 100644 --- a/processor/transformprocessor/README.md +++ b/processor/transformprocessor/README.md @@ -3,7 +3,7 @@ | Status | | | ------------- |-----------| | Stability | [alpha]: traces, metrics, logs | -| Distributions | [contrib], [grafana], [observiq], [splunk], [sumo] | +| Distributions | [contrib], [grafana], [liatrio], [observiq], [splunk], [sumo] | | Warnings | [Unsound Transformations, Identity Conflict, Orphaned Telemetry, Other](#warnings) | | Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aprocessor%2Ftransform%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aprocessor%2Ftransform) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aprocessor%2Ftransform%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aprocessor%2Ftransform) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@TylerHelmuth](https://www.github.com/TylerHelmuth), [@kentquirk](https://www.github.com/kentquirk), [@bogdandrutu](https://www.github.com/bogdandrutu), [@evan-bradley](https://www.github.com/evan-bradley) | @@ -11,6 +11,7 @@ [alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib [grafana]: https://github.com/grafana/agent +[liatrio]: https://github.com/liatrio/liatrio-otel-collector [observiq]: https://github.com/observIQ/observiq-otel-collector [splunk]: https://github.com/signalfx/splunk-otel-collector [sumo]: https://github.com/SumoLogic/sumologic-otel-collector diff --git a/processor/transformprocessor/generated_component_test.go b/processor/transformprocessor/generated_component_test.go new file mode 100644 index 000000000000..d9b4ad30b40b --- /dev/null +++ b/processor/transformprocessor/generated_component_test.go @@ -0,0 +1,122 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package transformprocessor + +import ( + "context" + "testing" + + "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/consumer/consumertest" + "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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(t *testing.T) { + factory := NewFactory() + + tests := []struct { + name string + createFn func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) + }{ + + { + name: "logs", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateLogsProcessor(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "metrics", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateMetricsProcessor(ctx, set, cfg, consumertest.NewNop()) + }, + }, + + { + name: "traces", + createFn: func(ctx context.Context, set processor.CreateSettings, cfg component.Config) (component.Component, error) { + return factory.CreateTracesProcessor(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(), processortest.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(), processortest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + err = c.Start(context.Background(), host) + require.NoError(t, err) + assert.NotPanics(t, func() { + switch e := c.(type) { + case processor.Logs: + logs := testdata.GenerateLogsManyLogRecordsSameResource(2) + if !e.Capabilities().MutatesData { + logs.MarkReadOnly() + } + err = e.ConsumeLogs(context.Background(), logs) + case processor.Metrics: + metrics := testdata.GenerateMetricsTwoMetrics() + if !e.Capabilities().MutatesData { + metrics.MarkReadOnly() + } + err = e.ConsumeMetrics(context.Background(), metrics) + case processor.Traces: + traces := testdata.GenerateTracesTwoSpansSameResource() + if !e.Capabilities().MutatesData { + traces.MarkReadOnly() + } + err = e.ConsumeTraces(context.Background(), traces) + } + }) + assert.NoError(t, err) + err = c.Shutdown(context.Background()) + require.NoError(t, err) + }) + } +} diff --git a/processor/transformprocessor/go.mod b/processor/transformprocessor/go.mod index 4c62b6fddf16..8823f6f9540f 100644 --- a/processor/transformprocessor/go.mod +++ b/processor/transformprocessor/go.mod @@ -4,6 +4,7 @@ go 1.20 require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.91.0 + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.91.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.91.0 @@ -12,6 +13,8 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/processor v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -34,15 +37,12 @@ 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.91.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector v0.91.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect - golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect + golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/processor/transformprocessor/go.sum b/processor/transformprocessor/go.sum index e7a6c51e9b7d..8aa1d2e931c4 100644 --- a/processor/transformprocessor/go.sum +++ b/processor/transformprocessor/go.sum @@ -138,8 +138,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= diff --git a/processor/transformprocessor/internal/logs/processor_test.go b/processor/transformprocessor/internal/logs/processor_test.go index 519e57ca65bb..5bceea2285c8 100644 --- a/processor/transformprocessor/internal/logs/processor_test.go +++ b/processor/transformprocessor/internal/logs/processor_test.go @@ -329,6 +329,10 @@ func Test_ProcessLogs_LogContext(t *testing.T) { td.ResourceLogs().At(0).ScopeLogs().At(0).LogRecords().At(0).Attributes().PutDouble("test", 0.0) }, }, + { + statement: `replace_match(body["metadata"]["uid"], "*", "12345")`, + want: func(td plog.Logs) {}, + }, } for _, tt := range tests { diff --git a/processor/transformprocessor/internal/metadata/generated_status.go b/processor/transformprocessor/internal/metadata/generated_status.go index 245af46abae5..9ac7b26f2525 100644 --- a/processor/transformprocessor/internal/metadata/generated_status.go +++ b/processor/transformprocessor/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/transform") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/transform") +} diff --git a/processor/transformprocessor/metadata.yaml b/processor/transformprocessor/metadata.yaml index efed23ad53a3..1503209aa717 100644 --- a/processor/transformprocessor/metadata.yaml +++ b/processor/transformprocessor/metadata.yaml @@ -4,7 +4,10 @@ status: class: processor stability: alpha: [traces, metrics, logs] - distributions: [contrib, splunk, observiq, sumo, grafana] + distributions: [contrib, splunk, observiq, sumo, grafana, liatrio] warnings: [Unsound Transformations, Identity Conflict, Orphaned Telemetry, Other] codeowners: active: [TylerHelmuth, kentquirk, bogdandrutu, evan-bradley] + +tests: + config: diff --git a/receiver/activedirectorydsreceiver/counters.go b/receiver/activedirectorydsreceiver/counters.go index 839487534ce9..6edd2ccdcdd7 100644 --- a/receiver/activedirectorydsreceiver/counters.go +++ b/receiver/activedirectorydsreceiver/counters.go @@ -24,9 +24,9 @@ const ( draOutboundObjects = "DRA Outbound Objects/sec" draInboundProperties = "DRA Inbound Properties Total/sec" draOutboundProperties = "DRA Outbound Properties/sec" - draInboundValuesDNs = "DRA Inbound Values (DNs only)/sec" + draInboundValuesDNs = "DRA Inbound Values (DNs only)/sec" //revive:disable-line:var-naming draInboundValuesTotal = "DRA Inbound Values Total/sec" - draOutboundValuesDNs = "DRA Outbound Values (DNs only)/sec" + draOutboundValuesDNs = "DRA Outbound Values (DNs only)/sec" //revive:disable-line:var-naming draOutboundValuesTotal = "DRA Outbound Values Total/sec" draPendingReplicationOperations = "DRA Pending Replication Operations" draSyncFailuresSchemaMismatch = "DRA Sync Failures on Schema Mismatch" diff --git a/receiver/activedirectorydsreceiver/factory_windows.go b/receiver/activedirectorydsreceiver/factory_windows.go index 70a8eb8290c2..68d23d2647a4 100644 --- a/receiver/activedirectorydsreceiver/factory_windows.go +++ b/receiver/activedirectorydsreceiver/factory_windows.go @@ -21,7 +21,7 @@ import ( var errConfigNotActiveDirectory = fmt.Errorf("config is not valid for the '%s' receiver", metadata.Type) func createMetricsReceiver( - ctx context.Context, + _ context.Context, params receiver.CreateSettings, rConf component.Config, consumer consumer.Metrics, diff --git a/receiver/activedirectorydsreceiver/go.mod b/receiver/activedirectorydsreceiver/go.mod index 71eebdee821a..194a654be62f 100644 --- a/receiver/activedirectorydsreceiver/go.mod +++ b/receiver/activedirectorydsreceiver/go.mod @@ -13,6 +13,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -39,8 +41,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/activedirectorydsreceiver/internal/metadata/generated_status.go b/receiver/activedirectorydsreceiver/internal/metadata/generated_status.go index d9a81b32daca..98a1160d8453 100644 --- a/receiver/activedirectorydsreceiver/internal/metadata/generated_status.go +++ b/receiver/activedirectorydsreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "active_directory_ds" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/activedirectorydsreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/activedirectorydsreceiver") +} diff --git a/receiver/activedirectorydsreceiver/scraper.go b/receiver/activedirectorydsreceiver/scraper.go index 541aebd9e451..7eb87c2f78ff 100644 --- a/receiver/activedirectorydsreceiver/scraper.go +++ b/receiver/activedirectorydsreceiver/scraper.go @@ -32,7 +32,7 @@ func newActiveDirectoryDSScraper(mbc metadata.MetricsBuilderConfig, params recei } } -func (a *activeDirectoryDSScraper) start(ctx context.Context, host component.Host) error { +func (a *activeDirectoryDSScraper) start(_ context.Context, _ component.Host) error { watchers, err := getWatchers(defaultWatcherCreater{}) if err != nil { return fmt.Errorf("failed to create performance counter watchers: %w", err) @@ -45,7 +45,7 @@ func (a *activeDirectoryDSScraper) start(ctx context.Context, host component.Hos return nil } -func (a *activeDirectoryDSScraper) scrape(ctx context.Context) (pmetric.Metrics, error) { +func (a *activeDirectoryDSScraper) scrape(_ context.Context) (pmetric.Metrics, error) { var multiErr error now := pcommon.NewTimestampFromTime(time.Now()) @@ -103,6 +103,7 @@ func (a *activeDirectoryDSScraper) scrape(ctx context.Context) (pmetric.Metrics, a.mb.RecordActiveDirectoryDsReplicationPropertyRateDataPoint(now, draOutboundProperties, metadata.AttributeDirectionSent) } + //revive:disable-next-line:var-naming draInboundValuesDNs, dnsErr := a.w.Scrape(draInboundValuesDNs) multiErr = multierr.Append(multiErr, dnsErr) if dnsErr == nil { @@ -116,6 +117,7 @@ func (a *activeDirectoryDSScraper) scrape(ctx context.Context) (pmetric.Metrics, a.mb.RecordActiveDirectoryDsReplicationValueRateDataPoint(now, otherValuesInbound, metadata.AttributeDirectionReceived, metadata.AttributeValueTypeOther) } + //revive:disable-next-line:var-naming draOutboundValuesDNs, dnsErr := a.w.Scrape(draOutboundValuesDNs) multiErr = multierr.Append(multiErr, dnsErr) if dnsErr == nil { @@ -245,10 +247,10 @@ func (a *activeDirectoryDSScraper) scrape(ctx context.Context) (pmetric.Metrics, } if multiErr != nil { - return pmetric.Metrics(a.mb.Emit()), scrapererror.NewPartialScrapeError(multiErr, len(multierr.Errors(multiErr))) + return a.mb.Emit(), scrapererror.NewPartialScrapeError(multiErr, len(multierr.Errors(multiErr))) } - return pmetric.Metrics(a.mb.Emit()), nil + return a.mb.Emit(), nil } func (a *activeDirectoryDSScraper) shutdown(_ context.Context) error { diff --git a/receiver/aerospikereceiver/generated_component_test.go b/receiver/aerospikereceiver/generated_component_test.go new file mode 100644 index 000000000000..cc885c89f963 --- /dev/null +++ b/receiver/aerospikereceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package aerospikereceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/aerospikereceiver/go.mod b/receiver/aerospikereceiver/go.mod index cb77e02dea2f..f32d9d61f047 100644 --- a/receiver/aerospikereceiver/go.mod +++ b/receiver/aerospikereceiver/go.mod @@ -17,6 +17,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -78,8 +80,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/receiver/aerospikereceiver/internal/metadata/generated_status.go b/receiver/aerospikereceiver/internal/metadata/generated_status.go index 87677d32fbe2..78be7a216a94 100644 --- a/receiver/aerospikereceiver/internal/metadata/generated_status.go +++ b/receiver/aerospikereceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "aerospike" MetricsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/aerospikereceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/aerospikereceiver") +} diff --git a/receiver/aerospikereceiver/metadata.yaml b/receiver/aerospikereceiver/metadata.yaml index 5561dcb50d02..2bee22a609ab 100644 --- a/receiver/aerospikereceiver/metadata.yaml +++ b/receiver/aerospikereceiver/metadata.yaml @@ -248,3 +248,6 @@ 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 new file mode 100644 index 000000000000..f1a0b57013eb --- /dev/null +++ b/receiver/apachereceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package apachereceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/apachereceiver/go.mod b/receiver/apachereceiver/go.mod index 90145b9c3006..8f60fcc364e3 100644 --- a/receiver/apachereceiver/go.mod +++ b/receiver/apachereceiver/go.mod @@ -16,6 +16,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -86,8 +88,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect golang.org/x/mod v0.14.0 // indirect diff --git a/receiver/apachereceiver/internal/metadata/generated_status.go b/receiver/apachereceiver/internal/metadata/generated_status.go index e736a3a1c284..870bb1c2a3ac 100644 --- a/receiver/apachereceiver/internal/metadata/generated_status.go +++ b/receiver/apachereceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "apache" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/apachereceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/apachereceiver") +} diff --git a/receiver/apachereceiver/metadata.yaml b/receiver/apachereceiver/metadata.yaml index a5bec812ed4a..83d51a319898 100644 --- a/receiver/apachereceiver/metadata.yaml +++ b/receiver/apachereceiver/metadata.yaml @@ -173,3 +173,6 @@ 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 new file mode 100644 index 000000000000..fb96f448d67e --- /dev/null +++ b/receiver/apachesparkreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package apachesparkreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/apachesparkreceiver/go.mod b/receiver/apachesparkreceiver/go.mod index 2a75541966a5..07e494c88bc5 100644 --- a/receiver/apachesparkreceiver/go.mod +++ b/receiver/apachesparkreceiver/go.mod @@ -15,6 +15,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -87,8 +89,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect golang.org/x/mod v0.14.0 // indirect diff --git a/receiver/apachesparkreceiver/internal/metadata/generated_status.go b/receiver/apachesparkreceiver/internal/metadata/generated_status.go index 4c2ba72440c6..71eeacd3063f 100644 --- a/receiver/apachesparkreceiver/internal/metadata/generated_status.go +++ b/receiver/apachesparkreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "apachespark" MetricsStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/apachesparkreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/apachesparkreceiver") +} diff --git a/receiver/apachesparkreceiver/metadata.yaml b/receiver/apachesparkreceiver/metadata.yaml index 33bf28c6af4a..8f68afde24bf 100644 --- a/receiver/apachesparkreceiver/metadata.yaml +++ b/receiver/apachesparkreceiver/metadata.yaml @@ -688,3 +688,6 @@ metrics: value_type: int unit: ms attributes: [gc_type] + +tests: + config: diff --git a/receiver/awscloudwatchmetricsreceiver/generated_component_test.go b/receiver/awscloudwatchmetricsreceiver/generated_component_test.go new file mode 100644 index 000000000000..b9bf1a4ed688 --- /dev/null +++ b/receiver/awscloudwatchmetricsreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package awscloudwatchmetricsreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/awscloudwatchmetricsreceiver/go.mod b/receiver/awscloudwatchmetricsreceiver/go.mod index 2493ec438d2d..f1b09828cfbf 100644 --- a/receiver/awscloudwatchmetricsreceiver/go.mod +++ b/receiver/awscloudwatchmetricsreceiver/go.mod @@ -5,8 +5,11 @@ go 1.20 require ( github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.91.0 + go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -26,12 +29,9 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect - go.opentelemetry.io/collector/confmap v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/pdata v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/receiver/awscloudwatchmetricsreceiver/internal/metadata/generated_status.go b/receiver/awscloudwatchmetricsreceiver/internal/metadata/generated_status.go index 16e6bb8277cd..b8795e41e369 100644 --- a/receiver/awscloudwatchmetricsreceiver/internal/metadata/generated_status.go +++ b/receiver/awscloudwatchmetricsreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "awscloudwatchmetrics" MetricsStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/awscloudwatchmetricsreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/awscloudwatchmetricsreceiver") +} diff --git a/receiver/awscloudwatchmetricsreceiver/metadata.yaml b/receiver/awscloudwatchmetricsreceiver/metadata.yaml index 9dae2cb53b24..f7afd3faa98b 100644 --- a/receiver/awscloudwatchmetricsreceiver/metadata.yaml +++ b/receiver/awscloudwatchmetricsreceiver/metadata.yaml @@ -6,4 +6,7 @@ status: development: [metrics] distributions: [contrib] codeowners: - active: [jpkrohling] \ No newline at end of file + active: [jpkrohling] + +tests: + config: diff --git a/receiver/awscloudwatchreceiver/generated_component_test.go b/receiver/awscloudwatchreceiver/generated_component_test.go new file mode 100644 index 000000000000..c3f00644a6aa --- /dev/null +++ b/receiver/awscloudwatchreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package awscloudwatchreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/awscloudwatchreceiver/go.mod b/receiver/awscloudwatchreceiver/go.mod index 7150ed9c6af7..1424348f4f76 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.20 require ( - github.com/aws/aws-sdk-go v1.49.1 + github.com/aws/aws-sdk-go v1.49.6 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.91.0 github.com/stretchr/testify v1.8.4 @@ -12,6 +12,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -37,8 +39,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/receiver/awscloudwatchreceiver/go.sum b/receiver/awscloudwatchreceiver/go.sum index 12e25faae8f8..58f823772e47 100644 --- a/receiver/awscloudwatchreceiver/go.sum +++ b/receiver/awscloudwatchreceiver/go.sum @@ -1,5 +1,5 @@ -github.com/aws/aws-sdk-go v1.49.1 h1:Dsamcd8d/nNb3A+bZ0ucfGl0vGZsW5wlRW0vhoYGoeQ= -github.com/aws/aws-sdk-go v1.49.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= +github.com/aws/aws-sdk-go v1.49.6/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= 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.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/receiver/awscloudwatchreceiver/internal/metadata/generated_status.go b/receiver/awscloudwatchreceiver/internal/metadata/generated_status.go index 0757ed842852..4e2b6df838a9 100644 --- a/receiver/awscloudwatchreceiver/internal/metadata/generated_status.go +++ b/receiver/awscloudwatchreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "awscloudwatch" LogsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/awscloudwatchreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/awscloudwatchreceiver") +} diff --git a/receiver/awscloudwatchreceiver/metadata.yaml b/receiver/awscloudwatchreceiver/metadata.yaml index 5d45699e2f81..11a375a93ad6 100644 --- a/receiver/awscloudwatchreceiver/metadata.yaml +++ b/receiver/awscloudwatchreceiver/metadata.yaml @@ -7,3 +7,6 @@ status: distributions: [contrib, observiq, sumo] codeowners: active: [djaglowski, schmikei] + +tests: + config: diff --git a/receiver/awscontainerinsightreceiver/generated_component_test.go b/receiver/awscontainerinsightreceiver/generated_component_test.go new file mode 100644 index 000000000000..017e7ed769f9 --- /dev/null +++ b/receiver/awscontainerinsightreceiver/generated_component_test.go @@ -0,0 +1,89 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package awscontainerinsightreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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) { + + // TODO support lifecycle + t.SkipNow() + + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + 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 cf56b78f6d4d..1bd6810133b6 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.20 require ( - github.com/aws/aws-sdk-go v1.49.1 + github.com/aws/aws-sdk-go v1.49.6 github.com/google/cadvisor v0.48.1 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/awsutil v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/containerinsight v0.91.0 @@ -19,6 +19,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 k8s.io/api v0.28.4 k8s.io/apimachinery v0.28.4 @@ -121,8 +123,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/oauth2 v0.14.0 // indirect @@ -138,7 +138,7 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.0.3 // indirect - k8s.io/klog/v2 v2.100.1 // indirect + k8s.io/klog/v2 v2.110.1 // indirect k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect diff --git a/receiver/awscontainerinsightreceiver/go.sum b/receiver/awscontainerinsightreceiver/go.sum index 34da98e37279..bbbcf03f0b39 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.49.1 h1:Dsamcd8d/nNb3A+bZ0ucfGl0vGZsW5wlRW0vhoYGoeQ= -github.com/aws/aws-sdk-go v1.49.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= +github.com/aws/aws-sdk-go v1.49.6/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -100,7 +100,6 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2 github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -698,8 +697,8 @@ k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= -k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= +k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 h1:LyMgNKD2P8Wn1iAwQU5OhxCKlKJy0sHc+PcDwFB24dQ= k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9/go.mod h1:wZK2AVp1uHCp4VamDVgBP2COHZjqD1T68Rf0CM3YjSM= diff --git a/receiver/awscontainerinsightreceiver/internal/metadata/generated_status.go b/receiver/awscontainerinsightreceiver/internal/metadata/generated_status.go index 3c8e95fb9a47..75b28f270687 100644 --- a/receiver/awscontainerinsightreceiver/internal/metadata/generated_status.go +++ b/receiver/awscontainerinsightreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "awscontainerinsightreceiver" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/awscontainerinsightreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/awscontainerinsightreceiver") +} diff --git a/receiver/awscontainerinsightreceiver/metadata.yaml b/receiver/awscontainerinsightreceiver/metadata.yaml index 6e86fe37b3d6..ab16d85dbf6f 100644 --- a/receiver/awscontainerinsightreceiver/metadata.yaml +++ b/receiver/awscontainerinsightreceiver/metadata.yaml @@ -7,4 +7,8 @@ status: distributions: [contrib, aws, observiq, sumo] warnings: [Other] codeowners: - active: [Aneurysm9, pxaws] \ No newline at end of file + active: [Aneurysm9, pxaws] + +tests: + config: + skip_lifecycle: true diff --git a/receiver/awsecscontainermetricsreceiver/go.mod b/receiver/awsecscontainermetricsreceiver/go.mod index 23581d8b54a0..f245fdbc3b7e 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.20 require ( - github.com/aws/aws-sdk-go v1.49.1 + github.com/aws/aws-sdk-go v1.49.6 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.91.0 github.com/stretchr/testify v1.8.4 @@ -14,6 +14,8 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -51,8 +53,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/receiver/awsecscontainermetricsreceiver/go.sum b/receiver/awsecscontainermetricsreceiver/go.sum index 1766cebb3820..20554c9cb1bc 100644 --- a/receiver/awsecscontainermetricsreceiver/go.sum +++ b/receiver/awsecscontainermetricsreceiver/go.sum @@ -1,5 +1,5 @@ -github.com/aws/aws-sdk-go v1.49.1 h1:Dsamcd8d/nNb3A+bZ0ucfGl0vGZsW5wlRW0vhoYGoeQ= -github.com/aws/aws-sdk-go v1.49.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= +github.com/aws/aws-sdk-go v1.49.6/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= diff --git a/receiver/awsecscontainermetricsreceiver/internal/metadata/generated_status.go b/receiver/awsecscontainermetricsreceiver/internal/metadata/generated_status.go index 2c61a860e37d..8f9401e2bb2f 100644 --- a/receiver/awsecscontainermetricsreceiver/internal/metadata/generated_status.go +++ b/receiver/awsecscontainermetricsreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "awsecscontainermetrics" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/awsecscontainermetricsreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/awsecscontainermetricsreceiver") +} diff --git a/receiver/awsfirehosereceiver/generated_component_test.go b/receiver/awsfirehosereceiver/generated_component_test.go new file mode 100644 index 000000000000..5190be074cbe --- /dev/null +++ b/receiver/awsfirehosereceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package awsfirehosereceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/awsfirehosereceiver/go.mod b/receiver/awsfirehosereceiver/go.mod index 37b6e11659a4..9d48a8181754 100644 --- a/receiver/awsfirehosereceiver/go.mod +++ b/receiver/awsfirehosereceiver/go.mod @@ -13,6 +13,8 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -48,8 +50,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/receiver/awsfirehosereceiver/internal/metadata/generated_status.go b/receiver/awsfirehosereceiver/internal/metadata/generated_status.go index 00036f12f462..ee52e719a041 100644 --- a/receiver/awsfirehosereceiver/internal/metadata/generated_status.go +++ b/receiver/awsfirehosereceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "awsfirehose" MetricsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/awsfirehosereceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/awsfirehosereceiver") +} diff --git a/receiver/awsfirehosereceiver/metadata.yaml b/receiver/awsfirehosereceiver/metadata.yaml index 9cb632b03e6b..cc49c2f86e80 100644 --- a/receiver/awsfirehosereceiver/metadata.yaml +++ b/receiver/awsfirehosereceiver/metadata.yaml @@ -7,3 +7,6 @@ status: distributions: [contrib, observiq, sumo] codeowners: active: [Aneurysm9] + +tests: + config: diff --git a/receiver/awsxrayreceiver/go.mod b/receiver/awsxrayreceiver/go.mod index 5444cf497273..bbf47afa97ca 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.20 require ( - github.com/aws/aws-sdk-go v1.49.1 + github.com/aws/aws-sdk-go v1.49.6 github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.5.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/proxy v0.91.0 @@ -21,6 +21,8 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -63,10 +65,8 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/otel/sdk v1.21.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/receiver/awsxrayreceiver/go.sum b/receiver/awsxrayreceiver/go.sum index b37a3eb3b324..7791e47a1a6d 100644 --- a/receiver/awsxrayreceiver/go.sum +++ b/receiver/awsxrayreceiver/go.sum @@ -41,8 +41,8 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= -github.com/aws/aws-sdk-go v1.49.1 h1:Dsamcd8d/nNb3A+bZ0ucfGl0vGZsW5wlRW0vhoYGoeQ= -github.com/aws/aws-sdk-go v1.49.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= +github.com/aws/aws-sdk-go v1.49.6/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= diff --git a/receiver/awsxrayreceiver/internal/metadata/generated_status.go b/receiver/awsxrayreceiver/internal/metadata/generated_status.go index 12af796c7f9f..dfb257d0fee3 100644 --- a/receiver/awsxrayreceiver/internal/metadata/generated_status.go +++ b/receiver/awsxrayreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "awsxray" TracesStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/awsxrayreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/awsxrayreceiver") +} diff --git a/receiver/azureblobreceiver/generated_component_test.go b/receiver/azureblobreceiver/generated_component_test.go new file mode 100644 index 000000000000..7ad60d743860 --- /dev/null +++ b/receiver/azureblobreceiver/generated_component_test.go @@ -0,0 +1,96 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package azureblobreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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: "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) { + + // TODO support lifecycle + t.SkipNow() + + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + 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 9e98b72a9053..5181057c368c 100644 --- a/receiver/azureblobreceiver/go.mod +++ b/receiver/azureblobreceiver/go.mod @@ -4,14 +4,17 @@ go 1.20 require ( github.com/Azure/azure-event-hubs-go/v3 v3.6.1 - github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0 + github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.1 github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.91.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.91.0 + go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/otelcol v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -19,8 +22,8 @@ require ( contrib.go.opencensus.io/exporter/prometheus v0.4.2 // indirect github.com/Azure/azure-amqp-common-go/v4 v4.2.0 // indirect github.com/Azure/azure-sdk-for-go v65.0.0+incompatible // indirect - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.0 // 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/go-amqp v1.0.2 // indirect github.com/Azure/go-autorest v14.2.0+incompatible // indirect github.com/Azure/go-autorest/autorest v0.11.28 // indirect @@ -78,7 +81,6 @@ require ( go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector v0.91.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect - go.opentelemetry.io/collector/confmap v0.91.0 // indirect go.opentelemetry.io/collector/connector v0.91.0 // indirect go.opentelemetry.io/collector/exporter v0.91.0 // indirect go.opentelemetry.io/collector/extension v0.91.0 // indirect @@ -98,14 +100,12 @@ require ( go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.44.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/otel/sdk v1.21.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.15.0 // indirect - golang.org/x/net v0.18.0 // indirect + golang.org/x/crypto v0.17.0 // indirect + golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect gonum.org/v1/gonum v0.14.0 // indirect diff --git a/receiver/azureblobreceiver/go.sum b/receiver/azureblobreceiver/go.sum index 3a57203acec5..ff16d9236854 100644 --- a/receiver/azureblobreceiver/go.sum +++ b/receiver/azureblobreceiver/go.sum @@ -39,14 +39,14 @@ github.com/Azure/azure-event-hubs-go/v3 v3.6.1 h1:vSiMmn3tOwgiLyfnmhT5K6Of/3QWRL github.com/Azure/azure-event-hubs-go/v3 v3.6.1/go.mod h1:i2NByb9Pr2na7y8wi/XefEVKkuA2CDUjCNoWQJtTsGo= github.com/Azure/azure-sdk-for-go v65.0.0+incompatible h1:HzKLt3kIwMm4KeJYTdx9EbjRYTySD/t8i1Ee/W5EGXw= github.com/Azure/azure-sdk-for-go v65.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.0 h1:8q4SaHjFsClSvuVne0ID/5Ka8u3fcIHyqkLjcFpNRHQ= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.0/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/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/resourcemanager/storage/armstorage v1.2.0 h1:Ma67P/GGprNwsslzEH6+Kb8nybI8jpDTm4Wmzu2ReK8= -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/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.4.0 h1:BMAjVKJM0U/CYF27gA0ZMmXGkOcvfFtD0oHVZ1TIPRI= +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.5.0 h1:AifHbc4mg0x9zW52WOpKbsHaDKuRhlI7TVl47thgQ70= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.1 h1:AMf7YbZOZIW5b66cXNHMWWT/zkjhz5+a+k/3x40EO7E= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.1/go.mod h1:uwfk06ZBcvL/g4VHNjurPfVln9NMbsk2XIZxJ+hu81k= github.com/Azure/go-amqp v1.0.2 h1:zHCHId+kKC7fO8IkwyZJnWMvtRXhYC0VJtD0GYkHc6M= github.com/Azure/go-amqp v1.0.2/go.mod h1:vZAogwdrkbyK3Mla8m/CxSc/aKdnTZ4IbPxl51Y5WZE= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= @@ -71,7 +71,7 @@ github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+Z github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= -github.com/AzureAD/microsoft-authentication-library-for-go v1.0.0 h1:OBhqkivkhkMqLPymWEppkm7vgPQY2XsHoEkaMQ0AdZY= +github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 h1:WpB/QDNLpMw72xHJc34BNNykqSOeEJDAWkhf0u12/Jk= 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/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -138,6 +138,7 @@ github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzw github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -433,8 +434,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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= @@ -501,8 +502,8 @@ golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= -golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= diff --git a/receiver/azureblobreceiver/internal/metadata/generated_status.go b/receiver/azureblobreceiver/internal/metadata/generated_status.go index 9a777de7ac84..167e958fe000 100644 --- a/receiver/azureblobreceiver/internal/metadata/generated_status.go +++ b/receiver/azureblobreceiver/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -11,3 +13,11 @@ const ( LogsStability = component.StabilityLevelDevelopment TracesStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/azureblobreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/azureblobreceiver") +} diff --git a/receiver/azureblobreceiver/metadata.yaml b/receiver/azureblobreceiver/metadata.yaml index 3cf4f6c83017..d9cbacf8e7d8 100644 --- a/receiver/azureblobreceiver/metadata.yaml +++ b/receiver/azureblobreceiver/metadata.yaml @@ -7,3 +7,8 @@ status: distributions: [contrib] codeowners: active: [eedorenko, mx-psi] + +tests: + config: + connection_string: DefaultEndpointsProtocol=https;AccountName=accountName;AccountKey=+idLkHYcL0MUWIKYHm2j4Q==;EndpointSuffix=core.windows.net + skip_lifecycle: true diff --git a/receiver/azureeventhubreceiver/README.md b/receiver/azureeventhubreceiver/README.md index f2c056eae603..a8e1bfc21be6 100644 --- a/receiver/azureeventhubreceiver/README.md +++ b/receiver/azureeventhubreceiver/README.md @@ -95,10 +95,11 @@ and the OpenTelemetry attributes. | resultSignature (optional) | azure.result.signature (attribute) | | resultType (optional) | azure.result.type (attribute) | | tenantId (required, tenant logs) | azure.tenant.id (attribute) | -| time (required) | time_unix_nano (field) | +| time or timeStamp (required) | time_unix_nano (time takes precedence) | | identity (optional) | azure.identity (attribute, nested) | -Note: JSON does not distinguish between fixed and floating point numbers. All +Notes: +* JSON does not distinguish between fixed and floating point numbers. All JSON numbers are encoded as doubles. For Metrics the Azure Metric Records are an array diff --git a/receiver/azureeventhubreceiver/generated_component_test.go b/receiver/azureeventhubreceiver/generated_component_test.go new file mode 100644 index 000000000000..c2e9b00abbca --- /dev/null +++ b/receiver/azureeventhubreceiver/generated_component_test.go @@ -0,0 +1,96 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package azureeventhubreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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) { + + // TODO support lifecycle + t.SkipNow() + + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + 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 488a03b88566..908d26e96178 100644 --- a/receiver/azureeventhubreceiver/go.mod +++ b/receiver/azureeventhubreceiver/go.mod @@ -12,12 +12,15 @@ require ( github.com/relvacode/iso8601 v1.3.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.91.0 + go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/extension v0.91.0 go.opentelemetry.io/collector/otelcol v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -83,7 +86,6 @@ require ( go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector v0.91.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect - go.opentelemetry.io/collector/confmap v0.91.0 // indirect go.opentelemetry.io/collector/connector v0.91.0 // indirect go.opentelemetry.io/collector/exporter v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect @@ -101,14 +103,12 @@ require ( go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.44.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/otel/sdk v1.21.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.15.0 // indirect - golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect + golang.org/x/crypto v0.17.0 // indirect + golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/azureeventhubreceiver/go.sum b/receiver/azureeventhubreceiver/go.sum index cdfadcb6e37d..ed6ef4ca6947 100644 --- a/receiver/azureeventhubreceiver/go.sum +++ b/receiver/azureeventhubreceiver/go.sum @@ -429,8 +429,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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= @@ -441,8 +441,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= diff --git a/receiver/azureeventhubreceiver/internal/metadata/generated_status.go b/receiver/azureeventhubreceiver/internal/metadata/generated_status.go index 3d47cf2b77f5..a44b92d8eb82 100644 --- a/receiver/azureeventhubreceiver/internal/metadata/generated_status.go +++ b/receiver/azureeventhubreceiver/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -11,3 +13,11 @@ const ( MetricsStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/azureeventhubreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/azureeventhubreceiver") +} diff --git a/receiver/azureeventhubreceiver/metadata.yaml b/receiver/azureeventhubreceiver/metadata.yaml index ace512760f42..b090edac49f2 100644 --- a/receiver/azureeventhubreceiver/metadata.yaml +++ b/receiver/azureeventhubreceiver/metadata.yaml @@ -7,3 +7,7 @@ status: distributions: [contrib, splunk, observiq, sumo] codeowners: active: [atoulme, djaglowski] + +tests: + config: + skip_lifecycle: true diff --git a/receiver/azuremonitorreceiver/generated_component_test.go b/receiver/azuremonitorreceiver/generated_component_test.go new file mode 100644 index 000000000000..f4322abed4e0 --- /dev/null +++ b/receiver/azuremonitorreceiver/generated_component_test.go @@ -0,0 +1,89 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package azuremonitorreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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) { + + // TODO support lifecycle + t.SkipNow() + + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + 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/azuremonitorreceiver/go.mod b/receiver/azuremonitorreceiver/go.mod index c3dee665abb9..30bd3e66ce5a 100644 --- a/receiver/azuremonitorreceiver/go.mod +++ b/receiver/azuremonitorreceiver/go.mod @@ -16,6 +16,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -48,9 +50,7 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect - golang.org/x/crypto v0.16.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/azuremonitorreceiver/go.sum b/receiver/azuremonitorreceiver/go.sum index c741463eb4b7..f924b75ee8de 100644 --- a/receiver/azuremonitorreceiver/go.sum +++ b/receiver/azuremonitorreceiver/go.sum @@ -151,8 +151,8 @@ 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.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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= diff --git a/receiver/azuremonitorreceiver/internal/metadata/generated_status.go b/receiver/azuremonitorreceiver/internal/metadata/generated_status.go index 3f47a0f2905a..4e756b90dab0 100644 --- a/receiver/azuremonitorreceiver/internal/metadata/generated_status.go +++ b/receiver/azuremonitorreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "azuremonitor" MetricsStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/azuremonitorreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/azuremonitorreceiver") +} diff --git a/receiver/azuremonitorreceiver/metadata.yaml b/receiver/azuremonitorreceiver/metadata.yaml index f0f5c34bdde1..8da29a730f9f 100644 --- a/receiver/azuremonitorreceiver/metadata.yaml +++ b/receiver/azuremonitorreceiver/metadata.yaml @@ -15,3 +15,7 @@ resource_attributes: azuremonitor.subscription_id: description: Azure subscription ID type: string + +tests: + config: + skip_lifecycle: true diff --git a/receiver/bigipreceiver/generated_component_test.go b/receiver/bigipreceiver/generated_component_test.go new file mode 100644 index 000000000000..992e1c525507 --- /dev/null +++ b/receiver/bigipreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package bigipreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/bigipreceiver/go.mod b/receiver/bigipreceiver/go.mod index 0c21476e8a98..5d331614126a 100644 --- a/receiver/bigipreceiver/go.mod +++ b/receiver/bigipreceiver/go.mod @@ -16,6 +16,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -88,8 +90,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect diff --git a/receiver/bigipreceiver/internal/metadata/generated_status.go b/receiver/bigipreceiver/internal/metadata/generated_status.go index e7b235d117b4..7e3d39fee4d9 100644 --- a/receiver/bigipreceiver/internal/metadata/generated_status.go +++ b/receiver/bigipreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "bigip" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/bigipreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/bigipreceiver") +} diff --git a/receiver/bigipreceiver/metadata.yaml b/receiver/bigipreceiver/metadata.yaml index cdd9a0ec52ad..da040235361a 100644 --- a/receiver/bigipreceiver/metadata.yaml +++ b/receiver/bigipreceiver/metadata.yaml @@ -286,3 +286,6 @@ metrics: value_type: int attributes: [enabled.status] enabled: true + +tests: + config: diff --git a/receiver/carbonreceiver/config.go b/receiver/carbonreceiver/config.go index 673118a3a7bd..b60a9a0476c2 100644 --- a/receiver/carbonreceiver/config.go +++ b/receiver/carbonreceiver/config.go @@ -4,23 +4,16 @@ package carbonreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver" import ( - "fmt" + "errors" "time" + "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/confignet" - "go.opentelemetry.io/collector/confmap" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/protocol" ) -const ( - // parserConfigSection is the name that must be used for the parser settings - // in the configuration struct. The metadata mapstructure for the parser - // should use the same string. - parserConfigSection = "parser" -) - -var _ confmap.Unmarshaler = (*Config)(nil) +var _ component.ConfigValidator = (*Config)(nil) // Config defines configuration for the Carbon receiver. type Config struct { @@ -35,29 +28,9 @@ type Config struct { Parser *protocol.Config `mapstructure:"parser"` } -func (cfg *Config) Unmarshal(componentParser *confmap.Conf) error { - if componentParser == nil { - // The section is empty nothing to do, using the default config. - return nil +func (cfg *Config) Validate() error { + if cfg.TCPIdleTimeout < 0 { + return errors.New("'tcp_idle_timeout' must be non-negative") } - - // Unmarshal but not exact yet so the different keys under config do not - // trigger errors, this is needed so that the types of protocol and transport - // are read. - if err := componentParser.Unmarshal(cfg); err != nil { - return err - } - - // Unmarshal the protocol, so the type of config can be properly set. - vParserCfg, errSub := componentParser.Sub(parserConfigSection) - if errSub != nil { - return errSub - } - - if err := protocol.LoadParserConfig(vParserCfg, cfg.Parser); err != nil { - return fmt.Errorf("error on %q section: %w", parserConfigSection, err) - } - - // Unmarshal exact to validate the config keys. - return componentParser.Unmarshal(cfg, confmap.WithErrorUnused()) + return nil } diff --git a/receiver/carbonreceiver/config_test.go b/receiver/carbonreceiver/config_test.go index 2d906f6b5867..fa56a4535775 100644 --- a/receiver/carbonreceiver/config_test.go +++ b/receiver/carbonreceiver/config_test.go @@ -92,3 +92,18 @@ func TestLoadConfig(t *testing.T) { }) } } + +func TestConfigValidate(t *testing.T) { + cfg := &Config{ + NetAddr: confignet.NetAddr{ + Endpoint: "localhost:2003", + Transport: "tcp", + }, + TCPIdleTimeout: -1 * time.Second, + Parser: &protocol.Config{ + Type: "plaintext", + Config: &protocol.PlaintextConfig{}, + }, + } + assert.Error(t, cfg.Validate()) +} diff --git a/receiver/carbonreceiver/factory.go b/receiver/carbonreceiver/factory.go index 084b97cd990c..94e566d99931 100644 --- a/receiver/carbonreceiver/factory.go +++ b/receiver/carbonreceiver/factory.go @@ -5,6 +5,7 @@ package carbonreceiver // import "github.com/open-telemetry/opentelemetry-collec import ( "context" + "time" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/confignet" @@ -13,7 +14,11 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/internal/metadata" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/protocol" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/transport" +) + +const ( + // tcpIdleTimeoutDefault is the default timeout for idle TCP connections. + tcpIdleTimeoutDefault = 30 * time.Second ) // This file implements factory for Carbon receiver. @@ -32,7 +37,7 @@ func createDefaultConfig() component.Config { Endpoint: "localhost:2003", Transport: "tcp", }, - TCPIdleTimeout: transport.TCPIdleTimeoutDefault, + TCPIdleTimeout: tcpIdleTimeoutDefault, Parser: &protocol.Config{ Type: "plaintext", Config: &protocol.PlaintextConfig{}, diff --git a/receiver/carbonreceiver/generated_component_test.go b/receiver/carbonreceiver/generated_component_test.go new file mode 100644 index 000000000000..8f4969ed04ac --- /dev/null +++ b/receiver/carbonreceiver/generated_component_test.go @@ -0,0 +1,89 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package carbonreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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) { + + // TODO support lifecycle + t.SkipNow() + + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + 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 c2357438c5f1..0f1c47d9772c 100644 --- a/receiver/carbonreceiver/go.mod +++ b/receiver/carbonreceiver/go.mod @@ -5,7 +5,6 @@ go 1.20 require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.91.0 github.com/stretchr/testify v1.8.4 - go.opencensus.io v0.24.0 go.opentelemetry.io/collector v0.91.0 go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/config/confignet v0.91.0 @@ -13,7 +12,9 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 go.opentelemetry.io/otel/sdk v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -46,13 +47,12 @@ require ( github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/prometheus/statsd_exporter v0.22.7 // indirect + go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/receiver/carbonreceiver/transport/client/plaintext_client.go b/receiver/carbonreceiver/internal/client/plaintext_client.go similarity index 98% rename from receiver/carbonreceiver/transport/client/plaintext_client.go rename to receiver/carbonreceiver/internal/client/plaintext_client.go index 9afb3de4a82f..d40a3491b232 100644 --- a/receiver/carbonreceiver/transport/client/plaintext_client.go +++ b/receiver/carbonreceiver/internal/client/plaintext_client.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package client // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/transport/client" +package client // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/internal/client" import ( "fmt" diff --git a/receiver/carbonreceiver/internal/metadata/generated_status.go b/receiver/carbonreceiver/internal/metadata/generated_status.go index 6dbde87f829a..8fa4e933ad9c 100644 --- a/receiver/carbonreceiver/internal/metadata/generated_status.go +++ b/receiver/carbonreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "carbon" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/carbonreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/carbonreceiver") +} diff --git a/receiver/carbonreceiver/transport/server.go b/receiver/carbonreceiver/internal/transport/server.go similarity index 97% rename from receiver/carbonreceiver/transport/server.go rename to receiver/carbonreceiver/internal/transport/server.go index 126834967793..0b6ba5440db3 100644 --- a/receiver/carbonreceiver/transport/server.go +++ b/receiver/carbonreceiver/internal/transport/server.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package transport // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/transport" +package transport // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/internal/transport" import ( "context" diff --git a/receiver/carbonreceiver/transport/server_test.go b/receiver/carbonreceiver/internal/transport/server_test.go similarity index 79% rename from receiver/carbonreceiver/transport/server_test.go rename to receiver/carbonreceiver/internal/transport/server_test.go index f864e0555a3d..26b7c2ef8008 100644 --- a/receiver/carbonreceiver/transport/server_test.go +++ b/receiver/carbonreceiver/internal/transport/server_test.go @@ -4,6 +4,7 @@ package transport import ( + "context" "runtime" "sync" "testing" @@ -14,8 +15,8 @@ import ( "go.opentelemetry.io/collector/consumer/consumertest" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/testutil" + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/internal/client" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/protocol" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/transport/client" ) func Test_Server_ListenAndServe(t *testing.T) { @@ -52,7 +53,8 @@ func Test_Server_ListenAndServe(t *testing.T) { mc := new(consumertest.MetricsSink) p, err := (&protocol.PlaintextConfig{}).BuildParser() require.NoError(t, err) - mr := NewMockReporter(1) + mr := &mockReporter{} + mr.wgMetricsProcessed.Add(1) wgListenAndServe := sync.WaitGroup{} wgListenAndServe.Add(1) @@ -76,7 +78,7 @@ func Test_Server_ListenAndServe(t *testing.T) { err = gc.Disconnect() assert.NoError(t, err) - mr.WaitAllOnMetricsProcessedCalls() + mr.wgMetricsProcessed.Wait() // Keep trying until we're timed out or got a result assert.Eventually(t, func() bool { @@ -96,3 +98,21 @@ func Test_Server_ListenAndServe(t *testing.T) { }) } } + +// mockReporter provides a Reporter that provides some useful functionalities for +// tests (eg.: wait for certain number of messages). +type mockReporter struct { + wgMetricsProcessed sync.WaitGroup +} + +func (m *mockReporter) OnDataReceived(ctx context.Context) context.Context { + return ctx +} + +func (m *mockReporter) OnTranslationError(context.Context, error) {} + +func (m *mockReporter) OnMetricsProcessed(context.Context, int, error) { + m.wgMetricsProcessed.Done() +} + +func (m *mockReporter) OnDebugf(string, ...any) {} diff --git a/receiver/carbonreceiver/transport/tcp_server.go b/receiver/carbonreceiver/internal/transport/tcp_server.go similarity index 90% rename from receiver/carbonreceiver/transport/tcp_server.go rename to receiver/carbonreceiver/internal/transport/tcp_server.go index 04a4419cc523..66fb42ac6535 100644 --- a/receiver/carbonreceiver/transport/tcp_server.go +++ b/receiver/carbonreceiver/internal/transport/tcp_server.go @@ -1,31 +1,24 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package transport // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/transport" +package transport // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/internal/transport" import ( "bufio" "context" "errors" - "fmt" "io" "net" "strings" "sync" "time" - "go.opencensus.io/trace" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/pdata/pmetric" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/protocol" ) -const ( - // TCPIdleTimeoutDefault is the default timeout for idle TCP connections. - TCPIdleTimeoutDefault = 30 * time.Second -) - type tcpServer struct { ln net.Listener wg sync.WaitGroup @@ -40,14 +33,6 @@ func NewTCPServer( addr string, idleTimeout time.Duration, ) (Server, error) { - if idleTimeout < 0 { - return nil, fmt.Errorf("invalid idle timeout: %v", idleTimeout) - } - - if idleTimeout == 0 { - idleTimeout = TCPIdleTimeoutDefault - } - ln, err := net.Listen("tcp", addr) if err != nil { return nil, err @@ -134,16 +119,10 @@ func (t *tcpServer) handleConnection( conn net.Conn, ) { defer conn.Close() - var span *trace.Span reader := bufio.NewReader(conn) reporterActive := false var ctx context.Context for { - if span != nil { - span.End() - span = nil - } - if err := conn.SetDeadline(time.Now().Add(t.idleTimeout)); err != nil { t.reporter.OnDebugf( "TCP Transport (%s) - conn.SetDeadLine error: %v", @@ -188,7 +167,6 @@ func (t *tcpServer) handleConnection( // Since this is a TCP connection it seems reasonable to close the // connection as a way to report "error" back to client and minimize // the effect of a client constantly submitting bad data. - span.End() return } } @@ -201,7 +179,6 @@ func (t *tcpServer) handleConnection( if reporterActive { t.reporter.OnMetricsProcessed(ctx, 0, err) } - span.End() return } } @@ -215,7 +192,6 @@ func (t *tcpServer) handleConnection( if reporterActive { t.reporter.OnMetricsProcessed(ctx, 0, err) } - span.End() return } } diff --git a/receiver/carbonreceiver/transport/udp_server.go b/receiver/carbonreceiver/internal/transport/udp_server.go similarity index 97% rename from receiver/carbonreceiver/transport/udp_server.go rename to receiver/carbonreceiver/internal/transport/udp_server.go index fc58b1b1c659..0f1679e617a3 100644 --- a/receiver/carbonreceiver/transport/udp_server.go +++ b/receiver/carbonreceiver/internal/transport/udp_server.go @@ -1,7 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 -package transport // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/transport" +package transport // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/internal/transport" import ( "bytes" diff --git a/receiver/carbonreceiver/metadata.yaml b/receiver/carbonreceiver/metadata.yaml index bbf85c50df99..194e14c46e45 100644 --- a/receiver/carbonreceiver/metadata.yaml +++ b/receiver/carbonreceiver/metadata.yaml @@ -8,3 +8,6 @@ status: codeowners: active: [aboguszewski-sumo] +tests: + config: + skip_lifecycle: true diff --git a/receiver/carbonreceiver/protocol/config.go b/receiver/carbonreceiver/protocol/config.go index 01be0b2338d2..08d576287c9c 100644 --- a/receiver/carbonreceiver/protocol/config.go +++ b/receiver/carbonreceiver/protocol/config.go @@ -35,12 +35,7 @@ func init() { }) } -const ( - // configSection is the name that must be used for the config settings - // in the configuration struct. The metadata mapstructure for the parser - // should use the same string. - configSection = "config" -) +var _ confmap.Unmarshaler = (*Config)(nil) // Config is the general configuration for the parser to be used. type Config struct { @@ -57,10 +52,14 @@ type ParserConfig interface { BuildParser() (Parser, error) } -// LoadParserConfig is used to load the parser configuration according to the -// specified parser type. It expects the passed viper to be pointing at the level -// of the Config reference. -func LoadParserConfig(cp *confmap.Conf, cfg *Config) error { +// Unmarshal is used to load the parser configuration according to the +// specified parser type. +func (cfg *Config) Unmarshal(cp *confmap.Conf) error { + // If type is configured then use that, otherwise use default. + if configuredType, ok := cp.Get("type").(string); ok { + cfg.Type = configuredType + } + defaultCfgFn, ok := parserMap[cfg.Type] if !ok { return fmt.Errorf( @@ -71,10 +70,5 @@ func LoadParserConfig(cp *confmap.Conf, cfg *Config) error { cfg.Config = defaultCfgFn() - vParserCfg, errSub := cp.Sub(configSection) - if errSub != nil { - return errSub - } - - return vParserCfg.Unmarshal(cfg.Config, confmap.WithErrorUnused()) + return cp.Unmarshal(cfg, confmap.WithErrorUnused()) } diff --git a/receiver/carbonreceiver/protocol/config_test.go b/receiver/carbonreceiver/protocol/config_test.go index 9cc9e12f3913..587365b151d7 100644 --- a/receiver/carbonreceiver/protocol/config_test.go +++ b/receiver/carbonreceiver/protocol/config_test.go @@ -14,14 +14,12 @@ func TestLoadParserConfig(t *testing.T) { tests := []struct { name string cfgMap map[string]any - cfg Config want Config wantErr bool }{ { name: "unknow_type", - cfgMap: map[string]any{"type": "unknow"}, - cfg: Config{Type: "unknown"}, + cfgMap: map[string]any{"type": "unknown"}, want: Config{Type: "unknown"}, wantErr: true, }, @@ -35,7 +33,6 @@ func TestLoadParserConfig(t *testing.T) { "rules": []any{map[string]any{"regexp": "(?.*test)"}}, }, }, - cfg: Config{Type: "regex"}, want: Config{ Type: "regex", Config: &RegexParserConfig{ @@ -47,19 +44,26 @@ func TestLoadParserConfig(t *testing.T) { { name: "default_regex", cfgMap: map[string]any{"type": "regex"}, - cfg: Config{Type: "regex"}, want: Config{ Type: "regex", Config: &RegexParserConfig{}, }, }, + { + name: "plaintext", + cfgMap: map[string]any{"type": "plaintext"}, + want: Config{ + Type: "plaintext", + Config: &PlaintextConfig{}, + }, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { v := confmap.NewFromStringMap(tt.cfgMap) - got := tt.cfg // Not strictly necessary but it makes easier to debug issues. - err := LoadParserConfig(v, &got) + got := Config{} + err := got.Unmarshal(v) assert.Equal(t, tt.want, got) assert.Equal(t, tt.wantErr, err != nil) }) diff --git a/receiver/carbonreceiver/receiver.go b/receiver/carbonreceiver/receiver.go index 666a8aeeadd1..c66891719eab 100644 --- a/receiver/carbonreceiver/receiver.go +++ b/receiver/carbonreceiver/receiver.go @@ -13,8 +13,8 @@ import ( "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/receiver" + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/internal/transport" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/protocol" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/transport" ) var ( diff --git a/receiver/carbonreceiver/receiver_test.go b/receiver/carbonreceiver/receiver_test.go index c355fb9e2588..7e1e2ff3dd7d 100644 --- a/receiver/carbonreceiver/receiver_test.go +++ b/receiver/carbonreceiver/receiver_test.go @@ -22,8 +22,8 @@ import ( "go.opentelemetry.io/otel/sdk/trace/tracetest" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/testutil" + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/internal/client" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/protocol" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/transport/client" ) func Test_carbonreceiver_New(t *testing.T) { @@ -136,24 +136,6 @@ func Test_carbonreceiver_Start(t *testing.T) { }, wantErr: errors.New("unsupported transport \"unknown_transp\""), }, - { - name: "negative_tcp_idle_timeout", - args: args{ - config: Config{ - NetAddr: confignet.NetAddr{ - Endpoint: "localhost:2003", - Transport: "tcp", - }, - TCPIdleTimeout: -1 * time.Second, - Parser: &protocol.Config{ - Type: "plaintext", - Config: &protocol.PlaintextConfig{}, - }, - }, - nextConsumer: consumertest.NewNop(), - }, - wantErr: errors.New("invalid idle timeout: -1s"), - }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/receiver/carbonreceiver/reporter.go b/receiver/carbonreceiver/reporter.go index 2f61e2ab64c3..e41ba919d37d 100644 --- a/receiver/carbonreceiver/reporter.go +++ b/receiver/carbonreceiver/reporter.go @@ -6,12 +6,12 @@ package carbonreceiver // import "github.com/open-telemetry/opentelemetry-collec import ( "context" - "go.opencensus.io/trace" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receiverhelper" + "go.opentelemetry.io/otel/trace" "go.uber.org/zap" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/transport" + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/internal/transport" ) // reporter struct implements the transport.Reporter interface to give consistent @@ -59,13 +59,7 @@ func (r *reporter) OnTranslationError(ctx context.Context, err error) { r.logger.Debug("Carbon translation error", zap.Error(err)) - // Using annotations since multiple translation errors can happen in the - // same client message/request. The time itself is not relevant. - span := trace.FromContext(ctx) - span.Annotate([]trace.Attribute{ - trace.StringAttribute("error", err.Error())}, - "translation", - ) + trace.SpanFromContext(ctx).RecordError(err) } // OnMetricsProcessed is called when the received data is passed to next @@ -82,12 +76,6 @@ func (r *reporter) OnMetricsProcessed( "Carbon receiver failed to push metrics into pipeline", zap.Int("numReceivedMetricPoints", numReceivedMetricPoints), zap.Error(err)) - - span := trace.FromContext(ctx) - span.SetStatus(trace.Status{ - Code: trace.StatusCodeUnknown, - Message: err.Error(), - }) } r.obsrecv.EndMetricsOp(ctx, "carbon", numReceivedMetricPoints, err) diff --git a/receiver/carbonreceiver/transport/mock_reporter.go b/receiver/carbonreceiver/transport/mock_reporter.go deleted file mode 100644 index 4c59251e87fd..000000000000 --- a/receiver/carbonreceiver/transport/mock_reporter.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package transport // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/transport" - -import ( - "context" - "sync" -) - -// MockReporter provides a Reporter that provides some useful functionalities for -// tests (eg.: wait for certain number of messages). -type MockReporter struct { - wgMetricsProcessed sync.WaitGroup -} - -var _ Reporter = (*MockReporter)(nil) - -// NewMockReporter returns a new instance of a MockReporter. -func NewMockReporter(expectedOnMetricsProcessedCalls int) *MockReporter { - m := MockReporter{} - m.wgMetricsProcessed.Add(expectedOnMetricsProcessedCalls) - return &m -} - -func (m *MockReporter) OnDataReceived(ctx context.Context) context.Context { - return ctx -} - -func (m *MockReporter) OnTranslationError(_ context.Context, _ error) { -} - -func (m *MockReporter) OnMetricsProcessed(_ context.Context, _ int, _ error) { - m.wgMetricsProcessed.Done() -} - -func (m *MockReporter) OnDebugf(_ string, _ ...any) { -} - -// WaitAllOnMetricsProcessedCalls blocks until the number of expected calls -// specified at creation of the reporter is completed. -func (m *MockReporter) WaitAllOnMetricsProcessedCalls() { - m.wgMetricsProcessed.Wait() -} diff --git a/receiver/chronyreceiver/go.mod b/receiver/chronyreceiver/go.mod index ae07966b9aa3..59d99b975efe 100644 --- a/receiver/chronyreceiver/go.mod +++ b/receiver/chronyreceiver/go.mod @@ -12,6 +12,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -38,8 +40,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/chronyreceiver/internal/metadata/generated_status.go b/receiver/chronyreceiver/internal/metadata/generated_status.go index 4426039439b8..7a6939b6ca85 100644 --- a/receiver/chronyreceiver/internal/metadata/generated_status.go +++ b/receiver/chronyreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "chrony" MetricsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/chronyreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/chronyreceiver") +} diff --git a/receiver/cloudflarereceiver/generated_component_test.go b/receiver/cloudflarereceiver/generated_component_test.go new file mode 100644 index 000000000000..bacd62b90290 --- /dev/null +++ b/receiver/cloudflarereceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package cloudflarereceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/cloudflarereceiver/go.mod b/receiver/cloudflarereceiver/go.mod index 5e123edf7465..5d7f7459c39b 100644 --- a/receiver/cloudflarereceiver/go.mod +++ b/receiver/cloudflarereceiver/go.mod @@ -13,6 +13,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -39,8 +41,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/cloudflarereceiver/internal/metadata/generated_status.go b/receiver/cloudflarereceiver/internal/metadata/generated_status.go index 551aa5d9439f..83893156d838 100644 --- a/receiver/cloudflarereceiver/internal/metadata/generated_status.go +++ b/receiver/cloudflarereceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "cloudflare" LogsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/cloudflarereceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/cloudflarereceiver") +} diff --git a/receiver/cloudflarereceiver/logs.go b/receiver/cloudflarereceiver/logs.go index ad4256f57b9e..bcf53d824f76 100644 --- a/receiver/cloudflarereceiver/logs.go +++ b/receiver/cloudflarereceiver/logs.go @@ -8,6 +8,7 @@ import ( "compress/gzip" "context" "encoding/json" + "errors" "fmt" "io" "net" @@ -27,12 +28,13 @@ import ( ) type logsReceiver struct { - logger *zap.Logger - cfg *LogsConfig - server *http.Server - consumer consumer.Logs - wg *sync.WaitGroup - id component.ID // ID of the receiver component + logger *zap.Logger + cfg *LogsConfig + server *http.Server + consumer consumer.Logs + wg *sync.WaitGroup + id component.ID // ID of the receiver component + telemetrySettings component.TelemetrySettings } const secretHeaderName = "X-CF-Secret" @@ -40,11 +42,12 @@ const receiverScopeName = "otelcol/" + metadata.Type func newLogsReceiver(params rcvr.CreateSettings, cfg *Config, consumer consumer.Logs) (*logsReceiver, error) { recv := &logsReceiver{ - cfg: &cfg.Logs, - consumer: consumer, - logger: params.Logger, - wg: &sync.WaitGroup{}, - id: params.ID, + cfg: &cfg.Logs, + consumer: consumer, + logger: params.Logger, + wg: &sync.WaitGroup{}, + telemetrySettings: params.TelemetrySettings, + id: params.ID, } recv.server = &http.Server{ @@ -80,7 +83,7 @@ func (l *logsReceiver) Shutdown(ctx context.Context) error { return nil } -func (l *logsReceiver) startListening(ctx context.Context, host component.Host) error { +func (l *logsReceiver) startListening(ctx context.Context, _ component.Host) error { l.logger.Debug("starting receiver HTTP server") // We use l.server.Serve* over l.server.ListenAndServe* // So that we can catch and return errors relating to binding to network interface on start. @@ -105,9 +108,9 @@ func (l *logsReceiver) startListening(ctx context.Context, host component.Host) l.logger.Debug("ServeTLS done") - if err != http.ErrServerClosed { + if !errors.Is(err, http.ErrServerClosed) { l.logger.Error("ServeTLS failed", zap.Error(err)) - host.ReportFatalError(err) + _ = l.telemetrySettings.ReportComponentStatus(component.NewFatalErrorEvent(err)) } } else { @@ -118,9 +121,9 @@ func (l *logsReceiver) startListening(ctx context.Context, host component.Host) l.logger.Debug("Serve done") - if err != http.ErrServerClosed { + if !errors.Is(err, http.ErrServerClosed) { l.logger.Error("Serve failed", zap.Error(err)) - host.ReportFatalError(err) + _ = l.telemetrySettings.ReportComponentStatus(component.NewFatalErrorEvent(err)) } } diff --git a/receiver/cloudflarereceiver/metadata.yaml b/receiver/cloudflarereceiver/metadata.yaml index 031aae49d673..2742bce9107d 100644 --- a/receiver/cloudflarereceiver/metadata.yaml +++ b/receiver/cloudflarereceiver/metadata.yaml @@ -7,3 +7,6 @@ status: distributions: [contrib, observiq, sumo] codeowners: active: [dehaansa, djaglowski] + +tests: + config: diff --git a/receiver/cloudfoundryreceiver/generated_component_test.go b/receiver/cloudfoundryreceiver/generated_component_test.go new file mode 100644 index 000000000000..21cc8bd2f5ac --- /dev/null +++ b/receiver/cloudfoundryreceiver/generated_component_test.go @@ -0,0 +1,89 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package cloudfoundryreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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) { + + // TODO support lifecycle + t.SkipNow() + + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + 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 8d3ab9edaa1f..9729cf691a1d 100644 --- a/receiver/cloudfoundryreceiver/go.mod +++ b/receiver/cloudfoundryreceiver/go.mod @@ -14,6 +14,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -54,8 +56,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/receiver/cloudfoundryreceiver/internal/metadata/generated_status.go b/receiver/cloudfoundryreceiver/internal/metadata/generated_status.go index c9b0886f4d11..fd69ff02cda3 100644 --- a/receiver/cloudfoundryreceiver/internal/metadata/generated_status.go +++ b/receiver/cloudfoundryreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "cloudfoundry" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/cloudfoundryreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/cloudfoundryreceiver") +} diff --git a/receiver/cloudfoundryreceiver/metadata.yaml b/receiver/cloudfoundryreceiver/metadata.yaml index f1397246fc35..4992884ee6b5 100644 --- a/receiver/cloudfoundryreceiver/metadata.yaml +++ b/receiver/cloudfoundryreceiver/metadata.yaml @@ -7,3 +7,7 @@ status: distributions: [contrib, splunk, observiq, sumo] codeowners: active: [agoallikmaa, pellared, crobert-1] + +tests: + config: + skip_lifecycle: true diff --git a/receiver/collectdreceiver/generated_component_test.go b/receiver/collectdreceiver/generated_component_test.go new file mode 100644 index 000000000000..ad451c0bf1c6 --- /dev/null +++ b/receiver/collectdreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package collectdreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/collectdreceiver/go.mod b/receiver/collectdreceiver/go.mod index 92e6c52ce391..c212a91ba2cd 100644 --- a/receiver/collectdreceiver/go.mod +++ b/receiver/collectdreceiver/go.mod @@ -14,6 +14,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -54,8 +56,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/receiver/collectdreceiver/internal/metadata/generated_status.go b/receiver/collectdreceiver/internal/metadata/generated_status.go index 80ff48023625..9fa9bd1a1cfd 100644 --- a/receiver/collectdreceiver/internal/metadata/generated_status.go +++ b/receiver/collectdreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "collectd" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/collectdreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/collectdreceiver") +} diff --git a/receiver/collectdreceiver/metadata.yaml b/receiver/collectdreceiver/metadata.yaml index 04e7fb48825c..3796acd9422a 100644 --- a/receiver/collectdreceiver/metadata.yaml +++ b/receiver/collectdreceiver/metadata.yaml @@ -7,3 +7,6 @@ status: distributions: [contrib, splunk, observiq, sumo] codeowners: active: [atoulme] + +tests: + config: diff --git a/receiver/couchdbreceiver/generated_component_test.go b/receiver/couchdbreceiver/generated_component_test.go new file mode 100644 index 000000000000..723d9eefb86b --- /dev/null +++ b/receiver/couchdbreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package couchdbreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/couchdbreceiver/go.mod b/receiver/couchdbreceiver/go.mod index aab30beca41b..b18769b0767b 100644 --- a/receiver/couchdbreceiver/go.mod +++ b/receiver/couchdbreceiver/go.mod @@ -15,6 +15,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -55,8 +57,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/couchdbreceiver/internal/metadata/generated_status.go b/receiver/couchdbreceiver/internal/metadata/generated_status.go index 044ad40ad22e..3324981bbbe9 100644 --- a/receiver/couchdbreceiver/internal/metadata/generated_status.go +++ b/receiver/couchdbreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "couchdb" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/couchdbreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/couchdbreceiver") +} diff --git a/receiver/couchdbreceiver/metadata.yaml b/receiver/couchdbreceiver/metadata.yaml index 8e632765db37..06c5b700544b 100644 --- a/receiver/couchdbreceiver/metadata.yaml +++ b/receiver/couchdbreceiver/metadata.yaml @@ -98,3 +98,5 @@ metrics: monotonic: true aggregation_temporality: cumulative attributes: [ operation ] +tests: + config: \ No newline at end of file diff --git a/receiver/datadogreceiver/go.mod b/receiver/datadogreceiver/go.mod index b8c04e438dcf..f785772e1743 100644 --- a/receiver/datadogreceiver/go.mod +++ b/receiver/datadogreceiver/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/datado go 1.20 require ( - github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7 + github.com/DataDog/datadog-agent/pkg/proto v0.50.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.91.0 github.com/stretchr/testify v1.8.4 github.com/vmihailenco/msgpack/v4 v4.3.13 @@ -13,6 +13,8 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 google.golang.org/protobuf v1.31.0 ) @@ -56,8 +58,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/receiver/datadogreceiver/go.sum b/receiver/datadogreceiver/go.sum index 1c535c54745c..df90cce77f37 100644 --- a/receiver/datadogreceiver/go.sum +++ b/receiver/datadogreceiver/go.sum @@ -1,8 +1,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= contrib.go.opencensus.io/exporter/prometheus v0.4.2 h1:sqfsYl5GIY/L570iT+l93ehxaWJs2/OwXtiWwew3oAg= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7 h1:qJuxmeIiXZNML5/Y9KEf7QKEKKIeliiTIxgRGvGAQBc= -github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7/go.mod h1:HvK26YCxg6MfYvPJgpHC7nSjw6DTpNhd75Wlb0GAvis= +github.com/DataDog/datadog-agent/pkg/proto v0.50.0 h1:FAzs/Hofs9CN7jYYd2P4l8/igdcDPc7q9amIXSje/3A= +github.com/DataDog/datadog-agent/pkg/proto v0.50.0/go.mod h1:HvK26YCxg6MfYvPJgpHC7nSjw6DTpNhd75Wlb0GAvis= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= diff --git a/receiver/datadogreceiver/internal/metadata/generated_status.go b/receiver/datadogreceiver/internal/metadata/generated_status.go index bef0e6fe969e..a1e7e3ce0d44 100644 --- a/receiver/datadogreceiver/internal/metadata/generated_status.go +++ b/receiver/datadogreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "datadog" TracesStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/datadogreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/datadogreceiver") +} diff --git a/receiver/dockerstatsreceiver/go.mod b/receiver/dockerstatsreceiver/go.mod index 63478954d268..6be549798e50 100644 --- a/receiver/dockerstatsreceiver/go.mod +++ b/receiver/dockerstatsreceiver/go.mod @@ -17,6 +17,8 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -74,8 +76,6 @@ require ( go.opentelemetry.io/collector v0.91.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/receiver/dockerstatsreceiver/internal/metadata/generated_status.go b/receiver/dockerstatsreceiver/internal/metadata/generated_status.go index e6c42c0b3a41..1081bd85d0cb 100644 --- a/receiver/dockerstatsreceiver/internal/metadata/generated_status.go +++ b/receiver/dockerstatsreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "docker_stats" MetricsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/dockerstatsreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/dockerstatsreceiver") +} diff --git a/receiver/elasticsearchreceiver/go.mod b/receiver/elasticsearchreceiver/go.mod index 283b33938217..10e12ff51e2b 100644 --- a/receiver/elasticsearchreceiver/go.mod +++ b/receiver/elasticsearchreceiver/go.mod @@ -19,6 +19,8 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -88,8 +90,6 @@ require ( go.opentelemetry.io/collector/extension/auth v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect diff --git a/receiver/elasticsearchreceiver/internal/metadata/generated_status.go b/receiver/elasticsearchreceiver/internal/metadata/generated_status.go index 1e75fc8444fd..19508d0618a7 100644 --- a/receiver/elasticsearchreceiver/internal/metadata/generated_status.go +++ b/receiver/elasticsearchreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "elasticsearch" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/elasticsearchreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/elasticsearchreceiver") +} diff --git a/receiver/expvarreceiver/generated_component_test.go b/receiver/expvarreceiver/generated_component_test.go new file mode 100644 index 000000000000..e553119615de --- /dev/null +++ b/receiver/expvarreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package expvarreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/expvarreceiver/go.mod b/receiver/expvarreceiver/go.mod index 91c4b3b70ff2..3a29d1737712 100644 --- a/receiver/expvarreceiver/go.mod +++ b/receiver/expvarreceiver/go.mod @@ -13,6 +13,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -53,8 +55,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/receiver/expvarreceiver/internal/metadata/generated_status.go b/receiver/expvarreceiver/internal/metadata/generated_status.go index 82ab4ddd3281..3a161a54892c 100644 --- a/receiver/expvarreceiver/internal/metadata/generated_status.go +++ b/receiver/expvarreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "expvar" MetricsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/expvarreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/expvarreceiver") +} diff --git a/receiver/expvarreceiver/metadata.yaml b/receiver/expvarreceiver/metadata.yaml index 7fad22e4fcd6..d45631c63959 100644 --- a/receiver/expvarreceiver/metadata.yaml +++ b/receiver/expvarreceiver/metadata.yaml @@ -264,3 +264,5 @@ metrics: unit: 1 gauge: value_type: double +tests: + config: \ No newline at end of file diff --git a/receiver/filelogreceiver/go.mod b/receiver/filelogreceiver/go.mod index 1f96c4428114..b4af51bbcf07 100644 --- a/receiver/filelogreceiver/go.mod +++ b/receiver/filelogreceiver/go.mod @@ -13,6 +13,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -43,8 +45,6 @@ require ( go.opentelemetry.io/collector/extension v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/receiver/filelogreceiver/internal/metadata/generated_status.go b/receiver/filelogreceiver/internal/metadata/generated_status.go index e5af859f475c..af0ec1daee9b 100644 --- a/receiver/filelogreceiver/internal/metadata/generated_status.go +++ b/receiver/filelogreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "filelog" LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/filelogreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/filelogreceiver") +} diff --git a/receiver/filereceiver/go.mod b/receiver/filereceiver/go.mod index ea264d11eebf..2f0a5bb409c7 100644 --- a/receiver/filereceiver/go.mod +++ b/receiver/filereceiver/go.mod @@ -9,6 +9,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -30,8 +32,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/receiver/filereceiver/internal/metadata/generated_status.go b/receiver/filereceiver/internal/metadata/generated_status.go index 0078298d283c..52d9e4b70db5 100644 --- a/receiver/filereceiver/internal/metadata/generated_status.go +++ b/receiver/filereceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "file" MetricsStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/filereceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/filereceiver") +} diff --git a/receiver/filestatsreceiver/generated_component_test.go b/receiver/filestatsreceiver/generated_component_test.go new file mode 100644 index 000000000000..78762f052969 --- /dev/null +++ b/receiver/filestatsreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package filestatsreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/filestatsreceiver/go.mod b/receiver/filestatsreceiver/go.mod index fde4ca591931..b77cdf4603ea 100644 --- a/receiver/filestatsreceiver/go.mod +++ b/receiver/filestatsreceiver/go.mod @@ -11,6 +11,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -35,8 +37,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/filestatsreceiver/internal/metadata/generated_status.go b/receiver/filestatsreceiver/internal/metadata/generated_status.go index fb070282000e..fe2affc5b847 100644 --- a/receiver/filestatsreceiver/internal/metadata/generated_status.go +++ b/receiver/filestatsreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "filestats" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/filestatsreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/filestatsreceiver") +} diff --git a/receiver/filestatsreceiver/metadata.yaml b/receiver/filestatsreceiver/metadata.yaml index 7a83877f625f..1ad23d35a17c 100644 --- a/receiver/filestatsreceiver/metadata.yaml +++ b/receiver/filestatsreceiver/metadata.yaml @@ -57,3 +57,5 @@ metrics: gauge: value_type: int unit: "b" +tests: + config: \ No newline at end of file diff --git a/receiver/flinkmetricsreceiver/generated_component_test.go b/receiver/flinkmetricsreceiver/generated_component_test.go new file mode 100644 index 000000000000..e8e6bdbb2e89 --- /dev/null +++ b/receiver/flinkmetricsreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package flinkmetricsreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/flinkmetricsreceiver/go.mod b/receiver/flinkmetricsreceiver/go.mod index 5ae6450ef221..4b40f9cbff13 100644 --- a/receiver/flinkmetricsreceiver/go.mod +++ b/receiver/flinkmetricsreceiver/go.mod @@ -16,6 +16,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -87,8 +89,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect golang.org/x/mod v0.14.0 // indirect diff --git a/receiver/flinkmetricsreceiver/internal/metadata/generated_status.go b/receiver/flinkmetricsreceiver/internal/metadata/generated_status.go index 309aacce367b..c7c54c576fa5 100644 --- a/receiver/flinkmetricsreceiver/internal/metadata/generated_status.go +++ b/receiver/flinkmetricsreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "flinkmetrics" MetricsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/flinkmetricsreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/flinkmetricsreceiver") +} diff --git a/receiver/flinkmetricsreceiver/metadata.yaml b/receiver/flinkmetricsreceiver/metadata.yaml index 116f8481abc6..8454dc23fabd 100644 --- a/receiver/flinkmetricsreceiver/metadata.yaml +++ b/receiver/flinkmetricsreceiver/metadata.yaml @@ -342,3 +342,5 @@ metrics: value_type: int input_type: string attributes: [ operator_name ] +tests: + config: \ No newline at end of file diff --git a/receiver/fluentforwardreceiver/generated_component_test.go b/receiver/fluentforwardreceiver/generated_component_test.go new file mode 100644 index 000000000000..dfc243a9fab9 --- /dev/null +++ b/receiver/fluentforwardreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package fluentforwardreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/fluentforwardreceiver/go.mod b/receiver/fluentforwardreceiver/go.mod index 2b70c4b2ffaa..75c46ee66498 100644 --- a/receiver/fluentforwardreceiver/go.mod +++ b/receiver/fluentforwardreceiver/go.mod @@ -12,6 +12,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -37,8 +39,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/receiver/fluentforwardreceiver/internal/metadata/generated_status.go b/receiver/fluentforwardreceiver/internal/metadata/generated_status.go index 631e60f7a36e..af9b652c005f 100644 --- a/receiver/fluentforwardreceiver/internal/metadata/generated_status.go +++ b/receiver/fluentforwardreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "fluentforward" LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/fluentforwardreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/fluentforwardreceiver") +} diff --git a/receiver/fluentforwardreceiver/metadata.yaml b/receiver/fluentforwardreceiver/metadata.yaml index 6b55ad731e7e..b4a4c708d38a 100644 --- a/receiver/fluentforwardreceiver/metadata.yaml +++ b/receiver/fluentforwardreceiver/metadata.yaml @@ -7,3 +7,5 @@ status: distributions: [contrib, splunk, observiq, sumo] codeowners: active: [dmitryax] +tests: + config: \ No newline at end of file diff --git a/receiver/gitproviderreceiver/go.mod b/receiver/gitproviderreceiver/go.mod index 3305a44c7e3d..1bd7b7d81f92 100644 --- a/receiver/gitproviderreceiver/go.mod +++ b/receiver/gitproviderreceiver/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/Khan/genqlient v0.6.0 github.com/google/go-cmp v0.6.0 - github.com/google/go-github/v53 v53.2.0 + github.com/google/go-github/v57 v57.0.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/config/confighttp v0.91.0 @@ -15,16 +15,16 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) require ( contrib.go.opencensus.io/exporter/prometheus v0.4.2 // indirect - github.com/ProtonMail/go-crypto v0.0.0-20230923063757-afb1ddc0824c // 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/cloudflare/circl v1.3.6 // 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 @@ -98,19 +98,14 @@ require ( go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.44.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/otel/sdk v1.21.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.16.0 // indirect golang.org/x/net v0.19.0 // indirect - golang.org/x/oauth2 v0.14.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect gonum.org/v1/gonum v0.14.0 // indirect - google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect google.golang.org/grpc v1.59.0 // indirect diff --git a/receiver/gitproviderreceiver/go.sum b/receiver/gitproviderreceiver/go.sum index fd46ce5e6a72..ddc5bfac76c1 100644 --- a/receiver/gitproviderreceiver/go.sum +++ b/receiver/gitproviderreceiver/go.sum @@ -37,8 +37,6 @@ 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/Khan/genqlient v0.6.0 h1:Bwb1170ekuNIVIwTJEqvO8y7RxBxXu639VJOkKSrwAk= github.com/Khan/genqlient v0.6.0/go.mod h1:rvChwWVTqXhiapdhLDV4bp9tz/Xvtewwkon4DpWWCRM= -github.com/ProtonMail/go-crypto v0.0.0-20230923063757-afb1ddc0824c h1:kMFnB0vCcX7IL/m9Y5LO+KQYv+t1CQOiFe6+SV2J7bE= -github.com/ProtonMail/go-crypto v0.0.0-20230923063757-afb1ddc0824c/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -50,7 +48,6 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= 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/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= 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= @@ -62,9 +59,6 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= -github.com/cloudflare/circl v1.3.6 h1:/xbKIqSHbZXHwkhbrhrt2YOHIwYJlXH94E3tI/gDlUg= -github.com/cloudflare/circl v1.3.6/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -154,8 +148,8 @@ github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN 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/google/go-github/v53 v53.2.0 h1:wvz3FyF53v4BK+AsnvCmeNhf8AkTaeh2SoYu/XUvTtI= -github.com/google/go-github/v53 v53.2.0/go.mod h1:XhFRObz+m/l+UCm9b7KSIC3lT3NWSXGt7mOsAWEloao= +github.com/google/go-github/v57 v57.0.0 h1:L+Y3UPTY8ALM8x+TV0lg+IEBI+upibemtBD8Q9u7zHs= +github.com/google/go-github/v57 v57.0.0/go.mod h1:s0omdnye0hvK/ecLvpsGfJMiRt85PimQh4oygmLIxHw= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -314,7 +308,6 @@ github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/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= github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -419,11 +412,6 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 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.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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= @@ -455,8 +443,6 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 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/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -487,14 +473,9 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 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-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -504,8 +485,6 @@ golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= -golang.org/x/oauth2 v0.14.0 h1:P0Vrf/2538nmC0H+pEQ3MNFRRnVR7RlqyVw+bvm26z0= -golang.org/x/oauth2 v0.14.0/go.mod h1:lAtNWgaWfL4cm7j2OV8TxGi9Qb7ECORx8DktCY74OwM= 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-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -517,8 +496,6 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/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.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -562,20 +539,12 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/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-20220708085239-5a0f0661e09d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -583,10 +552,6 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 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.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -634,8 +599,6 @@ golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= 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/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= 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= @@ -664,8 +627,6 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -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-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= diff --git a/receiver/gitproviderreceiver/internal/metadata/generated_status.go b/receiver/gitproviderreceiver/internal/metadata/generated_status.go index b3ad9b8e840c..7418c60fae43 100644 --- a/receiver/gitproviderreceiver/internal/metadata/generated_status.go +++ b/receiver/gitproviderreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "gitprovider" MetricsStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/gitproviderreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/gitproviderreceiver") +} diff --git a/receiver/gitproviderreceiver/internal/scraper/githubscraper/helpers.go b/receiver/gitproviderreceiver/internal/scraper/githubscraper/helpers.go index a5ec04c553e2..784a1026bc1b 100644 --- a/receiver/gitproviderreceiver/internal/scraper/githubscraper/helpers.go +++ b/receiver/gitproviderreceiver/internal/scraper/githubscraper/helpers.go @@ -9,7 +9,7 @@ import ( "net/url" "github.com/Khan/genqlient/graphql" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v57/github" "go.uber.org/zap" ) @@ -132,7 +132,7 @@ func (ghs *githubScraper) createClients() (gClient graphql.Client, rClient *gith // The rest client needs the endpoint to be the root of the server ru := ghs.cfg.HTTPClientSettings.Endpoint - rClient, err = github.NewEnterpriseClient(ru, ru, ghs.client) + rClient, err = github.NewClient(ghs.client).WithEnterpriseURLs(ru, ru) if err != nil { ghs.logger.Sugar().Errorf("error creating enterprise client: %v", err) return nil, nil, err diff --git a/receiver/gitproviderreceiver/internal/scraper/githubscraper/helpers_test.go b/receiver/gitproviderreceiver/internal/scraper/githubscraper/helpers_test.go index c6e91d4faf51..f4c556939d5a 100644 --- a/receiver/gitproviderreceiver/internal/scraper/githubscraper/helpers_test.go +++ b/receiver/gitproviderreceiver/internal/scraper/githubscraper/helpers_test.go @@ -14,7 +14,7 @@ import ( "testing" "github.com/Khan/genqlient/graphql" - "github.com/google/go-github/v53/github" + "github.com/google/go-github/v57/github" "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/receiver/receivertest" ) diff --git a/receiver/googlecloudpubsubreceiver/generated_component_test.go b/receiver/googlecloudpubsubreceiver/generated_component_test.go new file mode 100644 index 000000000000..55c26fc43058 --- /dev/null +++ b/receiver/googlecloudpubsubreceiver/generated_component_test.go @@ -0,0 +1,103 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package googlecloudpubsubreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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) { + + // TODO support lifecycle + t.SkipNow() + + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + 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/googlecloudpubsubreceiver/go.mod b/receiver/googlecloudpubsubreceiver/go.mod index 40ca62bd8494..a5f0e6b22885 100644 --- a/receiver/googlecloudpubsubreceiver/go.mod +++ b/receiver/googlecloudpubsubreceiver/go.mod @@ -11,18 +11,23 @@ require ( go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 - google.golang.org/api v0.151.0 - google.golang.org/grpc v1.60.0 + google.golang.org/api v0.154.0 + google.golang.org/grpc v1.60.1 ) require ( cloud.google.com/go v0.110.10 // indirect - cloud.google.com/go/compute v1.23.1 // indirect + cloud.google.com/go/compute v1.23.3 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v1.1.3 // indirect + cloud.google.com/go/iam v1.1.5 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/go-logr/logr v1.3.0 // indirect + github.com/go-logr/stdr v1.2.2 // 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 @@ -46,21 +51,21 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/extension v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.15.0 // indirect - golang.org/x/net v0.18.0 // indirect - golang.org/x/oauth2 v0.14.0 // indirect + golang.org/x/crypto v0.17.0 // indirect + golang.org/x/net v0.19.0 // indirect + golang.org/x/oauth2 v0.15.0 // indirect golang.org/x/sync v0.5.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/time v0.3.0 // indirect + golang.org/x/time v0.5.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect + google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/receiver/googlecloudpubsubreceiver/go.sum b/receiver/googlecloudpubsubreceiver/go.sum index d000732895f6..a5bac1d14a52 100644 --- a/receiver/googlecloudpubsubreceiver/go.sum +++ b/receiver/googlecloudpubsubreceiver/go.sum @@ -1,12 +1,12 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.110.10 h1:LXy9GEO+timppncPIAZoOj3l58LIU9k+kn48AN7IO3Y= cloud.google.com/go v0.110.10/go.mod h1:v1OoFqYxiBkUrruItNM3eT4lLByNjxmJSV/xDKJNnic= -cloud.google.com/go/compute v1.23.1 h1:V97tBoDaZHb6leicZ1G6DLK2BAaZLJ/7+9BB/En3hR0= -cloud.google.com/go/compute v1.23.1/go.mod h1:CqB3xpmPKKt3OJpW2ndFIXnA9A4xAy/F3Xp1ixncW78= +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.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= -cloud.google.com/go/iam v1.1.3 h1:18tKG7DzydKWUnLjonWcJO6wjSCAtzh4GcRKlH/Hrzc= -cloud.google.com/go/iam v1.1.3/go.mod h1:3khUlaBXfPKKe7huYgEpDn6FtgRyMEqbkvBxrQyY5SE= +cloud.google.com/go/iam v1.1.5 h1:1jTsCu4bcsNsE4iiqNT5SHwrDRCfRmIaaaVFhRveTJI= +cloud.google.com/go/iam v1.1.5/go.mod h1:rB6P/Ic3mykPbFio+vo7403drjlgvoWfYpJhMXEbzv8= cloud.google.com/go/pubsub v1.33.0 h1:6SPCPvWav64tj0sVX/+npCBKhUi/UjJehy9op/V3p2g= cloud.google.com/go/pubsub v1.33.0/go.mod h1:f+w71I33OMyxf9VpMVcZbnG5KSUkCOUHYpFd5U1GdRc= contrib.go.opencensus.io/exporter/prometheus v0.4.2 h1:sqfsYl5GIY/L570iT+l93ehxaWJs2/OwXtiWwew3oAg= @@ -18,6 +18,7 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= 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/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -25,10 +26,16 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF 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/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/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/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= @@ -136,6 +143,10 @@ go.opentelemetry.io/collector/pdata v1.0.0 h1:ECP2jnLztewsHmL1opL8BeMtWVc7/oSlKN go.opentelemetry.io/collector/pdata v1.0.0/go.mod h1:TsDFgs4JLNG7t6x9D8kGswXUz4mme+MyNChHx8zSF6k= go.opentelemetry.io/collector/receiver v0.91.0 h1:0TZF/0OXoJtxgm+mvOinRRXo9LgVyOsOgCQfWkNGXJA= go.opentelemetry.io/collector/receiver v0.91.0/go.mod h1:d5qo2mpovqKoi47hrMxj5BLdLzOXM0mUHL5CKrjfWNM= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 h1:SpGay3w+nEwMpfVnbqOLH5gY52/foP8RE8UzTZ1pdSE= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1/go.mod h1:4UoMYEZOC0yN/sPGH76KPkkU7zgiEWYWL9vwmbnTJPE= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 h1:aFJWCqJMNjENlcleuuOkGAPH82y0yULBScfXcIEdS24= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1/go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo= go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 h1:TnhkxGJ5qPHAMIMI4r+HPT/BbpoHxqn4xONJrok054o= @@ -154,8 +165,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk 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.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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= @@ -174,11 +185,11 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY 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.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= -golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.14.0 h1:P0Vrf/2538nmC0H+pEQ3MNFRRnVR7RlqyVw+bvm26z0= -golang.org/x/oauth2 v0.14.0/go.mod h1:lAtNWgaWfL4cm7j2OV8TxGi9Qb7ECORx8DktCY74OwM= +golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ= +golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= 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= @@ -205,8 +216,8 @@ 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.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +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= @@ -220,8 +231,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.151.0 h1:FhfXLO/NFdJIzQtCqjpysWwqKk8AzGWBUhMIx67cVDU= -google.golang.org/api v0.151.0/go.mod h1:ccy+MJ6nrYFgE3WgRx/AMXOxOmU8Q4hSa+jjibzhxcg= +google.golang.org/api v0.154.0 h1:X7QkVKZBskztmpPKWQXgjJRPA2dJYrL6r+sYPRLj050= +google.golang.org/api v0.154.0/go.mod h1:qhSMkM85hgqiokIYsrRyKxrjfBeIhgl4Z2JmeRkYylc= 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= @@ -229,19 +240,19 @@ google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJ 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-20231016165738-49dd2c1f3d0b h1:+YaDE2r2OG8t/z5qmsh7Y+XXwCbvadxxZ0YY6mTdrVA= -google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:CgAqfJo+Xmu0GwA0411Ht3OU3OntXwsGmrmjI8ioGXI= -google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b h1:CIC2YMXmIhYw6evmhPxBKJ4fmLbOFtXQN/GV3XOZR8k= -google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:IBQ646DjkDkvUIsVq/cc03FUFQ9wbZu7yE396YcL870= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 h1:AB/lmRny7e2pLhFEYIbl5qkDAUt2h0ZRO4wGPhZf+ik= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405/go.mod h1:67X1fPuzjcrkymZzZV1vvkFeTn2Rvc6lYF9MYFGCcwE= +google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f h1:Vn+VyHU5guc9KjB5KrjI2q0wCOWEOIh0OEsleqakHJg= +google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f/go.mod h1:nWSwAFPb+qfNJXsoeO3Io7zf4tMSfN8EA8RlDA04GhY= +google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f h1:2yNACc1O40tTnrsbk9Cv6oxiW8pxI/pXj0wRtdlYmgY= +google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f/go.mod h1:Uy9bTZJqmfrw2rIBxgGLnamc78euZULUBrLZ9XTITKI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 h1:DC7wcm+i+P1rN3Ff07vL+OndGg5OhNddHyTA+ocPqYE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4/go.mod h1:eJVxU6o+4G1PSczBr85xmyvSNYAKvAYgkub40YGomFM= 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.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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= diff --git a/receiver/googlecloudpubsubreceiver/internal/metadata/generated_status.go b/receiver/googlecloudpubsubreceiver/internal/metadata/generated_status.go index 4ca213b9b990..6fbc953505eb 100644 --- a/receiver/googlecloudpubsubreceiver/internal/metadata/generated_status.go +++ b/receiver/googlecloudpubsubreceiver/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( LogsStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/googlecloudpubsubreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/googlecloudpubsubreceiver") +} diff --git a/receiver/googlecloudpubsubreceiver/metadata.yaml b/receiver/googlecloudpubsubreceiver/metadata.yaml index 9837e28052d6..ca8b4d5a503d 100644 --- a/receiver/googlecloudpubsubreceiver/metadata.yaml +++ b/receiver/googlecloudpubsubreceiver/metadata.yaml @@ -7,3 +7,11 @@ status: distributions: [observiq, sumo] codeowners: active: [alexvanboxel] + +tests: + config: + project: my-project + user_agent: user-agent + timeout: 20s + subscription: projects/my-project/subscriptions/otlp-subscription + skip_lifecycle: true diff --git a/receiver/googlecloudpubsubreceiver/receiver.go b/receiver/googlecloudpubsubreceiver/receiver.go index e4fc2b073bb8..f5c51b9fc264 100644 --- a/receiver/googlecloudpubsubreceiver/receiver.go +++ b/receiver/googlecloudpubsubreceiver/receiver.go @@ -111,6 +111,9 @@ func (receiver *pubsubReceiver) Start(ctx context.Context, _ component.Host) err } func (receiver *pubsubReceiver) Shutdown(_ context.Context) error { + if receiver.handler == nil { + return nil + } receiver.logger.Info("Stopping Google Pubsub receiver") receiver.handler.CancelNow() receiver.logger.Info("Stopped Google Pubsub receiver") diff --git a/receiver/googlecloudspannerreceiver/generated_component_test.go b/receiver/googlecloudspannerreceiver/generated_component_test.go new file mode 100644 index 000000000000..229d5141834e --- /dev/null +++ b/receiver/googlecloudspannerreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package googlecloudspannerreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/googlecloudspannerreceiver/go.mod b/receiver/googlecloudspannerreceiver/go.mod index 482ea00d29e1..8f7d6f0fc9cc 100644 --- a/receiver/googlecloudspannerreceiver/go.mod +++ b/receiver/googlecloudspannerreceiver/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/google go 1.20 require ( - cloud.google.com/go/spanner v1.53.1 + cloud.google.com/go/spanner v1.54.0 github.com/ReneKroon/ttlcache/v2 v2.11.0 github.com/mitchellh/hashstructure v1.1.0 github.com/stretchr/testify v1.8.4 @@ -12,19 +12,21 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 - google.golang.org/api v0.151.0 - google.golang.org/grpc v1.60.0 + google.golang.org/api v0.154.0 + google.golang.org/grpc v1.60.1 gopkg.in/yaml.v3 v3.0.1 ) require ( cloud.google.com/go v0.110.10 // indirect - cloud.google.com/go/compute v1.23.1 // indirect + cloud.google.com/go/compute v1.23.3 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v1.1.3 // indirect - cloud.google.com/go/longrunning v0.5.2 // indirect + cloud.google.com/go/iam v1.1.5 // indirect + cloud.google.com/go/longrunning v0.5.4 // indirect github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe // indirect @@ -32,6 +34,9 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/envoyproxy/go-control-plane v0.11.1 // indirect github.com/envoyproxy/protoc-gen-validate v1.0.2 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/go-logr/logr v1.3.0 // indirect + github.com/go-logr/stdr v1.2.2 // 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 @@ -54,21 +59,21 @@ require ( go.opentelemetry.io/collector v0.91.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect - golang.org/x/crypto v0.15.0 // indirect - golang.org/x/net v0.18.0 // indirect - golang.org/x/oauth2 v0.14.0 // indirect + golang.org/x/crypto v0.17.0 // indirect + golang.org/x/net v0.19.0 // indirect + golang.org/x/oauth2 v0.15.0 // indirect golang.org/x/sync v0.5.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/time v0.3.0 // indirect + golang.org/x/time v0.5.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect + google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 // indirect google.golang.org/protobuf v1.31.0 // indirect ) diff --git a/receiver/googlecloudspannerreceiver/go.sum b/receiver/googlecloudspannerreceiver/go.sum index ab9014f23997..ad380e7c6c06 100644 --- a/receiver/googlecloudspannerreceiver/go.sum +++ b/receiver/googlecloudspannerreceiver/go.sum @@ -1,16 +1,16 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.110.10 h1:LXy9GEO+timppncPIAZoOj3l58LIU9k+kn48AN7IO3Y= cloud.google.com/go v0.110.10/go.mod h1:v1OoFqYxiBkUrruItNM3eT4lLByNjxmJSV/xDKJNnic= -cloud.google.com/go/compute v1.23.1 h1:V97tBoDaZHb6leicZ1G6DLK2BAaZLJ/7+9BB/En3hR0= -cloud.google.com/go/compute v1.23.1/go.mod h1:CqB3xpmPKKt3OJpW2ndFIXnA9A4xAy/F3Xp1ixncW78= +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.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= -cloud.google.com/go/iam v1.1.3 h1:18tKG7DzydKWUnLjonWcJO6wjSCAtzh4GcRKlH/Hrzc= -cloud.google.com/go/iam v1.1.3/go.mod h1:3khUlaBXfPKKe7huYgEpDn6FtgRyMEqbkvBxrQyY5SE= -cloud.google.com/go/longrunning v0.5.2 h1:u+oFqfEwwU7F9dIELigxbe0XVnBAo9wqMuQLA50CZ5k= -cloud.google.com/go/longrunning v0.5.2/go.mod h1:nqo6DQbNV2pXhGDbDMoN2bWz68MjZUzqv2YttZiveCs= -cloud.google.com/go/spanner v1.53.1 h1:xNmE0SXMSxNBuk7lRZ5G/S+A49X91zkSTt7Jn5Ptlvw= -cloud.google.com/go/spanner v1.53.1/go.mod h1:liG4iCeLqm5L3fFLU5whFITqP0e0orsAW1uUSrd4rws= +cloud.google.com/go/iam v1.1.5 h1:1jTsCu4bcsNsE4iiqNT5SHwrDRCfRmIaaaVFhRveTJI= +cloud.google.com/go/iam v1.1.5/go.mod h1:rB6P/Ic3mykPbFio+vo7403drjlgvoWfYpJhMXEbzv8= +cloud.google.com/go/longrunning v0.5.4 h1:w8xEcbZodnA2BbW6sVirkkoC+1gP8wS57EUUgGS0GVg= +cloud.google.com/go/longrunning v0.5.4/go.mod h1:zqNVncI0BOP8ST6XQD1+VcvuShMmq7+xFSzOL++V0dI= +cloud.google.com/go/spanner v1.54.0 h1:ttU+lhARPF/iZE3OkCpmfsemCz9mLaqBhGPd3Qub2sQ= +cloud.google.com/go/spanner v1.54.0/go.mod h1:wZvSQVBgngF0Gq86fKup6KIYmN2be7uOKjtK97X+bQU= contrib.go.opencensus.io/exporter/prometheus v0.4.2 h1:sqfsYl5GIY/L570iT+l93ehxaWJs2/OwXtiWwew3oAg= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/ReneKroon/ttlcache/v2 v2.11.0 h1:OvlcYFYi941SBN3v9dsDcC2N8vRxyHcCmJb3Vl4QMoM= @@ -39,10 +39,15 @@ github.com/envoyproxy/go-control-plane v0.11.1/go.mod h1:uhMcXKCQMEJHiAb0w+YGefQ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= 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/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/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/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= @@ -153,6 +158,10 @@ go.opentelemetry.io/collector/pdata v1.0.0 h1:ECP2jnLztewsHmL1opL8BeMtWVc7/oSlKN go.opentelemetry.io/collector/pdata v1.0.0/go.mod h1:TsDFgs4JLNG7t6x9D8kGswXUz4mme+MyNChHx8zSF6k= go.opentelemetry.io/collector/receiver v0.91.0 h1:0TZF/0OXoJtxgm+mvOinRRXo9LgVyOsOgCQfWkNGXJA= go.opentelemetry.io/collector/receiver v0.91.0/go.mod h1:d5qo2mpovqKoi47hrMxj5BLdLzOXM0mUHL5CKrjfWNM= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 h1:SpGay3w+nEwMpfVnbqOLH5gY52/foP8RE8UzTZ1pdSE= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1/go.mod h1:4UoMYEZOC0yN/sPGH76KPkkU7zgiEWYWL9vwmbnTJPE= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 h1:aFJWCqJMNjENlcleuuOkGAPH82y0yULBScfXcIEdS24= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1/go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo= go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 h1:TnhkxGJ5qPHAMIMI4r+HPT/BbpoHxqn4xONJrok054o= @@ -172,8 +181,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk 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.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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= @@ -195,11 +204,11 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY 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.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= -golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.14.0 h1:P0Vrf/2538nmC0H+pEQ3MNFRRnVR7RlqyVw+bvm26z0= -golang.org/x/oauth2 v0.14.0/go.mod h1:lAtNWgaWfL4cm7j2OV8TxGi9Qb7ECORx8DktCY74OwM= +golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ= +golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= 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= @@ -227,8 +236,8 @@ 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.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +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= @@ -247,8 +256,8 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -google.golang.org/api v0.151.0 h1:FhfXLO/NFdJIzQtCqjpysWwqKk8AzGWBUhMIx67cVDU= -google.golang.org/api v0.151.0/go.mod h1:ccy+MJ6nrYFgE3WgRx/AMXOxOmU8Q4hSa+jjibzhxcg= +google.golang.org/api v0.154.0 h1:X7QkVKZBskztmpPKWQXgjJRPA2dJYrL6r+sYPRLj050= +google.golang.org/api v0.154.0/go.mod h1:qhSMkM85hgqiokIYsrRyKxrjfBeIhgl4Z2JmeRkYylc= 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= @@ -256,19 +265,19 @@ google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJ 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-20231016165738-49dd2c1f3d0b h1:+YaDE2r2OG8t/z5qmsh7Y+XXwCbvadxxZ0YY6mTdrVA= -google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:CgAqfJo+Xmu0GwA0411Ht3OU3OntXwsGmrmjI8ioGXI= -google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b h1:CIC2YMXmIhYw6evmhPxBKJ4fmLbOFtXQN/GV3XOZR8k= -google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:IBQ646DjkDkvUIsVq/cc03FUFQ9wbZu7yE396YcL870= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 h1:AB/lmRny7e2pLhFEYIbl5qkDAUt2h0ZRO4wGPhZf+ik= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405/go.mod h1:67X1fPuzjcrkymZzZV1vvkFeTn2Rvc6lYF9MYFGCcwE= +google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f h1:Vn+VyHU5guc9KjB5KrjI2q0wCOWEOIh0OEsleqakHJg= +google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f/go.mod h1:nWSwAFPb+qfNJXsoeO3Io7zf4tMSfN8EA8RlDA04GhY= +google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f h1:2yNACc1O40tTnrsbk9Cv6oxiW8pxI/pXj0wRtdlYmgY= +google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f/go.mod h1:Uy9bTZJqmfrw2rIBxgGLnamc78euZULUBrLZ9XTITKI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 h1:DC7wcm+i+P1rN3Ff07vL+OndGg5OhNddHyTA+ocPqYE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4/go.mod h1:eJVxU6o+4G1PSczBr85xmyvSNYAKvAYgkub40YGomFM= 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.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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= diff --git a/receiver/googlecloudspannerreceiver/internal/metadata/generated_status.go b/receiver/googlecloudspannerreceiver/internal/metadata/generated_status.go index 4a8d2ff5bf1a..8a5b22791786 100644 --- a/receiver/googlecloudspannerreceiver/internal/metadata/generated_status.go +++ b/receiver/googlecloudspannerreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "googlecloudspanner" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/googlecloudspannerreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/googlecloudspannerreceiver") +} diff --git a/receiver/googlecloudspannerreceiver/metadata.yaml b/receiver/googlecloudspannerreceiver/metadata.yaml index 5083961d92f4..2d5f10f8ccc6 100644 --- a/receiver/googlecloudspannerreceiver/metadata.yaml +++ b/receiver/googlecloudspannerreceiver/metadata.yaml @@ -7,3 +7,5 @@ status: distributions: [contrib, observiq, sumo] codeowners: active: [architjugran, varunraiko, kiranmayib] +tests: + config: \ No newline at end of file diff --git a/receiver/haproxyreceiver/generated_component_test.go b/receiver/haproxyreceiver/generated_component_test.go new file mode 100644 index 000000000000..7f65e0d9a495 --- /dev/null +++ b/receiver/haproxyreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package haproxyreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/haproxyreceiver/go.mod b/receiver/haproxyreceiver/go.mod index 459b643a905e..b612333d42e2 100644 --- a/receiver/haproxyreceiver/go.mod +++ b/receiver/haproxyreceiver/go.mod @@ -15,6 +15,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -87,8 +89,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect diff --git a/receiver/haproxyreceiver/internal/metadata/generated_status.go b/receiver/haproxyreceiver/internal/metadata/generated_status.go index 800ca6321a73..f87f2a87d730 100644 --- a/receiver/haproxyreceiver/internal/metadata/generated_status.go +++ b/receiver/haproxyreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "haproxy" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/haproxyreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/haproxyreceiver") +} diff --git a/receiver/haproxyreceiver/metadata.yaml b/receiver/haproxyreceiver/metadata.yaml index 260f045184f4..c949ccb0938b 100644 --- a/receiver/haproxyreceiver/metadata.yaml +++ b/receiver/haproxyreceiver/metadata.yaml @@ -261,3 +261,6 @@ 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 new file mode 100644 index 000000000000..18c0861c732a --- /dev/null +++ b/receiver/hostmetricsreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package hostmetricsreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/hostmetricsreceiver/go.mod b/receiver/hostmetricsreceiver/go.mod index 8bb43a738610..f458923ba70d 100644 --- a/receiver/hostmetricsreceiver/go.mod +++ b/receiver/hostmetricsreceiver/go.mod @@ -19,6 +19,8 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 golang.org/x/sys v0.15.0 @@ -52,6 +54,7 @@ require ( github.com/google/uuid v1.5.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 // indirect github.com/hashicorp/go-version v1.6.0 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.17.2 // indirect @@ -111,12 +114,10 @@ require ( go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.44.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/otel/sdk v1.21.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect - golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect + golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/hostmetricsreceiver/go.sum b/receiver/hostmetricsreceiver/go.sum index 11453f68dddd..da5eaf2d0754 100644 --- a/receiver/hostmetricsreceiver/go.sum +++ b/receiver/hostmetricsreceiver/go.sum @@ -194,6 +194,8 @@ github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mO github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= @@ -460,8 +462,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= diff --git a/receiver/hostmetricsreceiver/internal/metadata/generated_status.go b/receiver/hostmetricsreceiver/internal/metadata/generated_status.go index d3dd91c1d197..98c47b73ced1 100644 --- a/receiver/hostmetricsreceiver/internal/metadata/generated_status.go +++ b/receiver/hostmetricsreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "hostmetrics" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/hostmetricsreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/hostmetricsreceiver") +} diff --git a/receiver/hostmetricsreceiver/metadata.yaml b/receiver/hostmetricsreceiver/metadata.yaml index 0d456d7d06c8..3a0de618f3ec 100644 --- a/receiver/hostmetricsreceiver/metadata.yaml +++ b/receiver/hostmetricsreceiver/metadata.yaml @@ -7,3 +7,5 @@ status: distributions: [core, contrib, observiq, splunk, sumo] codeowners: active: [dmitryax, braydonk] +tests: + config: diff --git a/receiver/httpcheckreceiver/generated_component_test.go b/receiver/httpcheckreceiver/generated_component_test.go new file mode 100644 index 000000000000..411d3eff71c6 --- /dev/null +++ b/receiver/httpcheckreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package httpcheckreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/httpcheckreceiver/go.mod b/receiver/httpcheckreceiver/go.mod index 710c4c601573..ac93925dcfc4 100644 --- a/receiver/httpcheckreceiver/go.mod +++ b/receiver/httpcheckreceiver/go.mod @@ -14,6 +14,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -54,8 +56,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/httpcheckreceiver/internal/metadata/generated_status.go b/receiver/httpcheckreceiver/internal/metadata/generated_status.go index 75cc7ae53d9c..8428f435ef12 100644 --- a/receiver/httpcheckreceiver/internal/metadata/generated_status.go +++ b/receiver/httpcheckreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "httpcheck" MetricsStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/httpcheckreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/httpcheckreceiver") +} diff --git a/receiver/httpcheckreceiver/metadata.yaml b/receiver/httpcheckreceiver/metadata.yaml index d828bc5ce7f7..583e1d833e52 100644 --- a/receiver/httpcheckreceiver/metadata.yaml +++ b/receiver/httpcheckreceiver/metadata.yaml @@ -54,3 +54,6 @@ metrics: monotonic: false unit: "{error}" attributes: [http.url, error.message] + +tests: + config: diff --git a/receiver/iisreceiver/go.mod b/receiver/iisreceiver/go.mod index c0cd0bc7fcb1..637acf0b1da5 100644 --- a/receiver/iisreceiver/go.mod +++ b/receiver/iisreceiver/go.mod @@ -14,6 +14,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -73,8 +75,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/receiver/iisreceiver/internal/metadata/generated_status.go b/receiver/iisreceiver/internal/metadata/generated_status.go index 695b9dd0e71a..c3d3269a3932 100644 --- a/receiver/iisreceiver/internal/metadata/generated_status.go +++ b/receiver/iisreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "iis" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/iisreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/iisreceiver") +} diff --git a/receiver/influxdbreceiver/generated_component_test.go b/receiver/influxdbreceiver/generated_component_test.go new file mode 100644 index 000000000000..74328de5bdd0 --- /dev/null +++ b/receiver/influxdbreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package influxdbreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/influxdbreceiver/go.mod b/receiver/influxdbreceiver/go.mod index dba536dc099b..4daadfa297fe 100644 --- a/receiver/influxdbreceiver/go.mod +++ b/receiver/influxdbreceiver/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/influx go 1.20 require ( - github.com/influxdata/influxdb-client-go/v2 v2.12.4 + github.com/influxdata/influxdb-client-go/v2 v2.13.0 github.com/influxdata/influxdb-observability/common v0.5.8 github.com/influxdata/influxdb-observability/influx2otel v0.5.8 github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c @@ -12,9 +12,12 @@ require ( github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/config/confighttp v0.91.0 + go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -22,7 +25,6 @@ require ( github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/deepmap/oapi-codegen v1.12.4 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/frankban/quicktest v1.14.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect @@ -44,6 +46,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/oapi-codegen/runtime v1.0.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.91.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rs/cors v1.10.1 // indirect @@ -55,15 +58,12 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/config/configtls v0.91.0 // indirect go.opentelemetry.io/collector/config/internal v0.91.0 // indirect - go.opentelemetry.io/collector/confmap v0.91.0 // indirect go.opentelemetry.io/collector/extension v0.91.0 // indirect go.opentelemetry.io/collector/extension/auth v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/semconv v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/receiver/influxdbreceiver/go.sum b/receiver/influxdbreceiver/go.sum index f31b9cc1ca74..6ce71f80d0b4 100644 --- a/receiver/influxdbreceiver/go.sum +++ b/receiver/influxdbreceiver/go.sum @@ -15,8 +15,6 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3 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/deepmap/oapi-codegen v1.12.4 h1:pPmn6qI9MuOtCz82WY2Xaw46EQjgvxednXXrP7g5Q2s= -github.com/deepmap/oapi-codegen v1.12.4/go.mod h1:3lgHGMu6myQ2vqbbTXH2H1o4eXFTGnFiDaOaKKl5yas= 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= @@ -73,8 +71,8 @@ github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 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/influxdata/influxdb-client-go/v2 v2.12.4 h1:9qJLqetEmhIlqaF/N9KUtdmRKSbNy6IohggyS3bxWlE= -github.com/influxdata/influxdb-client-go/v2 v2.12.4/go.mod h1:3BQow2tDJRxKi8oUUy/6BtHaSq7wrBIoKieYMXB6knQ= +github.com/influxdata/influxdb-client-go/v2 v2.13.0 h1:ioBbLmR5NMbAjP4UVA5r9b5xGjpABD7j65pI8kFphDM= +github.com/influxdata/influxdb-client-go/v2 v2.13.0/go.mod h1:k+spCbt9hcvqvUiz0sr5D8LolXHqAAOfPw9v/RIRHl4= github.com/influxdata/influxdb-observability/common v0.5.8 h1:nyk4dqnKbPGIyr1vAs6oEsFQEHWi5jkSQ7PtP4v//lc= github.com/influxdata/influxdb-observability/common v0.5.8/go.mod h1:aG8A2gbtXbl/P2FePd6QNsCUSOkcvz1n+NL5dJLUO1s= github.com/influxdata/influxdb-observability/influx2otel v0.5.8 h1:pHkeImZksXNNQbbH/w1qPuC/u6e7cK3kTG12otQHDuE= @@ -124,6 +122,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ 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/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/oapi-codegen/runtime v1.0.0 h1:P4rqFX5fMFWqRzY9M/3YF9+aPSPPB06IzP2P7oOxrWo= +github.com/oapi-codegen/runtime v1.0.0/go.mod h1:LmCUMQuPB4M/nLXilQXhHw+BLZdDb18B34OO356yJ/A= github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.85.0 h1:M8jCisGDhD0WbSwaA54pIX7WTn9/x/wAcUEXtTRExbw= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= diff --git a/receiver/influxdbreceiver/internal/metadata/generated_status.go b/receiver/influxdbreceiver/internal/metadata/generated_status.go index 4e60cfc4242f..ab98f7407999 100644 --- a/receiver/influxdbreceiver/internal/metadata/generated_status.go +++ b/receiver/influxdbreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "influxdb" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/influxdbreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/influxdbreceiver") +} diff --git a/receiver/influxdbreceiver/metadata.yaml b/receiver/influxdbreceiver/metadata.yaml index 1778488433ff..1004879a5549 100644 --- a/receiver/influxdbreceiver/metadata.yaml +++ b/receiver/influxdbreceiver/metadata.yaml @@ -7,3 +7,5 @@ status: distributions: [contrib, observiq, sumo] codeowners: active: [jacobmarble] +tests: + config: diff --git a/receiver/jaegerreceiver/README.md b/receiver/jaegerreceiver/README.md index 008152c64a38..e766f671b678 100644 --- a/receiver/jaegerreceiver/README.md +++ b/receiver/jaegerreceiver/README.md @@ -4,7 +4,7 @@ | Status | | | ------------- |-----------| | Stability | [beta]: traces | -| Distributions | [core], [contrib], [aws], [grafana], [observiq], [redhat], [splunk], [sumo] | +| Distributions | [core], [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%3Areceiver%2Fjaeger%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fjaeger) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fjaeger%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fjaeger) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@yurishkuro](https://www.github.com/yurishkuro) | @@ -13,6 +13,7 @@ [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 [splunk]: https://github.com/signalfx/splunk-otel-collector diff --git a/receiver/jaegerreceiver/generated_component_test.go b/receiver/jaegerreceiver/generated_component_test.go new file mode 100644 index 000000000000..ea88b8b5e739 --- /dev/null +++ b/receiver/jaegerreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package jaegerreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/jaegerreceiver/go.mod b/receiver/jaegerreceiver/go.mod index d921ddba801f..c3686f8b0704 100644 --- a/receiver/jaegerreceiver/go.mod +++ b/receiver/jaegerreceiver/go.mod @@ -20,9 +20,11 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 - google.golang.org/grpc v1.60.0 + google.golang.org/grpc v1.60.1 ) require ( @@ -63,8 +65,6 @@ require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/oauth2 v0.14.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/receiver/jaegerreceiver/go.sum b/receiver/jaegerreceiver/go.sum index 7725bb1f9b74..f5a5fc71967d 100644 --- a/receiver/jaegerreceiver/go.sum +++ b/receiver/jaegerreceiver/go.sum @@ -264,8 +264,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac 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.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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= diff --git a/receiver/jaegerreceiver/internal/metadata/generated_status.go b/receiver/jaegerreceiver/internal/metadata/generated_status.go index efc542c560a6..f41e9f271679 100644 --- a/receiver/jaegerreceiver/internal/metadata/generated_status.go +++ b/receiver/jaegerreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "jaeger" TracesStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/jaegerreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/jaegerreceiver") +} diff --git a/receiver/jaegerreceiver/metadata.yaml b/receiver/jaegerreceiver/metadata.yaml index 44680c8595ae..cd49812a3952 100644 --- a/receiver/jaegerreceiver/metadata.yaml +++ b/receiver/jaegerreceiver/metadata.yaml @@ -13,5 +13,11 @@ status: - redhat - splunk - sumo + - liatrio codeowners: active: [yurishkuro] + +tests: + config: + protocols: + grpc: diff --git a/receiver/jmxreceiver/go.mod b/receiver/jmxreceiver/go.mod index d345d0b9eaa7..e58beb21463f 100644 --- a/receiver/jmxreceiver/go.mod +++ b/receiver/jmxreceiver/go.mod @@ -17,6 +17,8 @@ require ( go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/collector/receiver/otlpreceiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -93,8 +95,6 @@ require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect golang.org/x/mod v0.14.0 // indirect diff --git a/receiver/jmxreceiver/internal/metadata/generated_status.go b/receiver/jmxreceiver/internal/metadata/generated_status.go index c65e91498686..5f33297d4bd4 100644 --- a/receiver/jmxreceiver/internal/metadata/generated_status.go +++ b/receiver/jmxreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "jmx" MetricsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/jmxreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/jmxreceiver") +} diff --git a/receiver/journaldreceiver/go.mod b/receiver/journaldreceiver/go.mod index 86b7669259fe..c871c38542de 100644 --- a/receiver/journaldreceiver/go.mod +++ b/receiver/journaldreceiver/go.mod @@ -10,6 +10,8 @@ require ( go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 ) require ( @@ -39,8 +41,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/pdata v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/receiver/journaldreceiver/internal/metadata/generated_status.go b/receiver/journaldreceiver/internal/metadata/generated_status.go index f7998abf9b44..8ae820cac5c0 100644 --- a/receiver/journaldreceiver/internal/metadata/generated_status.go +++ b/receiver/journaldreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "journald" LogsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/journaldreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/journaldreceiver") +} diff --git a/receiver/k8sclusterreceiver/README.md b/receiver/k8sclusterreceiver/README.md index a23da2ab45b1..9cd60947cfd1 100644 --- a/receiver/k8sclusterreceiver/README.md +++ b/receiver/k8sclusterreceiver/README.md @@ -5,13 +5,14 @@ | ------------- |-----------| | Stability | [beta]: metrics | | | [development]: logs | -| Distributions | [contrib], [observiq], [splunk], [sumo] | +| 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 [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 [splunk]: https://github.com/signalfx/splunk-otel-collector [sumo]: https://github.com/SumoLogic/sumologic-otel-collector diff --git a/receiver/k8sclusterreceiver/e2e_test.go b/receiver/k8sclusterreceiver/e2e_test.go index 6a6ec8cbb6a2..d9216b494e23 100644 --- a/receiver/k8sclusterreceiver/e2e_test.go +++ b/receiver/k8sclusterreceiver/e2e_test.go @@ -39,6 +39,7 @@ const testKubeConfig = "/tmp/kube-config-otelcol-e2e-testing" // make docker-otelcontribcol // KUBECONFIG=/tmp/kube-config-otelcol-e2e-testing kind load docker-image otelcontribcol:latest func TestE2E(t *testing.T) { + var expected pmetric.Metrics expectedFile := filepath.Join("testdata", "e2e", "expected.yaml") expected, err := golden.ReadMetrics(expectedFile) @@ -48,6 +49,10 @@ func TestE2E(t *testing.T) { dynamicClient, err := dynamic.NewForConfig(kubeConfig) require.NoError(t, err) + metricsConsumer := new(consumertest.MetricsSink) + shutdownSink := startUpSink(t, metricsConsumer) + defer shutdownSink() + testID := uuid.NewString()[:8] collectorObjs := k8stest.CreateCollectorObjects(t, dynamicClient, testID) @@ -57,7 +62,6 @@ func TestE2E(t *testing.T) { } }() - metricsConsumer := new(consumertest.MetricsSink) wantEntries := 10 // Minimal number of metrics to wait for. waitForData(t, wantEntries, metricsConsumer) @@ -108,17 +112,19 @@ func TestE2E(t *testing.T) { ) } -func waitForData(t *testing.T, entriesNum int, mc *consumertest.MetricsSink) { +func startUpSink(t *testing.T, mc *consumertest.MetricsSink) func() { f := otlpreceiver.NewFactory() cfg := f.CreateDefaultConfig().(*otlpreceiver.Config) rcvr, err := f.CreateMetricsReceiver(context.Background(), receivertest.NewNopCreateSettings(), cfg, mc) require.NoError(t, rcvr.Start(context.Background(), componenttest.NewNopHost())) require.NoError(t, err, "failed creating metrics receiver") - defer func() { + return func() { assert.NoError(t, rcvr.Shutdown(context.Background())) - }() + } +} +func waitForData(t *testing.T, entriesNum int, mc *consumertest.MetricsSink) { timeoutMinutes := 3 require.Eventuallyf(t, func() bool { return len(mc.AllMetrics()) > entriesNum diff --git a/receiver/k8sclusterreceiver/go.mod b/receiver/k8sclusterreceiver/go.mod index 9e8aa9b6c55b..c8b4cfaa9080 100644 --- a/receiver/k8sclusterreceiver/go.mod +++ b/receiver/k8sclusterreceiver/go.mod @@ -24,6 +24,8 @@ require ( go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/collector/receiver/otlpreceiver v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 k8s.io/api v0.28.4 k8s.io/apimachinery v0.28.4 @@ -105,10 +107,8 @@ require ( go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/otel/sdk v1.21.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect diff --git a/receiver/k8sclusterreceiver/internal/metadata/generated_status.go b/receiver/k8sclusterreceiver/internal/metadata/generated_status.go index 1eaeb822b837..784c87d59c29 100644 --- a/receiver/k8sclusterreceiver/internal/metadata/generated_status.go +++ b/receiver/k8sclusterreceiver/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -11,3 +13,11 @@ const ( MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/k8sclusterreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/k8sclusterreceiver") +} diff --git a/receiver/k8sclusterreceiver/metadata.yaml b/receiver/k8sclusterreceiver/metadata.yaml index c6ec5e180044..7c1117081d0d 100644 --- a/receiver/k8sclusterreceiver/metadata.yaml +++ b/receiver/k8sclusterreceiver/metadata.yaml @@ -5,7 +5,7 @@ status: stability: beta: [metrics] development: [logs] - distributions: [contrib, splunk, observiq, sumo] + distributions: [contrib, splunk, observiq, sumo, liatrio] codeowners: active: [dmitryax, TylerHelmuth, povilasv] diff --git a/receiver/k8sclusterreceiver/testdata/e2e/collector/deployment.yaml b/receiver/k8sclusterreceiver/testdata/e2e/collector/deployment.yaml index f7f21c5d4856..841c472b04f4 100644 --- a/receiver/k8sclusterreceiver/testdata/e2e/collector/deployment.yaml +++ b/receiver/k8sclusterreceiver/testdata/e2e/collector/deployment.yaml @@ -37,10 +37,12 @@ spec: httpGet: path: / port: 13133 + initialDelaySeconds: 3 readinessProbe: httpGet: path: / port: 13133 + initialDelaySeconds: 3 resources: limits: cpu: 128m diff --git a/receiver/k8seventsreceiver/factory.go b/receiver/k8seventsreceiver/factory.go index d4bf18300779..5965f992bcf9 100644 --- a/receiver/k8seventsreceiver/factory.go +++ b/receiver/k8seventsreceiver/factory.go @@ -38,10 +38,5 @@ func createLogsReceiver( ) (receiver.Logs, error) { rCfg := cfg.(*Config) - k8sInterface, err := rCfg.getK8sClient() - if err != nil { - return nil, err - } - - return newReceiver(params, rCfg, consumer, k8sInterface) + return newReceiver(params, rCfg, consumer) } diff --git a/receiver/k8seventsreceiver/factory_test.go b/receiver/k8seventsreceiver/factory_test.go index 35cb96508de1..c79739ee58d9 100644 --- a/receiver/k8seventsreceiver/factory_test.go +++ b/receiver/k8seventsreceiver/factory_test.go @@ -10,6 +10,7 @@ import ( "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/consumer/consumertest" "go.opentelemetry.io/collector/receiver/receivertest" k8s "k8s.io/client-go/kubernetes" @@ -42,8 +43,9 @@ func TestCreateReceiver(t *testing.T) { context.Background(), receivertest.NewNopCreateSettings(), rCfg, consumertest.NewNop(), ) + require.NoError(t, err) + err = r.Start(context.Background(), componenttest.NewNopHost()) assert.Error(t, err) - assert.Nil(t, r) // Override for test. rCfg.makeClient = func(apiConf k8sconfig.APIConfig) (k8s.Interface, error) { @@ -54,6 +56,7 @@ func TestCreateReceiver(t *testing.T) { receivertest.NewNopCreateSettings(), rCfg, consumertest.NewNop(), ) + require.NoError(t, err) + err = r.Start(context.Background(), componenttest.NewNopHost()) assert.NoError(t, err) - assert.NotNil(t, r) } diff --git a/receiver/k8seventsreceiver/generated_component_test.go b/receiver/k8seventsreceiver/generated_component_test.go new file mode 100644 index 000000000000..2a91346ba1e2 --- /dev/null +++ b/receiver/k8seventsreceiver/generated_component_test.go @@ -0,0 +1,89 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package k8seventsreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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) { + + // TODO support lifecycle + t.SkipNow() + + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + 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 9fdd76df4777..8555a87a3eff 100644 --- a/receiver/k8seventsreceiver/go.mod +++ b/receiver/k8seventsreceiver/go.mod @@ -11,6 +11,8 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 k8s.io/api v0.28.4 k8s.io/apimachinery v0.28.4 @@ -55,8 +57,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/oauth2 v0.14.0 // indirect diff --git a/receiver/k8seventsreceiver/internal/metadata/generated_status.go b/receiver/k8seventsreceiver/internal/metadata/generated_status.go index ac70184bc900..3c9e145082dc 100644 --- a/receiver/k8seventsreceiver/internal/metadata/generated_status.go +++ b/receiver/k8seventsreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "k8s_events" LogsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/k8seventsreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/k8seventsreceiver") +} diff --git a/receiver/k8seventsreceiver/metadata.yaml b/receiver/k8seventsreceiver/metadata.yaml index c8e1e10b1127..febae1aca702 100644 --- a/receiver/k8seventsreceiver/metadata.yaml +++ b/receiver/k8seventsreceiver/metadata.yaml @@ -7,3 +7,7 @@ status: distributions: [contrib, splunk, observiq, sumo] codeowners: active: [dmitryax, TylerHelmuth] + +tests: + config: + skip_lifecycle: true diff --git a/receiver/k8seventsreceiver/receiver.go b/receiver/k8seventsreceiver/receiver.go index acaf7d461c2b..dc0e6f2d6450 100644 --- a/receiver/k8seventsreceiver/receiver.go +++ b/receiver/k8seventsreceiver/receiver.go @@ -22,7 +22,6 @@ import ( type k8seventsReceiver struct { config *Config settings receiver.CreateSettings - client k8s.Interface logsConsumer consumer.Logs stopperChanList []chan struct{} startTime time.Time @@ -36,7 +35,6 @@ func newReceiver( set receiver.CreateSettings, config *Config, consumer consumer.Logs, - client k8s.Interface, ) (receiver.Logs, error) { transport := "http" @@ -52,7 +50,6 @@ func newReceiver( return &k8seventsReceiver{ settings: set, config: config, - client: client, logsConsumer: consumer, startTime: time.Now(), obsrecv: obsrecv, @@ -62,12 +59,17 @@ func newReceiver( func (kr *k8seventsReceiver) Start(ctx context.Context, _ component.Host) error { kr.ctx, kr.cancel = context.WithCancel(ctx) + k8sInterface, err := kr.config.getK8sClient() + if err != nil { + return err + } + kr.settings.Logger.Info("starting to watch namespaces for the events.") if len(kr.config.Namespaces) == 0 { - kr.startWatch(corev1.NamespaceAll) + kr.startWatch(corev1.NamespaceAll, k8sInterface) } else { for _, ns := range kr.config.Namespaces { - kr.startWatch(ns) + kr.startWatch(ns, k8sInterface) } } @@ -75,6 +77,9 @@ func (kr *k8seventsReceiver) Start(ctx context.Context, _ component.Host) error } func (kr *k8seventsReceiver) Shutdown(context.Context) error { + if kr.cancel == nil { + return nil + } // Stop watching all the namespaces by closing all the stopper channels. for _, stopperChan := range kr.stopperChanList { close(stopperChan) @@ -86,10 +91,10 @@ func (kr *k8seventsReceiver) Shutdown(context.Context) error { // Add the 'Event' handler and trigger the watch for a specific namespace. // For new and updated events, the code is relying on the following k8s code implementation: // https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/client-go/tools/record/events_cache.go#L327 -func (kr *k8seventsReceiver) startWatch(ns string) { +func (kr *k8seventsReceiver) startWatch(ns string, client k8s.Interface) { stopperChan := make(chan struct{}) kr.stopperChanList = append(kr.stopperChanList, stopperChan) - kr.startWatchingNamespace(kr.client, cache.ResourceEventHandlerFuncs{ + kr.startWatchingNamespace(client, cache.ResourceEventHandlerFuncs{ AddFunc: func(obj any) { ev := obj.(*corev1.Event) kr.handleEvent(ev) diff --git a/receiver/k8seventsreceiver/receiver_test.go b/receiver/k8seventsreceiver/receiver_test.go index 1f81b9082489..49cff154707f 100644 --- a/receiver/k8seventsreceiver/receiver_test.go +++ b/receiver/k8seventsreceiver/receiver_test.go @@ -16,17 +16,21 @@ import ( corev1 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + k8s "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/fake" + + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig" ) func TestNewReceiver(t *testing.T) { rCfg := createDefaultConfig().(*Config) - client := fake.NewSimpleClientset() + rCfg.makeClient = func(apiConf k8sconfig.APIConfig) (k8s.Interface, error) { + return fake.NewSimpleClientset(), nil + } r, err := newReceiver( receivertest.NewNopCreateSettings(), rCfg, consumertest.NewNop(), - client, ) require.NoError(t, err) @@ -39,7 +43,6 @@ func TestNewReceiver(t *testing.T) { receivertest.NewNopCreateSettings(), rCfg, consumertest.NewNop(), - client, ) require.NoError(t, err) @@ -50,13 +53,11 @@ func TestNewReceiver(t *testing.T) { func TestHandleEvent(t *testing.T) { rCfg := createDefaultConfig().(*Config) - client := fake.NewSimpleClientset() sink := new(consumertest.LogsSink) r, err := newReceiver( receivertest.NewNopCreateSettings(), rCfg, sink, - client, ) require.NoError(t, err) require.NotNil(t, r) @@ -70,13 +71,11 @@ func TestHandleEvent(t *testing.T) { func TestDropEventsOlderThanStartupTime(t *testing.T) { rCfg := createDefaultConfig().(*Config) - client := fake.NewSimpleClientset() sink := new(consumertest.LogsSink) r, err := newReceiver( receivertest.NewNopCreateSettings(), rCfg, sink, - client, ) require.NoError(t, err) require.NotNil(t, r) @@ -108,12 +107,10 @@ func TestGetEventTimestamp(t *testing.T) { func TestAllowEvent(t *testing.T) { rCfg := createDefaultConfig().(*Config) - client := fake.NewSimpleClientset() r, err := newReceiver( receivertest.NewNopCreateSettings(), rCfg, consumertest.NewNop(), - client, ) require.NoError(t, err) require.NotNil(t, r) diff --git a/receiver/k8sobjectsreceiver/go.mod b/receiver/k8sobjectsreceiver/go.mod index 0e3492a2f1e3..68b7e96fe423 100644 --- a/receiver/k8sobjectsreceiver/go.mod +++ b/receiver/k8sobjectsreceiver/go.mod @@ -16,6 +16,8 @@ require ( go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/collector/receiver/otlpreceiver v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 k8s.io/apimachinery v0.28.4 k8s.io/client-go v0.28.4 @@ -88,8 +90,6 @@ require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect diff --git a/receiver/k8sobjectsreceiver/internal/metadata/generated_status.go b/receiver/k8sobjectsreceiver/internal/metadata/generated_status.go index 82fd3e358f34..33e5b5d2de8e 100644 --- a/receiver/k8sobjectsreceiver/internal/metadata/generated_status.go +++ b/receiver/k8sobjectsreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "k8sobjects" LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/k8sobjectsreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/k8sobjectsreceiver") +} diff --git a/receiver/k8sobjectsreceiver/testdata/e2e/expected/watch_events.yaml b/receiver/k8sobjectsreceiver/testdata/e2e/expected/watch_events.yaml index 1220124e949c..642bda8b3482 100644 --- a/receiver/k8sobjectsreceiver/testdata/e2e/expected/watch_events.yaml +++ b/receiver/k8sobjectsreceiver/testdata/e2e/expected/watch_events.yaml @@ -16,7 +16,7 @@ resourceLogs: values: - key: note value: - stringValue: test event + stringValue: test event of type warning - key: eventTime value: stringValue: "2023-01-01T00:00:00.000000Z" @@ -28,7 +28,7 @@ resourceLogs: stringValue: test - key: reason value: - stringValue: Test event of type warning + stringValue: TestEvent - key: regarding value: kvlistValue: diff --git a/receiver/k8sobjectsreceiver/testdata/e2e/expected/watch_events_core.yaml b/receiver/k8sobjectsreceiver/testdata/e2e/expected/watch_events_core.yaml index 755b3f5cf59f..a8d432c0d829 100644 --- a/receiver/k8sobjectsreceiver/testdata/e2e/expected/watch_events_core.yaml +++ b/receiver/k8sobjectsreceiver/testdata/e2e/expected/watch_events_core.yaml @@ -29,7 +29,7 @@ resourceLogs: stringValue: test - key: message value: - stringValue: test event + stringValue: test event of type warning - key: source value: kvlistValue: {} @@ -112,7 +112,7 @@ resourceLogs: stringValue: Warning - key: reason value: - stringValue: Test event of type warning + stringValue: TestEvent - key: kind value: stringValue: Event diff --git a/receiver/k8sobjectsreceiver/testdata/e2e/testobjects/event.yaml b/receiver/k8sobjectsreceiver/testdata/e2e/testobjects/event.yaml index 7f25edfdacd7..7bb741666186 100644 --- a/receiver/k8sobjectsreceiver/testdata/e2e/testobjects/event.yaml +++ b/receiver/k8sobjectsreceiver/testdata/e2e/testobjects/event.yaml @@ -5,8 +5,8 @@ kind: Event metadata: name: test-k8sobjects-receiver namespace: default -note: test event -reason: Test event of type warning +note: test event of type warning +reason: TestEvent reportingController: e2etest reportingInstance: k8sobjectsreceiver regarding: diff --git a/receiver/k8sobjectsreceiver/testdata/e2e/testobjects/event_core.yaml b/receiver/k8sobjectsreceiver/testdata/e2e/testobjects/event_core.yaml index ba286c7a8fe4..7a2c2f3138fa 100644 --- a/receiver/k8sobjectsreceiver/testdata/e2e/testobjects/event_core.yaml +++ b/receiver/k8sobjectsreceiver/testdata/e2e/testobjects/event_core.yaml @@ -5,8 +5,8 @@ kind: Event metadata: name: test-k8sobjects-receiver-events-core namespace: default -note: test event -reason: Test event of type warning +note: test event of type warning +reason: TestEvent reportingController: e2etest-events-core reportingInstance: k8sobjectsreceiver regarding: diff --git a/receiver/kafkametricsreceiver/generated_component_test.go b/receiver/kafkametricsreceiver/generated_component_test.go new file mode 100644 index 000000000000..cd9b4770733d --- /dev/null +++ b/receiver/kafkametricsreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package kafkametricsreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/kafkametricsreceiver/go.mod b/receiver/kafkametricsreceiver/go.mod index b15626c135ce..683bd802622e 100644 --- a/receiver/kafkametricsreceiver/go.mod +++ b/receiver/kafkametricsreceiver/go.mod @@ -17,6 +17,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -26,7 +28,7 @@ require ( github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/Microsoft/hcsshim v0.11.1 // indirect - github.com/aws/aws-sdk-go v1.49.1 // indirect + github.com/aws/aws-sdk-go v1.49.6 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/containerd/containerd v1.7.7 // indirect @@ -97,9 +99,7 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect - golang.org/x/crypto v0.15.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/receiver/kafkametricsreceiver/go.sum b/receiver/kafkametricsreceiver/go.sum index 167c7280b2b1..e95dac257528 100644 --- a/receiver/kafkametricsreceiver/go.sum +++ b/receiver/kafkametricsreceiver/go.sum @@ -12,8 +12,8 @@ github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migc github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Microsoft/hcsshim v0.11.1 h1:hJ3s7GbWlGK4YVV92sO88BQSyF4ZLVy7/awqOlPxFbA= github.com/Microsoft/hcsshim v0.11.1/go.mod h1:nFJmaO4Zr5Y7eADdFOpYswDDlNVbvcIJJNJLECr5JQg= -github.com/aws/aws-sdk-go v1.49.1 h1:Dsamcd8d/nNb3A+bZ0ucfGl0vGZsW5wlRW0vhoYGoeQ= -github.com/aws/aws-sdk-go v1.49.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= +github.com/aws/aws-sdk-go v1.49.6/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= 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= @@ -291,8 +291,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 h1:FqrVOBQxQ8r/UwwXibI0KMolVhvFiGobSfdE33deHJM= golang.org/x/exp v0.0.0-20230711023510-fffb14384f22/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= diff --git a/receiver/kafkametricsreceiver/internal/metadata/generated_status.go b/receiver/kafkametricsreceiver/internal/metadata/generated_status.go index 1d4598439f8f..3cfff1ef398c 100644 --- a/receiver/kafkametricsreceiver/internal/metadata/generated_status.go +++ b/receiver/kafkametricsreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "kafkametrics" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/kafkametricsreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/kafkametricsreceiver") +} diff --git a/receiver/kafkametricsreceiver/metadata.yaml b/receiver/kafkametricsreceiver/metadata.yaml index 042d592db6c8..4e685ab7010e 100644 --- a/receiver/kafkametricsreceiver/metadata.yaml +++ b/receiver/kafkametricsreceiver/metadata.yaml @@ -108,4 +108,7 @@ metrics: unit: 1 gauge: value_type: int - attributes: [group, topic] \ No newline at end of file + attributes: [group, topic] + +tests: + config: diff --git a/receiver/kafkareceiver/factory_test.go b/receiver/kafkareceiver/factory_test.go index 25d999886b90..45386eca9657 100644 --- a/receiver/kafkareceiver/factory_test.go +++ b/receiver/kafkareceiver/factory_test.go @@ -35,9 +35,9 @@ func TestCreateTracesReceiver(t *testing.T) { cfg.ProtocolVersion = "2.0.0" f := kafkaReceiverFactory{tracesUnmarshalers: defaultTracesUnmarshalers()} r, err := f.createTracesReceiver(context.Background(), receivertest.NewNopCreateSettings(), cfg, nil) + require.NoError(t, err) // no available broker - require.Error(t, err) - assert.Nil(t, r) + require.Error(t, r.Start(context.Background(), componenttest.NewNopHost())) } func TestCreateTracesReceiver_error(t *testing.T) { @@ -79,9 +79,9 @@ func TestCreateMetricsReceiver(t *testing.T) { cfg.ProtocolVersion = "2.0.0" f := kafkaReceiverFactory{metricsUnmarshalers: defaultMetricsUnmarshalers()} r, err := f.createMetricsReceiver(context.Background(), receivertest.NewNopCreateSettings(), cfg, nil) + require.NoError(t, err) // no available broker - require.Error(t, err) - assert.Nil(t, r) + require.Error(t, r.Start(context.Background(), componenttest.NewNopHost())) } func TestCreateMetricsReceiver_error(t *testing.T) { @@ -123,9 +123,9 @@ func TestCreateLogsReceiver(t *testing.T) { cfg.ProtocolVersion = "2.0.0" f := kafkaReceiverFactory{logsUnmarshalers: defaultLogsUnmarshalers("Test Version", zap.NewNop())} r, err := f.createLogsReceiver(context.Background(), receivertest.NewNopCreateSettings(), cfg, nil) + require.NoError(t, err) // no available broker - require.Error(t, err) - assert.Nil(t, r) + require.Error(t, r.Start(context.Background(), componenttest.NewNopHost())) } func TestCreateLogsReceiver_error(t *testing.T) { diff --git a/receiver/kafkareceiver/generated_component_test.go b/receiver/kafkareceiver/generated_component_test.go new file mode 100644 index 000000000000..c7cce24e803f --- /dev/null +++ b/receiver/kafkareceiver/generated_component_test.go @@ -0,0 +1,103 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package kafkareceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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) { + + // TODO support lifecycle + t.SkipNow() + + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + 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 745b76038b6b..c801e7ad3eb9 100644 --- a/receiver/kafkareceiver/go.mod +++ b/receiver/kafkareceiver/go.mod @@ -24,11 +24,13 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) require ( - github.com/aws/aws-sdk-go v1.49.1 // indirect + github.com/aws/aws-sdk-go v1.49.6 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/eapache/go-resiliency v1.4.0 // indirect @@ -56,7 +58,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/pkg/batchpersignal v0.90.1 // indirect + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/batchpersignal v0.91.0 // indirect github.com/pierrec/lz4/v4 v4.1.18 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect @@ -71,11 +73,9 @@ require ( go.opentelemetry.io/collector/extension v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.16.0 // indirect - golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect + golang.org/x/crypto v0.17.0 // indirect + golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/kafkareceiver/go.sum b/receiver/kafkareceiver/go.sum index d10e5a654880..74bb44e46cdd 100644 --- a/receiver/kafkareceiver/go.sum +++ b/receiver/kafkareceiver/go.sum @@ -5,8 +5,8 @@ github.com/IBM/sarama v1.42.1 h1:wugyWa15TDEHh2kvq2gAy1IHLjEjuYOYgXz/ruC/OSQ= github.com/IBM/sarama v1.42.1/go.mod h1:Xxho9HkHd4K/MDUo/T/sOqwtX/17D33++E9Wib6hUdQ= 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.49.1 h1:Dsamcd8d/nNb3A+bZ0ucfGl0vGZsW5wlRW0vhoYGoeQ= -github.com/aws/aws-sdk-go v1.49.1/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= +github.com/aws/aws-sdk-go v1.49.6/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= 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= @@ -206,11 +206,11 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= diff --git a/receiver/kafkareceiver/internal/metadata/generated_status.go b/receiver/kafkareceiver/internal/metadata/generated_status.go index 9e14972f8709..b8f06cb67437 100644 --- a/receiver/kafkareceiver/internal/metadata/generated_status.go +++ b/receiver/kafkareceiver/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( LogsStability = component.StabilityLevelBeta TracesStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/kafkareceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/kafkareceiver") +} diff --git a/receiver/kafkareceiver/kafka_receiver.go b/receiver/kafkareceiver/kafka_receiver.go index 8ae63f8c9e26..0e40c6ad6f08 100644 --- a/receiver/kafkareceiver/kafka_receiver.go +++ b/receiver/kafkareceiver/kafka_receiver.go @@ -28,6 +28,7 @@ var errInvalidInitialOffset = fmt.Errorf("invalid initial offset") // kafkaTracesConsumer uses sarama to consume and handle messages from kafka. type kafkaTracesConsumer struct { + config Config consumerGroup sarama.ConsumerGroup nextConsumer consumer.Traces topics []string @@ -44,6 +45,7 @@ type kafkaTracesConsumer struct { // kafkaMetricsConsumer uses sarama to consume and handle messages from kafka. type kafkaMetricsConsumer struct { + config Config consumerGroup sarama.ConsumerGroup nextConsumer consumer.Metrics topics []string @@ -60,6 +62,7 @@ type kafkaMetricsConsumer struct { // kafkaLogsConsumer uses sarama to consume and handle messages from kafka. type kafkaLogsConsumer struct { + config Config consumerGroup sarama.ConsumerGroup nextConsumer consumer.Logs topics []string @@ -83,37 +86,8 @@ func newTracesReceiver(config Config, set receiver.CreateSettings, unmarshaler T return nil, errUnrecognizedEncoding } - c := sarama.NewConfig() - c.ClientID = config.ClientID - c.Metadata.Full = config.Metadata.Full - c.Metadata.Retry.Max = config.Metadata.Retry.Max - c.Metadata.Retry.Backoff = config.Metadata.Retry.Backoff - c.Consumer.Offsets.AutoCommit.Enable = config.AutoCommit.Enable - c.Consumer.Offsets.AutoCommit.Interval = config.AutoCommit.Interval - if initialOffset, err := toSaramaInitialOffset(config.InitialOffset); err == nil { - c.Consumer.Offsets.Initial = initialOffset - } else { - return nil, err - } - if config.ResolveCanonicalBootstrapServersOnly { - c.Net.ResolveCanonicalBootstrapServers = true - } - if config.ProtocolVersion != "" { - version, err := sarama.ParseKafkaVersion(config.ProtocolVersion) - if err != nil { - return nil, err - } - c.Version = version - } - if err := kafka.ConfigureAuthentication(config.Authentication, c); err != nil { - return nil, err - } - client, err := sarama.NewConsumerGroup(config.Brokers, config.GroupID, c) - if err != nil { - return nil, err - } return &kafkaTracesConsumer{ - consumerGroup: client, + config: config, topics: []string{config.Topic}, nextConsumer: nextConsumer, unmarshaler: unmarshaler, @@ -125,6 +99,32 @@ func newTracesReceiver(config Config, set receiver.CreateSettings, unmarshaler T }, nil } +func createKafkaClient(config Config) (sarama.ConsumerGroup, error) { + saramaConfig := sarama.NewConfig() + saramaConfig.ClientID = config.ClientID + saramaConfig.Metadata.Full = config.Metadata.Full + saramaConfig.Metadata.Retry.Max = config.Metadata.Retry.Max + saramaConfig.Metadata.Retry.Backoff = config.Metadata.Retry.Backoff + saramaConfig.Consumer.Offsets.AutoCommit.Enable = config.AutoCommit.Enable + saramaConfig.Consumer.Offsets.AutoCommit.Interval = config.AutoCommit.Interval + var err error + if saramaConfig.Consumer.Offsets.Initial, err = toSaramaInitialOffset(config.InitialOffset); err != nil { + return nil, err + } + if config.ResolveCanonicalBootstrapServersOnly { + saramaConfig.Net.ResolveCanonicalBootstrapServers = true + } + if config.ProtocolVersion != "" { + if saramaConfig.Version, err = sarama.ParseKafkaVersion(config.ProtocolVersion); err != nil { + return nil, err + } + } + if err := kafka.ConfigureAuthentication(config.Authentication, saramaConfig); err != nil { + return nil, err + } + return sarama.NewConsumerGroup(config.Brokers, config.GroupID, saramaConfig) +} + func (c *kafkaTracesConsumer) Start(_ context.Context, host component.Host) error { ctx, cancel := context.WithCancel(context.Background()) c.cancelConsumeLoop = cancel @@ -136,6 +136,12 @@ func (c *kafkaTracesConsumer) Start(_ context.Context, host component.Host) erro if err != nil { return err } + // consumerGroup may be set in tests to inject fake implementation. + if c.consumerGroup == nil { + if c.consumerGroup, err = createKafkaClient(c.config); err != nil { + return err + } + } consumerGroup := &tracesConsumerGroupHandler{ logger: c.settings.Logger, unmarshaler: c.unmarshaler, @@ -178,6 +184,9 @@ func (c *kafkaTracesConsumer) consumeLoop(ctx context.Context, handler sarama.Co } func (c *kafkaTracesConsumer) Shutdown(context.Context) error { + if c.cancelConsumeLoop == nil { + return nil + } c.cancelConsumeLoop() return c.consumerGroup.Close() } @@ -187,34 +196,8 @@ func newMetricsReceiver(config Config, set receiver.CreateSettings, unmarshaler return nil, errUnrecognizedEncoding } - c := sarama.NewConfig() - c.ClientID = config.ClientID - c.Metadata.Full = config.Metadata.Full - c.Metadata.Retry.Max = config.Metadata.Retry.Max - c.Metadata.Retry.Backoff = config.Metadata.Retry.Backoff - c.Consumer.Offsets.AutoCommit.Enable = config.AutoCommit.Enable - c.Consumer.Offsets.AutoCommit.Interval = config.AutoCommit.Interval - if initialOffset, err := toSaramaInitialOffset(config.InitialOffset); err == nil { - c.Consumer.Offsets.Initial = initialOffset - } else { - return nil, err - } - if config.ProtocolVersion != "" { - version, err := sarama.ParseKafkaVersion(config.ProtocolVersion) - if err != nil { - return nil, err - } - c.Version = version - } - if err := kafka.ConfigureAuthentication(config.Authentication, c); err != nil { - return nil, err - } - client, err := sarama.NewConsumerGroup(config.Brokers, config.GroupID, c) - if err != nil { - return nil, err - } return &kafkaMetricsConsumer{ - consumerGroup: client, + config: config, topics: []string{config.Topic}, nextConsumer: nextConsumer, unmarshaler: unmarshaler, @@ -237,6 +220,12 @@ func (c *kafkaMetricsConsumer) Start(_ context.Context, host component.Host) err if err != nil { return err } + // consumerGroup may be set in tests to inject fake implementation. + if c.consumerGroup == nil { + if c.consumerGroup, err = createKafkaClient(c.config); err != nil { + return err + } + } metricsConsumerGroup := &metricsConsumerGroupHandler{ logger: c.settings.Logger, unmarshaler: c.unmarshaler, @@ -279,6 +268,9 @@ func (c *kafkaMetricsConsumer) consumeLoop(ctx context.Context, handler sarama.C } func (c *kafkaMetricsConsumer) Shutdown(context.Context) error { + if c.cancelConsumeLoop == nil { + return nil + } c.cancelConsumeLoop() return c.consumerGroup.Close() } @@ -287,35 +279,9 @@ func newLogsReceiver(config Config, set receiver.CreateSettings, unmarshaler Log if unmarshaler == nil { return nil, errUnrecognizedEncoding } - c := sarama.NewConfig() - c.ClientID = config.ClientID - c.Metadata.Full = config.Metadata.Full - c.Metadata.Retry.Max = config.Metadata.Retry.Max - c.Metadata.Retry.Backoff = config.Metadata.Retry.Backoff - c.Consumer.Offsets.AutoCommit.Enable = config.AutoCommit.Enable - c.Consumer.Offsets.AutoCommit.Interval = config.AutoCommit.Interval - if initialOffset, err := toSaramaInitialOffset(config.InitialOffset); err == nil { - c.Consumer.Offsets.Initial = initialOffset - } else { - return nil, err - } - if config.ProtocolVersion != "" { - var version sarama.KafkaVersion - version, err := sarama.ParseKafkaVersion(config.ProtocolVersion) - if err != nil { - return nil, err - } - c.Version = version - } - if err := kafka.ConfigureAuthentication(config.Authentication, c); err != nil { - return nil, err - } - client, err := sarama.NewConsumerGroup(config.Brokers, config.GroupID, c) - if err != nil { - return nil, err - } + return &kafkaLogsConsumer{ - consumerGroup: client, + config: config, topics: []string{config.Topic}, nextConsumer: nextConsumer, unmarshaler: unmarshaler, @@ -338,7 +304,12 @@ func (c *kafkaLogsConsumer) Start(_ context.Context, host component.Host) error if err != nil { return err } - + // consumerGroup may be set in tests to inject fake implementation. + if c.consumerGroup == nil { + if c.consumerGroup, err = createKafkaClient(c.config); err != nil { + return err + } + } logsConsumerGroup := &logsConsumerGroupHandler{ logger: c.settings.Logger, unmarshaler: c.unmarshaler, @@ -381,6 +352,9 @@ func (c *kafkaLogsConsumer) consumeLoop(ctx context.Context, handler sarama.Cons } func (c *kafkaLogsConsumer) Shutdown(context.Context) error { + if c.cancelConsumeLoop == nil { + return nil + } c.cancelConsumeLoop() return c.consumerGroup.Close() } diff --git a/receiver/kafkareceiver/kafka_receiver_test.go b/receiver/kafkareceiver/kafka_receiver_test.go index be46036d4ff7..ca4b5f544dc1 100644 --- a/receiver/kafkareceiver/kafka_receiver_test.go +++ b/receiver/kafkareceiver/kafka_receiver_test.go @@ -39,8 +39,9 @@ func TestNewTracesReceiver_version_err(t *testing.T) { } unmarshaler := defaultTracesUnmarshalers()[c.Encoding] r, err := newTracesReceiver(c, receivertest.NewNopCreateSettings(), unmarshaler, consumertest.NewNop()) + require.NoError(t, err) + err = r.Start(context.Background(), componenttest.NewNopHost()) assert.Error(t, err) - assert.Nil(t, r) } func TestNewTracesReceiver_encoding_err(t *testing.T) { @@ -71,9 +72,9 @@ func TestNewTracesReceiver_err_auth_type(t *testing.T) { } unmarshaler := defaultTracesUnmarshalers()[c.Encoding] r, err := newTracesReceiver(c, receivertest.NewNopCreateSettings(), unmarshaler, consumertest.NewNop()) - assert.Error(t, err) + require.NoError(t, err) + err = r.Start(context.Background(), componenttest.NewNopHost()) assert.Contains(t, err.Error(), "failed to load TLS config") - assert.Nil(t, r) } func TestNewTracesReceiver_initial_offset_err(t *testing.T) { @@ -83,8 +84,9 @@ func TestNewTracesReceiver_initial_offset_err(t *testing.T) { } unmarshaler := defaultTracesUnmarshalers()[c.Encoding] r, err := newTracesReceiver(c, receivertest.NewNopCreateSettings(), unmarshaler, consumertest.NewNop()) + require.NoError(t, err) + err = r.Start(context.Background(), componenttest.NewNopHost()) require.Error(t, err) - assert.Nil(t, r) assert.EqualError(t, err, errInvalidInitialOffset.Error()) } @@ -304,8 +306,9 @@ func TestNewMetricsReceiver_version_err(t *testing.T) { } unmarshaler := defaultMetricsUnmarshalers()[c.Encoding] r, err := newMetricsReceiver(c, receivertest.NewNopCreateSettings(), unmarshaler, consumertest.NewNop()) + require.NoError(t, err) + err = r.Start(context.Background(), componenttest.NewNopHost()) assert.Error(t, err) - assert.Nil(t, r) } func TestNewMetricsReceiver_encoding_err(t *testing.T) { @@ -313,9 +316,8 @@ func TestNewMetricsReceiver_encoding_err(t *testing.T) { Encoding: "foo", } unmarshaler := defaultMetricsUnmarshalers()[c.Encoding] - r, err := newMetricsReceiver(c, receivertest.NewNopCreateSettings(), unmarshaler, consumertest.NewNop()) + _, err := newMetricsReceiver(c, receivertest.NewNopCreateSettings(), unmarshaler, consumertest.NewNop()) require.Error(t, err) - assert.Nil(t, r) assert.EqualError(t, err, errUnrecognizedEncoding.Error()) } @@ -336,9 +338,10 @@ func TestNewMetricsExporter_err_auth_type(t *testing.T) { } unmarshaler := defaultMetricsUnmarshalers()[c.Encoding] r, err := newMetricsReceiver(c, receivertest.NewNopCreateSettings(), unmarshaler, consumertest.NewNop()) + require.NoError(t, err) + err = r.Start(context.Background(), componenttest.NewNopHost()) assert.Error(t, err) assert.Contains(t, err.Error(), "failed to load TLS config") - assert.Nil(t, r) } func TestNewMetricsReceiver_initial_offset_err(t *testing.T) { @@ -348,22 +351,12 @@ func TestNewMetricsReceiver_initial_offset_err(t *testing.T) { } unmarshaler := defaultMetricsUnmarshalers()[c.Encoding] r, err := newMetricsReceiver(c, receivertest.NewNopCreateSettings(), unmarshaler, consumertest.NewNop()) + require.NoError(t, err) + err = r.Start(context.Background(), componenttest.NewNopHost()) require.Error(t, err) - assert.Nil(t, r) assert.EqualError(t, err, errInvalidInitialOffset.Error()) } -func TestMetricsReceiverStart(t *testing.T) { - c := kafkaMetricsConsumer{ - nextConsumer: consumertest.NewNop(), - settings: receivertest.NewNopCreateSettings(), - consumerGroup: &testConsumerGroup{}, - } - - require.NoError(t, c.Start(context.Background(), componenttest.NewNopHost())) - require.NoError(t, c.Shutdown(context.Background())) -} - func TestMetricsReceiverStartConsume(t *testing.T) { c := kafkaMetricsConsumer{ nextConsumer: consumertest.NewNop(), @@ -567,8 +560,9 @@ func TestNewLogsReceiver_version_err(t *testing.T) { } unmarshaler := defaultLogsUnmarshalers("Test Version", zap.NewNop())[c.Encoding] r, err := newLogsReceiver(c, receivertest.NewNopCreateSettings(), unmarshaler, consumertest.NewNop()) + require.NoError(t, err) + err = r.Start(context.Background(), componenttest.NewNopHost()) assert.Error(t, err) - assert.Nil(t, r) } func TestNewLogsReceiver_encoding_err(t *testing.T) { @@ -599,9 +593,10 @@ func TestNewLogsExporter_err_auth_type(t *testing.T) { } unmarshaler := defaultLogsUnmarshalers("Test Version", zap.NewNop())[c.Encoding] r, err := newLogsReceiver(c, receivertest.NewNopCreateSettings(), unmarshaler, consumertest.NewNop()) + require.NoError(t, err) + err = r.Start(context.Background(), componenttest.NewNopHost()) assert.Error(t, err) assert.Contains(t, err.Error(), "failed to load TLS config") - assert.Nil(t, r) } func TestNewLogsReceiver_initial_offset_err(t *testing.T) { @@ -611,8 +606,9 @@ func TestNewLogsReceiver_initial_offset_err(t *testing.T) { } unmarshaler := defaultLogsUnmarshalers("Test Version", zap.NewNop())[c.Encoding] r, err := newLogsReceiver(c, receivertest.NewNopCreateSettings(), unmarshaler, consumertest.NewNop()) + require.NoError(t, err) + err = r.Start(context.Background(), componenttest.NewNopHost()) require.Error(t, err) - assert.Nil(t, r) assert.EqualError(t, err, errInvalidInitialOffset.Error()) } @@ -653,6 +649,7 @@ func TestLogsReceiver_error(t *testing.T) { nextConsumer: consumertest.NewNop(), settings: settings, consumerGroup: &testConsumerGroup{err: expectedErr}, + config: *createDefaultConfig().(*Config), } require.NoError(t, c.Start(context.Background(), componenttest.NewNopHost())) diff --git a/receiver/kafkareceiver/metadata.yaml b/receiver/kafkareceiver/metadata.yaml index 58c399f2171a..f8886ef0b32f 100644 --- a/receiver/kafkareceiver/metadata.yaml +++ b/receiver/kafkareceiver/metadata.yaml @@ -13,3 +13,7 @@ status: - sumo codeowners: active: [pavolloffay, MovieStoreGuy] + +tests: + config: + skip_lifecycle: true diff --git a/receiver/kubeletstatsreceiver/README.md b/receiver/kubeletstatsreceiver/README.md index f410039bcfcd..89d85a888d25 100644 --- a/receiver/kubeletstatsreceiver/README.md +++ b/receiver/kubeletstatsreceiver/README.md @@ -4,12 +4,13 @@ | Status | | | ------------- |-----------| | Stability | [beta]: metrics | -| Distributions | [contrib], [observiq], [splunk], [sumo] | +| 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%2Fkubeletstats%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fkubeletstats) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fkubeletstats%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fkubeletstats) | | [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) | [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 [splunk]: https://github.com/signalfx/splunk-otel-collector [sumo]: https://github.com/SumoLogic/sumologic-otel-collector diff --git a/receiver/kubeletstatsreceiver/e2e_test.go b/receiver/kubeletstatsreceiver/e2e_test.go index e9a8bc35efe3..1cb44b0fa3f1 100644 --- a/receiver/kubeletstatsreceiver/e2e_test.go +++ b/receiver/kubeletstatsreceiver/e2e_test.go @@ -31,6 +31,7 @@ import ( const testKubeConfig = "/tmp/kube-config-otelcol-e2e-testing" func TestE2E(t *testing.T) { + var expected pmetric.Metrics expectedFile := filepath.Join("testdata", "e2e", "expected.yaml") expected, err := golden.ReadMetrics(expectedFile) @@ -40,6 +41,10 @@ func TestE2E(t *testing.T) { dynamicClient, err := dynamic.NewForConfig(kubeConfig) require.NoError(t, err) + metricsConsumer := new(consumertest.MetricsSink) + shutdownSink := startUpSink(t, metricsConsumer) + defer shutdownSink() + testID := uuid.NewString()[:8] collectorObjs := k8stest.CreateCollectorObjects(t, dynamicClient, testID) @@ -49,7 +54,6 @@ func TestE2E(t *testing.T) { } }() - metricsConsumer := new(consumertest.MetricsSink) wantEntries := 10 // Minimal number of metrics to wait for. waitForData(t, wantEntries, metricsConsumer) @@ -66,17 +70,19 @@ func TestE2E(t *testing.T) { ) } -func waitForData(t *testing.T, entriesNum int, mc *consumertest.MetricsSink) { +func startUpSink(t *testing.T, mc *consumertest.MetricsSink) func() { f := otlpreceiver.NewFactory() cfg := f.CreateDefaultConfig().(*otlpreceiver.Config) rcvr, err := f.CreateMetricsReceiver(context.Background(), receivertest.NewNopCreateSettings(), cfg, mc) require.NoError(t, rcvr.Start(context.Background(), componenttest.NewNopHost())) require.NoError(t, err, "failed creating metrics receiver") - defer func() { + return func() { assert.NoError(t, rcvr.Shutdown(context.Background())) - }() + } +} +func waitForData(t *testing.T, entriesNum int, mc *consumertest.MetricsSink) { timeoutMinutes := 3 require.Eventuallyf(t, func() bool { return len(mc.AllMetrics()) > entriesNum diff --git a/receiver/kubeletstatsreceiver/go.mod b/receiver/kubeletstatsreceiver/go.mod index 575fe02dfc41..5e08fe4eb304 100644 --- a/receiver/kubeletstatsreceiver/go.mod +++ b/receiver/kubeletstatsreceiver/go.mod @@ -20,6 +20,8 @@ require ( go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/collector/receiver/otlpreceiver v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 k8s.io/api v0.28.4 k8s.io/apimachinery v0.28.4 @@ -92,8 +94,6 @@ require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect diff --git a/receiver/kubeletstatsreceiver/internal/metadata/generated_status.go b/receiver/kubeletstatsreceiver/internal/metadata/generated_status.go index 464c8e8a8707..69c4917f6879 100644 --- a/receiver/kubeletstatsreceiver/internal/metadata/generated_status.go +++ b/receiver/kubeletstatsreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "kubeletstats" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/kubeletstatsreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/kubeletstatsreceiver") +} diff --git a/receiver/kubeletstatsreceiver/metadata.yaml b/receiver/kubeletstatsreceiver/metadata.yaml index e384819097e7..7216f70d8224 100644 --- a/receiver/kubeletstatsreceiver/metadata.yaml +++ b/receiver/kubeletstatsreceiver/metadata.yaml @@ -4,7 +4,7 @@ status: class: receiver stability: beta: [metrics] - distributions: [contrib, observiq, splunk, sumo] + distributions: [contrib, observiq, splunk, sumo, liatrio] codeowners: active: [dmitryax, TylerHelmuth] diff --git a/receiver/lokireceiver/go.mod b/receiver/lokireceiver/go.mod index e452fd81cda9..137ad5362d81 100644 --- a/receiver/lokireceiver/go.mod +++ b/receiver/lokireceiver/go.mod @@ -21,7 +21,7 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/receiver v0.91.0 go.uber.org/zap v1.26.0 - google.golang.org/grpc v1.60.0 + google.golang.org/grpc v1.60.1 ) require ( @@ -29,6 +29,8 @@ require ( go.opentelemetry.io/collector/config/confighttp v0.91.0 go.opentelemetry.io/collector/config/confignet v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 ) require ( @@ -79,8 +81,6 @@ require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect diff --git a/receiver/lokireceiver/go.sum b/receiver/lokireceiver/go.sum index 2ef3c77e1f55..4653c62714a1 100644 --- a/receiver/lokireceiver/go.sum +++ b/receiver/lokireceiver/go.sum @@ -276,8 +276,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac 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.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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= diff --git a/receiver/lokireceiver/internal/metadata/generated_status.go b/receiver/lokireceiver/internal/metadata/generated_status.go index 9f065a21a9f3..81830681b00b 100644 --- a/receiver/lokireceiver/internal/metadata/generated_status.go +++ b/receiver/lokireceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "loki" LogsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/lokireceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/lokireceiver") +} diff --git a/receiver/memcachedreceiver/go.mod b/receiver/memcachedreceiver/go.mod index 7fcea454c145..5c511994eac4 100644 --- a/receiver/memcachedreceiver/go.mod +++ b/receiver/memcachedreceiver/go.mod @@ -16,6 +16,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -73,8 +75,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect golang.org/x/mod v0.14.0 // indirect diff --git a/receiver/memcachedreceiver/internal/metadata/generated_status.go b/receiver/memcachedreceiver/internal/metadata/generated_status.go index 2cccd525b394..7d22c62ad2af 100644 --- a/receiver/memcachedreceiver/internal/metadata/generated_status.go +++ b/receiver/memcachedreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "memcached" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/memcachedreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/memcachedreceiver") +} diff --git a/receiver/mongodbatlasreceiver/go.mod b/receiver/mongodbatlasreceiver/go.mod index 883425e0bce1..fa2c9a106de9 100644 --- a/receiver/mongodbatlasreceiver/go.mod +++ b/receiver/mongodbatlasreceiver/go.mod @@ -11,7 +11,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.91.0 github.com/stretchr/testify v1.8.4 - go.mongodb.org/atlas v0.35.0 + go.mongodb.org/atlas v0.36.0 go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/config/configopaque v0.91.0 go.opentelemetry.io/collector/config/configtls v0.91.0 @@ -21,6 +21,8 @@ require ( go.opentelemetry.io/collector/extension v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -54,8 +56,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/mongodbatlasreceiver/go.sum b/receiver/mongodbatlasreceiver/go.sum index e832456bad69..c9151061fd50 100644 --- a/receiver/mongodbatlasreceiver/go.sum +++ b/receiver/mongodbatlasreceiver/go.sum @@ -112,8 +112,8 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl 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.mongodb.org/atlas v0.35.0 h1:fLSPEyv+QcrG5djPWMekaM+BEVfEVBKQO4yEUQl4CQ4= -go.mongodb.org/atlas v0.35.0/go.mod h1:nfPldE9dSama6G2IbIzmEza02Ly7yFZjMMVscaM0uEc= +go.mongodb.org/atlas v0.36.0 h1:m05S3AO7zkl+bcG1qaNsEKBnAqnKx2FDwLooHpIG3j4= +go.mongodb.org/atlas v0.36.0/go.mod h1:nfPldE9dSama6G2IbIzmEza02Ly7yFZjMMVscaM0uEc= 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.91.0 h1:C7sGUJDJ5nwm+CkWpAaVP3lNsuYpwSRbkmLncFjkmO8= diff --git a/receiver/mongodbatlasreceiver/internal/metadata/generated_status.go b/receiver/mongodbatlasreceiver/internal/metadata/generated_status.go index 081c2a41b5f9..69faf0e507d9 100644 --- a/receiver/mongodbatlasreceiver/internal/metadata/generated_status.go +++ b/receiver/mongodbatlasreceiver/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -11,3 +13,11 @@ const ( MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/mongodbatlasreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/mongodbatlasreceiver") +} diff --git a/receiver/mongodbreceiver/go.mod b/receiver/mongodbreceiver/go.mod index adc3509ddbc3..e8815c54ef87 100644 --- a/receiver/mongodbreceiver/go.mod +++ b/receiver/mongodbreceiver/go.mod @@ -20,6 +20,8 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -84,9 +86,7 @@ require ( go.opentelemetry.io/collector v0.91.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect - golang.org/x/crypto v0.15.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/receiver/mongodbreceiver/go.sum b/receiver/mongodbreceiver/go.sum index a5c79a24d550..6e91427968d3 100644 --- a/receiver/mongodbreceiver/go.sum +++ b/receiver/mongodbreceiver/go.sum @@ -258,8 +258,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 h1:FqrVOBQxQ8r/UwwXibI0KMolVhvFiGobSfdE33deHJM= golang.org/x/exp v0.0.0-20230711023510-fffb14384f22/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= diff --git a/receiver/mongodbreceiver/internal/metadata/generated_status.go b/receiver/mongodbreceiver/internal/metadata/generated_status.go index 890e4a845bc1..a883d449e5d0 100644 --- a/receiver/mongodbreceiver/internal/metadata/generated_status.go +++ b/receiver/mongodbreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "mongodb" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/mongodbreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/mongodbreceiver") +} diff --git a/receiver/mysqlreceiver/generated_component_test.go b/receiver/mysqlreceiver/generated_component_test.go new file mode 100644 index 000000000000..dc37f098a025 --- /dev/null +++ b/receiver/mysqlreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package mysqlreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/mysqlreceiver/go.mod b/receiver/mysqlreceiver/go.mod index 52bc455cb18d..6dc67c884258 100644 --- a/receiver/mysqlreceiver/go.mod +++ b/receiver/mysqlreceiver/go.mod @@ -18,6 +18,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -76,8 +78,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect golang.org/x/mod v0.14.0 // indirect diff --git a/receiver/mysqlreceiver/internal/metadata/generated_status.go b/receiver/mysqlreceiver/internal/metadata/generated_status.go index d9e2251a07eb..d1919504daf2 100644 --- a/receiver/mysqlreceiver/internal/metadata/generated_status.go +++ b/receiver/mysqlreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "mysql" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/mysqlreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/mysqlreceiver") +} diff --git a/receiver/mysqlreceiver/metadata.yaml b/receiver/mysqlreceiver/metadata.yaml index a82e65fa7bfc..34349e7f69ac 100644 --- a/receiver/mysqlreceiver/metadata.yaml +++ b/receiver/mysqlreceiver/metadata.yaml @@ -579,3 +579,6 @@ metrics: input_type: string monotonic: true aggregation_temporality: cumulative + +tests: + config: \ No newline at end of file diff --git a/receiver/namedpipereceiver/Makefile b/receiver/namedpipereceiver/Makefile new file mode 100644 index 000000000000..ded7a36092dc --- /dev/null +++ b/receiver/namedpipereceiver/Makefile @@ -0,0 +1 @@ +include ../../Makefile.Common diff --git a/receiver/namedpipereceiver/README.md b/receiver/namedpipereceiver/README.md new file mode 100644 index 000000000000..fd2fb8a42ec5 --- /dev/null +++ b/receiver/namedpipereceiver/README.md @@ -0,0 +1,39 @@ +# Named Pipe Receiver + + +| Status | | +| ------------- |-----------| +| Stability | [alpha]: logs | +| Distributions | [contrib] | +| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fnamedpipe%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fnamedpipe) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fnamedpipe%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fnamedpipe) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@djaglowski](https://www.github.com/djaglowski) | + +[alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha +[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib + + +This receiver supports opening a Unix Named Pipe (aka FIFO), and reading logs from it. + +## Prerequisites + +Named pipes are only supported on Unix operating systems. + + +## Configuration + +The following settings are required: + +- `path`: The path to open the named pipe at. + +The following settings are optional: + +- `mode`: The mode bits to set on the opened pipe (default: 666) + +## Example Configuration + +```yaml +receivers: + namedpipe: + path: /tmp/pipe + mode: 0600 +``` diff --git a/receiver/namedpipereceiver/doc.go b/receiver/namedpipereceiver/doc.go new file mode 100644 index 000000000000..947507f0fc94 --- /dev/null +++ b/receiver/namedpipereceiver/doc.go @@ -0,0 +1,8 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +//go:generate mdatagen metadata.yaml + +// Package namedpipereceiver implements a receiver that can be used by the +// OpenTelemetry collector to receive logs using the stanza log agent +package namedpipereceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/namedpipereceiver" diff --git a/receiver/namedpipereceiver/go.mod b/receiver/namedpipereceiver/go.mod new file mode 100644 index 000000000000..7ffafeb3fb33 --- /dev/null +++ b/receiver/namedpipereceiver/go.mod @@ -0,0 +1,67 @@ +module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/namedpipereceiver + +go 1.20 + +require ( + github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza v0.91.0 + github.com/stretchr/testify v1.8.4 + go.opentelemetry.io/collector/component v0.91.0 + go.opentelemetry.io/collector/confmap v0.91.0 + go.opentelemetry.io/collector/consumer v0.91.0 + go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 + go.uber.org/zap v1.26.0 +) + +require ( + 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/expr-lang/expr v1.15.7 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/hashicorp/go-version v1.6.0 // indirect + github.com/influxdata/go-syslog/v3 v3.0.1-0.20230911200830-875f5bc594a4 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/knadh/koanf/maps v0.1.1 // indirect + github.com/knadh/koanf/providers/confmap v0.1.0 // indirect + github.com/knadh/koanf/v2 v2.0.1 // indirect + github.com/leodido/ragel-machinery v0.0.0-20181214104525-299bdde78165 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect + github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 // 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 + go.opencensus.io v0.24.0 // indirect + go.opentelemetry.io/collector v0.91.0 // indirect + go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect + go.opentelemetry.io/collector/extension v0.91.0 // indirect + go.opentelemetry.io/collector/featuregate v1.0.0 // indirect + go.opentelemetry.io/collector/pdata v1.0.0 // indirect + go.opentelemetry.io/otel v1.21.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/net v0.18.0 // indirect + golang.org/x/sys v0.15.0 // indirect + golang.org/x/text v0.14.0 // indirect + gonum.org/v1/gonum v0.14.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect + google.golang.org/grpc v1.59.0 // indirect + google.golang.org/protobuf v1.31.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) + +replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza => ../../pkg/stanza + +replace github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage => ../../extension/storage + +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/receiver/namedpipereceiver/go.sum b/receiver/namedpipereceiver/go.sum new file mode 100644 index 000000000000..607dbf57bc77 --- /dev/null +++ b/receiver/namedpipereceiver/go.sum @@ -0,0 +1,241 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +contrib.go.opencensus.io/exporter/prometheus v0.4.2 h1:sqfsYl5GIY/L570iT+l93ehxaWJs2/OwXtiWwew3oAg= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +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/expr-lang/expr v1.15.7 h1:BK0JcWUkoW6nrbLBo6xCKhz4BvH5DSOOu1Gx5lucyZo= +github.com/expr-lang/expr v1.15.7/go.mod h1:uCkhfG+x7fcZ5A5sXHKuQ07jGZRl6J0FCAaf2k4PtVQ= +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-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= +github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= +github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +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/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.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +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/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +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/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/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/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.0.1 h1:1dYGITt1I23x8cfx8ZnldtezdyaZtfAuRtIFOiRzK7g= +github.com/knadh/koanf/v2 v2.0.1/go.mod h1:ZeiIlIDXTE7w1lMT6UVcNiRAS2/rCeLn/GdLNvY1Dus= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/leodido/ragel-machinery v0.0.0-20181214104525-299bdde78165 h1:bCiVCRCs1Heq84lurVinUPy19keqGEe4jh5vtK37jcg= +github.com/leodido/ragel-machinery v0.0.0-20181214104525-299bdde78165/go.mod h1:WZxr2/6a/Ar9bMDc2rN/LJrE/hF6bXE4LPyDSIxwAfg= +github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= +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.20220423185008-bf980b35cac4 h1:BpfhmLKZf+SjVanKKhCgf3bg+511DmU9eDQTen7LLbY= +github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4/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.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= +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/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= +github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= +github.com/prometheus/statsd_exporter v0.22.7 h1:7Pji/i2GuhK6Lu7DHrtTkFmNBCudCPT1pX2CziuyQR0= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +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.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +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.91.0 h1:C7sGUJDJ5nwm+CkWpAaVP3lNsuYpwSRbkmLncFjkmO8= +go.opentelemetry.io/collector v0.91.0/go.mod h1:YhQpIDZsn+bICAAqgBwXk9wqK8GKZDv+aogfG52zUuE= +go.opentelemetry.io/collector/component v0.91.0 h1:aBT1i2zGyfh9PalYJLfXVvQp+osHyalwyDFselI1CtA= +go.opentelemetry.io/collector/component v0.91.0/go.mod h1:2KBHvjNFdU7oOjsObQeC4Ta2Ef607OISU5obznW00fw= +go.opentelemetry.io/collector/config/configtelemetry v0.91.0 h1:mEwvqrYfwUJ7LwYfpcF9M8z7LHFoYaKhEPhnERD/88E= +go.opentelemetry.io/collector/config/configtelemetry v0.91.0/go.mod h1:+LAXM5WFMW/UbTlAuSs6L/W72WC+q8TBJt/6z39FPOU= +go.opentelemetry.io/collector/confmap v0.91.0 h1:7U2MT+u74oEzq/WWrpXSLKB7nX5jPNC4drwtQdYfwKk= +go.opentelemetry.io/collector/confmap v0.91.0/go.mod h1:uxV+fZ85kG31oovL6Cl3fAMQ3RRPwUvfAbbA9WT1Yhk= +go.opentelemetry.io/collector/consumer v0.91.0 h1:0nU1lUe2S0b8iOmF3w3R/9Dt24n413thRTbXz/nJgrM= +go.opentelemetry.io/collector/consumer v0.91.0/go.mod h1:phTUQmr7hpYfwXyDXo4mFHVjYrlSbZE+nZYlKlbVxGs= +go.opentelemetry.io/collector/extension v0.91.0 h1:bkoSLgnWm4g6n+RLmyKG6Up7dr8KmJy68quonoLZnr0= +go.opentelemetry.io/collector/extension v0.91.0/go.mod h1:F3r0fVTTh4sYR0GVv51Qez8lk8v77kTDPdyMOp6A2kg= +go.opentelemetry.io/collector/featuregate v1.0.0 h1:5MGqe2v5zxaoo73BUOvUTunftX5J8RGrbFsC2Ha7N3g= +go.opentelemetry.io/collector/featuregate v1.0.0/go.mod h1:xGbRuw+GbutRtVVSEy3YR2yuOlEyiUMhN2M9DJljgqY= +go.opentelemetry.io/collector/pdata v1.0.0 h1:ECP2jnLztewsHmL1opL8BeMtWVc7/oSlKNhfY9jP8ec= +go.opentelemetry.io/collector/pdata v1.0.0/go.mod h1:TsDFgs4JLNG7t6x9D8kGswXUz4mme+MyNChHx8zSF6k= +go.opentelemetry.io/collector/receiver v0.91.0 h1:0TZF/0OXoJtxgm+mvOinRRXo9LgVyOsOgCQfWkNGXJA= +go.opentelemetry.io/collector/receiver v0.91.0/go.mod h1:d5qo2mpovqKoi47hrMxj5BLdLzOXM0mUHL5CKrjfWNM= +go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= +go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= +go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 h1:TnhkxGJ5qPHAMIMI4r+HPT/BbpoHxqn4xONJrok054o= +go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= +go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= +go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= +go.opentelemetry.io/otel/sdk/metric v1.21.0 h1:smhI5oD714d6jHE6Tie36fPx4WDFIg+Y6RfAY4ICcR0= +go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= +go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= +go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= +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/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 h1:FqrVOBQxQ8r/UwwXibI0KMolVhvFiGobSfdE33deHJM= +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.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= +golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-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.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.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/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= +gonum.org/v1/gonum v0.14.0 h1:2NiG67LD1tEH0D7kM+ps2V+fXmsAnpUeec7n8tcr4S0= +gonum.org/v1/gonum v0.14.0/go.mod h1:AoWeoz0becf9QMWtE8iWXNXc27fK4fNeHNf/oMejGfU= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +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.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= +google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +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/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +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/receiver/namedpipereceiver/internal/metadata/generated_status.go b/receiver/namedpipereceiver/internal/metadata/generated_status.go new file mode 100644 index 000000000000..3d006f004aa5 --- /dev/null +++ b/receiver/namedpipereceiver/internal/metadata/generated_status.go @@ -0,0 +1,22 @@ +// 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 ( + Type = "namedpipe" + LogsStability = component.StabilityLevelAlpha +) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/namedpipereceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/namedpipereceiver") +} diff --git a/receiver/namedpipereceiver/metadata.yaml b/receiver/namedpipereceiver/metadata.yaml new file mode 100644 index 000000000000..7a2484200808 --- /dev/null +++ b/receiver/namedpipereceiver/metadata.yaml @@ -0,0 +1,9 @@ +type: namedpipe + +status: + class: receiver + stability: + alpha: [logs] + distributions: [contrib] + codeowners: + active: [djaglowski] diff --git a/receiver/namedpipereceiver/namedpipe.go b/receiver/namedpipereceiver/namedpipe.go new file mode 100644 index 000000000000..b81ea71ec31e --- /dev/null +++ b/receiver/namedpipereceiver/namedpipe.go @@ -0,0 +1,62 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package namedpipereceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/namedpipereceiver" + +import ( + "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/receiver" + + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/consumerretry" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/adapter" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/input/namedpipe" + "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/namedpipereceiver/internal/metadata" +) + +func NewFactory() receiver.Factory { + return adapter.NewFactory(&ReceiverType{}, metadata.LogsStability) +} + +type ReceiverType struct{} + +// Type is the receiver type +func (f ReceiverType) Type() component.Type { + return metadata.Type +} + +// CreateDefaultConfig creates a config with type and version +func (f ReceiverType) CreateDefaultConfig() component.Config { + return createDefaultConfig() +} + +func createDefaultConfig() *NamedPipeConfig { + return &NamedPipeConfig{ + BaseConfig: adapter.BaseConfig{ + Operators: []operator.Config{}, + RetryOnFailure: consumerretry.NewDefaultConfig(), + }, + InputConfig: func() namedpipe.Config { + conf := namedpipe.NewConfig() + conf.Permissions = 0o666 + + return *conf + }(), + } +} + +// BaseConfig gets the base config from config, for now +func (f ReceiverType) BaseConfig(cfg component.Config) adapter.BaseConfig { + return cfg.(*NamedPipeConfig).BaseConfig +} + +// NamedPipeConfig defines configuration for the namedpipe receiver +type NamedPipeConfig struct { + InputConfig namedpipe.Config `mapstructure:",squash"` + adapter.BaseConfig `mapstructure:",squash"` +} + +// InputConfig unmarshals the input operator +func (f ReceiverType) InputConfig(cfg component.Config) operator.Config { + return operator.NewConfig(&cfg.(*NamedPipeConfig).InputConfig) +} diff --git a/receiver/namedpipereceiver/namedpipe_test.go b/receiver/namedpipereceiver/namedpipe_test.go new file mode 100644 index 000000000000..15db4fad168f --- /dev/null +++ b/receiver/namedpipereceiver/namedpipe_test.go @@ -0,0 +1,104 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +//go:build linux +// +build linux + +package namedpipereceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/namedpipereceiver" + +import ( + "context" + "os" + "path/filepath" + "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/confmap/confmaptest" + "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/receiver/receivertest" + "go.uber.org/zap" + + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/consumerretry" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/adapter" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/input/namedpipe" +) + +func TestDefaultConfig(t *testing.T) { + factory := NewFactory() + cfg := factory.CreateDefaultConfig() + require.NotNil(t, cfg, "failed to create default config") + require.NoError(t, componenttest.CheckConfigStruct(cfg)) +} + +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.NewID("namedpipe").String()) + require.NoError(t, err) + require.NoError(t, component.UnmarshalConfig(sub, cfg)) + + assert.NoError(t, component.ValidateConfig(cfg)) + assert.Equal(t, testdataConfigYaml(), cfg) +} + +func TestReadPipe(t *testing.T) { + t.Parallel() + + f := NewFactory() + sink := new(consumertest.LogsSink) + cfg := testdataConfigYaml() + + converter := adapter.NewConverter(zap.NewNop()) + converter.Start() + defer converter.Stop() + + rcvr, err := f.CreateLogsReceiver(context.Background(), receivertest.NewNopCreateSettings(), cfg, sink) + require.NoError(t, err, "failed to create receiver") + require.NoError(t, rcvr.Start(context.Background(), componenttest.NewNopHost())) + + pipe, err := os.OpenFile("/tmp/pipe", os.O_WRONLY, 0o600) + require.NoError(t, err, "failed to open pipe") + defer pipe.Close() + + // Write 10 logs into the pipe and assert that they all come out the other end. + numLogs := 10 + for i := 0; i < numLogs; i++ { + _, err = pipe.WriteString("test\n") + require.NoError(t, err, "failed to write to pipe") + } + + assert.Eventually(t, func() bool { + return sink.LogRecordCount() == numLogs + }, time.Second, 100*time.Millisecond) +} + +func testdataConfigYaml() *NamedPipeConfig { + return &NamedPipeConfig{ + BaseConfig: adapter.BaseConfig{ + Operators: []operator.Config{}, + RetryOnFailure: consumerretry.Config{ + Enabled: false, + InitialInterval: 1 * time.Second, + MaxInterval: 30 * time.Second, + MaxElapsedTime: 5 * time.Minute, + }, + }, + InputConfig: func() namedpipe.Config { + c := namedpipe.NewConfig() + c.Path = "/tmp/pipe" + c.Permissions = 0o600 + c.Encoding = "utf-8" + + return *c + }(), + } +} diff --git a/receiver/namedpipereceiver/testdata/config.yaml b/receiver/namedpipereceiver/testdata/config.yaml new file mode 100644 index 000000000000..aa0da50da0ad --- /dev/null +++ b/receiver/namedpipereceiver/testdata/config.yaml @@ -0,0 +1,4 @@ +namedpipe: + path: /tmp/pipe + mode: 0600 + encoding: utf-8 diff --git a/receiver/nginxreceiver/generated_component_test.go b/receiver/nginxreceiver/generated_component_test.go new file mode 100644 index 000000000000..7f5eccedd573 --- /dev/null +++ b/receiver/nginxreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package nginxreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/nginxreceiver/go.mod b/receiver/nginxreceiver/go.mod index d40ae2d1a250..5d9faa0b6b54 100644 --- a/receiver/nginxreceiver/go.mod +++ b/receiver/nginxreceiver/go.mod @@ -17,6 +17,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -87,8 +89,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect golang.org/x/mod v0.14.0 // indirect diff --git a/receiver/nginxreceiver/internal/metadata/generated_status.go b/receiver/nginxreceiver/internal/metadata/generated_status.go index 935ed605e106..01df7602840e 100644 --- a/receiver/nginxreceiver/internal/metadata/generated_status.go +++ b/receiver/nginxreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "nginx" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/nginxreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/nginxreceiver") +} diff --git a/receiver/nginxreceiver/metadata.yaml b/receiver/nginxreceiver/metadata.yaml index c5cd9aa4987f..4303ff3b32a1 100644 --- a/receiver/nginxreceiver/metadata.yaml +++ b/receiver/nginxreceiver/metadata.yaml @@ -55,3 +55,6 @@ 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 new file mode 100644 index 000000000000..805fadf7203f --- /dev/null +++ b/receiver/nsxtreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package nsxtreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/nsxtreceiver/go.mod b/receiver/nsxtreceiver/go.mod index 1528285ed126..c0b0ab739db4 100644 --- a/receiver/nsxtreceiver/go.mod +++ b/receiver/nsxtreceiver/go.mod @@ -15,6 +15,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -56,8 +58,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/nsxtreceiver/internal/metadata/generated_status.go b/receiver/nsxtreceiver/internal/metadata/generated_status.go index 55bcfbc8bafa..98e7cc3d5ca8 100644 --- a/receiver/nsxtreceiver/internal/metadata/generated_status.go +++ b/receiver/nsxtreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "nsxt" MetricsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/nsxtreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/nsxtreceiver") +} diff --git a/receiver/nsxtreceiver/metadata.yaml b/receiver/nsxtreceiver/metadata.yaml index 08ba878f6dff..6a6d357c289d 100644 --- a/receiver/nsxtreceiver/metadata.yaml +++ b/receiver/nsxtreceiver/metadata.yaml @@ -112,3 +112,5 @@ 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 new file mode 100644 index 000000000000..6d090b1beb62 --- /dev/null +++ b/receiver/opencensusreceiver/generated_component_test.go @@ -0,0 +1,96 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package opencensusreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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()) + }, + }, + + { + 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) { + + // TODO support lifecycle + t.SkipNow() + + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + 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 610dec758eff..2a3dfbae1747 100644 --- a/receiver/opencensusreceiver/go.mod +++ b/receiver/opencensusreceiver/go.mod @@ -23,9 +23,10 @@ require ( go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 go.opentelemetry.io/otel v1.21.0 + go.opentelemetry.io/otel/metric v1.21.0 go.opentelemetry.io/otel/sdk v1.21.0 go.opentelemetry.io/otel/trace v1.21.0 - google.golang.org/grpc v1.60.0 + google.golang.org/grpc v1.60.1 google.golang.org/protobuf v1.31.0 ) @@ -74,7 +75,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/semconv v0.91.0 // indirect go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect diff --git a/receiver/opencensusreceiver/go.sum b/receiver/opencensusreceiver/go.sum index fad87144ff88..978058d5df45 100644 --- a/receiver/opencensusreceiver/go.sum +++ b/receiver/opencensusreceiver/go.sum @@ -606,8 +606,8 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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= diff --git a/receiver/opencensusreceiver/internal/metadata/generated_status.go b/receiver/opencensusreceiver/internal/metadata/generated_status.go index 3bea874298ae..d5c0349c5e93 100644 --- a/receiver/opencensusreceiver/internal/metadata/generated_status.go +++ b/receiver/opencensusreceiver/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -11,3 +13,11 @@ const ( MetricsStability = component.StabilityLevelBeta TracesStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/opencensusreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/opencensusreceiver") +} diff --git a/receiver/opencensusreceiver/metadata.yaml b/receiver/opencensusreceiver/metadata.yaml index 5ad4557b86e6..a59a4cfa08e0 100644 --- a/receiver/opencensusreceiver/metadata.yaml +++ b/receiver/opencensusreceiver/metadata.yaml @@ -13,3 +13,6 @@ status: - sumo codeowners: active: [open-telemetry/collector-approvers] +tests: + config: + skip_lifecycle: true \ No newline at end of file diff --git a/receiver/oracledbreceiver/generated_component_test.go b/receiver/oracledbreceiver/generated_component_test.go new file mode 100644 index 000000000000..ab8795745558 --- /dev/null +++ b/receiver/oracledbreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package oracledbreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/oracledbreceiver/internal/metadata/generated_status.go b/receiver/oracledbreceiver/internal/metadata/generated_status.go index 5374f367d479..0cdef17bbece 100644 --- a/receiver/oracledbreceiver/internal/metadata/generated_status.go +++ b/receiver/oracledbreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "oracledb" MetricsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/oracledbreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/oracledbreceiver") +} diff --git a/receiver/oracledbreceiver/metadata.yaml b/receiver/oracledbreceiver/metadata.yaml index ecb8b88538e2..d4d0be3ac398 100644 --- a/receiver/oracledbreceiver/metadata.yaml +++ b/receiver/oracledbreceiver/metadata.yaml @@ -251,4 +251,7 @@ metrics: monotonic: true value_type: int input_type: string - unit: "{gets}" \ No newline at end of file + unit: "{gets}" + +tests: + config: diff --git a/receiver/otlpjsonfilereceiver/generated_component_test.go b/receiver/otlpjsonfilereceiver/generated_component_test.go new file mode 100644 index 000000000000..f4fe062aaebb --- /dev/null +++ b/receiver/otlpjsonfilereceiver/generated_component_test.go @@ -0,0 +1,100 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package otlpjsonfilereceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/otlpjsonfilereceiver/go.mod b/receiver/otlpjsonfilereceiver/go.mod index b1aad439db04..a1b2277cdfe9 100644 --- a/receiver/otlpjsonfilereceiver/go.mod +++ b/receiver/otlpjsonfilereceiver/go.mod @@ -11,6 +11,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 ) require ( @@ -40,8 +42,6 @@ require ( go.opentelemetry.io/collector/extension v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/receiver/otlpjsonfilereceiver/internal/metadata/generated_status.go b/receiver/otlpjsonfilereceiver/internal/metadata/generated_status.go index cbef087aadf0..20aae4cd14d2 100644 --- a/receiver/otlpjsonfilereceiver/internal/metadata/generated_status.go +++ b/receiver/otlpjsonfilereceiver/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( MetricsStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/otlpjsonfilereceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/otlpjsonfilereceiver") +} diff --git a/receiver/otlpjsonfilereceiver/metadata.yaml b/receiver/otlpjsonfilereceiver/metadata.yaml index e6ab3530249a..e7489cdbe3ab 100644 --- a/receiver/otlpjsonfilereceiver/metadata.yaml +++ b/receiver/otlpjsonfilereceiver/metadata.yaml @@ -6,4 +6,8 @@ status: alpha: [traces, metrics, logs] distributions: [contrib, sumo] codeowners: - active: [djaglowski, atoulme] \ No newline at end of file + active: [djaglowski, atoulme] +tests: + config: + include: + - "/tmp/*.log" diff --git a/receiver/podmanreceiver/go.mod b/receiver/podmanreceiver/go.mod index b381bcd89360..dab49c821d41 100644 --- a/receiver/podmanreceiver/go.mod +++ b/receiver/podmanreceiver/go.mod @@ -11,9 +11,11 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 - golang.org/x/crypto v0.15.0 + golang.org/x/crypto v0.17.0 ) require ( @@ -36,8 +38,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/podmanreceiver/go.sum b/receiver/podmanreceiver/go.sum index e1157ac3f125..6cd493a6f662 100644 --- a/receiver/podmanreceiver/go.sum +++ b/receiver/podmanreceiver/go.sum @@ -130,8 +130,8 @@ 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.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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= @@ -161,7 +161,7 @@ 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.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.14.0 h1:LGK9IlZ8T9jvdy6cTdfKUCltatMFOehAQo9SRC46UQ8= +golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= 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= diff --git a/receiver/podmanreceiver/internal/metadata/generated_status.go b/receiver/podmanreceiver/internal/metadata/generated_status.go index 5d5d7a8f46e6..3db39a5e22e4 100644 --- a/receiver/podmanreceiver/internal/metadata/generated_status.go +++ b/receiver/podmanreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "podman_stats" MetricsStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/podmanreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/podmanreceiver") +} diff --git a/receiver/postgresqlreceiver/generated_component_test.go b/receiver/postgresqlreceiver/generated_component_test.go new file mode 100644 index 000000000000..93f1953abe03 --- /dev/null +++ b/receiver/postgresqlreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package postgresqlreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/postgresqlreceiver/go.mod b/receiver/postgresqlreceiver/go.mod index 7bdd069e8a78..976bf716c414 100644 --- a/receiver/postgresqlreceiver/go.mod +++ b/receiver/postgresqlreceiver/go.mod @@ -20,6 +20,8 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -79,8 +81,6 @@ require ( go.opentelemetry.io/collector v0.91.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/receiver/postgresqlreceiver/internal/metadata/generated_status.go b/receiver/postgresqlreceiver/internal/metadata/generated_status.go index 72987187142a..c99b7977ca0b 100644 --- a/receiver/postgresqlreceiver/internal/metadata/generated_status.go +++ b/receiver/postgresqlreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "postgresql" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/postgresqlreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/postgresqlreceiver") +} diff --git a/receiver/postgresqlreceiver/metadata.yaml b/receiver/postgresqlreceiver/metadata.yaml index a30e0624e9ee..33b99de51e3a 100644 --- a/receiver/postgresqlreceiver/metadata.yaml +++ b/receiver/postgresqlreceiver/metadata.yaml @@ -307,3 +307,5 @@ metrics: extended_documentation: | This metric requires WAL to be enabled with at least one replica. +tests: + config: diff --git a/receiver/prometheusreceiver/README.md b/receiver/prometheusreceiver/README.md index 1634d48f4981..db573d138342 100644 --- a/receiver/prometheusreceiver/README.md +++ b/receiver/prometheusreceiver/README.md @@ -4,7 +4,7 @@ | Status | | | ------------- |-----------| | Stability | [beta]: metrics | -| Distributions | [core], [contrib], [aws], [grafana], [observiq], [splunk], [sumo] | +| Distributions | [core], [contrib], [aws], [grafana], [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%2Fprometheus%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fprometheus) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fprometheus%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fprometheus) | | [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) | @@ -13,6 +13,7 @@ [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 [splunk]: https://github.com/signalfx/splunk-otel-collector [sumo]: https://github.com/SumoLogic/sumologic-otel-collector diff --git a/receiver/prometheusreceiver/generated_component_test.go b/receiver/prometheusreceiver/generated_component_test.go new file mode 100644 index 000000000000..834b8917225f --- /dev/null +++ b/receiver/prometheusreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package prometheusreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/prometheusreceiver/go.mod b/receiver/prometheusreceiver/go.mod index 9fbe1f494e6f..612f464448f8 100644 --- a/receiver/prometheusreceiver/go.mod +++ b/receiver/prometheusreceiver/go.mod @@ -24,6 +24,8 @@ require ( go.opentelemetry.io/collector/processor/batchprocessor v0.91.0 go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 google.golang.org/protobuf v1.31.0 gopkg.in/yaml.v2 v2.4.0 @@ -182,14 +184,12 @@ require ( go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.44.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/otel/sdk v1.21.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.16.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect diff --git a/receiver/prometheusreceiver/go.sum b/receiver/prometheusreceiver/go.sum index b056b002a3cc..cd562c122296 100644 --- a/receiver/prometheusreceiver/go.sum +++ b/receiver/prometheusreceiver/go.sum @@ -659,8 +659,8 @@ golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3 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-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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/receiver/prometheusreceiver/internal/metadata/generated_status.go b/receiver/prometheusreceiver/internal/metadata/generated_status.go index 793e897d7681..b96cf65f2bdf 100644 --- a/receiver/prometheusreceiver/internal/metadata/generated_status.go +++ b/receiver/prometheusreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "prometheus" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/prometheusreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/prometheusreceiver") +} diff --git a/receiver/prometheusreceiver/metadata.yaml b/receiver/prometheusreceiver/metadata.yaml index 38a3aa19f3ea..a2a9e95bb17e 100644 --- a/receiver/prometheusreceiver/metadata.yaml +++ b/receiver/prometheusreceiver/metadata.yaml @@ -12,5 +12,11 @@ status: - observiq - splunk - sumo + - liatrio codeowners: active: [Aneurysm9, dashpole] +tests: + config: + config: + scrape_configs: + - job_name: 'test' \ No newline at end of file diff --git a/receiver/pulsarreceiver/generated_component_test.go b/receiver/pulsarreceiver/generated_component_test.go new file mode 100644 index 000000000000..a79d6ed43ac7 --- /dev/null +++ b/receiver/pulsarreceiver/generated_component_test.go @@ -0,0 +1,103 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package pulsarreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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) { + + // TODO support lifecycle + t.SkipNow() + + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + 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 56a74e3dc23b..0a02155b09ed 100644 --- a/receiver/pulsarreceiver/go.mod +++ b/receiver/pulsarreceiver/go.mod @@ -18,6 +18,8 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -67,11 +69,9 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.16.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/oauth2 v0.14.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/receiver/pulsarreceiver/go.sum b/receiver/pulsarreceiver/go.sum index 2ca90b95e4dc..432f6c02d239 100644 --- a/receiver/pulsarreceiver/go.sum +++ b/receiver/pulsarreceiver/go.sum @@ -454,8 +454,8 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 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.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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/receiver/pulsarreceiver/internal/metadata/generated_status.go b/receiver/pulsarreceiver/internal/metadata/generated_status.go index 5002329249d4..8e040d2b292c 100644 --- a/receiver/pulsarreceiver/internal/metadata/generated_status.go +++ b/receiver/pulsarreceiver/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( TracesStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/pulsarreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/pulsarreceiver") +} diff --git a/receiver/pulsarreceiver/metadata.yaml b/receiver/pulsarreceiver/metadata.yaml index 680d4608233d..e90b33d89578 100644 --- a/receiver/pulsarreceiver/metadata.yaml +++ b/receiver/pulsarreceiver/metadata.yaml @@ -7,3 +7,6 @@ status: distributions: [contrib] codeowners: active: [dmitryax, dao-jun] +tests: + config: + skip_lifecycle: true diff --git a/receiver/purefareceiver/generated_component_test.go b/receiver/purefareceiver/generated_component_test.go new file mode 100644 index 000000000000..0fcba302b7cd --- /dev/null +++ b/receiver/purefareceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package purefareceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/purefareceiver/go.mod b/receiver/purefareceiver/go.mod index 882d05a180a4..48356993e96a 100644 --- a/receiver/purefareceiver/go.mod +++ b/receiver/purefareceiver/go.mod @@ -15,6 +15,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/extension v0.91.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 ) @@ -142,11 +144,9 @@ require ( go.opentelemetry.io/collector/semconv v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect - golang.org/x/crypto v0.16.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect @@ -161,7 +161,7 @@ require ( google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect - google.golang.org/grpc v1.60.0 // indirect + google.golang.org/grpc v1.60.1 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/receiver/purefareceiver/go.sum b/receiver/purefareceiver/go.sum index 1db5f38b56d9..ff2149e6b3f7 100644 --- a/receiver/purefareceiver/go.sum +++ b/receiver/purefareceiver/go.sum @@ -600,8 +600,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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= @@ -897,8 +897,8 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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= diff --git a/receiver/purefareceiver/internal/metadata/generated_status.go b/receiver/purefareceiver/internal/metadata/generated_status.go index 0e84e929033c..d1c878d0e344 100644 --- a/receiver/purefareceiver/internal/metadata/generated_status.go +++ b/receiver/purefareceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "purefa" MetricsStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/purefareceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/purefareceiver") +} diff --git a/receiver/purefareceiver/metadata.yaml b/receiver/purefareceiver/metadata.yaml index 6d2f2f3fb08f..18f1d6f5df2f 100644 --- a/receiver/purefareceiver/metadata.yaml +++ b/receiver/purefareceiver/metadata.yaml @@ -7,3 +7,6 @@ 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 new file mode 100644 index 000000000000..420f6b36983e --- /dev/null +++ b/receiver/purefbreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package purefbreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/purefbreceiver/go.mod b/receiver/purefbreceiver/go.mod index a7e3da62efdc..3af5629c1a47 100644 --- a/receiver/purefbreceiver/go.mod +++ b/receiver/purefbreceiver/go.mod @@ -15,6 +15,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/extension v0.91.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 ) @@ -142,11 +144,9 @@ require ( go.opentelemetry.io/collector/semconv v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect - golang.org/x/crypto v0.16.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect @@ -161,7 +161,7 @@ require ( google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect - google.golang.org/grpc v1.60.0 // indirect + google.golang.org/grpc v1.60.1 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/receiver/purefbreceiver/go.sum b/receiver/purefbreceiver/go.sum index 1db5f38b56d9..ff2149e6b3f7 100644 --- a/receiver/purefbreceiver/go.sum +++ b/receiver/purefbreceiver/go.sum @@ -600,8 +600,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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= @@ -897,8 +897,8 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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= diff --git a/receiver/purefbreceiver/internal/metadata/generated_status.go b/receiver/purefbreceiver/internal/metadata/generated_status.go index 18405043f96f..c9278be7e477 100644 --- a/receiver/purefbreceiver/internal/metadata/generated_status.go +++ b/receiver/purefbreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "purefb" MetricsStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/purefbreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/purefbreceiver") +} diff --git a/receiver/purefbreceiver/metadata.yaml b/receiver/purefbreceiver/metadata.yaml index 5c4c52d2612f..cf9a19b5fec7 100644 --- a/receiver/purefbreceiver/metadata.yaml +++ b/receiver/purefbreceiver/metadata.yaml @@ -7,3 +7,6 @@ status: distributions: [contrib, sumo] codeowners: active: [jpkrohling, dgoscn, chrroberts-pure] + +tests: + config: diff --git a/receiver/rabbitmqreceiver/generated_component_test.go b/receiver/rabbitmqreceiver/generated_component_test.go new file mode 100644 index 000000000000..9dfa06daabcb --- /dev/null +++ b/receiver/rabbitmqreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package rabbitmqreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/rabbitmqreceiver/go.mod b/receiver/rabbitmqreceiver/go.mod index 1428bd90216d..4ad77d247afd 100644 --- a/receiver/rabbitmqreceiver/go.mod +++ b/receiver/rabbitmqreceiver/go.mod @@ -15,6 +15,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -55,8 +57,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/rabbitmqreceiver/internal/metadata/generated_status.go b/receiver/rabbitmqreceiver/internal/metadata/generated_status.go index 0b838f884e9d..670cf57b741f 100644 --- a/receiver/rabbitmqreceiver/internal/metadata/generated_status.go +++ b/receiver/rabbitmqreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "rabbitmq" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/rabbitmqreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/rabbitmqreceiver") +} diff --git a/receiver/rabbitmqreceiver/metadata.yaml b/receiver/rabbitmqreceiver/metadata.yaml index 0b8770892f0d..930a680e6fba 100644 --- a/receiver/rabbitmqreceiver/metadata.yaml +++ b/receiver/rabbitmqreceiver/metadata.yaml @@ -80,3 +80,6 @@ metrics: value_type: int attributes: [message.state] enabled: true + +tests: + config: diff --git a/receiver/receivercreator/go.mod b/receiver/receivercreator/go.mod index 684e3642b413..1f839f8efa3f 100644 --- a/receiver/receivercreator/go.mod +++ b/receiver/receivercreator/go.mod @@ -17,6 +17,8 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -85,10 +87,8 @@ require ( go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.44.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/otel/sdk v1.21.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/receiver/receivercreator/internal/metadata/generated_status.go b/receiver/receivercreator/internal/metadata/generated_status.go index 2d1d94d45487..38b0e84f697d 100644 --- a/receiver/receivercreator/internal/metadata/generated_status.go +++ b/receiver/receivercreator/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -12,3 +14,11 @@ const ( TracesStability = component.StabilityLevelAlpha MetricsStability = component.StabilityLevelBeta ) + +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/receiver/redisreceiver/generated_component_test.go b/receiver/redisreceiver/generated_component_test.go new file mode 100644 index 000000000000..709139684d6c --- /dev/null +++ b/receiver/redisreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package redisreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/redisreceiver/go.mod b/receiver/redisreceiver/go.mod index c97299e9c6fd..265d76f5c98e 100644 --- a/receiver/redisreceiver/go.mod +++ b/receiver/redisreceiver/go.mod @@ -6,7 +6,7 @@ require ( github.com/google/go-cmp v0.6.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.91.0 - github.com/redis/go-redis/v9 v9.3.0 + github.com/redis/go-redis/v9 v9.3.1 github.com/stretchr/testify v1.8.4 github.com/testcontainers/testcontainers-go v0.26.0 go.opentelemetry.io/collector/component v0.91.0 @@ -17,6 +17,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -77,8 +79,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect golang.org/x/mod v0.14.0 // indirect diff --git a/receiver/redisreceiver/go.sum b/receiver/redisreceiver/go.sum index 6ab1910d799a..323d959b5d2a 100644 --- a/receiver/redisreceiver/go.sum +++ b/receiver/redisreceiver/go.sum @@ -165,8 +165,8 @@ github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cY github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= github.com/prometheus/statsd_exporter v0.22.7 h1:7Pji/i2GuhK6Lu7DHrtTkFmNBCudCPT1pX2CziuyQR0= -github.com/redis/go-redis/v9 v9.3.0 h1:RiVDjmig62jIWp7Kk4XVLs0hzV6pI3PyTnnL0cnn0u0= -github.com/redis/go-redis/v9 v9.3.0/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= +github.com/redis/go-redis/v9 v9.3.1 h1:KqdY8U+3X6z+iACvumCNxnoluToB+9Me+TvyFa21Mds= +github.com/redis/go-redis/v9 v9.3.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= diff --git a/receiver/redisreceiver/internal/metadata/generated_status.go b/receiver/redisreceiver/internal/metadata/generated_status.go index defca6ff527a..86fd27ad64c5 100644 --- a/receiver/redisreceiver/internal/metadata/generated_status.go +++ b/receiver/redisreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "redis" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/redisreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/redisreceiver") +} diff --git a/receiver/redisreceiver/metadata.yaml b/receiver/redisreceiver/metadata.yaml index b4ac8273884e..94a4d5fc2d85 100644 --- a/receiver/redisreceiver/metadata.yaml +++ b/receiver/redisreceiver/metadata.yaml @@ -344,3 +344,7 @@ metrics: gauge: value_type: int attributes: [db] + +tests: + config: + endpoint: localhost:6379 diff --git a/receiver/riakreceiver/generated_component_test.go b/receiver/riakreceiver/generated_component_test.go new file mode 100644 index 000000000000..4d8bdb05db5d --- /dev/null +++ b/receiver/riakreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package riakreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/riakreceiver/go.mod b/receiver/riakreceiver/go.mod index a1af37c5764f..0de9557ca361 100644 --- a/receiver/riakreceiver/go.mod +++ b/receiver/riakreceiver/go.mod @@ -15,6 +15,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -55,8 +57,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/riakreceiver/internal/metadata/generated_status.go b/receiver/riakreceiver/internal/metadata/generated_status.go index da3d0d68edf5..92edb4084b5c 100644 --- a/receiver/riakreceiver/internal/metadata/generated_status.go +++ b/receiver/riakreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "riak" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/riakreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/riakreceiver") +} diff --git a/receiver/riakreceiver/metadata.yaml b/receiver/riakreceiver/metadata.yaml index a199e9155e5a..7e37d272a5ea 100644 --- a/receiver/riakreceiver/metadata.yaml +++ b/receiver/riakreceiver/metadata.yaml @@ -80,3 +80,6 @@ metrics: value_type: int attributes: [operation] enabled: true + +tests: + config: diff --git a/receiver/saphanareceiver/go.mod b/receiver/saphanareceiver/go.mod index 4ef56bf6d287..4d8086e79301 100644 --- a/receiver/saphanareceiver/go.mod +++ b/receiver/saphanareceiver/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/saphan go 1.20 require ( - github.com/SAP/go-hdb v1.6.5 + github.com/SAP/go-hdb v1.6.6 github.com/google/go-cmp v0.6.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.91.0 @@ -16,6 +16,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -44,9 +46,7 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect - golang.org/x/crypto v0.16.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/receiver/saphanareceiver/go.sum b/receiver/saphanareceiver/go.sum index cd266a2a0906..80e0c3b263d0 100644 --- a/receiver/saphanareceiver/go.sum +++ b/receiver/saphanareceiver/go.sum @@ -1,8 +1,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= contrib.go.opencensus.io/exporter/prometheus v0.4.2 h1:sqfsYl5GIY/L570iT+l93ehxaWJs2/OwXtiWwew3oAg= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/SAP/go-hdb v1.6.5 h1:MmlBKJPV82HyVGJQr2PIC1g0HK+90qyUPuf7yPNSKZ8= -github.com/SAP/go-hdb v1.6.5/go.mod h1:RESA/tq6gO9jnSKeXokpnlWOYGmJ2jmCat+rC+AhRCI= +github.com/SAP/go-hdb v1.6.6 h1:n0uqv+omYcz01sLXQ4bK7vDj76x5ELU0qJ/8PPgri08= +github.com/SAP/go-hdb v1.6.6/go.mod h1:RESA/tq6gO9jnSKeXokpnlWOYGmJ2jmCat+rC+AhRCI= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= @@ -139,8 +139,8 @@ 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.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= diff --git a/receiver/saphanareceiver/internal/metadata/generated_status.go b/receiver/saphanareceiver/internal/metadata/generated_status.go index 3f9ead43d61c..44a6597ae7f8 100644 --- a/receiver/saphanareceiver/internal/metadata/generated_status.go +++ b/receiver/saphanareceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "saphana" MetricsStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/saphanareceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/saphanareceiver") +} diff --git a/receiver/sapmreceiver/generated_component_test.go b/receiver/sapmreceiver/generated_component_test.go new file mode 100644 index 000000000000..15b8424f106d --- /dev/null +++ b/receiver/sapmreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package sapmreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/sapmreceiver/go.mod b/receiver/sapmreceiver/go.mod index 3a1cdd8943cc..eeb2e73cef62 100644 --- a/receiver/sapmreceiver/go.mod +++ b/receiver/sapmreceiver/go.mod @@ -9,7 +9,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.91.0 - github.com/signalfx/sapm-proto v0.13.0 + github.com/signalfx/sapm-proto v0.14.0 github.com/stretchr/testify v1.8.4 go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/config/confighttp v0.91.0 @@ -19,6 +19,8 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 ) require ( @@ -58,8 +60,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.19.0 // indirect diff --git a/receiver/sapmreceiver/go.sum b/receiver/sapmreceiver/go.sum index f8738ae0ea74..b1b3052c4733 100644 --- a/receiver/sapmreceiver/go.sum +++ b/receiver/sapmreceiver/go.sum @@ -104,8 +104,8 @@ github.com/prometheus/statsd_exporter v0.22.7 h1:7Pji/i2GuhK6Lu7DHrtTkFmNBCudCPT github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/signalfx/sapm-proto v0.13.0 h1:yEkp1+MAU4vZvnJMp56uhVlRjlvCK7KQjBg0g2Apw8k= -github.com/signalfx/sapm-proto v0.13.0/go.mod h1:C72HjeCW5v0Llk6pIVJ/ZH8A5GbiZpCCSkE1dSlpWxY= +github.com/signalfx/sapm-proto v0.14.0 h1:KWh3I5E4EkelB19aP1/54Ik8khSioC/RVRW/riOfRGg= +github.com/signalfx/sapm-proto v0.14.0/go.mod h1:Km6PskZh966cqNoUn3AmRyGRix5VfwnxVBvn2vjRC9U= 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= diff --git a/receiver/sapmreceiver/internal/metadata/generated_status.go b/receiver/sapmreceiver/internal/metadata/generated_status.go index b623b108ae12..ba97ef60747a 100644 --- a/receiver/sapmreceiver/internal/metadata/generated_status.go +++ b/receiver/sapmreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "sapm" TracesStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/sapmreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/sapmreceiver") +} diff --git a/receiver/sapmreceiver/metadata.yaml b/receiver/sapmreceiver/metadata.yaml index e1307fbe30d8..d6ba89598d34 100644 --- a/receiver/sapmreceiver/metadata.yaml +++ b/receiver/sapmreceiver/metadata.yaml @@ -6,4 +6,7 @@ status: beta: [traces] distributions: [contrib, splunk, observiq, sumo] codeowners: - active: [atoulme] \ No newline at end of file + active: [atoulme] + +tests: + config: diff --git a/receiver/sapmreceiver/trace_receiver_test.go b/receiver/sapmreceiver/trace_receiver_test.go index 3c14e0af8683..05dbfb8de022 100644 --- a/receiver/sapmreceiver/trace_receiver_test.go +++ b/receiver/sapmreceiver/trace_receiver_test.go @@ -19,8 +19,6 @@ import ( "github.com/signalfx/sapm-proto/sapmprotocol" "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/confighttp" "go.opentelemetry.io/collector/config/configtls" "go.opentelemetry.io/collector/consumer/consumertest" @@ -423,21 +421,3 @@ func TestAccessTokenPassthrough(t *testing.T) { }) } } - -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -// newAssertNoErrorHost returns a new instance of assertNoErrorHost. -func newAssertNoErrorHost(t *testing.T) component.Host { - return &assertNoErrorHost{ - Host: componenttest.NewNopHost(), - T: t, - } -} - -func (aneh *assertNoErrorHost) ReportFatalError(err error) { - assert.NoError(aneh, err) -} diff --git a/receiver/signalfxreceiver/generated_component_test.go b/receiver/signalfxreceiver/generated_component_test.go new file mode 100644 index 000000000000..daf601d03d6b --- /dev/null +++ b/receiver/signalfxreceiver/generated_component_test.go @@ -0,0 +1,93 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package signalfxreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/signalfxreceiver/go.mod b/receiver/signalfxreceiver/go.mod index a6287a10cd46..ac16f1647662 100644 --- a/receiver/signalfxreceiver/go.mod +++ b/receiver/signalfxreceiver/go.mod @@ -11,7 +11,6 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/signalfx v0.91.0 github.com/signalfx/com_signalfx_metrics_protobuf v0.0.3 github.com/stretchr/testify v1.8.4 - go.opencensus.io v0.24.0 go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/config/confighttp v0.91.0 go.opentelemetry.io/collector/config/configtls v0.91.0 @@ -20,7 +19,8 @@ require ( go.opentelemetry.io/collector/exporter v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 - go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -35,7 +35,6 @@ require ( github.com/go-ole/go-ole v1.2.6 // indirect github.com/gobwas/glob v0.2.3 // 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/hashicorp/go-version v1.6.0 // indirect @@ -62,6 +61,7 @@ require ( 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.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector v0.91.0 // indirect go.opentelemetry.io/collector/config/configauth v0.91.0 // indirect go.opentelemetry.io/collector/config/configcompression v0.91.0 // indirect @@ -71,10 +71,9 @@ require ( go.opentelemetry.io/collector/extension v0.91.0 // indirect go.opentelemetry.io/collector/extension/auth v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect + go.opentelemetry.io/collector/semconv v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/receiver/signalfxreceiver/go.sum b/receiver/signalfxreceiver/go.sum index 6fde3d5d6394..157cc87e34d2 100644 --- a/receiver/signalfxreceiver/go.sum +++ b/receiver/signalfxreceiver/go.sum @@ -36,7 +36,6 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69 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= diff --git a/receiver/signalfxreceiver/internal/metadata/generated_status.go b/receiver/signalfxreceiver/internal/metadata/generated_status.go index d1205b62b2b3..5a7f83a280af 100644 --- a/receiver/signalfxreceiver/internal/metadata/generated_status.go +++ b/receiver/signalfxreceiver/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -11,3 +13,11 @@ const ( MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/signalfxreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/signalfxreceiver") +} diff --git a/receiver/signalfxreceiver/metadata.yaml b/receiver/signalfxreceiver/metadata.yaml index 1ab2bb674571..598fa13bf08e 100644 --- a/receiver/signalfxreceiver/metadata.yaml +++ b/receiver/signalfxreceiver/metadata.yaml @@ -8,3 +8,6 @@ status: codeowners: active: ["dmitryax"] emeritus: + +tests: + config: diff --git a/receiver/signalfxreceiver/receiver.go b/receiver/signalfxreceiver/receiver.go index 23cf6f637da9..419112058577 100644 --- a/receiver/signalfxreceiver/receiver.go +++ b/receiver/signalfxreceiver/receiver.go @@ -17,13 +17,11 @@ import ( "github.com/gorilla/mux" sfxpb "github.com/signalfx/com_signalfx_metrics_protobuf/model" - "go.opencensus.io/trace" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/pdata/plog" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receiverhelper" - conventions "go.opentelemetry.io/collector/semconv/v1.6.1" "go.uber.org/zap" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk" @@ -329,22 +327,7 @@ func (r *sfxReceiver) failRequest( // Use the same pattern as strings.Builder String(). msg := *(*string)(unsafe.Pointer(&jsonResponse)) - reqSpan := trace.FromContext(ctx) - reqSpan.AddAttributes( - trace.Int64Attribute(conventions.AttributeHTTPStatusCode, int64(httpStatusCode)), - trace.StringAttribute("http.status_text", msg)) - traceStatus := trace.Status{ - Code: trace.StatusCodeInvalidArgument, - } - if httpStatusCode == http.StatusInternalServerError { - traceStatus.Code = trace.StatusCodeInternal - } - if err != nil { - traceStatus.Message = err.Error() - } - reqSpan.SetStatus(traceStatus) - reqSpan.End() - + r.obsrecv.EndMetricsOp(ctx, metadata.Type, 0, err) r.settings.Logger.Debug( "SignalFx receiver request failed", zap.Int("http_status_code", httpStatusCode), diff --git a/receiver/signalfxreceiver/receiver_test.go b/receiver/signalfxreceiver/receiver_test.go index 3348163bd1fc..711007cc9dab 100644 --- a/receiver/signalfxreceiver/receiver_test.go +++ b/receiver/signalfxreceiver/receiver_test.go @@ -820,24 +820,6 @@ func (b badReqBody) Close() error { return nil } -// assertNoErrorHost implements a component.Host that asserts that there were no errors. -type assertNoErrorHost struct { - component.Host - *testing.T -} - -// newAssertNoErrorHost returns a new instance of assertNoErrorHost. -func newAssertNoErrorHost(t *testing.T) component.Host { - return &assertNoErrorHost{ - Host: componenttest.NewNopHost(), - T: t, - } -} - -func (aneh *assertNoErrorHost) ReportFatalError(err error) { - assert.NoError(aneh, err) -} - func strPtr(s string) *string { return &s } diff --git a/receiver/simpleprometheusreceiver/generated_component_test.go b/receiver/simpleprometheusreceiver/generated_component_test.go new file mode 100644 index 000000000000..865138395261 --- /dev/null +++ b/receiver/simpleprometheusreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package simpleprometheusreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/simpleprometheusreceiver/go.mod b/receiver/simpleprometheusreceiver/go.mod index 37d9046b3dfa..aa2454d18ca2 100644 --- a/receiver/simpleprometheusreceiver/go.mod +++ b/receiver/simpleprometheusreceiver/go.mod @@ -13,6 +13,8 @@ require ( go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 k8s.io/client-go v0.28.4 ) @@ -141,12 +143,10 @@ require ( go.opentelemetry.io/collector/semconv v0.91.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.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.16.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect diff --git a/receiver/simpleprometheusreceiver/go.sum b/receiver/simpleprometheusreceiver/go.sum index fb1a747f9e20..8d86951bc8ff 100644 --- a/receiver/simpleprometheusreceiver/go.sum +++ b/receiver/simpleprometheusreceiver/go.sum @@ -597,8 +597,8 @@ golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3 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-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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/receiver/simpleprometheusreceiver/internal/metadata/generated_status.go b/receiver/simpleprometheusreceiver/internal/metadata/generated_status.go index f00b1937abf6..cff80b1efaba 100644 --- a/receiver/simpleprometheusreceiver/internal/metadata/generated_status.go +++ b/receiver/simpleprometheusreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "prometheus_simple" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/simpleprometheusreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/simpleprometheusreceiver") +} diff --git a/receiver/simpleprometheusreceiver/metadata.yaml b/receiver/simpleprometheusreceiver/metadata.yaml index ee7e54472a10..1c02f3f64a86 100644 --- a/receiver/simpleprometheusreceiver/metadata.yaml +++ b/receiver/simpleprometheusreceiver/metadata.yaml @@ -7,3 +7,6 @@ status: distributions: [contrib, splunk, observiq, sumo] codeowners: active: [fatsheep9146] + +tests: + config: diff --git a/receiver/skywalkingreceiver/generated_component_test.go b/receiver/skywalkingreceiver/generated_component_test.go new file mode 100644 index 000000000000..6c9eef939cbf --- /dev/null +++ b/receiver/skywalkingreceiver/generated_component_test.go @@ -0,0 +1,93 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package skywalkingreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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()) + }, + }, + + { + 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 := newAssertNoErrorHost(t) + 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/skywalkingreceiver/go.mod b/receiver/skywalkingreceiver/go.mod index 2abb8bcee81e..ba80ab2f8738 100644 --- a/receiver/skywalkingreceiver/go.mod +++ b/receiver/skywalkingreceiver/go.mod @@ -17,10 +17,12 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 - google.golang.org/grpc v1.60.0 + google.golang.org/grpc v1.60.1 google.golang.org/protobuf v1.31.0 - skywalking.apache.org/repo/goapi v0.0.0-20231026090926-09378dd56587 + skywalking.apache.org/repo/goapi v0.0.0-20231213062226-7849efc09ba3 ) require ( @@ -61,8 +63,6 @@ require ( go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/oauth2 v0.14.0 // indirect diff --git a/receiver/skywalkingreceiver/go.sum b/receiver/skywalkingreceiver/go.sum index 6912aaee87b1..c96d119fc013 100644 --- a/receiver/skywalkingreceiver/go.sum +++ b/receiver/skywalkingreceiver/go.sum @@ -200,6 +200,7 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk 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.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= 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= @@ -210,6 +211,7 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= 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-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -225,6 +227,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -239,6 +243,7 @@ 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/sync v0.0.0-20210220032951-036812b2e83c/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.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -251,16 +256,22 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= 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.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= 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= @@ -274,6 +285,7 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= 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= @@ -297,8 +309,8 @@ google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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= @@ -322,5 +334,5 @@ 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= -skywalking.apache.org/repo/goapi v0.0.0-20231026090926-09378dd56587 h1:TY79I5Y7xRB8q5LQ+MJn7NYsYi0VL5nj1QDrUHwK7cQ= -skywalking.apache.org/repo/goapi v0.0.0-20231026090926-09378dd56587/go.mod h1:onFubXaIoY/2FTRVrLMqCTlaNq4SilAEwF/2G0IcaBw= +skywalking.apache.org/repo/goapi v0.0.0-20231213062226-7849efc09ba3 h1:rqXePgPd1SeNYl4GSHyndwNggpGdOh+9ZMSRCfesgDU= +skywalking.apache.org/repo/goapi v0.0.0-20231213062226-7849efc09ba3/go.mod h1:oD2dxcDAHVIt95Ee7kJHgZ5f64QNhrqTjQYARwfafc4= diff --git a/receiver/skywalkingreceiver/internal/metadata/generated_status.go b/receiver/skywalkingreceiver/internal/metadata/generated_status.go index 5c7e14dd2798..66fcb374c6b2 100644 --- a/receiver/skywalkingreceiver/internal/metadata/generated_status.go +++ b/receiver/skywalkingreceiver/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -11,3 +13,11 @@ const ( TracesStability = component.StabilityLevelBeta MetricsStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/skywalkingreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/skywalkingreceiver") +} diff --git a/receiver/skywalkingreceiver/metadata.yaml b/receiver/skywalkingreceiver/metadata.yaml index 43edd9e827a6..ffbef358da76 100644 --- a/receiver/skywalkingreceiver/metadata.yaml +++ b/receiver/skywalkingreceiver/metadata.yaml @@ -8,3 +8,9 @@ status: distributions: [contrib, sumo] codeowners: active: [JaredTan95] + +tests: + config: + protocols: + grpc: + endpoint: localhost:1234 \ No newline at end of file diff --git a/receiver/snmpreceiver/client.go b/receiver/snmpreceiver/client.go index dd4b30a49265..df2547960811 100644 --- a/receiver/snmpreceiver/client.go +++ b/receiver/snmpreceiver/client.go @@ -189,7 +189,7 @@ func (c *snmpClient) Close() error { // GetScalarData retrieves and returns scalar data from passed in scalar OIDs. // Note: These OIDs must all end in ".0" for the SNMP GET to work correctly func (c *snmpClient) GetScalarData(oids []string, scraperErrors *scrapererror.ScrapeErrors) []SNMPData { - scalarData := []SNMPData{} + var scalarData []SNMPData // Nothing to do if there are no OIDs if len(oids) == 0 { @@ -244,7 +244,7 @@ func (c *snmpClient) GetScalarData(oids []string, scraperErrors *scrapererror.Sc // GetIndexedData retrieves indexed metrics from passed in column OIDs. The returned data // is then also passed into the provided function. func (c *snmpClient) GetIndexedData(oids []string, scraperErrors *scrapererror.ScrapeErrors) []SNMPData { - indexedData := []SNMPData{} + var indexedData []SNMPData // Nothing to do if there are no OIDs if len(oids) == 0 { @@ -372,7 +372,7 @@ func (c *snmpClient) convertSnmpPDUToSnmpData(pdu gosnmp.SnmpPDU) SNMPData { // This is a convenience function to make working with SnmpPDU's easier - it // reduces the need for type assertions. A int64 is convenient, as SNMP can // return int32, uint32, and int64. -func (c snmpClient) toInt64(name string, value any) (int64, error) { +func (c *snmpClient) toInt64(name string, value any) (int64, error) { switch value := value.(type) { // shadow case uint: return int64(value), nil @@ -405,7 +405,7 @@ func (c snmpClient) toInt64(name string, value any) (int64, error) { // This is a convenience function to make working with SnmpPDU's easier - it // reduces the need for type assertions. A float64 is convenient, as SNMP can // return float32 and float64. -func (c snmpClient) toFloat64(name string, value any) (float64, error) { +func (c *snmpClient) toFloat64(name string, value any) (float64, error) { switch value := value.(type) { // shadow case float32: return float64(value), nil diff --git a/receiver/snmpreceiver/client_test.go b/receiver/snmpreceiver/client_test.go index 491b20d9a2d9..0f54b111c9f6 100644 --- a/receiver/snmpreceiver/client_test.go +++ b/receiver/snmpreceiver/client_test.go @@ -204,7 +204,7 @@ func TestGetScalarData(t *testing.T) { { desc: "No OIDs does nothing", testFunc: func(t *testing.T) { - expectedSNMPData := []SNMPData{} + var expectedSNMPData []SNMPData mockGoSNMP := new(mocks.MockGoSNMPWrapper) client := &snmpClient{ logger: zap.NewNop(), @@ -219,7 +219,6 @@ func TestGetScalarData(t *testing.T) { { desc: "GoSNMP Client failures adds error", testFunc: func(t *testing.T) { - expectedSNMPData := []SNMPData{} getError := errors.New("Bad GET") mockGoSNMP := new(mocks.MockGoSNMPWrapper) mockGoSNMP.On("Get", []string{"1"}).Return(nil, getError) @@ -233,13 +232,13 @@ func TestGetScalarData(t *testing.T) { returnedSNMPData := client.GetScalarData(oidSlice, &scraperErrors) expectedErr := fmt.Errorf("problem with getting scalar data: problem with SNMP GET for OIDs '%v': %w", oidSlice, getError) require.EqualError(t, scraperErrors.Combine(), expectedErr.Error()) - require.Equal(t, expectedSNMPData, returnedSNMPData) + require.Nil(t, returnedSNMPData) }, }, { desc: "GoSNMP Client timeout failures tries to reset connection", testFunc: func(t *testing.T) { - expectedSNMPData := []SNMPData{} + var expectedSNMPData []SNMPData getError := errors.New("request timeout (after 0 retries)") mockGoSNMP := new(mocks.MockGoSNMPWrapper) mockGoSNMP.On("Get", []string{"1"}).Return(nil, getError) @@ -261,7 +260,6 @@ func TestGetScalarData(t *testing.T) { { desc: "GoSNMP Client reset connection fails on connect adds error", testFunc: func(t *testing.T) { - expectedSNMPData := []SNMPData{} getError := errors.New("request timeout (after 0 retries)") mockGoSNMP := new(mocks.MockGoSNMPWrapper) mockGoSNMP.On("Get", []string{"1"}).Return(nil, getError) @@ -280,7 +278,7 @@ func TestGetScalarData(t *testing.T) { expectedErr2 := fmt.Errorf("problem with getting scalar data: problem connecting while trying to reset connection: %w", connectErr) expectedErr := fmt.Errorf(expectedErr1.Error() + "; " + expectedErr2.Error()) require.EqualError(t, scraperErrors.Combine(), expectedErr.Error()) - require.Equal(t, expectedSNMPData, returnedSNMPData) + require.Nil(t, returnedSNMPData) }, }, { @@ -321,7 +319,6 @@ func TestGetScalarData(t *testing.T) { { desc: "GoSNMP Client returned nil value does not return data", testFunc: func(t *testing.T) { - expectedSNMPData := []SNMPData{} mockGoSNMP := new(mocks.MockGoSNMPWrapper) pdu := gosnmp.SnmpPDU{ Value: nil, @@ -341,13 +338,12 @@ func TestGetScalarData(t *testing.T) { returnedSNMPData := client.GetScalarData(oidSlice, &scraperErrors) expectedErr := fmt.Errorf("problem with getting scalar data: data for OID '%s' not found", badOID) require.EqualError(t, scraperErrors.Combine(), expectedErr.Error()) - require.Equal(t, expectedSNMPData, returnedSNMPData) + require.Nil(t, returnedSNMPData) }, }, { desc: "GoSNMP Client returned unsupported type value does not return data", testFunc: func(t *testing.T) { - expectedSNMPData := []SNMPData{} mockGoSNMP := new(mocks.MockGoSNMPWrapper) pdu := gosnmp.SnmpPDU{ Value: true, @@ -367,7 +363,7 @@ func TestGetScalarData(t *testing.T) { returnedSNMPData := client.GetScalarData(oidSlice, &scraperErrors) expectedErr := fmt.Errorf("problem with getting scalar data: data for OID '%s' not a supported type", badOID) require.EqualError(t, scraperErrors.Combine(), expectedErr.Error()) - require.Equal(t, expectedSNMPData, returnedSNMPData) + require.Nil(t, returnedSNMPData) }, }, { @@ -462,7 +458,6 @@ func TestGetScalarData(t *testing.T) { { desc: "GoSNMP Client float data type with bad value adds error", testFunc: func(t *testing.T) { - expectedSNMPData := []SNMPData{} mockGoSNMP := new(mocks.MockGoSNMPWrapper) pdu1 := gosnmp.SnmpPDU{ Value: true, @@ -480,13 +475,12 @@ func TestGetScalarData(t *testing.T) { returnedSNMPData := client.GetScalarData(oidSlice, &scraperErrors) expectedErr := fmt.Errorf("problem with getting scalar data: data for OID '1' not a supported type") require.EqualError(t, scraperErrors.Combine(), expectedErr.Error()) - require.Equal(t, expectedSNMPData, returnedSNMPData) + require.Nil(t, returnedSNMPData) }, }, { desc: "GoSNMP Client float data type with bad string value adds error", testFunc: func(t *testing.T) { - expectedSNMPData := []SNMPData{} mockGoSNMP := new(mocks.MockGoSNMPWrapper) pdu1 := gosnmp.SnmpPDU{ Value: "bad", @@ -504,13 +498,12 @@ func TestGetScalarData(t *testing.T) { returnedSNMPData := client.GetScalarData(oidSlice, &scraperErrors) expectedErr := fmt.Errorf("problem with getting scalar data: data for OID '1' not a supported type") require.EqualError(t, scraperErrors.Combine(), expectedErr.Error()) - require.Equal(t, expectedSNMPData, returnedSNMPData) + require.Nil(t, returnedSNMPData) }, }, { desc: "GoSNMP Client int data type with bad value adds error", testFunc: func(t *testing.T) { - expectedSNMPData := []SNMPData{} mockGoSNMP := new(mocks.MockGoSNMPWrapper) pdu1 := gosnmp.SnmpPDU{ Value: float64(math.MaxFloat64), @@ -528,7 +521,7 @@ func TestGetScalarData(t *testing.T) { returnedSNMPData := client.GetScalarData(oidSlice, &scraperErrors) expectedErr := fmt.Errorf("problem with getting scalar data: data for OID '1' not a supported type") require.EqualError(t, scraperErrors.Combine(), expectedErr.Error()) - require.Equal(t, expectedSNMPData, returnedSNMPData) + require.Nil(t, returnedSNMPData) }, }, { @@ -575,7 +568,6 @@ func TestGetIndexedData(t *testing.T) { { desc: "No OIDs does nothing", testFunc: func(t *testing.T) { - expectedSNMPData := []SNMPData{} mockGoSNMP := new(mocks.MockGoSNMPWrapper) client := &snmpClient{ logger: zap.NewNop(), @@ -584,13 +576,12 @@ func TestGetIndexedData(t *testing.T) { var scraperErrors scrapererror.ScrapeErrors returnedSNMPData := client.GetIndexedData([]string{}, &scraperErrors) require.NoError(t, scraperErrors.Combine()) - require.Equal(t, expectedSNMPData, returnedSNMPData) + require.Nil(t, returnedSNMPData) }, }, { desc: "GoSNMP Client failures adds error", testFunc: func(t *testing.T) { - expectedSNMPData := []SNMPData{} walkError := errors.New("Bad WALK") mockGoSNMP := new(mocks.MockGoSNMPWrapper) mockGoSNMP.On("GetVersion", mock.Anything).Return(gosnmp.Version2c) @@ -604,13 +595,12 @@ func TestGetIndexedData(t *testing.T) { returnedSNMPData := client.GetIndexedData(oidSlice, &scraperErrors) expectedErr := fmt.Errorf("problem with getting indexed data: problem with SNMP WALK for OID '1': %w", walkError) require.EqualError(t, scraperErrors.Combine(), expectedErr.Error()) - require.Equal(t, expectedSNMPData, returnedSNMPData) + require.Nil(t, returnedSNMPData) }, }, { desc: "GoSNMP Client timeout failures tries to reset connection", testFunc: func(t *testing.T) { - expectedSNMPData := []SNMPData{} walkError := errors.New("request timeout (after 0 retries)") mockGoSNMP := new(mocks.MockGoSNMPWrapper) mockGoSNMP.On("GetVersion", mock.Anything).Return(gosnmp.Version2c) @@ -626,13 +616,12 @@ func TestGetIndexedData(t *testing.T) { returnedSNMPData := client.GetIndexedData(oidSlice, &scraperErrors) expectedErr := fmt.Errorf("problem with getting indexed data: problem with SNMP WALK for OID '1': %w", walkError) require.EqualError(t, scraperErrors.Combine(), expectedErr.Error()) - require.Equal(t, expectedSNMPData, returnedSNMPData) + require.Nil(t, returnedSNMPData) }, }, { desc: "GoSNMP Client reset connection fails on connect adds errors", testFunc: func(t *testing.T) { - expectedSNMPData := []SNMPData{} walkError := errors.New("request timeout (after 0 retries)") mockGoSNMP := new(mocks.MockGoSNMPWrapper) mockGoSNMP.On("GetVersion", mock.Anything).Return(gosnmp.Version2c) @@ -651,7 +640,7 @@ func TestGetIndexedData(t *testing.T) { expectedErr2 := fmt.Errorf("problem with getting indexed data: problem connecting while trying to reset connection: %w", connectErr) expectedErr := fmt.Errorf(expectedErr1.Error() + "; " + expectedErr2.Error()) require.EqualError(t, scraperErrors.Combine(), expectedErr.Error()) - require.Equal(t, expectedSNMPData, returnedSNMPData) + require.Nil(t, returnedSNMPData) }, }, { @@ -690,7 +679,6 @@ func TestGetIndexedData(t *testing.T) { { desc: "GoSNMP Client returned nil value does not return data", testFunc: func(t *testing.T) { - expectedSNMPData := []SNMPData{} mockGoSNMP := new(mocks.MockGoSNMPWrapper) mockGoSNMP.On("GetVersion", mock.Anything).Return(gosnmp.Version2c) badOID := "1.1" @@ -709,13 +697,12 @@ func TestGetIndexedData(t *testing.T) { returnedSNMPData := client.GetIndexedData(oidSlice, &scraperErrors) expectedErr := fmt.Errorf("problem with getting indexed data: data for OID '%s' not found", badOID) require.EqualError(t, scraperErrors.Combine(), expectedErr.Error()) - require.Equal(t, expectedSNMPData, returnedSNMPData) + require.Nil(t, returnedSNMPData) }, }, { desc: "GoSNMP Client returned unsupported type value does not return data", testFunc: func(t *testing.T) { - expectedSNMPData := []SNMPData{} mockGoSNMP := new(mocks.MockGoSNMPWrapper) mockGoSNMP.On("GetVersion", mock.Anything).Return(gosnmp.Version2c) badOID := "1.1" @@ -734,7 +721,7 @@ func TestGetIndexedData(t *testing.T) { returnedSNMPData := client.GetIndexedData(oidSlice, &scraperErrors) expectedErr := fmt.Errorf("problem with getting indexed data: data for OID '%s' not a supported type", badOID) require.EqualError(t, scraperErrors.Combine(), expectedErr.Error()) - require.Equal(t, expectedSNMPData, returnedSNMPData) + require.Nil(t, returnedSNMPData) }, }, { @@ -833,7 +820,6 @@ func TestGetIndexedData(t *testing.T) { { desc: "GoSNMP Client float data type with bad value adds error", testFunc: func(t *testing.T) { - expectedSNMPData := []SNMPData{} mockGoSNMP := new(mocks.MockGoSNMPWrapper) mockGoSNMP.On("GetVersion", mock.Anything).Return(gosnmp.Version2c) pdu := gosnmp.SnmpPDU{ @@ -850,13 +836,12 @@ func TestGetIndexedData(t *testing.T) { returnedSNMPData := client.GetIndexedData([]string{"1"}, &scraperErrors) expectedErr := fmt.Errorf("problem with getting indexed data: data for OID '1.1' not a supported type") require.EqualError(t, scraperErrors.Combine(), expectedErr.Error()) - require.Equal(t, expectedSNMPData, returnedSNMPData) + require.Nil(t, returnedSNMPData) }, }, { desc: "GoSNMP Client float data type with bad string value adds error", testFunc: func(t *testing.T) { - expectedSNMPData := []SNMPData{} mockGoSNMP := new(mocks.MockGoSNMPWrapper) mockGoSNMP.On("GetVersion", mock.Anything).Return(gosnmp.Version2c) pdu := gosnmp.SnmpPDU{ @@ -873,13 +858,12 @@ func TestGetIndexedData(t *testing.T) { returnedSNMPData := client.GetIndexedData([]string{"1"}, &scraperErrors) expectedErr := fmt.Errorf("problem with getting indexed data: data for OID '1.1' not a supported type") require.EqualError(t, scraperErrors.Combine(), expectedErr.Error()) - require.Equal(t, expectedSNMPData, returnedSNMPData) + require.Nil(t, returnedSNMPData) }, }, { desc: "GoSNMP Client int data type with bad value adds error", testFunc: func(t *testing.T) { - expectedSNMPData := []SNMPData{} mockGoSNMP := new(mocks.MockGoSNMPWrapper) mockGoSNMP.On("GetVersion", mock.Anything).Return(gosnmp.Version2c) pdu := gosnmp.SnmpPDU{ @@ -896,7 +880,7 @@ func TestGetIndexedData(t *testing.T) { returnedSNMPData := client.GetIndexedData([]string{"1"}, &scraperErrors) expectedErr := fmt.Errorf("problem with getting indexed data: data for OID '1.1' not a supported type") require.EqualError(t, scraperErrors.Combine(), expectedErr.Error()) - require.Equal(t, expectedSNMPData, returnedSNMPData) + require.Nil(t, returnedSNMPData) }, }, { diff --git a/receiver/snmpreceiver/generated_component_test.go b/receiver/snmpreceiver/generated_component_test.go new file mode 100644 index 000000000000..80832d62c8bf --- /dev/null +++ b/receiver/snmpreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package snmpreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/snmpreceiver/go.mod b/receiver/snmpreceiver/go.mod index f4de7e679615..5c26bcf96f13 100644 --- a/receiver/snmpreceiver/go.mod +++ b/receiver/snmpreceiver/go.mod @@ -15,6 +15,8 @@ require ( go.opentelemetry.io/collector/otelcol v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -107,10 +109,8 @@ require ( go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.44.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect go.opentelemetry.io/otel/sdk v1.21.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect diff --git a/receiver/snmpreceiver/internal/metadata/generated_status.go b/receiver/snmpreceiver/internal/metadata/generated_status.go index 439779d726fb..0c8652dfa96f 100644 --- a/receiver/snmpreceiver/internal/metadata/generated_status.go +++ b/receiver/snmpreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "snmp" MetricsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/snmpreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/snmpreceiver") +} diff --git a/receiver/snmpreceiver/metadata.yaml b/receiver/snmpreceiver/metadata.yaml index 204f1e9eadf3..aed9f3699602 100644 --- a/receiver/snmpreceiver/metadata.yaml +++ b/receiver/snmpreceiver/metadata.yaml @@ -6,4 +6,14 @@ status: alpha: [metrics] distributions: [contrib, sumo] codeowners: - active: [djaglowski, StefanKurek, tamir-michaeli] \ No newline at end of file + active: [djaglowski, StefanKurek, tamir-michaeli] + +tests: + config: + metrics: + m1: + unit: "1" + gauge: + value_type: int + scalar_oids: + - oid: ".1" diff --git a/receiver/snowflakereceiver/generated_component_test.go b/receiver/snowflakereceiver/generated_component_test.go new file mode 100644 index 000000000000..823c9014c3b3 --- /dev/null +++ b/receiver/snowflakereceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package snowflakereceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/snowflakereceiver/go.mod b/receiver/snowflakereceiver/go.mod index 2f6842f368a4..24e730ec9b7a 100644 --- a/receiver/snowflakereceiver/go.mod +++ b/receiver/snowflakereceiver/go.mod @@ -15,6 +15,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -83,15 +85,13 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect - golang.org/x/crypto v0.15.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sync v0.5.0 // indirect golang.org/x/sys v0.15.0 // indirect - golang.org/x/term v0.14.0 // indirect + golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.15.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect diff --git a/receiver/snowflakereceiver/go.sum b/receiver/snowflakereceiver/go.sum index f89b37ffdf14..7c4a8c4d94c5 100644 --- a/receiver/snowflakereceiver/go.sum +++ b/receiver/snowflakereceiver/go.sum @@ -253,8 +253,8 @@ 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.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 h1:FqrVOBQxQ8r/UwwXibI0KMolVhvFiGobSfdE33deHJM= golang.org/x/exp v0.0.0-20230711023510-fffb14384f22/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= @@ -294,8 +294,8 @@ golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.14.0 h1:LGK9IlZ8T9jvdy6cTdfKUCltatMFOehAQo9SRC46UQ8= -golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww= +golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= 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= diff --git a/receiver/snowflakereceiver/internal/metadata/generated_status.go b/receiver/snowflakereceiver/internal/metadata/generated_status.go index a4a6286e70aa..02686bbe1ad1 100644 --- a/receiver/snowflakereceiver/internal/metadata/generated_status.go +++ b/receiver/snowflakereceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "snowflake" MetricsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/snowflakereceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/snowflakereceiver") +} diff --git a/receiver/snowflakereceiver/metadata.yaml b/receiver/snowflakereceiver/metadata.yaml index f3d31d3a0430..a81d14009e4f 100644 --- a/receiver/snowflakereceiver/metadata.yaml +++ b/receiver/snowflakereceiver/metadata.yaml @@ -313,3 +313,6 @@ metrics: gauge: value_type: int enabled: false + +tests: + config: diff --git a/receiver/solacereceiver/go.mod b/receiver/solacereceiver/go.mod index bb2086be9770..65669f17f0ad 100644 --- a/receiver/solacereceiver/go.mod +++ b/receiver/solacereceiver/go.mod @@ -17,6 +17,8 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/otel v1.21.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 google.golang.org/protobuf v1.31.0 ) @@ -39,8 +41,6 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/receiver/solacereceiver/internal/metadata/generated_status.go b/receiver/solacereceiver/internal/metadata/generated_status.go index d29fa4ce7ba0..ea4e1c54d4f6 100644 --- a/receiver/solacereceiver/internal/metadata/generated_status.go +++ b/receiver/solacereceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "solace" TracesStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/solacereceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/solacereceiver") +} diff --git a/receiver/splunkenterprisereceiver/generated_component_test.go b/receiver/splunkenterprisereceiver/generated_component_test.go new file mode 100644 index 000000000000..82544817215f --- /dev/null +++ b/receiver/splunkenterprisereceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package splunkenterprisereceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/splunkenterprisereceiver/go.mod b/receiver/splunkenterprisereceiver/go.mod index deeaa9eea97e..2a74d22fece8 100644 --- a/receiver/splunkenterprisereceiver/go.mod +++ b/receiver/splunkenterprisereceiver/go.mod @@ -16,6 +16,8 @@ require ( go.opentelemetry.io/collector/extension/auth v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -54,8 +56,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/splunkenterprisereceiver/internal/metadata/generated_status.go b/receiver/splunkenterprisereceiver/internal/metadata/generated_status.go index 9ab9965626b7..061ba0be1da7 100644 --- a/receiver/splunkenterprisereceiver/internal/metadata/generated_status.go +++ b/receiver/splunkenterprisereceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "splunkenterprise" MetricsStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/splunkenterprisereceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/splunkenterprisereceiver") +} diff --git a/receiver/splunkenterprisereceiver/metadata.yaml b/receiver/splunkenterprisereceiver/metadata.yaml index 9059a4f11841..8666de0743fb 100644 --- a/receiver/splunkenterprisereceiver/metadata.yaml +++ b/receiver/splunkenterprisereceiver/metadata.yaml @@ -105,3 +105,6 @@ metrics: gauge: value_type: int attributes: [splunk.queue.name] + +tests: + config: diff --git a/receiver/splunkhecreceiver/README.md b/receiver/splunkhecreceiver/README.md index 24213f53acc6..cfd66279cf47 100644 --- a/receiver/splunkhecreceiver/README.md +++ b/receiver/splunkhecreceiver/README.md @@ -39,7 +39,7 @@ The following settings are optional: exporter](../../exporter/splunkhecexporter/README.md) to preserve datapoint origin. * `tls_settings` (no default): This is an optional object used to specify if TLS should be used for - incoming connections. + incoming connections. Please consult [configtls] for the complete list of options available. * `cert_file`: Specifies the certificate file to use for TLS connection. Note: Both `key_file` and `cert_file` are required for TLS connection. * `key_file`: Specifies the key file to use for TLS connection. Note: Both @@ -71,3 +71,5 @@ receivers: The full list of settings exposed for this receiver are documented [here](./config.go) with detailed sample configurations [here](./testdata/config.yaml). + +[configtls]: https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/configtls \ No newline at end of file diff --git a/receiver/splunkhecreceiver/go.mod b/receiver/splunkhecreceiver/go.mod index 46cf96b78d91..46e4cbffc416 100644 --- a/receiver/splunkhecreceiver/go.mod +++ b/receiver/splunkhecreceiver/go.mod @@ -20,6 +20,8 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -61,8 +63,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/receiver/splunkhecreceiver/internal/metadata/generated_status.go b/receiver/splunkhecreceiver/internal/metadata/generated_status.go index 94372e4579b1..2ab0fedbeb10 100644 --- a/receiver/splunkhecreceiver/internal/metadata/generated_status.go +++ b/receiver/splunkhecreceiver/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -11,3 +13,11 @@ const ( MetricsStability = component.StabilityLevelBeta LogsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/splunkhecreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/splunkhecreceiver") +} diff --git a/receiver/splunkhecreceiver/receiver.go b/receiver/splunkhecreceiver/receiver.go index 6f62bc6dcd8e..ccf13b18be93 100644 --- a/receiver/splunkhecreceiver/receiver.go +++ b/receiver/splunkhecreceiver/receiver.go @@ -49,6 +49,8 @@ const ( // Centralizing some HTTP and related string constants. gzipEncoding = "gzip" httpContentEncodingHeader = "Content-Encoding" + httpContentTypeHeader = "Content-Type" + httpJSONTypeHeader = "application/json" ) var ( @@ -229,6 +231,14 @@ func (r *splunkReceiver) Shutdown(context.Context) error { return err } +func (r *splunkReceiver) writeSuccessResponse(ctx context.Context, resp http.ResponseWriter, eventCount int) { + resp.Header().Set(httpContentTypeHeader, httpJSONTypeHeader) + resp.WriteHeader(http.StatusOK) + if _, err := resp.Write(okRespBody); err != nil { + r.failRequest(ctx, resp, http.StatusInternalServerError, errInternalServerError, eventCount, err) + } +} + func (r *splunkReceiver) handleRawReq(resp http.ResponseWriter, req *http.Request) { ctx := req.Context() ctx = r.obsrecv.StartLogsOp(ctx) @@ -292,7 +302,7 @@ func (r *splunkReceiver) handleRawReq(resp http.ResponseWriter, req *http.Reques if consumerErr != nil { r.failRequest(ctx, resp, http.StatusInternalServerError, errInternalServerError, slLen, consumerErr) } else { - resp.WriteHeader(http.StatusOK) + r.writeSuccessResponse(ctx, resp, ld.LogRecordCount()) r.obsrecv.EndLogsOp(ctx, metadata.Type, slLen, nil) } } @@ -404,10 +414,7 @@ func (r *splunkReceiver) handleReq(resp http.ResponseWriter, req *http.Request) } } - resp.WriteHeader(http.StatusOK) - if _, err := resp.Write(okRespBody); err != nil { - r.failRequest(ctx, resp, http.StatusInternalServerError, errInternalServerError, len(events)+len(metricEvents), err) - } + r.writeSuccessResponse(ctx, resp, len(events)+len(metricEvents)) } func (r *splunkReceiver) createResourceCustomizer(req *http.Request) func(resource pcommon.Resource) { diff --git a/receiver/splunkhecreceiver/receiver_test.go b/receiver/splunkhecreceiver/receiver_test.go index 6ae210f768b3..4fc29b3d07da 100644 --- a/receiver/splunkhecreceiver/receiver_test.go +++ b/receiver/splunkhecreceiver/receiver_test.go @@ -37,6 +37,13 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/internal/splunk" ) +func assertHecSuccessResponse(t *testing.T, resp *http.Response, body any) { + status := resp.StatusCode + assert.Equal(t, http.StatusOK, status) + assert.Equal(t, httpJSONTypeHeader, resp.Header.Get(httpContentTypeHeader)) + assert.Equal(t, map[string]any{"code": float64(0), "text": "Success"}, body) +} + func Test_splunkhecreceiver_NewLogsReceiver(t *testing.T) { defaultConfig := createDefaultConfig().(*Config) emptyEndpointConfig := createDefaultConfig().(*Config) @@ -167,14 +174,15 @@ func Test_splunkhecReceiver_handleReq(t *testing.T) { tests := []struct { name string req *http.Request - assertResponse func(t *testing.T, status int, body any) + assertResponse func(t *testing.T, resp *http.Response, body any) assertSink func(t *testing.T, sink *consumertest.LogsSink) assertMetricsSink func(t *testing.T, sink *consumertest.MetricsSink) }{ { name: "incorrect_method", req: httptest.NewRequest("PUT", "http://localhost/foo", nil), - assertResponse: func(t *testing.T, status int, body any) { + assertResponse: func(t *testing.T, resp *http.Response, body any) { + status := resp.StatusCode assert.Equal(t, http.StatusBadRequest, status) assert.Equal(t, "Only \"POST\" method is supported", body) }, @@ -188,7 +196,8 @@ func Test_splunkhecReceiver_handleReq(t *testing.T) { req.Header.Set("Content-Type", "application/not-json") return req }(), - assertResponse: func(t *testing.T, status int, body any) { + assertResponse: func(t *testing.T, resp *http.Response, body any) { + status := resp.StatusCode assert.Equal(t, http.StatusOK, status) assert.Equal(t, map[string]any{ "text": "Success", @@ -203,7 +212,8 @@ func Test_splunkhecReceiver_handleReq(t *testing.T) { req.Header.Set("Content-Encoding", "superzipper") return req }(), - assertResponse: func(t *testing.T, status int, body any) { + assertResponse: func(t *testing.T, resp *http.Response, body any) { + status := resp.StatusCode assert.Equal(t, http.StatusUnsupportedMediaType, status) assert.Equal(t, `"Content-Encoding" must be "gzip" or empty`, body) }, @@ -214,7 +224,8 @@ func Test_splunkhecReceiver_handleReq(t *testing.T) { req := httptest.NewRequest("POST", "http://localhost/foo", bytes.NewReader([]byte{1, 2, 3, 4})) return req }(), - assertResponse: func(t *testing.T, status int, body any) { + assertResponse: func(t *testing.T, resp *http.Response, body any) { + status := resp.StatusCode assert.Equal(t, http.StatusBadRequest, status) assert.Equal(t, map[string]any{"code": float64(6), "text": "Invalid data format"}, body) }, @@ -225,7 +236,8 @@ func Test_splunkhecReceiver_handleReq(t *testing.T) { req := httptest.NewRequest("POST", "http://localhost/foo", bytes.NewReader(nil)) return req }(), - assertResponse: func(t *testing.T, status int, body any) { + assertResponse: func(t *testing.T, resp *http.Response, body any) { + status := resp.StatusCode assert.Equal(t, http.StatusBadRequest, status) assert.Equal(t, map[string]any{"code": float64(5), "text": "No data"}, body) }, @@ -238,7 +250,8 @@ func Test_splunkhecReceiver_handleReq(t *testing.T) { req := httptest.NewRequest("POST", "http://localhost/foo", bytes.NewReader(msgBytes)) return req }(), - assertResponse: func(t *testing.T, status int, body any) { + assertResponse: func(t *testing.T, resp *http.Response, body any) { + status := resp.StatusCode assert.Equal(t, http.StatusBadRequest, status) assert.Equal(t, map[string]any{"code": float64(6), "text": "Invalid data format"}, body) }, @@ -253,7 +266,8 @@ func Test_splunkhecReceiver_handleReq(t *testing.T) { req := httptest.NewRequest("POST", "http://localhost/foo", bytes.NewReader(msgBytes)) return req }(), - assertResponse: func(t *testing.T, status int, body any) { + assertResponse: func(t *testing.T, resp *http.Response, body any) { + status := resp.StatusCode assert.Equal(t, http.StatusBadRequest, status) assert.Equal(t, map[string]any{"code": float64(12), "text": "Event field is required"}, body) }, @@ -268,7 +282,8 @@ func Test_splunkhecReceiver_handleReq(t *testing.T) { req := httptest.NewRequest("POST", "http://localhost/foo", bytes.NewReader(msgBytes)) return req }(), - assertResponse: func(t *testing.T, status int, body any) { + assertResponse: func(t *testing.T, resp *http.Response, body any) { + status := resp.StatusCode assert.Equal(t, http.StatusBadRequest, status) assert.Equal(t, map[string]any{"code": float64(13), "text": "Event field cannot be blank"}, body) }, @@ -281,9 +296,8 @@ func Test_splunkhecReceiver_handleReq(t *testing.T) { req := httptest.NewRequest("POST", "http://localhost/foo", bytes.NewReader(msgBytes)) return req }(), - assertResponse: func(t *testing.T, status int, body any) { - assert.Equal(t, http.StatusOK, status) - assert.Equal(t, map[string]any{"code": float64(0), "text": "Success"}, body) + assertResponse: func(t *testing.T, resp *http.Response, body any) { + assertHecSuccessResponse(t, resp, body) }, assertSink: func(t *testing.T, sink *consumertest.LogsSink) { assert.Equal(t, 1, len(sink.AllLogs())) @@ -300,9 +314,8 @@ func Test_splunkhecReceiver_handleReq(t *testing.T) { req := httptest.NewRequest("POST", "http://localhost/foo", bytes.NewReader(msgBytes)) return req }(), - assertResponse: func(t *testing.T, status int, body any) { - assert.Equal(t, http.StatusOK, status) - assert.Equal(t, map[string]any{"code": float64(0), "text": "Success"}, body) + assertResponse: func(t *testing.T, resp *http.Response, body any) { + assertHecSuccessResponse(t, resp, body) }, assertSink: func(t *testing.T, sink *consumertest.LogsSink) { assert.Equal(t, 0, len(sink.AllLogs())) @@ -327,9 +340,8 @@ func Test_splunkhecReceiver_handleReq(t *testing.T) { req.Header.Set("Content-Encoding", "gzip") return req }(), - assertResponse: func(t *testing.T, status int, body any) { - assert.Equal(t, http.StatusOK, status) - assert.Equal(t, map[string]any{"code": float64(0), "text": "Success"}, body) + assertResponse: func(t *testing.T, resp *http.Response, body any) { + assertHecSuccessResponse(t, resp, body) }, }, { @@ -342,7 +354,8 @@ func Test_splunkhecReceiver_handleReq(t *testing.T) { req.Header.Set("Content-Encoding", "gzip") return req }(), - assertResponse: func(t *testing.T, status int, body any) { + assertResponse: func(t *testing.T, resp *http.Response, body any) { + status := resp.StatusCode assert.Equal(t, http.StatusBadRequest, status) assert.Equal(t, `Error on gzip body`, body) }, @@ -373,7 +386,7 @@ func Test_splunkhecReceiver_handleReq(t *testing.T) { fmt.Println(string(respBytes)) assert.NoError(t, json.Unmarshal(respBytes, &body)) - tt.assertResponse(t, resp.StatusCode, body) + tt.assertResponse(t, resp, body) if tt.assertSink != nil { tt.assertSink(t, sink) } @@ -928,12 +941,13 @@ func Test_splunkhecReceiver_handleRawReq(t *testing.T) { tests := []struct { name string req *http.Request - assertResponse func(t *testing.T, status int, body any) + assertResponse func(t *testing.T, resp *http.Response, body any) }{ { name: "incorrect_method", req: httptest.NewRequest("PUT", "http://localhost/foo", nil), - assertResponse: func(t *testing.T, status int, body any) { + assertResponse: func(t *testing.T, resp *http.Response, body any) { + status := resp.StatusCode assert.Equal(t, http.StatusBadRequest, status) assert.Equal(t, `Only "POST" method is supported`, body) }, @@ -945,7 +959,8 @@ func Test_splunkhecReceiver_handleRawReq(t *testing.T) { req.Header.Set("Content-Type", "application/not-json") return req }(), - assertResponse: func(t *testing.T, status int, body any) { + assertResponse: func(t *testing.T, resp *http.Response, body any) { + status := resp.StatusCode assert.Equal(t, http.StatusOK, status) }, }, @@ -956,7 +971,8 @@ func Test_splunkhecReceiver_handleRawReq(t *testing.T) { req.Header.Set("Content-Encoding", "superzipper") return req }(), - assertResponse: func(t *testing.T, status int, body any) { + assertResponse: func(t *testing.T, resp *http.Response, body any) { + status := resp.StatusCode assert.Equal(t, http.StatusUnsupportedMediaType, status) assert.Equal(t, `"Content-Encoding" must be "gzip" or empty`, body) }, @@ -967,7 +983,8 @@ func Test_splunkhecReceiver_handleRawReq(t *testing.T) { req := httptest.NewRequest("POST", "http://localhost/foo", bytes.NewReader(nil)) return req }(), - assertResponse: func(t *testing.T, status int, body any) { + assertResponse: func(t *testing.T, resp *http.Response, body any) { + status := resp.StatusCode assert.Equal(t, http.StatusBadRequest, status) assert.Equal(t, map[string]any{"code": float64(5), "text": "No data"}, body) }, @@ -979,7 +996,8 @@ func Test_splunkhecReceiver_handleRawReq(t *testing.T) { req := httptest.NewRequest("POST", "http://localhost/foo", strings.NewReader("foo\nbar")) return req }(), - assertResponse: func(t *testing.T, status int, body any) { + assertResponse: func(t *testing.T, resp *http.Response, body any) { + status := resp.StatusCode assert.Equal(t, http.StatusOK, status) }, }, @@ -991,8 +1009,8 @@ func Test_splunkhecReceiver_handleRawReq(t *testing.T) { req := httptest.NewRequest("POST", "http://localhost/foo", bytes.NewReader(msgBytes)) return req }(), - assertResponse: func(t *testing.T, status int, body any) { - assert.Equal(t, http.StatusOK, status) + assertResponse: func(t *testing.T, resp *http.Response, body any) { + assertHecSuccessResponse(t, resp, body) }, }, { @@ -1011,8 +1029,8 @@ func Test_splunkhecReceiver_handleRawReq(t *testing.T) { req.Header.Set("Content-Encoding", "gzip") return req }(), - assertResponse: func(t *testing.T, status int, body any) { - assert.Equal(t, http.StatusOK, status) + assertResponse: func(t *testing.T, resp *http.Response, body any) { + assertHecSuccessResponse(t, resp, body) }, }, { @@ -1025,7 +1043,8 @@ func Test_splunkhecReceiver_handleRawReq(t *testing.T) { req.Header.Set("Content-Encoding", "gzip") return req }(), - assertResponse: func(t *testing.T, status int, body any) { + assertResponse: func(t *testing.T, resp *http.Response, body any) { + status := resp.StatusCode assert.Equal(t, http.StatusBadRequest, status) assert.Equal(t, `Error on gzip body`, body) }, @@ -1044,7 +1063,8 @@ func Test_splunkhecReceiver_handleRawReq(t *testing.T) { return req }(), - assertResponse: func(t *testing.T, status int, body any) { + assertResponse: func(t *testing.T, resp *http.Response, body any) { + status := resp.StatusCode assert.Equal(t, http.StatusBadRequest, status) assert.Equal(t, map[string]any{"code": float64(6), "text": "Invalid data format"}, body) }, @@ -1063,7 +1083,8 @@ func Test_splunkhecReceiver_handleRawReq(t *testing.T) { return req }(), - assertResponse: func(t *testing.T, status int, body any) { + assertResponse: func(t *testing.T, resp *http.Response, body any) { + status := resp.StatusCode assert.Equal(t, http.StatusBadRequest, status) assert.Equal(t, map[string]any{"code": float64(6), "text": "Invalid data format"}, body) }, @@ -1094,7 +1115,7 @@ func Test_splunkhecReceiver_handleRawReq(t *testing.T) { assert.NoError(t, json.Unmarshal(respBytes, &body)) } - tt.assertResponse(t, resp.StatusCode, body) + tt.assertResponse(t, resp, body) }) } } diff --git a/receiver/sqlqueryreceiver/generated_component_test.go b/receiver/sqlqueryreceiver/generated_component_test.go new file mode 100644 index 000000000000..14c5c455d92b --- /dev/null +++ b/receiver/sqlqueryreceiver/generated_component_test.go @@ -0,0 +1,93 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package sqlqueryreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/sqlqueryreceiver/go.mod b/receiver/sqlqueryreceiver/go.mod index 2a10addb2092..ec5dc335de73 100644 --- a/receiver/sqlqueryreceiver/go.mod +++ b/receiver/sqlqueryreceiver/go.mod @@ -3,7 +3,7 @@ module github.com/open-telemetry/opentelemetry-collector-contrib/receiver/sqlque go 1.20 require ( - github.com/SAP/go-hdb v1.6.5 + github.com/SAP/go-hdb v1.6.6 github.com/denisenkom/go-mssqldb v0.12.3 github.com/docker/go-connections v0.4.0 github.com/go-sql-driver/mysql v1.7.1 @@ -22,6 +22,8 @@ require ( go.opentelemetry.io/collector/extension v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -125,9 +127,7 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect - golang.org/x/crypto v0.16.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect diff --git a/receiver/sqlqueryreceiver/go.sum b/receiver/sqlqueryreceiver/go.sum index e2f0f46401e7..1cf5d627b5d5 100644 --- a/receiver/sqlqueryreceiver/go.sum +++ b/receiver/sqlqueryreceiver/go.sum @@ -28,8 +28,8 @@ github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migc github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Microsoft/hcsshim v0.11.1 h1:hJ3s7GbWlGK4YVV92sO88BQSyF4ZLVy7/awqOlPxFbA= github.com/Microsoft/hcsshim v0.11.1/go.mod h1:nFJmaO4Zr5Y7eADdFOpYswDDlNVbvcIJJNJLECr5JQg= -github.com/SAP/go-hdb v1.6.5 h1:MmlBKJPV82HyVGJQr2PIC1g0HK+90qyUPuf7yPNSKZ8= -github.com/SAP/go-hdb v1.6.5/go.mod h1:RESA/tq6gO9jnSKeXokpnlWOYGmJ2jmCat+rC+AhRCI= +github.com/SAP/go-hdb v1.6.6 h1:n0uqv+omYcz01sLXQ4bK7vDj76x5ELU0qJ/8PPgri08= +github.com/SAP/go-hdb v1.6.6/go.mod h1:RESA/tq6gO9jnSKeXokpnlWOYGmJ2jmCat+rC+AhRCI= github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/apache/arrow/go/v12 v12.0.1 h1:JsR2+hzYYjgSUkBSaahpqCetqZMr76djX80fF/DiJbg= @@ -373,8 +373,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/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.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= diff --git a/receiver/sqlqueryreceiver/internal/metadata/generated_status.go b/receiver/sqlqueryreceiver/internal/metadata/generated_status.go index f1ed4309364b..c8ed5cda33d1 100644 --- a/receiver/sqlqueryreceiver/internal/metadata/generated_status.go +++ b/receiver/sqlqueryreceiver/internal/metadata/generated_status.go @@ -4,6 +4,8 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( @@ -11,3 +13,11 @@ const ( MetricsStability = component.StabilityLevelAlpha LogsStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/sqlqueryreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/sqlqueryreceiver") +} diff --git a/receiver/sqlqueryreceiver/metadata.yaml b/receiver/sqlqueryreceiver/metadata.yaml index 5094a3ab8b44..a4df60be3553 100644 --- a/receiver/sqlqueryreceiver/metadata.yaml +++ b/receiver/sqlqueryreceiver/metadata.yaml @@ -7,4 +7,7 @@ status: development: [logs] distributions: [contrib, splunk, observiq, sumo] codeowners: - active: [dmitryax, pmcollins] \ No newline at end of file + active: [dmitryax, pmcollins] + +tests: + config: diff --git a/receiver/sqlserverreceiver/go.mod b/receiver/sqlserverreceiver/go.mod index dd11664c748c..a823a775ea96 100644 --- a/receiver/sqlserverreceiver/go.mod +++ b/receiver/sqlserverreceiver/go.mod @@ -13,6 +13,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -40,8 +42,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/sqlserverreceiver/internal/metadata/generated_status.go b/receiver/sqlserverreceiver/internal/metadata/generated_status.go index b21d07ebe250..560b048eda86 100644 --- a/receiver/sqlserverreceiver/internal/metadata/generated_status.go +++ b/receiver/sqlserverreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "sqlserver" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/sqlserverreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/sqlserverreceiver") +} diff --git a/receiver/sshcheckreceiver/go.mod b/receiver/sshcheckreceiver/go.mod index e43d75a3926d..e1c2a050aa49 100644 --- a/receiver/sshcheckreceiver/go.mod +++ b/receiver/sshcheckreceiver/go.mod @@ -16,7 +16,7 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 go.uber.org/multierr v1.11.0 - golang.org/x/crypto v0.15.0 + golang.org/x/crypto v0.17.0 ) require ( @@ -50,8 +50,8 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect diff --git a/receiver/sshcheckreceiver/go.sum b/receiver/sshcheckreceiver/go.sum index d242cbb63403..c6f6bc2b1848 100644 --- a/receiver/sshcheckreceiver/go.sum +++ b/receiver/sshcheckreceiver/go.sum @@ -139,8 +139,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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= @@ -183,7 +183,7 @@ golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.14.0 h1:LGK9IlZ8T9jvdy6cTdfKUCltatMFOehAQo9SRC46UQ8= +golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= diff --git a/receiver/sshcheckreceiver/internal/metadata/generated_status.go b/receiver/sshcheckreceiver/internal/metadata/generated_status.go index 0b93ac586923..a122b3e84b47 100644 --- a/receiver/sshcheckreceiver/internal/metadata/generated_status.go +++ b/receiver/sshcheckreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "sshcheck" MetricsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/sshcheckreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/sshcheckreceiver") +} diff --git a/receiver/statsdreceiver/config_test.go b/receiver/statsdreceiver/config_test.go index ecfb38ecc0e6..b9d726e0baca 100644 --- a/receiver/statsdreceiver/config_test.go +++ b/receiver/statsdreceiver/config_test.go @@ -93,6 +93,7 @@ func TestValidate(t *testing.T) { noObjectNameErr = "must specify object id for all TimerHistogramMappings" statsdTypeNotSupportErr = "statsd_type is not a supported mapping for histogram and timing metrics: %s" observerTypeNotSupportErr = "observer_type is not supported for histogram and timing metrics: %s" + invalidHistogramErr = "histogram configuration requires observer_type: histogram" ) tests := []test{ @@ -160,7 +161,7 @@ func TestValidate(t *testing.T) { }, }, }, - expectedErr: "histogram configuration requires observer_type: histogram", + expectedErr: invalidHistogramErr, }, { name: "negativeAggregationInterval", @@ -170,7 +171,7 @@ func TestValidate(t *testing.T) { {StatsdType: "timing", ObserverType: "gauge"}, }, }, - expectedErr: "aggregation_interval must be a positive duration", + expectedErr: negativeAggregationIntervalErr, }, } diff --git a/receiver/statsdreceiver/generated_component_test.go b/receiver/statsdreceiver/generated_component_test.go new file mode 100644 index 000000000000..9459e2b072e6 --- /dev/null +++ b/receiver/statsdreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package statsdreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/statsdreceiver/go.mod b/receiver/statsdreceiver/go.mod index a349d163c6c6..a15f721396c3 100644 --- a/receiver/statsdreceiver/go.mod +++ b/receiver/statsdreceiver/go.mod @@ -7,7 +7,6 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal v0.91.0 github.com/stretchr/testify v1.8.4 - go.opencensus.io v0.24.0 go.opentelemetry.io/collector v0.91.0 go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/config/confignet v0.91.0 @@ -16,54 +15,38 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/otel v1.21.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 gonum.org/v1/gonum v0.14.0 ) require ( - contrib.go.opencensus.io/exporter/prometheus v0.4.2 // 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/go-kit/log v0.2.1 // indirect - github.com/go-logfmt/logfmt v0.5.1 // indirect - github.com/go-logr/logr v1.3.0 // indirect - github.com/go-logr/stdr v1.2.2 // 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/hashicorp/go-version v1.6.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/knadh/koanf/maps v0.1.1 // indirect github.com/knadh/koanf/providers/confmap v0.1.0 // indirect github.com/knadh/koanf/v2 v2.0.1 // indirect - github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.5.1-0.20220423185008-bf980b35cac4 // 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.17.0 // indirect - github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect - github.com/prometheus/statsd_exporter v0.22.7 // indirect + go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect - go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/sdk v1.21.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect google.golang.org/grpc v1.59.0 // indirect google.golang.org/protobuf v1.31.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/receiver/statsdreceiver/go.sum b/receiver/statsdreceiver/go.sum index 6fc08717ce6d..1a8e3cbf8dfa 100644 --- a/receiver/statsdreceiver/go.sum +++ b/receiver/statsdreceiver/go.sum @@ -1,59 +1,9 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= contrib.go.opencensus.io/exporter/prometheus v0.4.2 h1:sqfsYl5GIY/L570iT+l93ehxaWJs2/OwXtiWwew3oAg= -contrib.go.opencensus.io/exporter/prometheus v0.4.2/go.mod h1:dvEHbiKmgvbr5pjaF9fpw1KeYcjrnC1J8B+JKjsZyRQ= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= 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/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE= -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= -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/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= 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/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= 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= @@ -63,103 +13,42 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= -github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= -github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= -github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= 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-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 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/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= 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.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= 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/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= 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.4.1/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.1/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.4/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.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= 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 v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -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/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs= @@ -168,19 +57,11 @@ github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPgh github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU= github.com/knadh/koanf/v2 v2.0.1 h1:1dYGITt1I23x8cfx8ZnldtezdyaZtfAuRtIFOiRzK7g= github.com/knadh/koanf/v2 v2.0.1/go.mod h1:ZeiIlIDXTE7w1lMT6UVcNiRAS2/rCeLn/GdLNvY1Dus= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/lightstep/go-expohisto v1.0.0 h1:UPtTS1rGdtehbbAF7o/dhkWLTDI73UifG8LbfQI7cA4= github.com/lightstep/go-expohisto v1.0.0/go.mod h1:xDXD0++Mu2FOaItXtdDfksfgxfV0z1TMPa+e/EUd0cs= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= 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/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.20220423185008-bf980b35cac4 h1:BpfhmLKZf+SjVanKKhCgf3bg+511DmU9eDQTen7LLbY= @@ -190,79 +71,29 @@ github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx 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 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= 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/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -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.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= -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= -github.com/prometheus/client_model v0.2.0/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.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -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.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.35.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= -github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= -github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/prometheus/statsd_exporter v0.22.7 h1:7Pji/i2GuhK6Lu7DHrtTkFmNBCudCPT1pX2CziuyQR0= -github.com/prometheus/statsd_exporter v0.22.7/go.mod h1:N/TevpjkIh9ccs6nuzY3jQn9dFqnUakOjnEuMPJJJnI= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/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.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.1/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/stvp/go-udp-testing v0.0.0-20201019212854-469649b16807/go.mod h1:7jxmlfBCDBXRzr0eAQJ48XC1hBu1np4CS5+cHEYfwpc= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -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= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= 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.91.0 h1:C7sGUJDJ5nwm+CkWpAaVP3lNsuYpwSRbkmLncFjkmO8= @@ -277,26 +108,20 @@ go.opentelemetry.io/collector/confmap v0.91.0 h1:7U2MT+u74oEzq/WWrpXSLKB7nX5jPNC go.opentelemetry.io/collector/confmap v0.91.0/go.mod h1:uxV+fZ85kG31oovL6Cl3fAMQ3RRPwUvfAbbA9WT1Yhk= go.opentelemetry.io/collector/consumer v0.91.0 h1:0nU1lUe2S0b8iOmF3w3R/9Dt24n413thRTbXz/nJgrM= go.opentelemetry.io/collector/consumer v0.91.0/go.mod h1:phTUQmr7hpYfwXyDXo4mFHVjYrlSbZE+nZYlKlbVxGs= -go.opentelemetry.io/collector/exporter v0.91.0 h1:guWcGflFjaenp3BMxAmAKjb8RQG80jQQKjuUFouS+z8= -go.opentelemetry.io/collector/extension v0.91.0 h1:bkoSLgnWm4g6n+RLmyKG6Up7dr8KmJy68quonoLZnr0= go.opentelemetry.io/collector/featuregate v1.0.0 h1:5MGqe2v5zxaoo73BUOvUTunftX5J8RGrbFsC2Ha7N3g= go.opentelemetry.io/collector/featuregate v1.0.0/go.mod h1:xGbRuw+GbutRtVVSEy3YR2yuOlEyiUMhN2M9DJljgqY= go.opentelemetry.io/collector/pdata v1.0.0 h1:ECP2jnLztewsHmL1opL8BeMtWVc7/oSlKNhfY9jP8ec= go.opentelemetry.io/collector/pdata v1.0.0/go.mod h1:TsDFgs4JLNG7t6x9D8kGswXUz4mme+MyNChHx8zSF6k= -go.opentelemetry.io/collector/processor v0.91.0 h1:Xi52gYMXTG4zYmNhsqJ8ly/9f7b0n0crMhKxVVI9HpY= go.opentelemetry.io/collector/receiver v0.91.0 h1:0TZF/0OXoJtxgm+mvOinRRXo9LgVyOsOgCQfWkNGXJA= go.opentelemetry.io/collector/receiver v0.91.0/go.mod h1:d5qo2mpovqKoi47hrMxj5BLdLzOXM0mUHL5CKrjfWNM= go.opentelemetry.io/collector/semconv v0.91.0 h1:TRd+yDDfKQl+aNtS24wmEbJp1/QE/xAFV9SB5zWGxpE= go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2 h1:TnhkxGJ5qPHAMIMI4r+HPT/BbpoHxqn4xONJrok054o= -go.opentelemetry.io/otel/exporters/prometheus v0.44.1-0.20231201153405-6027c1ae76f2/go.mod h1:ERL2uIeBtg4TxZdojHUwzZfIFlUIjZtxubT5p4h1Gjg= go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= -go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= go.opentelemetry.io/otel/sdk/metric v1.21.0 h1:smhI5oD714d6jHE6Tie36fPx4WDFIg+Y6RfAY4ICcR0= -go.opentelemetry.io/otel/sdk/metric v1.21.0/go.mod h1:FJ8RAsoPGv/wYMgBdUJXOm+6pzFY3YdljnXtv1SBE8Q= go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= @@ -304,194 +129,50 @@ 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-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= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 h1:FqrVOBQxQ8r/UwwXibI0KMolVhvFiGobSfdE33deHJM= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= 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-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/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-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/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-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= 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-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= 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-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/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-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/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-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/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-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/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-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/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-20220708085239-5a0f0661e09d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.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.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -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.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 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-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= 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= @@ -499,71 +180,17 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.14.0 h1:2NiG67LD1tEH0D7kM+ps2V+fXmsAnpUeec7n8tcr4S0= gonum.org/v1/gonum v0.14.0/go.mod h1:AoWeoz0becf9QMWtE8iWXNXc27fK4fNeHNf/oMejGfU= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= 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.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= @@ -575,37 +202,16 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi 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.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= 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.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/receiver/statsdreceiver/internal/metadata/generated_status.go b/receiver/statsdreceiver/internal/metadata/generated_status.go index 64492ec32c5e..9d41088e3918 100644 --- a/receiver/statsdreceiver/internal/metadata/generated_status.go +++ b/receiver/statsdreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "statsd" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/statsdreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/statsdreceiver") +} diff --git a/receiver/statsdreceiver/internal/transport/client/client.go b/receiver/statsdreceiver/internal/transport/client/client.go index 710aecc5e491..8b9fd7f06ba3 100644 --- a/receiver/statsdreceiver/internal/transport/client/client.go +++ b/receiver/statsdreceiver/internal/transport/client/client.go @@ -7,33 +7,25 @@ import ( "fmt" "io" "net" + "strings" ) // StatsD defines the properties of a StatsD connection. type StatsD struct { - Host string - Port int - Conn io.Writer + transport string + address string + conn io.Writer } -// Transport is an enum to select the type of transport. -type Transport int - -const ( - // TCP Transport - TCP Transport = iota - // UDP Transport - UDP -) - // NewStatsD creates a new StatsD instance to support the need for testing // the statsdreceiver package and is not intended/tested to be used in production. -func NewStatsD(transport Transport, host string, port int) (*StatsD, error) { +func NewStatsD(transport string, address string) (*StatsD, error) { statsd := &StatsD{ - Host: host, - Port: port, + transport: transport, + address: address, } - err := statsd.connect(transport) + + err := statsd.connect() if err != nil { return nil, err } @@ -41,56 +33,46 @@ func NewStatsD(transport Transport, host string, port int) (*StatsD, error) { return statsd, nil } -// connect populates the StatsD.Conn -func (s *StatsD) connect(transport Transport) error { - if cl, ok := s.Conn.(io.Closer); ok { - err := cl.Close() +// connect populates the StatsD.conn +func (s *StatsD) connect() error { + switch s.transport { + case "udp": + udpAddr, err := net.ResolveUDPAddr(s.transport, s.address) if err != nil { return err } - } - - address := fmt.Sprintf("%s:%d", s.Host, s.Port) - - var err error - switch transport { - case TCP: - s.Conn, err = net.Dial("tcp", address) - if err != nil { - return err - } - case UDP: - var udpAddr *net.UDPAddr - udpAddr, err = net.ResolveUDPAddr("udp", address) + s.conn, err = net.DialUDP(s.transport, nil, udpAddr) if err != nil { return err } - s.Conn, err = net.DialUDP("udp", nil, udpAddr) + case "tcp": + var err error + s.conn, err = net.Dial(s.transport, s.address) if err != nil { return err } default: - return fmt.Errorf("unknown transport: %d", transport) + return fmt.Errorf("unknown/unsupported transport: %s", s.transport) } - return err + return nil } -// Disconnect closes the StatsD.Conn. +// Disconnect closes the StatsD.conn. func (s *StatsD) Disconnect() error { var err error - if cl, ok := s.Conn.(io.Closer); ok { + if cl, ok := s.conn.(io.Closer); ok { err = cl.Close() } - s.Conn = nil + s.conn = nil return err } // SendMetric sends the input metric to the StatsD connection. func (s *StatsD) SendMetric(metric Metric) error { - _, err := fmt.Fprint(s.Conn, metric.String()) + _, err := io.Copy(s.conn, strings.NewReader(metric.String())) if err != nil { - return err + return fmt.Errorf("send metric on test client: %w", err) } return nil } diff --git a/receiver/statsdreceiver/internal/transport/mock_reporter.go b/receiver/statsdreceiver/internal/transport/mock_reporter.go index 6e8b25818bed..c7a0947309b5 100644 --- a/receiver/statsdreceiver/internal/transport/mock_reporter.go +++ b/receiver/statsdreceiver/internal/transport/mock_reporter.go @@ -4,7 +4,6 @@ package transport // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/statsdreceiver/internal/transport" import ( - "context" "sync" ) @@ -23,16 +22,6 @@ func NewMockReporter(expectedOnMetricsProcessedCalls int) *MockReporter { return &m } -func (m *MockReporter) OnDataReceived(ctx context.Context) context.Context { - return ctx -} - -func (m *MockReporter) OnTranslationError(_ context.Context, _ error) {} - -func (m *MockReporter) OnMetricsProcessed(_ context.Context, _ int, _ error) { - m.wgMetricsProcessed.Done() -} - func (m *MockReporter) OnDebugf(_ string, _ ...any) { } diff --git a/receiver/statsdreceiver/internal/transport/server.go b/receiver/statsdreceiver/internal/transport/server.go index 5cc0474bf9de..0466d2861a2a 100644 --- a/receiver/statsdreceiver/internal/transport/server.go +++ b/receiver/statsdreceiver/internal/transport/server.go @@ -4,13 +4,10 @@ package transport // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/statsdreceiver/internal/transport" import ( - "context" "errors" "net" "go.opentelemetry.io/collector/consumer" - - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/statsdreceiver/internal/protocol" ) var errNilListenAndServeParameters = errors.New("no parameter of ListenAndServe can be nil") @@ -22,7 +19,6 @@ type Server interface { // on the specific transport, and prepares the message to be processed by // the Parser and passed to the next consumer. ListenAndServe( - p protocol.Parser, mc consumer.Metrics, r Reporter, transferChan chan<- Metric, @@ -41,23 +37,6 @@ type Metric struct { // Reporter is used to report (via zPages, logs, metrics, etc) the events // happening when the Server is receiving and processing data. type Reporter interface { - // OnDataReceived is called when a message or request is received from - // a client. The returned context should be used in other calls to the same - // reporter instance. The caller code should include a call to end the - // returned span. - OnDataReceived(ctx context.Context) context.Context - - // OnTranslationError is used to report a translation error from original - // format to the internal format of the Collector. The context - // passed to it should be the ones returned by OnDataReceived. - OnTranslationError(ctx context.Context, err error) - - // OnMetricsProcessed is called when the received data is passed to next - // consumer on the pipeline. The context passed to it should be the - // one returned by OnDataReceived. The error should be error returned by - // the next consumer - the reporter is expected to handle nil error too. - OnMetricsProcessed(ctx context.Context, numReceivedMessages int, err error) - // OnDebugf allows less structured reporting for debugging scenarios. OnDebugf( template string, diff --git a/receiver/statsdreceiver/internal/transport/server_test.go b/receiver/statsdreceiver/internal/transport/server_test.go index c92f4b373397..a774c0fd4154 100644 --- a/receiver/statsdreceiver/internal/transport/server_test.go +++ b/receiver/statsdreceiver/internal/transport/server_test.go @@ -4,9 +4,9 @@ package transport import ( + "io" "net" "runtime" - "strconv" "sync" "testing" "time" @@ -16,65 +16,43 @@ import ( "go.opentelemetry.io/collector/consumer/consumertest" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/testutil" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/statsdreceiver/internal/protocol" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/statsdreceiver/internal/transport/client" ) func Test_Server_ListenAndServe(t *testing.T) { tests := []struct { - name string - transport string - buildServerFn func(addr string) (Server, error) - buildClientFn func(host string, port int) (*client.StatsD, error) + name string + transport Transport + buildServerFn func(transport Transport, addr string) (Server, error) + getFreeEndpointFn func(t testing.TB, transport string) string + buildClientFn func(transport string, address string) (*client.StatsD, error) }{ { - name: "udp", - transport: "udp", - buildServerFn: NewUDPServer, - buildClientFn: func(host string, port int) (*client.StatsD, error) { - return client.NewStatsD(client.UDP, host, port) - }, + name: "udp", + transport: UDP, + getFreeEndpointFn: testutil.GetAvailableLocalNetworkAddress, + buildServerFn: NewUDPServer, + buildClientFn: client.NewStatsD, }, { - name: "tcp", - transport: "tcp", - buildServerFn: NewTCPServer, - buildClientFn: func(host string, port int) (*client.StatsD, error) { - return client.NewStatsD(client.TCP, host, port) - }, + name: "tcp", + transport: TCP, + getFreeEndpointFn: testutil.GetAvailableLocalNetworkAddress, + buildServerFn: NewTCPServer, + buildClientFn: client.NewStatsD, }, } + for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - addr := testutil.GetAvailableLocalNetworkAddress(t, tt.transport) - - if tt.transport == "udp" { - // Endpoint should be free. - ln0, err := net.ListenPacket("udp", addr) - require.NoError(t, err) - require.NotNil(t, ln0) - - // Ensure that the endpoint wasn't something like ":0" by checking that a second listener will fail. - ln1, err := net.ListenPacket("udp", addr) - require.Error(t, err) - require.Nil(t, ln1) + addr := tt.getFreeEndpointFn(t, tt.name) + testFreeEndpoint(t, tt.name, addr) - // Unbind the local address so the mock UDP service can use it - err = ln0.Close() - require.NoError(t, err) - } - - srv, err := tt.buildServerFn(addr) + srv, err := tt.buildServerFn(tt.transport, addr) require.NoError(t, err) require.NotNil(t, srv) - host, portStr, err := net.SplitHostPort(addr) - require.NoError(t, err) - port, err := strconv.Atoi(portStr) - require.NoError(t, err) - mc := new(consumertest.MetricsSink) - p := &protocol.StatsDParser{} require.NoError(t, err) mr := NewMockReporter(1) transferChan := make(chan Metric, 10) @@ -83,12 +61,12 @@ func Test_Server_ListenAndServe(t *testing.T) { wgListenAndServe.Add(1) go func() { defer wgListenAndServe.Done() - assert.Error(t, srv.ListenAndServe(p, mc, mr, transferChan)) + assert.Error(t, srv.ListenAndServe(mc, mr, transferChan)) }() runtime.Gosched() - gc, err := tt.buildClientFn(host, port) + gc, err := tt.buildClientFn(tt.transport.String(), addr) require.NoError(t, err) require.NotNil(t, gc) err = gc.SendMetric(client.Metric{ @@ -115,3 +93,36 @@ func Test_Server_ListenAndServe(t *testing.T) { }) } } + +func testFreeEndpoint(t *testing.T, transport string, address string) { + t.Helper() + + var ln0, ln1 io.Closer + var err0, err1 error + + trans := NewTransport(transport) + require.NotEqual(t, trans, Transport("")) + + if trans.IsPacketTransport() { + // Endpoint should be free. + ln0, err0 = net.ListenPacket(transport, address) + ln1, err1 = net.ListenPacket(transport, address) + } + + if trans.IsStreamTransport() { + // Endpoint should be free. + ln0, err0 = net.Listen(transport, address) + ln1, err1 = net.Listen(transport, address) + } + + // Endpoint should be free. + require.NoError(t, err0) + require.NotNil(t, ln0) + + // Ensure that the endpoint wasn't something like ":0" by checking that a second listener will fail. + require.Error(t, err1) + require.Nil(t, ln1) + + // Unbind the local address so the mock UDP service can use it + require.NoError(t, ln0.Close()) +} diff --git a/receiver/statsdreceiver/internal/transport/tcp_server.go b/receiver/statsdreceiver/internal/transport/tcp_server.go index a464b1927c88..f776bcd88f04 100644 --- a/receiver/statsdreceiver/internal/transport/tcp_server.go +++ b/receiver/statsdreceiver/internal/transport/tcp_server.go @@ -6,43 +6,50 @@ package transport // import "github.com/open-telemetry/opentelemetry-collector-c import ( "bytes" "errors" + "fmt" "io" "net" "strings" "sync" "go.opentelemetry.io/collector/consumer" - - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/statsdreceiver/internal/protocol" ) var errTCPServerDone = errors.New("server stopped") type tcpServer struct { - listener net.Listener - reporter Reporter - wg sync.WaitGroup - stopChan chan struct{} + listener net.Listener + reporter Reporter + wg sync.WaitGroup + transport Transport + stopChan chan struct{} } +// Ensure that Server is implemented on TCP Server. var _ Server = (*tcpServer)(nil) // NewTCPServer creates a transport.Server using TCP as its transport. -func NewTCPServer(addr string) (Server, error) { - l, err := net.Listen("tcp", addr) - if err != nil { - return nil, err +func NewTCPServer(transport Transport, address string) (Server, error) { + var tsrv tcpServer + var err error + + if !transport.IsStreamTransport() { + return nil, fmt.Errorf("NewTCPServer with %s: %w", transport.String(), ErrUnsupportedStreamTransport) } - t := tcpServer{ - listener: l, - stopChan: make(chan struct{}), + tsrv.transport = transport + tsrv.listener, err = net.Listen(transport.String(), address) + if err != nil { + return nil, fmt.Errorf("starting to listen %s socket: %w", transport.String(), err) } - return &t, nil + + tsrv.stopChan = make(chan struct{}) + return &tsrv, nil } -func (t *tcpServer) ListenAndServe(parser protocol.Parser, nextConsumer consumer.Metrics, reporter Reporter, transferChan chan<- Metric) error { - if parser == nil || nextConsumer == nil || reporter == nil { +// ListenAndServe starts the server ready to receive metrics. +func (t *tcpServer) ListenAndServe(nextConsumer consumer.Metrics, reporter Reporter, transferChan chan<- Metric) error { + if nextConsumer == nil || reporter == nil { return errNilListenAndServeParameters } @@ -71,6 +78,7 @@ LOOP: return errTCPServerDone } +// handleConn is helper that parses the buffer and split it line by line to be parsed upstream. func (t *tcpServer) handleConn(c net.Conn, transferChan chan<- Metric) { payload := make([]byte, 4096) var remainder []byte @@ -98,6 +106,7 @@ func (t *tcpServer) handleConn(c net.Conn, transferChan chan<- Metric) { } } +// Close closes the server. func (t *tcpServer) Close() error { close(t.stopChan) t.wg.Wait() diff --git a/receiver/statsdreceiver/internal/transport/transport.go b/receiver/statsdreceiver/internal/transport/transport.go new file mode 100644 index 000000000000..c065e30c746f --- /dev/null +++ b/receiver/statsdreceiver/internal/transport/transport.go @@ -0,0 +1,63 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package transport // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/statsdreceiver/internal/transport" + +import "errors" + +// Transport is a set of constants of the transport supported by this receiver. +type Transport string + +var ( + ErrUnsupportedTransport = errors.New("unsupported transport") + ErrUnsupportedPacketTransport = errors.New("unsupported Packet transport") + ErrUnsupportedStreamTransport = errors.New("unsupported Stream transport") +) + +const ( + UDP Transport = "udp" + UDP4 Transport = "udp4" + UDP6 Transport = "udp6" + TCP Transport = "tcp" + TCP4 Transport = "tcp4" + TCP6 Transport = "tcp6" +) + +// NewTransport creates a Transport based on the transport string or returns an empty Transport. +func NewTransport(ts string) Transport { + trans := Transport(ts) + switch trans { + case UDP, UDP4, UDP6: + return trans + case TCP, TCP4, TCP6: + return trans + } + return Transport("") +} + +// String casts the transport to a String if the Transport is supported. Return an empty Transport overwise. +func (trans Transport) String() string { + switch trans { + case UDP, UDP4, UDP6, TCP, TCP4, TCP6: + return string(trans) + } + return "" +} + +// IsPacketTransport returns true if the transport is packet based. +func (trans Transport) IsPacketTransport() bool { + switch trans { + case UDP, UDP4, UDP6: + return true + } + return false +} + +// IsStreamTransport returns true if the transport is stream based. +func (trans Transport) IsStreamTransport() bool { + switch trans { + case TCP, TCP4, TCP6: + return true + } + return false +} diff --git a/receiver/statsdreceiver/internal/transport/udp_server.go b/receiver/statsdreceiver/internal/transport/udp_server.go index 7a483ce61649..19ad0803d8fe 100644 --- a/receiver/statsdreceiver/internal/transport/udp_server.go +++ b/receiver/statsdreceiver/internal/transport/udp_server.go @@ -6,47 +6,49 @@ package transport // import "github.com/open-telemetry/opentelemetry-collector-c import ( "bytes" "errors" + "fmt" "io" "net" "strings" "go.opentelemetry.io/collector/consumer" - - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/statsdreceiver/internal/protocol" ) type udpServer struct { packetConn net.PacketConn - reporter Reporter + transport Transport } +// Ensure that Server is implemented on UDP Server. var _ (Server) = (*udpServer)(nil) // NewUDPServer creates a transport.Server using UDP as its transport. -func NewUDPServer(addr string) (Server, error) { - packetConn, err := net.ListenPacket("udp", addr) - if err != nil { - return nil, err +func NewUDPServer(transport Transport, address string) (Server, error) { + if !transport.IsPacketTransport() { + return nil, fmt.Errorf("NewUDPServer with %s: %w", transport.String(), ErrUnsupportedPacketTransport) } - u := udpServer{ - packetConn: packetConn, + conn, err := net.ListenPacket(transport.String(), address) + if err != nil { + return nil, fmt.Errorf("starting to listen %s socket: %w", transport.String(), err) } - return &u, nil + + return &udpServer{ + packetConn: conn, + transport: transport, + }, nil } +// ListenAndServe starts the server ready to receive metrics. func (u *udpServer) ListenAndServe( - parser protocol.Parser, nextConsumer consumer.Metrics, reporter Reporter, transferChan chan<- Metric, ) error { - if parser == nil || nextConsumer == nil || reporter == nil { + if nextConsumer == nil || reporter == nil { return errNilListenAndServeParameters } - u.reporter = reporter - buf := make([]byte, 65527) // max size for udp packet body (assuming ipv6) for { n, addr, err := u.packetConn.ReadFrom(buf) @@ -56,7 +58,8 @@ func (u *udpServer) ListenAndServe( u.handlePacket(bufCopy, addr, transferChan) } if err != nil { - u.reporter.OnDebugf("UDP Transport (%s) - ReadFrom error: %v", + reporter.OnDebugf("%s Transport (%s) - ReadFrom error: %v", + u.transport, u.packetConn.LocalAddr(), err) var netErr net.Error @@ -70,10 +73,12 @@ func (u *udpServer) ListenAndServe( } } +// Close closes the server. func (u *udpServer) Close() error { return u.packetConn.Close() } +// handlePacket is helper that parses the buffer and split it line by line to be parsed upstream. func (u *udpServer) handlePacket( data []byte, addr net.Addr, diff --git a/receiver/statsdreceiver/metadata.yaml b/receiver/statsdreceiver/metadata.yaml index cd17f73b5133..d11d7b216244 100644 --- a/receiver/statsdreceiver/metadata.yaml +++ b/receiver/statsdreceiver/metadata.yaml @@ -6,4 +6,7 @@ status: beta: [metrics] distributions: [contrib, splunk, sumo, aws] codeowners: - active: [jmacd, dmitryax] \ No newline at end of file + active: [jmacd, dmitryax] + +tests: + config: diff --git a/receiver/statsdreceiver/receiver.go b/receiver/statsdreceiver/receiver.go index 3034fc561bbc..de61a6537ee7 100644 --- a/receiver/statsdreceiver/receiver.go +++ b/receiver/statsdreceiver/receiver.go @@ -68,12 +68,13 @@ func newReceiver( } func buildTransportServer(config Config) (transport.Server, error) { - // TODO: Add TCP/unix socket transport implementations - switch strings.ToLower(config.NetAddr.Transport) { - case "", "udp": - return transport.NewUDPServer(config.NetAddr.Endpoint) - case "tcp": - return transport.NewTCPServer(config.NetAddr.Endpoint) + // TODO: Add unix socket transport implementations + trans := transport.NewTransport(strings.ToLower(config.NetAddr.Transport)) + switch trans { + case transport.UDP, transport.UDP4, transport.UDP6: + return transport.NewUDPServer(trans, config.NetAddr.Endpoint) + case transport.TCP, transport.TCP4, transport.TCP6: + return transport.NewTCPServer(trans, config.NetAddr.Endpoint) } return nil, fmt.Errorf("unsupported transport %q", config.NetAddr.Transport) @@ -99,7 +100,7 @@ func (r *statsdReceiver) Start(ctx context.Context, host component.Host) error { return err } go func() { - if err := r.server.ListenAndServe(r.parser, r.nextConsumer, r.reporter, transferChan); err != nil { + if err := r.server.ListenAndServe(r.nextConsumer, r.reporter, transferChan); err != nil { if !errors.Is(err, net.ErrClosed) { host.ReportFatalError(err) } diff --git a/receiver/statsdreceiver/receiver_test.go b/receiver/statsdreceiver/receiver_test.go index 77f49c49008e..ec2b5cb90942 100644 --- a/receiver/statsdreceiver/receiver_test.go +++ b/receiver/statsdreceiver/receiver_test.go @@ -6,8 +6,6 @@ package statsdreceiver import ( "context" "errors" - "net" - "strconv" "testing" "time" @@ -113,19 +111,15 @@ func TestStatsdReceiver_Flush(t *testing.T) { } func Test_statsdreceiver_EndToEnd(t *testing.T) { - addr := testutil.GetAvailableLocalAddress(t) - host, portStr, err := net.SplitHostPort(addr) - require.NoError(t, err) - port, err := strconv.Atoi(portStr) - require.NoError(t, err) - tests := []struct { name string + addr string configFn func() *Config - clientFn func(t *testing.T) *client.StatsD + clientFn func(t *testing.T, addr string) *client.StatsD }{ { name: "default_config with 4s interval", + addr: testutil.GetAvailableLocalNetworkAddress(t, "udp"), configFn: func() *Config { return &Config{ NetAddr: confignet.NetAddr{ @@ -135,8 +129,8 @@ func Test_statsdreceiver_EndToEnd(t *testing.T) { AggregationInterval: 4 * time.Second, } }, - clientFn: func(t *testing.T) *client.StatsD { - c, err := client.NewStatsD(client.UDP, host, port) + clientFn: func(t *testing.T, addr string) *client.StatsD { + c, err := client.NewStatsD("udp", addr) require.NoError(t, err) return c }, @@ -145,7 +139,7 @@ func Test_statsdreceiver_EndToEnd(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { cfg := tt.configFn() - cfg.NetAddr.Endpoint = addr + cfg.NetAddr.Endpoint = tt.addr sink := new(consumertest.MetricsSink) rcv, err := newReceiver(receivertest.NewNopCreateSettings(), *cfg, sink) require.NoError(t, err) @@ -159,7 +153,7 @@ func Test_statsdreceiver_EndToEnd(t *testing.T) { assert.NoError(t, r.Shutdown(context.Background())) }() - statsdClient := tt.clientFn(t) + statsdClient := tt.clientFn(t, tt.addr) statsdMetric := client.Metric{ Name: "test.metric", diff --git a/receiver/statsdreceiver/reporter.go b/receiver/statsdreceiver/reporter.go index 3baa8a8975da..6eb5407b88b8 100644 --- a/receiver/statsdreceiver/reporter.go +++ b/receiver/statsdreceiver/reporter.go @@ -4,9 +4,6 @@ package statsdreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/statsdreceiver" import ( - "context" - - "go.opencensus.io/trace" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receiverhelper" "go.uber.org/zap" @@ -40,58 +37,6 @@ func newReporter(set receiver.CreateSettings) (transport.Reporter, error) { }, nil } -// OnDataReceived is called when a message or request is received from -// a client. The returned context should be used in other calls to the same -// reporter instance. The caller code should include a call to end the -// returned span. -func (r *reporter) OnDataReceived(ctx context.Context) context.Context { - return r.obsrecv.StartMetricsOp(ctx) -} - -// OnTranslationError is used to report a translation error from original -// format to the internal format of the Collector. The context and span -// passed to it should be the ones returned by OnDataReceived. -func (r *reporter) OnTranslationError(ctx context.Context, err error) { - if err == nil { - return - } - - r.logger.Debug("StatsD translation error", zap.Error(err)) - - // Using annotations since multiple translation errors can happen in the - // same client message/request. The time itself is not relevant. - span := trace.FromContext(ctx) - span.Annotate([]trace.Attribute{ - trace.StringAttribute("error", err.Error())}, - "translation", - ) -} - -// OnMetricsProcessed is called when the received data is passed to next -// consumer on the pipeline. The context and span passed to it should be the -// ones returned by OnDataReceived. The error should be error returned by -// the next consumer - the reporter is expected to handle nil error too. -func (r *reporter) OnMetricsProcessed( - ctx context.Context, - numReceivedMessages int, - err error, -) { - if err != nil { - r.logger.Debug( - "StatsD receiver failed to push metrics into pipeline", - zap.Int("numReceivedMessages", numReceivedMessages), - zap.Error(err)) - - span := trace.FromContext(ctx) - span.SetStatus(trace.Status{ - Code: trace.StatusCodeUnknown, - Message: err.Error(), - }) - } - - r.obsrecv.EndMetricsOp(ctx, "statsd", numReceivedMessages, err) -} - func (r *reporter) OnDebugf(template string, args ...any) { if r.logger.Check(zap.DebugLevel, "debug") != nil { r.sugaredLogger.Debugf(template, args...) diff --git a/receiver/statsdreceiver/reporter_test.go b/receiver/statsdreceiver/reporter_test.go deleted file mode 100644 index bbae83c3c37c..000000000000 --- a/receiver/statsdreceiver/reporter_test.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package statsdreceiver - -import ( - "context" - "errors" - "testing" - - "github.com/stretchr/testify/require" - "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/obsreport/obsreporttest" - "go.opentelemetry.io/collector/receiver" - - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/statsdreceiver/internal/metadata" -) - -func TestReporterObservability(t *testing.T) { - receiverID := component.NewIDWithName(metadata.Type, "fake_receiver") - tt, err := obsreporttest.SetupTelemetry(receiverID) - require.NoError(t, err) - defer func() { - require.NoError(t, tt.Shutdown(context.Background())) - }() - - reporter, err := newReporter(receiver.CreateSettings{ID: receiverID, TelemetrySettings: tt.TelemetrySettings, BuildInfo: component.NewDefaultBuildInfo()}) - require.NoError(t, err) - - ctx := reporter.OnDataReceived(context.Background()) - - reporter.OnMetricsProcessed(ctx, 17, nil) - - require.NoError(t, tt.CheckReceiverMetrics("tcp", 17, 0)) - - // Below just exercise the error paths. - err = errors.New("fake error for tests") - reporter.OnTranslationError(ctx, err) - reporter.OnMetricsProcessed(ctx, 10, err) - - require.NoError(t, tt.CheckReceiverMetrics("tcp", 17, 10)) -} diff --git a/receiver/syslogreceiver/generated_component_test.go b/receiver/syslogreceiver/generated_component_test.go new file mode 100644 index 000000000000..867d42b39bef --- /dev/null +++ b/receiver/syslogreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package syslogreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/syslogreceiver/go.mod b/receiver/syslogreceiver/go.mod index b206631137c9..592b74fb0b08 100644 --- a/receiver/syslogreceiver/go.mod +++ b/receiver/syslogreceiver/go.mod @@ -11,6 +11,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 ) require ( @@ -43,8 +45,6 @@ require ( go.opentelemetry.io/collector/extension v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/receiver/syslogreceiver/internal/metadata/generated_status.go b/receiver/syslogreceiver/internal/metadata/generated_status.go index 7b226c8c8706..44cfcd27eb85 100644 --- a/receiver/syslogreceiver/internal/metadata/generated_status.go +++ b/receiver/syslogreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "syslog" LogsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/syslogreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/syslogreceiver") +} diff --git a/receiver/syslogreceiver/metadata.yaml b/receiver/syslogreceiver/metadata.yaml index 2374df77559a..85cce455dcec 100644 --- a/receiver/syslogreceiver/metadata.yaml +++ b/receiver/syslogreceiver/metadata.yaml @@ -7,3 +7,9 @@ status: distributions: [contrib, splunk, observiq, sumo] codeowners: active: [djaglowski] + +tests: + config: + tcp: + listen_address: "localhost:0" + protocol: "rfc5424" diff --git a/receiver/tcplogreceiver/generated_component_test.go b/receiver/tcplogreceiver/generated_component_test.go new file mode 100644 index 000000000000..ec6079237ac2 --- /dev/null +++ b/receiver/tcplogreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package tcplogreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/tcplogreceiver/go.mod b/receiver/tcplogreceiver/go.mod index a7e59b18fcea..a2ad264294f8 100644 --- a/receiver/tcplogreceiver/go.mod +++ b/receiver/tcplogreceiver/go.mod @@ -9,6 +9,8 @@ require ( go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 ) require ( @@ -43,8 +45,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/pdata v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/receiver/tcplogreceiver/internal/metadata/generated_status.go b/receiver/tcplogreceiver/internal/metadata/generated_status.go index 9923ae161e9b..7ce1c6031dd2 100644 --- a/receiver/tcplogreceiver/internal/metadata/generated_status.go +++ b/receiver/tcplogreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "tcplog" LogsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/tcplogreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/tcplogreceiver") +} diff --git a/receiver/tcplogreceiver/metadata.yaml b/receiver/tcplogreceiver/metadata.yaml index 8f95bbe11e2f..16a13846b5b3 100644 --- a/receiver/tcplogreceiver/metadata.yaml +++ b/receiver/tcplogreceiver/metadata.yaml @@ -7,3 +7,7 @@ status: distributions: [contrib, splunk, observiq, sumo] codeowners: active: [djaglowski] + +tests: + config: + listen_address: "localhost:0" diff --git a/receiver/udplogreceiver/generated_component_test.go b/receiver/udplogreceiver/generated_component_test.go new file mode 100644 index 000000000000..eddde3ae2f6a --- /dev/null +++ b/receiver/udplogreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package udplogreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/udplogreceiver/go.mod b/receiver/udplogreceiver/go.mod index 677526ffe746..2017de4bfc03 100644 --- a/receiver/udplogreceiver/go.mod +++ b/receiver/udplogreceiver/go.mod @@ -9,6 +9,8 @@ require ( go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 ) require ( @@ -39,8 +41,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/pdata v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/receiver/udplogreceiver/internal/metadata/generated_status.go b/receiver/udplogreceiver/internal/metadata/generated_status.go index 152e240218de..9c3ccab41099 100644 --- a/receiver/udplogreceiver/internal/metadata/generated_status.go +++ b/receiver/udplogreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "udplog" LogsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/udplogreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/udplogreceiver") +} diff --git a/receiver/udplogreceiver/metadata.yaml b/receiver/udplogreceiver/metadata.yaml index a97e4062a039..174d176de961 100644 --- a/receiver/udplogreceiver/metadata.yaml +++ b/receiver/udplogreceiver/metadata.yaml @@ -6,4 +6,8 @@ status: alpha: [logs] distributions: [contrib, observiq, sumo, splunk] codeowners: - active: [djaglowski] \ No newline at end of file + active: [djaglowski] + +tests: + config: + listen_address: "localhost:0" diff --git a/receiver/vcenterreceiver/generated_component_test.go b/receiver/vcenterreceiver/generated_component_test.go new file mode 100644 index 000000000000..8b79f632ff41 --- /dev/null +++ b/receiver/vcenterreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package vcenterreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/vcenterreceiver/go.mod b/receiver/vcenterreceiver/go.mod index 0f33e40dd791..15bf98b8049c 100644 --- a/receiver/vcenterreceiver/go.mod +++ b/receiver/vcenterreceiver/go.mod @@ -9,7 +9,7 @@ require ( github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden v0.91.0 github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.91.0 github.com/stretchr/testify v1.8.4 - github.com/vmware/govmomi v0.34.0 + github.com/vmware/govmomi v0.34.1 go.opentelemetry.io/collector/component v0.91.0 go.opentelemetry.io/collector/config/configopaque v0.91.0 go.opentelemetry.io/collector/config/configtls v0.91.0 @@ -18,6 +18,8 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -78,8 +80,6 @@ require ( go.opentelemetry.io/collector v0.91.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/receiver/vcenterreceiver/go.sum b/receiver/vcenterreceiver/go.sum index bc75f34b886d..98cf214d9f20 100644 --- a/receiver/vcenterreceiver/go.sum +++ b/receiver/vcenterreceiver/go.sum @@ -196,8 +196,8 @@ github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9f github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= -github.com/vmware/govmomi v0.34.0 h1:Aun71BDf1t8r3jNeUWJ3ZM+7kHbIuuNzIuxRVo5LYYU= -github.com/vmware/govmomi v0.34.0/go.mod h1:qWWT6n9mdCr/T9vySsoUqcI04sSEj4CqHXxtk/Y+Los= +github.com/vmware/govmomi v0.34.1 h1:Hqu2Uke2itC+cNoIcFQBLEZvX9wBRTTOP04J7V1fqRw= +github.com/vmware/govmomi v0.34.1/go.mod h1:qWWT6n9mdCr/T9vySsoUqcI04sSEj4CqHXxtk/Y+Los= 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= diff --git a/receiver/vcenterreceiver/internal/metadata/generated_status.go b/receiver/vcenterreceiver/internal/metadata/generated_status.go index 090b6a5cfbcb..55e6ec944f65 100644 --- a/receiver/vcenterreceiver/internal/metadata/generated_status.go +++ b/receiver/vcenterreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "vcenter" MetricsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/vcenterreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/vcenterreceiver") +} diff --git a/receiver/vcenterreceiver/metadata.yaml b/receiver/vcenterreceiver/metadata.yaml index 3bbaefd58ac5..55cfebf3095b 100644 --- a/receiver/vcenterreceiver/metadata.yaml +++ b/receiver/vcenterreceiver/metadata.yaml @@ -421,3 +421,6 @@ metrics: gauge: value_type: double attributes: [] + +tests: + config: diff --git a/receiver/wavefrontreceiver/config.go b/receiver/wavefrontreceiver/config.go index 3641bc5e2c43..6b0b20cad5fd 100644 --- a/receiver/wavefrontreceiver/config.go +++ b/receiver/wavefrontreceiver/config.go @@ -4,6 +4,7 @@ package wavefrontreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/wavefrontreceiver" import ( + "errors" "time" "go.opentelemetry.io/collector/config/confignet" @@ -20,3 +21,10 @@ type Config struct { // tags in the CollectD format from the metric name. The default is false. ExtractCollectdTags bool `mapstructure:"extract_collectd_tags"` } + +func (cfg *Config) Validate() error { + if cfg.TCPIdleTimeout < 0 { + return errors.New("'tcp_idle_timeout' must be non-negative") + } + return nil +} diff --git a/receiver/wavefrontreceiver/factory.go b/receiver/wavefrontreceiver/factory.go index 6c9f44bcabc0..7da77a461942 100644 --- a/receiver/wavefrontreceiver/factory.go +++ b/receiver/wavefrontreceiver/factory.go @@ -6,16 +6,21 @@ package wavefrontreceiver // import "github.com/open-telemetry/opentelemetry-col import ( "context" "fmt" + "time" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/confignet" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/receiver" - "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/carbonreceiver/transport" "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/wavefrontreceiver/internal/metadata" ) +const ( + // tcpIdleTimeoutDefault is the default timeout for idle TCP connections. + tcpIdleTimeoutDefault = 30 * time.Second +) + // This file implements factory for the Wavefront receiver. // NewFactory creates a factory for WaveFront receiver. @@ -31,7 +36,7 @@ func createDefaultConfig() component.Config { TCPAddr: confignet.TCPAddr{ Endpoint: "localhost:2003", }, - TCPIdleTimeout: transport.TCPIdleTimeoutDefault, + TCPIdleTimeout: tcpIdleTimeoutDefault, } } diff --git a/receiver/wavefrontreceiver/generated_component_test.go b/receiver/wavefrontreceiver/generated_component_test.go new file mode 100644 index 000000000000..ba0c42949b56 --- /dev/null +++ b/receiver/wavefrontreceiver/generated_component_test.go @@ -0,0 +1,89 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package wavefrontreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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) { + + // TODO support lifecycle + t.SkipNow() + + firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg) + require.NoError(t, err) + host := newAssertNoErrorHost(t) + 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 34acb477503e..9441a4e4ea93 100644 --- a/receiver/wavefrontreceiver/go.mod +++ b/receiver/wavefrontreceiver/go.mod @@ -13,12 +13,13 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 ) require ( github.com/davecgh/go-spew v1.1.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/hashicorp/go-version v1.6.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -36,8 +37,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/receiver/wavefrontreceiver/go.sum b/receiver/wavefrontreceiver/go.sum index 4b73b4b71c30..a7b98d3c652c 100644 --- a/receiver/wavefrontreceiver/go.sum +++ b/receiver/wavefrontreceiver/go.sum @@ -22,7 +22,6 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69 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= diff --git a/receiver/wavefrontreceiver/internal/metadata/generated_status.go b/receiver/wavefrontreceiver/internal/metadata/generated_status.go index 3391a063223a..9536a060f539 100644 --- a/receiver/wavefrontreceiver/internal/metadata/generated_status.go +++ b/receiver/wavefrontreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "wavefront" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/wavefrontreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/wavefrontreceiver") +} diff --git a/receiver/wavefrontreceiver/metadata.yaml b/receiver/wavefrontreceiver/metadata.yaml index 2ced88b5ae76..d6829633cbf2 100644 --- a/receiver/wavefrontreceiver/metadata.yaml +++ b/receiver/wavefrontreceiver/metadata.yaml @@ -8,3 +8,6 @@ status: codeowners: active: [samiura] +tests: + config: + skip_lifecycle: true diff --git a/receiver/webhookeventreceiver/generated_component_test.go b/receiver/webhookeventreceiver/generated_component_test.go new file mode 100644 index 000000000000..2414230af5b6 --- /dev/null +++ b/receiver/webhookeventreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package webhookeventreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/webhookeventreceiver/go.mod b/receiver/webhookeventreceiver/go.mod index c83e11ae1068..02312729fd05 100644 --- a/receiver/webhookeventreceiver/go.mod +++ b/receiver/webhookeventreceiver/go.mod @@ -12,6 +12,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -50,8 +52,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/webhookeventreceiver/internal/metadata/generated_status.go b/receiver/webhookeventreceiver/internal/metadata/generated_status.go index e0bb6684022d..21f22f088068 100644 --- a/receiver/webhookeventreceiver/internal/metadata/generated_status.go +++ b/receiver/webhookeventreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "webhookevent" LogsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/webhookeventreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/webhookeventreceiver") +} diff --git a/receiver/webhookeventreceiver/metadata.yaml b/receiver/webhookeventreceiver/metadata.yaml index a7c2d384a3ba..552b9167c333 100644 --- a/receiver/webhookeventreceiver/metadata.yaml +++ b/receiver/webhookeventreceiver/metadata.yaml @@ -8,3 +8,7 @@ status: codeowners: active: ["atoulme", "shalper2"] emeritus: + +tests: + config: + endpoint: 127.0.0.1:8088 diff --git a/receiver/windowseventlogreceiver/go.mod b/receiver/windowseventlogreceiver/go.mod index 8bbf69c2f8f3..52c2fcbe576e 100644 --- a/receiver/windowseventlogreceiver/go.mod +++ b/receiver/windowseventlogreceiver/go.mod @@ -10,6 +10,8 @@ require ( go.opentelemetry.io/collector/confmap v0.91.0 go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 golang.org/x/sys v0.15.0 ) @@ -40,8 +42,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/collector/pdata v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.18.0 // indirect diff --git a/receiver/windowseventlogreceiver/internal/metadata/generated_status.go b/receiver/windowseventlogreceiver/internal/metadata/generated_status.go index 7e14474db9f7..9bd1d0745cbc 100644 --- a/receiver/windowseventlogreceiver/internal/metadata/generated_status.go +++ b/receiver/windowseventlogreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "windowseventlog" LogsStability = component.StabilityLevelAlpha ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/windowseventlogreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/windowseventlogreceiver") +} diff --git a/receiver/windowsperfcountersreceiver/go.mod b/receiver/windowsperfcountersreceiver/go.mod index 0b5cb0c8503a..61a4fe738cba 100644 --- a/receiver/windowsperfcountersreceiver/go.mod +++ b/receiver/windowsperfcountersreceiver/go.mod @@ -12,6 +12,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 ) @@ -38,8 +40,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect golang.org/x/net v0.18.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/receiver/windowsperfcountersreceiver/internal/metadata/generated_status.go b/receiver/windowsperfcountersreceiver/internal/metadata/generated_status.go index 6c7b3498afe4..9d64e7682bde 100644 --- a/receiver/windowsperfcountersreceiver/internal/metadata/generated_status.go +++ b/receiver/windowsperfcountersreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "windowsperfcounters" MetricsStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/windowsperfcountersreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/windowsperfcountersreceiver") +} diff --git a/receiver/zipkinreceiver/README.md b/receiver/zipkinreceiver/README.md index 441a723a8001..8c8a0990e63b 100644 --- a/receiver/zipkinreceiver/README.md +++ b/receiver/zipkinreceiver/README.md @@ -4,7 +4,7 @@ | Status | | | ------------- |-----------| | Stability | [beta]: traces | -| Distributions | [core], [contrib], [aws], [grafana], [observiq], [redhat], [splunk], [sumo] | +| Distributions | [core], [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%3Areceiver%2Fzipkin%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fzipkin) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fzipkin%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fzipkin) | | [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@MovieStoreGuy](https://www.github.com/MovieStoreGuy), [@astencel-sumo](https://www.github.com/astencel-sumo), [@crobert-1](https://www.github.com/crobert-1) | @@ -13,6 +13,7 @@ [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 [splunk]: https://github.com/signalfx/splunk-otel-collector diff --git a/receiver/zipkinreceiver/generated_component_test.go b/receiver/zipkinreceiver/generated_component_test.go new file mode 100644 index 000000000000..29e50744a760 --- /dev/null +++ b/receiver/zipkinreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package zipkinreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/zipkinreceiver/go.mod b/receiver/zipkinreceiver/go.mod index a8b94fe18f30..aef69ccee703 100644 --- a/receiver/zipkinreceiver/go.mod +++ b/receiver/zipkinreceiver/go.mod @@ -15,6 +15,8 @@ require ( go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 go.opentelemetry.io/collector/semconv v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 google.golang.org/protobuf v1.31.0 ) @@ -54,8 +56,6 @@ require ( go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect golang.org/x/net v0.19.0 // indirect diff --git a/receiver/zipkinreceiver/internal/metadata/generated_status.go b/receiver/zipkinreceiver/internal/metadata/generated_status.go index 7304d293cd3f..f06a4a308a90 100644 --- a/receiver/zipkinreceiver/internal/metadata/generated_status.go +++ b/receiver/zipkinreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "zipkin" TracesStability = component.StabilityLevelBeta ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/zipkinreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/zipkinreceiver") +} diff --git a/receiver/zipkinreceiver/metadata.yaml b/receiver/zipkinreceiver/metadata.yaml index bfbdffacf008..e0c7eadb0b3d 100644 --- a/receiver/zipkinreceiver/metadata.yaml +++ b/receiver/zipkinreceiver/metadata.yaml @@ -13,5 +13,9 @@ status: - redhat - splunk - sumo + - liatrio codeowners: active: [MovieStoreGuy, astencel-sumo, crobert-1] + +tests: + config: diff --git a/receiver/zookeeperreceiver/generated_component_test.go b/receiver/zookeeperreceiver/generated_component_test.go new file mode 100644 index 000000000000..da3140141258 --- /dev/null +++ b/receiver/zookeeperreceiver/generated_component_test.go @@ -0,0 +1,86 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package zookeeperreceiver + +import ( + "context" + "testing" + + "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/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) + +// newAssertNoErrorHost returns a new instance of assertNoErrorHost. +func newAssertNoErrorHost(t *testing.T) component.Host { + return &assertNoErrorHost{ + componenttest.NewNopHost(), + t, + } +} + +func (aneh *assertNoErrorHost) ReportFatalError(err error) { + assert.NoError(aneh, err) +} + +func Test_ComponentLifecycle(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 := newAssertNoErrorHost(t) + 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/zookeeperreceiver/go.mod b/receiver/zookeeperreceiver/go.mod index 553a7b34d433..fb2851bed3c4 100644 --- a/receiver/zookeeperreceiver/go.mod +++ b/receiver/zookeeperreceiver/go.mod @@ -16,6 +16,8 @@ require ( go.opentelemetry.io/collector/consumer v0.91.0 go.opentelemetry.io/collector/pdata v1.0.0 go.opentelemetry.io/collector/receiver v0.91.0 + go.opentelemetry.io/otel/metric v1.21.0 + go.opentelemetry.io/otel/trace v1.21.0 go.uber.org/zap v1.26.0 ) @@ -73,8 +75,6 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.91.0 // indirect go.opentelemetry.io/collector/featuregate v1.0.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect - go.opentelemetry.io/otel/metric v1.21.0 // indirect - go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/exp v0.0.0-20230711023510-fffb14384f22 // indirect golang.org/x/mod v0.14.0 // indirect diff --git a/receiver/zookeeperreceiver/internal/metadata/generated_status.go b/receiver/zookeeperreceiver/internal/metadata/generated_status.go index b19c024c2827..d3c5cf2350b9 100644 --- a/receiver/zookeeperreceiver/internal/metadata/generated_status.go +++ b/receiver/zookeeperreceiver/internal/metadata/generated_status.go @@ -4,9 +4,19 @@ package metadata import ( "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" ) const ( Type = "zookeeper" MetricsStability = component.StabilityLevelDevelopment ) + +func Meter(settings component.TelemetrySettings) metric.Meter { + return settings.MeterProvider.Meter("otelcol/zookeeperreceiver") +} + +func Tracer(settings component.TelemetrySettings) trace.Tracer { + return settings.TracerProvider.Tracer("otelcol/zookeeperreceiver") +} diff --git a/receiver/zookeeperreceiver/metadata.yaml b/receiver/zookeeperreceiver/metadata.yaml index 0020aa2d72ee..9d86b310e2e1 100644 --- a/receiver/zookeeperreceiver/metadata.yaml +++ b/receiver/zookeeperreceiver/metadata.yaml @@ -153,3 +153,6 @@ metrics: unit: 1 gauge: value_type: int + +tests: + config: diff --git a/reports/distributions/contrib.yaml b/reports/distributions/contrib.yaml index f5746848b2b1..2fbef2930e6b 100644 --- a/reports/distributions/contrib.yaml +++ b/reports/distributions/contrib.yaml @@ -149,6 +149,7 @@ components: - mongodb - mongodbatlas - mysql + - namedpipe - nginx - nsxt - opencensus diff --git a/reports/distributions/liatrio.yaml b/reports/distributions/liatrio.yaml index 6f5136b67e5d..ce7cc14df21a 100644 --- a/reports/distributions/liatrio.yaml +++ b/reports/distributions/liatrio.yaml @@ -1,6 +1,33 @@ name: liatrio url: https://github.com/liatrio/liatrio-otel-collector -maintainers: [] +maintainers: + - adrielp components: + connector: + - spanmetrics + exporter: + - awscloudwatchlogs + - awsxray + - influxdb + - prometheus + - prometheusremotewrite + - zipkin + extension: + - basicauth + - bearertokenauth + - health_check + - pprof + - sigv4auth + processor: + - filter + - k8sattributes + - resource + - resourcedetection + - transform receiver: - gitprovider + - jaeger + - k8s_cluster + - kubeletstats + - prometheus + - zipkin diff --git a/reports/distributions/sumo.yaml b/reports/distributions/sumo.yaml index a02bbf0d3461..7064477973dd 100644 --- a/reports/distributions/sumo.yaml +++ b/reports/distributions/sumo.yaml @@ -1,6 +1,12 @@ name: sumo url: https://github.com/SumoLogic/sumologic-otel-collector -maintainers: [] +maintainers: + - aboguszewski-sumo + - astencel-sumo + - kkujawa-sumo + - rnishtala-sumo + - sumo-drosiek + - swiatekm-sumo components: connector: - count diff --git a/testbed/datasenders/carbon.go b/testbed/datasenders/carbon.go index d3bf33dce248..e6a67fc13a24 100644 --- a/testbed/datasenders/carbon.go +++ b/testbed/datasenders/carbon.go @@ -8,7 +8,9 @@ import ( "fmt" "time" + "go.opentelemetry.io/collector/config/confignet" "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/exporter/exporterhelper" "go.opentelemetry.io/collector/exporter/exportertest" "go.uber.org/zap" @@ -40,8 +42,12 @@ func NewCarbonDataSender(port int) *CarbonDataSender { func (cs *CarbonDataSender) Start() error { factory := carbonexporter.NewFactory() cfg := &carbonexporter.Config{ - Endpoint: cs.GetEndpoint().String(), - Timeout: 5 * time.Second, + TCPAddr: confignet.TCPAddr{ + Endpoint: cs.GetEndpoint().String(), + }, + TimeoutSettings: exporterhelper.TimeoutSettings{ + Timeout: 5 * time.Second, + }, } params := exportertest.NewNopCreateSettings() params.Logger = zap.L() diff --git a/testbed/go.mod b/testbed/go.mod index 2ce2a73155e2..02ec244c743c 100644 --- a/testbed/go.mod +++ b/testbed/go.mod @@ -60,7 +60,7 @@ require ( go.uber.org/multierr v1.11.0 go.uber.org/zap v1.26.0 golang.org/x/text v0.14.0 - google.golang.org/grpc v1.60.0 + google.golang.org/grpc v1.60.1 ) require ( @@ -73,7 +73,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.0-rc.7 // indirect + github.com/DataDog/datadog-agent/pkg/proto v0.50.0 // 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 @@ -203,7 +203,7 @@ require ( github.com/scaleway/scaleway-sdk-go v1.0.0-beta.21 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/signalfx/com_signalfx_metrics_protobuf v0.0.3 // indirect - github.com/signalfx/sapm-proto v0.13.0 // indirect + github.com/signalfx/sapm-proto v0.14.0 // indirect github.com/soheilhy/cmux v0.1.5 // indirect github.com/spf13/cobra v1.8.0 // indirect github.com/spf13/pflag v1.0.5 // indirect @@ -243,7 +243,7 @@ require ( go.opentelemetry.io/otel/trace v1.21.0 // indirect go.opentelemetry.io/proto/otlp v1.0.0 // indirect go.uber.org/atomic v1.11.0 // indirect - golang.org/x/crypto v0.16.0 // indirect + golang.org/x/crypto v0.17.0 // indirect golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect diff --git a/testbed/go.sum b/testbed/go.sum index 642514cf0236..022695eacdd1 100644 --- a/testbed/go.sum +++ b/testbed/go.sum @@ -55,8 +55,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.0-rc.7 h1:qJuxmeIiXZNML5/Y9KEf7QKEKKIeliiTIxgRGvGAQBc= -github.com/DataDog/datadog-agent/pkg/proto v0.50.0-rc.7/go.mod h1:HvK26YCxg6MfYvPJgpHC7nSjw6DTpNhd75Wlb0GAvis= +github.com/DataDog/datadog-agent/pkg/proto v0.50.0 h1:FAzs/Hofs9CN7jYYd2P4l8/igdcDPc7q9amIXSje/3A= +github.com/DataDog/datadog-agent/pkg/proto v0.50.0/go.mod h1:HvK26YCxg6MfYvPJgpHC7nSjw6DTpNhd75Wlb0GAvis= 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= @@ -566,8 +566,8 @@ github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnj github.com/shoenig/test v0.6.6 h1:Oe8TPH9wAbv++YPNDKJWUnI8Q4PPWCx3UbOfH+FxiMU= github.com/signalfx/com_signalfx_metrics_protobuf v0.0.3 h1:32k2QLgsKhcEs55q4REPKyIadvid5FPy2+VMgvbmKJ0= github.com/signalfx/com_signalfx_metrics_protobuf v0.0.3/go.mod h1:gJrXWi7wSGXfiC7+VheQaz+ypdCt5SmZNL+BRxUe7y4= -github.com/signalfx/sapm-proto v0.13.0 h1:yEkp1+MAU4vZvnJMp56uhVlRjlvCK7KQjBg0g2Apw8k= -github.com/signalfx/sapm-proto v0.13.0/go.mod h1:C72HjeCW5v0Llk6pIVJ/ZH8A5GbiZpCCSkE1dSlpWxY= +github.com/signalfx/sapm-proto v0.14.0 h1:KWh3I5E4EkelB19aP1/54Ik8khSioC/RVRW/riOfRGg= +github.com/signalfx/sapm-proto v0.14.0/go.mod h1:Km6PskZh966cqNoUn3AmRyGRix5VfwnxVBvn2vjRC9U= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -755,8 +755,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= 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= @@ -1067,8 +1067,8 @@ google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3Iji google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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= diff --git a/versions.yaml b/versions.yaml index 135e5400a988..b0a6e9da4d5c 100644 --- a/versions.yaml +++ b/versions.yaml @@ -213,6 +213,7 @@ module-sets: - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbreceiver - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mongodbatlasreceiver - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/mysqlreceiver + - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/namedpipereceiver - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nginxreceiver - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxtreceiver - github.com/open-telemetry/opentelemetry-collector-contrib/receiver/opencensusreceiver