diff --git a/.chloggen/TEMPLATE.yaml b/.chloggen/TEMPLATE.yaml
index 5f4d66bd650..3e6c5003947 100644
--- a/.chloggen/TEMPLATE.yaml
+++ b/.chloggen/TEMPLATE.yaml
@@ -22,4 +22,4 @@ subtext:
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
-change_logs: []
\ No newline at end of file
+change_logs: []
diff --git a/.chloggen/add_generated_tests_check_config.yaml b/.chloggen/add_unsupported_platforms.yaml
old mode 100755
new mode 100644
similarity index 88%
rename from .chloggen/add_generated_tests_check_config.yaml
rename to .chloggen/add_unsupported_platforms.yaml
index 25eaf93f55c..0733c87522d
--- a/.chloggen/add_generated_tests_check_config.yaml
+++ b/.chloggen/add_unsupported_platforms.yaml
@@ -7,10 +7,10 @@ change_type: enhancement
component: mdatagen
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
-note: Add a generated test that checks the config struct using `componenttest.CheckConfigStruct`
+note: Adds unsupported platforms to the README header
# One or more tracking issues or pull requests related to the change
-issues: [9438]
+issues: [9794]
# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
@@ -22,4 +22,4 @@ subtext:
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
-change_logs: []
\ No newline at end of file
+change_logs: []
diff --git a/.chloggen/mx-psi_featuregate-localhost-2.yaml b/.chloggen/batch-exporter-helper.yaml
similarity index 67%
rename from .chloggen/mx-psi_featuregate-localhost-2.yaml
rename to .chloggen/batch-exporter-helper.yaml
index 6070b6316e5..855be88f3af 100755
--- a/.chloggen/mx-psi_featuregate-localhost-2.yaml
+++ b/.chloggen/batch-exporter-helper.yaml
@@ -4,23 +4,25 @@
change_type: enhancement
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
-component: component
+component: exporterhelper
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
-note: "Add `component.UseLocalHostAsDefaultHost` feature gate that changes default endpoints from 0.0.0.0 to localhost"
+note: Make the `WithBatcher` option available for regular exporter helpers based on OTLP data type.
# One or more tracking issues or pull requests related to the change
-issues: [8510]
+issues: [8122]
# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
-subtext: |
- The only component in this repository affected by this is the OTLP receiver.
+subtext: |
+ Not `WithBatcher` can be used with both regular exporter helper (e.g. NewTracesExporter) and the request-based exporter
+ helper (e.g. NewTracesRequestExporter). The request-based exporter helpers require `WithRequestBatchFuncs` option
+ providing batching functions.
+
# 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: []
-
+change_logs: [api]
\ No newline at end of file
diff --git a/.chloggen/mx-psi_component-type-validation.yaml b/.chloggen/codeboten_use-period.yaml
old mode 100755
new mode 100644
similarity index 67%
rename from .chloggen/mx-psi_component-type-validation.yaml
rename to .chloggen/codeboten_use-period.yaml
index af38d42d60f..161b956146f
--- a/.chloggen/mx-psi_component-type-validation.yaml
+++ b/.chloggen/codeboten_use-period.yaml
@@ -4,23 +4,26 @@
change_type: breaking
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
-component: component
+component: service
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
-note: Validate component.Type at creation and unmarshaling time.
+note: emit internal collector metrics with _ instead of / with OTLP export
# One or more tracking issues or pull requests related to the change
-issues: [9208]
+issues: [9774]
# (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: |
- - A component.Type must start with an ASCII alphabetic character and can only contain ASCII alphanumeric characters and '_'.
+ This is addressing an issue w/ the names of the metrics generated by the Collector for its
+ internal metrics. Note that this change only impacts users that emit telemetry using OTLP, which
+ is currently still in experimental support. The prometheus metrics already replaced `/` with `_`
+ and they will do the same with `_`.
# 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]
+change_logs: []
diff --git a/.chloggen/grpcserversettings_grpcserverconfig.yaml b/.chloggen/configgrpc-remove-deprecated-funcs-2.yaml
old mode 100755
new mode 100644
similarity index 88%
rename from .chloggen/grpcserversettings_grpcserverconfig.yaml
rename to .chloggen/configgrpc-remove-deprecated-funcs-2.yaml
index 4f8907c478c..3bfefda5bae
--- a/.chloggen/grpcserversettings_grpcserverconfig.yaml
+++ b/.chloggen/configgrpc-remove-deprecated-funcs-2.yaml
@@ -1,16 +1,16 @@
# Use this changelog template to create an entry for release notes.
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
-change_type: deprecation
+change_type: breaking
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
component: configgrpc
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
-note: Deprecate GRPCServerSettings, use ServerConfig instead
+note: Remove deprecated `ToServerContext`, use `ToServer` instead.
# One or more tracking issues or pull requests related to the change
-issues: [6767]
+issues: [9836]
# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
@@ -22,4 +22,4 @@ subtext:
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
-change_logs: [api]
\ No newline at end of file
+change_logs: [api]
diff --git a/.chloggen/grpcclientsettings_grpcclientconfig.yaml b/.chloggen/configgrpc-remove-deprecated-funcs.yaml
old mode 100755
new mode 100644
similarity index 88%
rename from .chloggen/grpcclientsettings_grpcclientconfig.yaml
rename to .chloggen/configgrpc-remove-deprecated-funcs.yaml
index 10bb2273420..2f7e1ba9751
--- a/.chloggen/grpcclientsettings_grpcclientconfig.yaml
+++ b/.chloggen/configgrpc-remove-deprecated-funcs.yaml
@@ -1,16 +1,16 @@
# Use this changelog template to create an entry for release notes.
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
-change_type: deprecation
+change_type: breaking
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
component: configgrpc
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
-note: Deprecate GRPCClientSettings, use ClientConfig instead
+note: Remove deprecated `SanitizedEndpoint`.
# One or more tracking issues or pull requests related to the change
-issues: [6767]
+issues: [9836]
# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
@@ -22,4 +22,4 @@ subtext:
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
-change_logs: []
\ No newline at end of file
+change_logs: [api]
diff --git a/.chloggen/configtls-add-context-to-public-funcs.yaml b/.chloggen/configtls-add-context-to-public-funcs.yaml
new file mode 100644
index 00000000000..d9f8b8359e9
--- /dev/null
+++ b/.chloggen/configtls-add-context-to-public-funcs.yaml
@@ -0,0 +1,25 @@
+# Use this changelog template to create an entry for release notes.
+
+# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
+change_type: deprecation
+
+# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
+component: configtls
+
+# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
+note: Deprecate `ClientConfig.LoadTLSConfig` and `ServerConfig.LoadTLSConfig`, use `ClientConfig.LoadTLSConfigContext` and `ServerConfig.LoadTLSConfigContext` instead.
+
+# One or more tracking issues or pull requests related to the change
+issues: [9811]
+
+# (Optional) One or more lines of additional information to render under the primary note.
+# These lines will be padded with 2 spaces and then inserted directly into the document.
+# Use pipe (|) for multiline entries.
+subtext:
+
+# Optional: The change log or logs in which this entry should be included.
+# e.g. '[user]' or '[user, api]'
+# Include 'user' if the change is relevant to end users.
+# Include 'api' if there is a change to a library API.
+# Default: '[user]'
+change_logs: [api]
diff --git a/.chloggen/configcompression-make-member-func.yaml b/.chloggen/configtls-fix-IncludeSystemCACertsPool-bug.yaml
old mode 100755
new mode 100644
similarity index 82%
rename from .chloggen/configcompression-make-member-func.yaml
rename to .chloggen/configtls-fix-IncludeSystemCACertsPool-bug.yaml
index f709f1529a2..ccc47d5e82c
--- a/.chloggen/configcompression-make-member-func.yaml
+++ b/.chloggen/configtls-fix-IncludeSystemCACertsPool-bug.yaml
@@ -1,16 +1,16 @@
# Use this changelog template to create an entry for release notes.
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
-change_type: deprecation
+change_type: bug_fix
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
-component: configcompressions
+component: configtls
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
-note: Deprecate `IsCompressed`. Use `CompressionType.IsCompressed instead` instead.
+note: Fix issue where `IncludeSystemCACertsPool` was not consistently used between `ServerConfig` and `ClientConfig`.
# One or more tracking issues or pull requests related to the change
-issues: [9435]
+issues: [9835]
# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
@@ -22,4 +22,4 @@ subtext:
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
-change_logs: [api]
\ No newline at end of file
+change_logs: []
diff --git a/.chloggen/deprecate_toListener.yaml b/.chloggen/configtls-remove-deprecated.yaml
old mode 100755
new mode 100644
similarity index 85%
rename from .chloggen/deprecate_toListener.yaml
rename to .chloggen/configtls-remove-deprecated.yaml
index a7e60618983..68b8ba4d406
--- a/.chloggen/deprecate_toListener.yaml
+++ b/.chloggen/configtls-remove-deprecated.yaml
@@ -1,16 +1,16 @@
# Use this changelog template to create an entry for release notes.
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
-change_type: deprecation
+change_type: breaking
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
-component: configgrpc
+component: configtls
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
-note: Deprecate `ToListener` function in favor of `ToListenerContext`
+note: Remove Deprecated `TLSSetting`, `TLSClientSetting`, and `TLSServerSetting`.
# One or more tracking issues or pull requests related to the change
-issues: [9389]
+issues: [9786]
# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
@@ -22,4 +22,4 @@ subtext:
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
-change_logs: [api]
\ No newline at end of file
+change_logs: [api]
diff --git a/.chloggen/confignet-remove-deprecated-functions.yaml b/.chloggen/configtls-remove-deprecated2.yaml
old mode 100755
new mode 100644
similarity index 87%
rename from .chloggen/confignet-remove-deprecated-functions.yaml
rename to .chloggen/configtls-remove-deprecated2.yaml
index 70b155b0f83..d771a01407e
--- a/.chloggen/confignet-remove-deprecated-functions.yaml
+++ b/.chloggen/configtls-remove-deprecated2.yaml
@@ -4,13 +4,13 @@
change_type: breaking
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
-component: confignet
+component: configtls
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
-note: Remove deprecated `DialContext` and `ListenContext` functions
+note: Rename `TLSSetting` to `Config` on `ClientConfig` and `ServerConfig`.
# One or more tracking issues or pull requests related to the change
-issues: [9363]
+issues: [9786]
# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
@@ -22,4 +22,4 @@ subtext:
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
-change_logs: [api]
\ No newline at end of file
+change_logs: [api]
diff --git a/.chloggen/convertersettings.yaml b/.chloggen/convertersettings.yaml
deleted file mode 100755
index 6b92cfdbea6..00000000000
--- a/.chloggen/convertersettings.yaml
+++ /dev/null
@@ -1,26 +0,0 @@
-# Use this changelog template to create an entry for release notes.
-
-# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
-change_type: breaking
-
-# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
-component: confmap/converter/expandconverter
-
-# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
-note: Add `confmap.ConverterSettings` argument to experimental `expandconverter.New` function.
-
-# One or more tracking issues or pull requests related to the change
-issues: [5615, 9162]
-
-# (Optional) One or more lines of additional information to render under the primary note.
-# These lines will be padded with 2 spaces and then inserted directly into the document.
-# Use pipe (|) for multiline entries.
-subtext: |
- - The `confmap.ConverterSettings` struct currently has no fields. It will be used to pass a logger.
-
-# 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/depcomponent.yaml b/.chloggen/depcomponent.yaml
deleted file mode 100755
index 34277cb36a6..00000000000
--- a/.chloggen/depcomponent.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
-# Use this changelog template to create an entry for release notes.
-
-# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
-change_type: "breaking"
-
-# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
-component: "component"
-
-# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
-note: "Remove deprecated funcs and types"
-
-# One or more tracking issues or pull requests related to the change
-issues: [9283]
-
-# 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]
\ No newline at end of file
diff --git a/.chloggen/embedded_unmarshaler.yaml b/.chloggen/embedded_unmarshaler.yaml
new file mode 100644
index 00000000000..4e23adc5253
--- /dev/null
+++ b/.chloggen/embedded_unmarshaler.yaml
@@ -0,0 +1,25 @@
+# Use this changelog template to create an entry for release notes.
+
+# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
+change_type: enhancement
+
+# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
+component: confmap
+
+# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
+note: Clarify the use of embedded structs to make unmarshaling composable
+
+# One or more tracking issues or pull requests related to the change
+issues: [7101]
+
+# (Optional) One or more lines of additional information to render under the primary note.
+# These lines will be padded with 2 spaces and then inserted directly into the document.
+# Use pipe (|) for multiline entries.
+subtext:
+
+# Optional: The change log or logs in which this entry should be included.
+# e.g. '[user]' or '[user, api]'
+# Include 'user' if the change is relevant to end users.
+# Include 'api' if there is a change to a library API.
+# Default: '[user]'
+change_logs: []
diff --git a/.chloggen/fix-componets-command.yaml b/.chloggen/fix-componets-command.yaml
new file mode 100644
index 00000000000..fdcd6effb8f
--- /dev/null
+++ b/.chloggen/fix-componets-command.yaml
@@ -0,0 +1,25 @@
+# Use this changelog template to create an entry for release notes.
+
+# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
+change_type: bug_fix
+
+# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
+component: component
+
+# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
+note: Fix issue where the `components` command wasn't properly printing the component type.
+
+# One or more tracking issues or pull requests related to the change
+issues: [9856]
+
+# (Optional) One or more lines of additional information to render under the primary note.
+# These lines will be padded with 2 spaces and then inserted directly into the document.
+# Use pipe (|) for multiline entries.
+subtext:
+
+# Optional: The change log or logs in which this entry should be included.
+# e.g. '[user]' or '[user, api]'
+# Include 'user' if the change is relevant to end users.
+# Include 'api' if there is a change to a library API.
+# Default: '[user]'
+change_logs: []
diff --git a/.chloggen/codeboten_fix-census-bridge.yaml b/.chloggen/fix-validate-command.yaml
old mode 100755
new mode 100644
similarity index 86%
rename from .chloggen/codeboten_fix-census-bridge.yaml
rename to .chloggen/fix-validate-command.yaml
index 67c4972ba1d..e63cbf6c0bc
--- a/.chloggen/codeboten_fix-census-bridge.yaml
+++ b/.chloggen/fix-validate-command.yaml
@@ -4,13 +4,13 @@
change_type: bug_fix
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
-component: service
+component: otelcol
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
-note: fix opencensus bridge configuration in periodic readers
+note: Fix issue where the `validate` command wasn't properly printing valid component type.
# One or more tracking issues or pull requests related to the change
-issues: [9361]
+issues: [9866]
# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
@@ -22,4 +22,4 @@ subtext:
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
-change_logs: []
\ No newline at end of file
+change_logs: []
diff --git a/.chloggen/grpcclientsettings_grpcclientconfig-otlpreceiver.yaml b/.chloggen/grpcclientsettings_grpcclientconfig-otlpreceiver.yaml
deleted file mode 100755
index 2e320b6e794..00000000000
--- a/.chloggen/grpcclientsettings_grpcclientconfig-otlpreceiver.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-# Use this changelog template to create an entry for release notes.
-
-# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
-change_type: breaking
-
-# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
-component: otlpexporter
-
-# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
-note: Config struct is moving from embedding the deprecated GRPCClientSettings struct to using ClientConfig instead.
-
-# One or more tracking issues or pull requests related to the change
-issues: [6767]
-
-# (Optional) One or more lines of additional information to render under the primary note.
-# These lines will be padded with 2 spaces and then inserted directly into the document.
-# Use pipe (|) for multiline entries.
-subtext:
-
-# Optional: The change log or logs in which this entry should be included.
-# e.g. '[user]' or '[user, api]'
-# Include 'user' if the change is relevant to end users.
-# Include 'api' if there is a change to a library API.
-# Default: '[user]'
-change_logs: [api]
\ No newline at end of file
diff --git a/.chloggen/httpclientsettings_httpclientconfig-breaking.yaml b/.chloggen/httpclientsettings_httpclientconfig-breaking.yaml
deleted file mode 100755
index 45982d775c0..00000000000
--- a/.chloggen/httpclientsettings_httpclientconfig-breaking.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-# Use this changelog template to create an entry for release notes.
-
-# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
-change_type: breaking
-
-# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
-component: otlphttpexporter
-
-# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
-note: otlphttpexporter.Config embeds the struct confighttp.ClientConfig instead of confighttp.HTTPClientSettings
-
-# One or more tracking issues or pull requests related to the change
-issues: [6767]
-
-# (Optional) One or more lines of additional information to render under the primary note.
-# These lines will be padded with 2 spaces and then inserted directly into the document.
-# Use pipe (|) for multiline entries.
-subtext:
-
-# Optional: The change log or logs in which this entry should be included.
-# e.g. '[user]' or '[user, api]'
-# Include 'user' if the change is relevant to end users.
-# Include 'api' if there is a change to a library API.
-# Default: '[user]'
-change_logs: [api]
\ No newline at end of file
diff --git a/.chloggen/httpclientsettings_httpclientconfig.yaml b/.chloggen/httpclientsettings_httpclientconfig.yaml
deleted file mode 100755
index 22255bd4df1..00000000000
--- a/.chloggen/httpclientsettings_httpclientconfig.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-# Use this changelog template to create an entry for release notes.
-
-# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
-change_type: deprecation
-
-# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
-component: confighttp
-
-# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
-note: Deprecate HTTPClientSettings, use ClientConfig instead
-
-# One or more tracking issues or pull requests related to the change
-issues: [6767]
-
-# (Optional) One or more lines of additional information to render under the primary note.
-# These lines will be padded with 2 spaces and then inserted directly into the document.
-# Use pipe (|) for multiline entries.
-subtext:
-
-# Optional: The change log or logs in which this entry should be included.
-# e.g. '[user]' or '[user, api]'
-# Include 'user' if the change is relevant to end users.
-# Include 'api' if there is a change to a library API.
-# Default: '[user]'
-change_logs: [api]
\ No newline at end of file
diff --git a/.chloggen/httpserversettings_httpserverconfig-otlpreceiver.yaml b/.chloggen/httpserversettings_httpserverconfig-otlpreceiver.yaml
deleted file mode 100755
index d1084112bd6..00000000000
--- a/.chloggen/httpserversettings_httpserverconfig-otlpreceiver.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-# Use this changelog template to create an entry for release notes.
-
-# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
-change_type: breaking
-
-# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
-component: otlpreceiver
-
-# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
-note: HTTPConfig struct is moving from embedding the deprecated ServerSettings struct to using HTTPServerConfig instead.
-
-# One or more tracking issues or pull requests related to the change
-issues: [6767]
-
-# (Optional) One or more lines of additional information to render under the primary note.
-# These lines will be padded with 2 spaces and then inserted directly into the document.
-# Use pipe (|) for multiline entries.
-subtext:
-
-# Optional: The change log or logs in which this entry should be included.
-# e.g. '[user]' or '[user, api]'
-# Include 'user' if the change is relevant to end users.
-# Include 'api' if there is a change to a library API.
-# Default: '[user]'
-change_logs: [api]
\ No newline at end of file
diff --git a/.chloggen/httpserversettings_httpserverconfig.yaml b/.chloggen/httpserversettings_httpserverconfig.yaml
deleted file mode 100755
index 52f5601f012..00000000000
--- a/.chloggen/httpserversettings_httpserverconfig.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-# Use this changelog template to create an entry for release notes.
-
-# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
-change_type: deprecation
-
-# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
-component: confighttp
-
-# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
-note: Deprecate HTTPServerSettings, use ServerConfig instead
-
-# One or more tracking issues or pull requests related to the change
-issues: [6767]
-
-# (Optional) One or more lines of additional information to render under the primary note.
-# These lines will be padded with 2 spaces and then inserted directly into the document.
-# Use pipe (|) for multiline entries.
-subtext:
-
-# Optional: The change log or logs in which this entry should be included.
-# e.g. '[user]' or '[user, api]'
-# Include 'user' if the change is relevant to end users.
-# Include 'api' if there is a change to a library API.
-# Default: '[user]'
-change_logs: [api]
\ No newline at end of file
diff --git a/.chloggen/mx-psi_featuregate-localhost.yaml b/.chloggen/log-env-empty.yaml
old mode 100755
new mode 100644
similarity index 78%
rename from .chloggen/mx-psi_featuregate-localhost.yaml
rename to .chloggen/log-env-empty.yaml
index 20632157ae8..e6f80766068
--- a/.chloggen/mx-psi_featuregate-localhost.yaml
+++ b/.chloggen/log-env-empty.yaml
@@ -4,19 +4,19 @@
change_type: enhancement
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
-component: featuregate
+component: confmap
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
-note: "Add the `featuregate.ErrAlreadyRegistered` error, which is returned by `featuregate.Registry`'s `Register` when adding a feature gate that is already registered."
+note: Creates a logger in the confmap.ProviderSettings and uses it to log when there is a missing or blank environment variable referenced in config. For now the noop logger is used everywhere except tests.
+
# One or more tracking issues or pull requests related to the change
-issues: [8622]
+issues: [5615]
# (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: |
- Use `errors.Is` to check for this error.
+subtext:
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
diff --git a/.chloggen/update-GetStatusFromError-code.yaml b/.chloggen/otlpreciever-http-response-code.yaml
similarity index 85%
rename from .chloggen/update-GetStatusFromError-code.yaml
rename to .chloggen/otlpreciever-http-response-code.yaml
index 6fa3566bd65..f53f83ac0e9 100755
--- a/.chloggen/update-GetStatusFromError-code.yaml
+++ b/.chloggen/otlpreciever-http-response-code.yaml
@@ -1,16 +1,16 @@
# Use this changelog template to create an entry for release notes.
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
-change_type: breaking
+change_type: bug_fix
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
component: receiver/otlp
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
-note: Update gRPC code from `codes.InvalidArgument` to `codes.Internal` when a permanent error doesn't contain a gRPC status
+note: Fix bug where the otlp receiver did not properly respond with a retryable error code when possible for http
# One or more tracking issues or pull requests related to the change
-issues: [9415]
+issues: [9357]
# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
diff --git a/.chloggen/providersettings.yaml b/.chloggen/providersettings.yaml
deleted file mode 100755
index bfdd0d35aed..00000000000
--- a/.chloggen/providersettings.yaml
+++ /dev/null
@@ -1,26 +0,0 @@
-# Use this changelog template to create an entry for release notes.
-
-# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
-change_type: deprecation
-
-# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
-component: confmap/provider
-
-# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
-note: Deprecate
@@ -59,6 +61,13 @@ Objectives:
- Extensible: Customizable without touching the core code.
- Unified: Single codebase, deployable as an agent or collector with support for traces, metrics and logs.
+## Supported OTLP version
+
+This code base is currently built against using OTLP protocol v1.1.0,
+considered Stable. [See the OpenTelemetry Protocol Stability
+definition
+here.](https://github.com/open-telemetry/opentelemetry-proto?tab=readme-ov-file#stability-definition)
+
## Stability levels
The collector components and implementation are in different stages of stability, and usually split between
@@ -113,6 +122,7 @@ Here is a list of community roles with current and previous members:
- [Andrzej Stencel](https://github.com/astencel-sumo), Sumo Logic
- [Antoine Toulme](https://github.com/atoulme), Splunk
+ - [Evan Bradley](https://github.com/evan-bradley), Dynatrace
- [Tyler Helmuth](https://github.com/TylerHelmuth), Honeycomb
- [Yang Song](https://github.com/songy23), Datadog
- Actively seeking contributors to triage issues
@@ -141,7 +151,7 @@ Here is a list of community roles with current and previous members:
- Maintainers ([@open-telemetry/collector-maintainers](https://github.com/orgs/open-telemetry/teams/collector-maintainers)):
- - [Alex Boten](https://github.com/codeboten), ServiceNow
+ - [Alex Boten](https://github.com/codeboten), Honeycomb
- [Bogdan Drutu](https://github.com/BogdanDrutu), Snowflake
- [Dmitrii Anoshin](https://github.com/dmitryax), Splunk
- [Pablo Baeyens](https://github.com/mx-psi), DataDog
diff --git a/client/client.go b/client/client.go
index 1f385f6af81..fa944cad909 100644
--- a/client/client.go
+++ b/client/client.go
@@ -98,15 +98,9 @@ type Info struct {
Auth AuthData
// Metadata is the request metadata from the client connecting to this connector.
- // Experimental: *NOTE* this structure is subject to change or removal in the future.
Metadata Metadata
}
-// Metadata is an immutable map, meant to contain request metadata.
-type Metadata struct {
- data map[string][]string
-}
-
// AuthData represents the authentication data as seen by authenticators tied to
// the receivers.
type AuthData interface {
@@ -116,8 +110,7 @@ type AuthData interface {
// "membership" might return a list of strings.
GetAttribute(string) any
- // GetAttributes returns the names of all attributes in this authentication
- // data.
+ // GetAttributeNames returns the names of all attributes in this authentication data.
GetAttributeNames() []string
}
@@ -139,30 +132,32 @@ func FromContext(ctx context.Context) Info {
return c
}
-// NewMetadata creates a new Metadata object to use in Info. md is used as-is.
+// Metadata is an immutable map, meant to contain request metadata.
+type Metadata struct {
+ data map[string][]string
+}
+
+// NewMetadata creates a new Metadata object to use in Info.
func NewMetadata(md map[string][]string) Metadata {
+ c := make(map[string][]string, len(md))
+ for k, v := range md {
+ c[strings.ToLower(k)] = v
+ }
return Metadata{
- data: md,
+ data: c,
}
}
// Get gets the value of the key from metadata, returning a copy.
+// The key lookup is case-insensitive.
func (m Metadata) Get(key string) []string {
- vals := m.data[key]
+ if len(m.data) == 0 {
+ return nil
+ }
+
+ vals := m.data[strings.ToLower(key)]
if len(vals) == 0 {
- // we didn't find the key, but perhaps it just has different cases?
- for k, v := range m.data {
- if strings.EqualFold(key, k) {
- vals = v
- // we optimize for the next lookup
- m.data[key] = v
- }
- }
-
- // if it's still not found, it's really not here
- if len(vals) == 0 {
- return nil
- }
+ return nil
}
ret := make([]string, len(vals))
diff --git a/client/client_test.go b/client/client_test.go
index f71b7da0728..ddec6bd89dd 100644
--- a/client/client_test.go
+++ b/client/client_test.go
@@ -77,10 +77,11 @@ func TestFromContext(t *testing.T) {
}
func TestMetadata(t *testing.T) {
- source := map[string][]string{"test-key": {"test-val"}}
+ source := map[string][]string{"test-key": {"test-val"}, "TEST-KEY-2": {"test-val"}}
md := NewMetadata(source)
assert.Equal(t, []string{"test-val"}, md.Get("test-key"))
- assert.Equal(t, []string{"test-val"}, md.Get("test-KEY")) // case insensitive lookup
+ assert.Equal(t, []string{"test-val"}, md.Get("test-KEY")) // case insensitive lookup
+ assert.Equal(t, []string{"test-val"}, md.Get("test-key-2")) // case insensitive lookup
// test if copy. In regular use, source cannot change
val := md.Get("test-key")
@@ -89,3 +90,8 @@ func TestMetadata(t *testing.T) {
assert.Empty(t, md.Get("non-existent-key"))
}
+
+func TestUninstantiatedMetadata(t *testing.T) {
+ i := Info{}
+ assert.Empty(t, i.Metadata.Get("test"))
+}
diff --git a/cmd/builder/go.mod b/cmd/builder/go.mod
index 4b11be988e9..33061f89798 100644
--- a/cmd/builder/go.mod
+++ b/cmd/builder/go.mod
@@ -3,7 +3,7 @@
module go.opentelemetry.io/collector/cmd/builder
-go 1.20
+go 1.21
require (
github.com/hashicorp/go-version v1.6.0
@@ -11,23 +11,23 @@ require (
github.com/knadh/koanf/providers/env v0.1.0
github.com/knadh/koanf/providers/file v0.1.0
github.com/knadh/koanf/providers/fs v0.1.0
- github.com/knadh/koanf/v2 v2.0.1
+ github.com/knadh/koanf/v2 v2.1.0
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
- github.com/stretchr/testify v1.8.4
+ github.com/stretchr/testify v1.9.0
go.uber.org/goleak v1.3.0
go.uber.org/multierr v1.11.0
- go.uber.org/zap v1.26.0
+ go.uber.org/zap v1.27.0
)
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
+ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/knadh/koanf/maps v0.1.1 // indirect
github.com/kr/pretty v0.3.1 // 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/rogpeppe/go-internal v1.10.0 // indirect
diff --git a/cmd/builder/go.sum b/cmd/builder/go.sum
index 0ee4e9969b1..f91d5888585 100644
--- a/cmd/builder/go.sum
+++ b/cmd/builder/go.sum
@@ -4,6 +4,8 @@ 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/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-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
@@ -18,8 +20,8 @@ github.com/knadh/koanf/providers/file v0.1.0 h1:fs6U7nrV58d3CFAFh8VTde8TM262ObYf
github.com/knadh/koanf/providers/file v0.1.0/go.mod h1:rjJ/nHQl64iYCtAW2QQnF0eSmDEX/YZ/eNFj5yR6BvA=
github.com/knadh/koanf/providers/fs v0.1.0 h1:9Hln9GS3bWTItAnGVFYyfkoAIxAFq7pvlF64pTNiDdQ=
github.com/knadh/koanf/providers/fs v0.1.0/go.mod h1:Cva1yH8NBxkEeVZx8CUmF5TunbgO72E+GwqDbqpP2sE=
-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/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
@@ -29,8 +31,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
-github.com/mitchellh/mapstructure v1.5.1-0.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/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
@@ -44,14 +44,14 @@ 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/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
-github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
-go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
-go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
diff --git a/cmd/builder/internal/builder/config.go b/cmd/builder/internal/builder/config.go
index 1dae52ec3e1..91d1e3ece7d 100644
--- a/cmd/builder/internal/builder/config.go
+++ b/cmd/builder/internal/builder/config.go
@@ -16,7 +16,7 @@ import (
"go.uber.org/zap"
)
-const defaultOtelColVersion = "0.93.0"
+const defaultOtelColVersion = "0.97.0"
// ErrInvalidGoMod indicates an invalid gomod
var ErrInvalidGoMod = errors.New("invalid gomod specification for module")
diff --git a/cmd/builder/internal/builder/main.go b/cmd/builder/internal/builder/main.go
index 89988bd398f..3b22300be2e 100644
--- a/cmd/builder/internal/builder/main.go
+++ b/cmd/builder/internal/builder/main.go
@@ -135,7 +135,7 @@ func GetModules(cfg Config) error {
return fmt.Errorf("failed to go get: %w", err)
}
- if err := runGoCommand(cfg, "mod", "tidy", "-compat=1.20"); err != nil {
+ if err := runGoCommand(cfg, "mod", "tidy", "-compat=1.21"); err != nil {
return fmt.Errorf("failed to update go.mod: %w", err)
}
@@ -162,5 +162,6 @@ func processAndWrite(cfg Config, tmpl *template.Template, outFile string, tmplPa
return err
}
+ defer out.Close()
return tmpl.Execute(out, tmplParams)
}
diff --git a/cmd/builder/internal/builder/main_test.go b/cmd/builder/internal/builder/main_test.go
index e9f2fbbd303..beac8cef5c7 100644
--- a/cmd/builder/internal/builder/main_test.go
+++ b/cmd/builder/internal/builder/main_test.go
@@ -10,7 +10,6 @@ import (
"path/filepath"
"runtime"
"testing"
- "time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -36,25 +35,21 @@ func TestGenerateInvalidOutputPath(t *testing.T) {
}
func TestSkipGenerate(t *testing.T) {
- if runtime.GOOS == "windows" {
- t.Skip("skipping the test on Windows, see https://github.com/open-telemetry/opentelemetry-collector/issues/5403")
- }
-
cfg := NewDefaultConfig()
cfg.Distribution.OutputPath = t.TempDir()
cfg.SkipGenerate = true
err := Generate(cfg)
require.NoError(t, err)
outputFile, err := os.Open(cfg.Distribution.OutputPath)
+ defer func() {
+ require.NoError(t, outputFile.Close())
+ }()
require.NoError(t, err)
_, err = outputFile.Readdirnames(1)
require.ErrorIs(t, err, io.EOF, "skip generate should leave output directory empty")
}
func TestGenerateAndCompile(t *testing.T) {
- if runtime.GOOS == "windows" {
- t.Skip("skipping the test on Windows, see https://github.com/open-telemetry/opentelemetry-collector/issues/5403")
- }
// This test is dependent on the current file structure.
// The goal is find the root of the repo so we can replace the root module.
_, thisFile, _, _ := runtime.Caller(0)
@@ -64,11 +59,18 @@ func TestGenerateAndCompile(t *testing.T) {
fmt.Sprintf("go.opentelemetry.io/collector/config/confignet => %s/config/confignet", workspaceDir),
fmt.Sprintf("go.opentelemetry.io/collector/config/configtelemetry => %s/config/configtelemetry", workspaceDir),
fmt.Sprintf("go.opentelemetry.io/collector/confmap => %s/confmap", workspaceDir),
+ fmt.Sprintf("go.opentelemetry.io/collector/confmap/converter/expandconverter => %s/confmap/converter/expandconverter", workspaceDir),
+ fmt.Sprintf("go.opentelemetry.io/collector/confmap/provider/envprovider => %s/confmap/provider/envprovider", workspaceDir),
+ fmt.Sprintf("go.opentelemetry.io/collector/confmap/provider/fileprovider => %s/confmap/provider/fileprovider", workspaceDir),
+ fmt.Sprintf("go.opentelemetry.io/collector/confmap/provider/httpprovider => %s/confmap/provider/httpprovider", workspaceDir),
+ fmt.Sprintf("go.opentelemetry.io/collector/confmap/provider/httpsprovider => %s/confmap/provider/httpsprovider", workspaceDir),
+ fmt.Sprintf("go.opentelemetry.io/collector/confmap/provider/yamlprovider => %s/confmap/provider/yamlprovider", workspaceDir),
fmt.Sprintf("go.opentelemetry.io/collector/consumer => %s/consumer", workspaceDir),
fmt.Sprintf("go.opentelemetry.io/collector/connector => %s/connector", workspaceDir),
fmt.Sprintf("go.opentelemetry.io/collector/exporter => %s/exporter", workspaceDir),
fmt.Sprintf("go.opentelemetry.io/collector/exporter/debugexporter => %s/exporter/debugexporter", workspaceDir),
fmt.Sprintf("go.opentelemetry.io/collector/exporter/loggingexporter => %s/exporter/loggingexporter", workspaceDir),
+ fmt.Sprintf("go.opentelemetry.io/collector/exporter/nopexporter => %s/exporter/nopexporter", workspaceDir),
fmt.Sprintf("go.opentelemetry.io/collector/exporter/otlpexporter => %s/exporter/otlpexporter", workspaceDir),
fmt.Sprintf("go.opentelemetry.io/collector/exporter/otlphttpexporter => %s/exporter/otlphttpexporter", workspaceDir),
fmt.Sprintf("go.opentelemetry.io/collector/extension => %s/extension", workspaceDir),
@@ -79,6 +81,7 @@ func TestGenerateAndCompile(t *testing.T) {
fmt.Sprintf("go.opentelemetry.io/collector/processor/batchprocessor => %s/processor/batchprocessor", workspaceDir),
fmt.Sprintf("go.opentelemetry.io/collector/processor/memorylimiterprocessor => %s/processor/memorylimiterprocessor", workspaceDir),
fmt.Sprintf("go.opentelemetry.io/collector/receiver => %s/receiver", workspaceDir),
+ fmt.Sprintf("go.opentelemetry.io/collector/receiver/nopreceiver => %s/receiver/nopreceiver", workspaceDir),
fmt.Sprintf("go.opentelemetry.io/collector/receiver/otlpreceiver => %s/receiver/otlpreceiver", workspaceDir),
fmt.Sprintf("go.opentelemetry.io/collector/otelcol => %s/otelcol", workspaceDir),
fmt.Sprintf("go.opentelemetry.io/collector/pdata => %s/pdata", workspaceDir),
@@ -129,8 +132,4 @@ func TestGenerateAndCompile(t *testing.T) {
require.NoError(t, GenerateAndCompile(cfg))
})
}
-
- // Sleep for 1 second to make sure all processes using the files are completed
- // (on Windows fail to delete temp dir otherwise).
- time.Sleep(1 * time.Second)
}
diff --git a/cmd/builder/internal/builder/templates/go.mod.tmpl b/cmd/builder/internal/builder/templates/go.mod.tmpl
index 29c1bfcf2b8..f70306ae95b 100644
--- a/cmd/builder/internal/builder/templates/go.mod.tmpl
+++ b/cmd/builder/internal/builder/templates/go.mod.tmpl
@@ -2,7 +2,7 @@
module {{.Distribution.Module}}
-go 1.20
+go 1.21
require (
{{- range .Connectors}}
diff --git a/cmd/builder/internal/command.go b/cmd/builder/internal/command.go
index a39ca733214..34d1b0b13b9 100644
--- a/cmd/builder/internal/command.go
+++ b/cmd/builder/internal/command.go
@@ -53,7 +53,7 @@ build configuration given by the "--config" argument. If no build
configuration is provided, ocb will generate a default Collector.
`,
Args: cobra.NoArgs,
- RunE: func(cmd *cobra.Command, args []string) error {
+ RunE: func(cmd *cobra.Command, _ []string) error {
if err := initConfig(cmd.Flags()); err != nil {
return err
}
diff --git a/cmd/builder/internal/config/default.yaml b/cmd/builder/internal/config/default.yaml
index bb174de7b13..2bd318f0e04 100644
--- a/cmd/builder/internal/config/default.yaml
+++ b/cmd/builder/internal/config/default.yaml
@@ -2,23 +2,25 @@ dist:
module: go.opentelemetry.io/collector/cmd/otelcorecol
name: otelcorecol
description: Local OpenTelemetry Collector binary, testing only.
- version: 0.93.0-dev
- otelcol_version: 0.93.0
+ version: 0.97.0-dev
+ otelcol_version: 0.97.0
receivers:
- - gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.93.0
+ - gomod: go.opentelemetry.io/collector/receiver/nopreceiver v0.97.0
+ - gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.97.0
exporters:
- - gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.93.0
- - gomod: go.opentelemetry.io/collector/exporter/loggingexporter v0.93.0
- - gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.93.0
- - gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.93.0
+ - gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.97.0
+ - gomod: go.opentelemetry.io/collector/exporter/loggingexporter v0.97.0
+ - gomod: go.opentelemetry.io/collector/exporter/nopexporter v0.97.0
+ - gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.97.0
+ - gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.97.0
extensions:
- - gomod: go.opentelemetry.io/collector/extension/ballastextension v0.93.0
- - gomod: go.opentelemetry.io/collector/extension/memorylimiterextension v0.93.0
- - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.93.0
+ - gomod: go.opentelemetry.io/collector/extension/ballastextension v0.97.0
+ - gomod: go.opentelemetry.io/collector/extension/memorylimiterextension v0.97.0
+ - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.97.0
processors:
- - gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.93.0
- - gomod: go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.93.0
+ - gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.97.0
+ - gomod: go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.97.0
connectors:
- - gomod: go.opentelemetry.io/collector/connector/forwardconnector v0.93.0
+ - gomod: go.opentelemetry.io/collector/connector/forwardconnector v0.97.0
diff --git a/cmd/builder/internal/version.go b/cmd/builder/internal/version.go
index 7ffabed75fc..9ffbbf30955 100644
--- a/cmd/builder/internal/version.go
+++ b/cmd/builder/internal/version.go
@@ -34,7 +34,7 @@ func versionCommand() *cobra.Command {
Use: "version",
Short: "Version of ocb",
Long: "Prints the version of the ocb binary",
- RunE: func(cmd *cobra.Command, args []string) error {
+ RunE: func(cmd *cobra.Command, _ []string) error {
version, err := binVersion()
if err != nil {
return err
diff --git a/cmd/builder/test/core.builder.yaml b/cmd/builder/test/core.builder.yaml
index 2a1a72b3f45..0f4fe8e9df4 100644
--- a/cmd/builder/test/core.builder.yaml
+++ b/cmd/builder/test/core.builder.yaml
@@ -1,20 +1,20 @@
dist:
module: go.opentelemetry.io/collector/builder/test/core
- otelcol_version: 0.93.0
+ otelcol_version: 0.94.0
extensions:
- import: go.opentelemetry.io/collector/extension/zpagesextension
- gomod: go.opentelemetry.io/collector v0.93.0
+ gomod: go.opentelemetry.io/collector v0.94.0
path: ${WORKSPACE_DIR}
receivers:
- import: go.opentelemetry.io/collector/receiver/otlpreceiver
- gomod: go.opentelemetry.io/collector v0.93.0
+ gomod: go.opentelemetry.io/collector v0.94.0
path: ${WORKSPACE_DIR}
exporters:
- import: go.opentelemetry.io/collector/exporter/debugexporter
- gomod: go.opentelemetry.io/collector v0.93.0
+ gomod: go.opentelemetry.io/collector v0.94.0
path: ${WORKSPACE_DIR}
replaces:
@@ -31,6 +31,12 @@ replaces:
- go.opentelemetry.io/collector/config/configtls => ${WORKSPACE_DIR}/config/configtls
- go.opentelemetry.io/collector/config/internal => ${WORKSPACE_DIR}/config/internal
- go.opentelemetry.io/collector/confmap => ${WORKSPACE_DIR}/confmap
+ - go.opentelemetry.io/collector/confmap/converter/expandconverter => ${WORKSPACE_DIR}/confmap/converter/expandconverter
+ - go.opentelemetry.io/collector/confmap/provider/envprovider => ${WORKSPACE_DIR}/confmap/provider/envprovider
+ - go.opentelemetry.io/collector/confmap/provider/fileprovider => ${WORKSPACE_DIR}/confmap/provider/fileprovider
+ - go.opentelemetry.io/collector/confmap/provider/httpprovider => ${WORKSPACE_DIR}/confmap/provider/httpprovider
+ - go.opentelemetry.io/collector/confmap/provider/httpsprovider => ${WORKSPACE_DIR}/confmap/provider/httpsprovider
+ - go.opentelemetry.io/collector/confmap/provider/yamlprovider => ${WORKSPACE_DIR}/confmap/provider/yamlprovider
- go.opentelemetry.io/collector/consumer => ${WORKSPACE_DIR}/consumer
- go.opentelemetry.io/collector/connector => ${WORKSPACE_DIR}/connector
- go.opentelemetry.io/collector/exporter => ${WORKSPACE_DIR}/exporter
diff --git a/cmd/mdatagen/doc.go b/cmd/mdatagen/doc.go
deleted file mode 100644
index 8f1fc6a7176..00000000000
--- a/cmd/mdatagen/doc.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// Copyright The OpenTelemetry Authors
-// SPDX-License-Identifier: Apache-2.0
-
-// Generate a test metrics builder from a sample metrics set covering all configuration options.
-//go:generate mdatagen metadata-sample.yaml
-
-package main
diff --git a/cmd/mdatagen/embeded_templates_test.go b/cmd/mdatagen/embeded_templates_test.go
index b52850da395..1f4c4684e4e 100644
--- a/cmd/mdatagen/embeded_templates_test.go
+++ b/cmd/mdatagen/embeded_templates_test.go
@@ -34,7 +34,7 @@ func TestEnsureTemplatesLoaded(t *testing.T) {
}
count = 0
)
- assert.NoError(t, fs.WalkDir(templateFS, ".", func(path string, d fs.DirEntry, err error) error {
+ assert.NoError(t, fs.WalkDir(templateFS, ".", func(path string, d fs.DirEntry, _ error) error {
if d != nil && d.IsDir() {
return nil
}
diff --git a/cmd/mdatagen/go.mod b/cmd/mdatagen/go.mod
index b9b75670723..e868995994c 100644
--- a/cmd/mdatagen/go.mod
+++ b/cmd/mdatagen/go.mod
@@ -1,19 +1,22 @@
module go.opentelemetry.io/collector/cmd/mdatagen
-go 1.20
+go 1.21
require (
github.com/google/go-cmp v0.6.0
- github.com/stretchr/testify v1.8.4
- go.opentelemetry.io/collector/component v0.93.0
- go.opentelemetry.io/collector/confmap v0.93.0
- go.opentelemetry.io/collector/pdata v1.0.1
- go.opentelemetry.io/collector/receiver v0.93.0
- go.opentelemetry.io/collector/semconv v0.93.0
- go.opentelemetry.io/otel/metric v1.22.0
- go.opentelemetry.io/otel/trace v1.22.0
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector/component v0.97.0
+ go.opentelemetry.io/collector/confmap v0.97.0
+ go.opentelemetry.io/collector/confmap/provider/fileprovider v0.97.0
+ go.opentelemetry.io/collector/consumer v0.97.0
+ go.opentelemetry.io/collector/pdata v1.4.0
+ go.opentelemetry.io/collector/receiver v0.97.0
+ go.opentelemetry.io/collector/semconv v0.97.0
+ go.opentelemetry.io/otel/metric v1.24.0
+ go.opentelemetry.io/otel/trace v1.24.0
+ go.uber.org/goleak v1.3.0
go.uber.org/multierr v1.11.0
- go.uber.org/zap v1.26.0
+ go.uber.org/zap v1.27.0
golang.org/x/text v0.14.0
)
@@ -23,33 +26,33 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
+ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
+ github.com/google/uuid 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/knadh/koanf/v2 v2.1.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
- github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
- github.com/prometheus/client_golang v1.18.0 // indirect
- github.com/prometheus/client_model v0.5.0 // indirect
- github.com/prometheus/common v0.46.0 // indirect
+ github.com/prometheus/client_golang v1.19.0 // indirect
+ github.com/prometheus/client_model v0.6.0 // indirect
+ github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
- go.opentelemetry.io/collector/config/configtelemetry v0.93.0 // indirect
- go.opentelemetry.io/collector/consumer v0.93.0 // indirect
- go.opentelemetry.io/otel v1.22.0 // indirect
- go.opentelemetry.io/otel/exporters/prometheus v0.45.0 // indirect
- go.opentelemetry.io/otel/sdk v1.22.0 // indirect
- go.opentelemetry.io/otel/sdk/metric v1.22.0 // indirect
- golang.org/x/net v0.20.0 // indirect
- golang.org/x/sys v0.16.0 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
- google.golang.org/grpc v1.61.0 // indirect
- google.golang.org/protobuf v1.32.0 // indirect
+ go.opentelemetry.io/collector/config/configtelemetry v0.97.0 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/exporters/prometheus v0.46.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk/metric v1.24.0 // indirect
+ golang.org/x/net v0.23.0 // indirect
+ golang.org/x/sys v0.18.0 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
+ google.golang.org/grpc v1.62.1 // indirect
+ google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
@@ -57,6 +60,8 @@ replace go.opentelemetry.io/collector/component => ../../component
replace go.opentelemetry.io/collector/confmap => ../../confmap
+replace go.opentelemetry.io/collector/confmap/provider/fileprovider => ../../confmap/provider/fileprovider
+
replace go.opentelemetry.io/collector/pdata => ../../pdata
replace go.opentelemetry.io/collector/receiver => ../../receiver
diff --git a/cmd/mdatagen/go.sum b/cmd/mdatagen/go.sum
index 4a5b60df47b..267b9a3ccd8 100644
--- a/cmd/mdatagen/go.sum
+++ b/cmd/mdatagen/go.sum
@@ -10,6 +10,8 @@ github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
@@ -19,6 +21,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/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
+github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
+github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/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=
@@ -27,14 +31,14 @@ github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NI
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/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -44,38 +48,40 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=
-github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA=
-github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
-github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
-github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y=
-github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ=
+github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU=
+github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k=
+github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=
+github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8=
+github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=
+github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
+github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
-github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y=
-go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0 h1:BeIK2KGho0oCWa7LxEGSqfDZbs7Fpv/Viz+FS4P8CXE=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0/go.mod h1:UVJZPLnfDSvHj+eJuZE+E1GjIBD267mEMfAAHJdghWg=
-go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg=
-go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY=
-go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw=
-go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc=
-go.opentelemetry.io/otel/sdk/metric v1.22.0 h1:ARrRetm1HCVxq0cbnaZQlfwODYJHo3gFL8Z3tSmHBcI=
-go.opentelemetry.io/otel/sdk/metric v1.22.0/go.mod h1:KjQGeMIDlBNEOo6HvjhxIec1p/69/kULDcp4gr0oLQQ=
-go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0=
-go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0 h1:I8WIFXR351FoLJYuloU4EgXbtNX2URfU/85pUPheIEQ=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0/go.mod h1:ztwVUHe5DTR/1v7PeuGRnU5Bbd4QKYwApWmuutKsJSs=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/sdk/metric v1.24.0 h1:yyMQrPzF+k88/DbH7o4FMAs80puqd+9osbiBrJrz/w8=
+go.opentelemetry.io/otel/sdk/metric v1.24.0/go.mod h1:I6Y5FjH6rvEnTTAYQz3Mmv2kl6Ek5IIrmwTLqMrrOE0=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
+go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
-go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
-go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -85,16 +91,16 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
-golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
+golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
+golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
-golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
+golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
@@ -107,15 +113,16 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA=
-google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
-google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s=
+google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=
+google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
-google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/cmd/mdatagen/internal/samplereceiver/README.md b/cmd/mdatagen/internal/samplereceiver/README.md
new file mode 100644
index 00000000000..8444ce2e8ec
--- /dev/null
+++ b/cmd/mdatagen/internal/samplereceiver/README.md
@@ -0,0 +1,22 @@
+# Sample Receiver
+This receiver is used for testing purposes to check the output of mdatagen.
+
+| Status | |
+| ------------- |-----------|
+| Stability | [development]: logs |
+| | [beta]: traces |
+| | [stable]: metrics |
+| Unsupported Platforms | freebsd, illumos |
+| Distributions | [] |
+| Warnings | [Any additional information that should be brought to the consumer's attention](#warnings) |
+| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fsample%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fsample) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fsample%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fsample) |
+| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@dmitryax](https://www.github.com/dmitryax) |
+
+[development]: https://github.com/open-telemetry/opentelemetry-collector#development
+[beta]: https://github.com/open-telemetry/opentelemetry-collector#beta
+[stable]: https://github.com/open-telemetry/opentelemetry-collector#stable
+
+
+## Warnings
+
+This is where warnings are described.
diff --git a/cmd/mdatagen/internal/samplereceiver/doc.go b/cmd/mdatagen/internal/samplereceiver/doc.go
new file mode 100644
index 00000000000..7b7505667ae
--- /dev/null
+++ b/cmd/mdatagen/internal/samplereceiver/doc.go
@@ -0,0 +1,10 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+// Generate a test metrics builder from a sample metrics set covering all configuration options.
+//go:generate mdatagen metadata.yaml
+
+// Deprecated: This package is moving to https://github.com/open-telemetry/opentelemetry-collector and will eventually be removed.
+// Please see https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/30497
+// This is a sample receiver package used to showcase how mdatagen is applied.
+package samplereceiver // import "go.opentelemetry.io/collector/cmd/mdatagen/internal/samplereceiver"
diff --git a/cmd/mdatagen/documentation.md b/cmd/mdatagen/internal/samplereceiver/documentation.md
similarity index 81%
rename from cmd/mdatagen/documentation.md
rename to cmd/mdatagen/internal/samplereceiver/documentation.md
index 1955e081535..60a79a7941a 100644
--- a/cmd/mdatagen/documentation.md
+++ b/cmd/mdatagen/internal/samplereceiver/documentation.md
@@ -1,6 +1,6 @@
[comment]: <> (Code generated by mdatagen. DO NOT EDIT.)
-# file
+# sample
## Default Metrics
@@ -42,6 +42,24 @@ The metric will be will be removed soon.
| ---- | ----------- | ---------- | ----------------------- | --------- |
| s | Sum | Double | Delta | false |
+### metric.input_type
+
+Monotonic cumulative sum int metric with string input_type enabled by default.
+
+| Unit | Metric Type | Value Type | Aggregation Temporality | Monotonic |
+| ---- | ----------- | ---------- | ----------------------- | --------- |
+| s | Sum | Int | Cumulative | true |
+
+#### Attributes
+
+| Name | Description | Values |
+| ---- | ----------- | ------ |
+| string_attr | Attribute with any string value. | Any Str |
+| state | Integer attribute with overridden name. | Any Int |
+| enum_attr | Attribute with a known set of string values. | Str: ``red``, ``green``, ``blue`` |
+| slice_attr | Attribute with a slice value. | Any Slice |
+| map_attr | Attribute with a map value. | Any Map |
+
## Optional Metrics
The following metrics are not emitted by default. Each of them can be enabled by applying the following configuration:
diff --git a/cmd/mdatagen/internal/samplereceiver/factory.go b/cmd/mdatagen/internal/samplereceiver/factory.go
new file mode 100644
index 00000000000..89769521f74
--- /dev/null
+++ b/cmd/mdatagen/internal/samplereceiver/factory.go
@@ -0,0 +1,42 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package samplereceiver // import "go.opentelemetry.io/collector/cmd/mdatagen/internal/samplereceiver"
+
+import (
+ "context"
+
+ "go.opentelemetry.io/collector/cmd/mdatagen/internal/samplereceiver/internal/metadata"
+ "go.opentelemetry.io/collector/component"
+ "go.opentelemetry.io/collector/consumer"
+ "go.opentelemetry.io/collector/receiver"
+)
+
+// NewFactory returns a receiver.Factory for sample receiver.
+func NewFactory() receiver.Factory {
+ return receiver.NewFactory(
+ metadata.Type,
+ func() component.Config { return &struct{}{} },
+ receiver.WithTraces(createTraces, metadata.TracesStability),
+ receiver.WithMetrics(createMetrics, metadata.MetricsStability),
+ receiver.WithLogs(createLogs, metadata.LogsStability))
+}
+
+func createTraces(context.Context, receiver.CreateSettings, component.Config, consumer.Traces) (receiver.Traces, error) {
+ return nopInstance, nil
+}
+
+func createMetrics(context.Context, receiver.CreateSettings, component.Config, consumer.Metrics) (receiver.Metrics, error) {
+ return nopInstance, nil
+}
+
+func createLogs(context.Context, receiver.CreateSettings, component.Config, consumer.Logs) (receiver.Logs, error) {
+ return nopInstance, nil
+}
+
+var nopInstance = &nopReceiver{}
+
+type nopReceiver struct {
+ component.StartFunc
+ component.ShutdownFunc
+}
diff --git a/cmd/mdatagen/internal/samplereceiver/generated_component_test.go b/cmd/mdatagen/internal/samplereceiver/generated_component_test.go
new file mode 100644
index 00000000000..18db92800e6
--- /dev/null
+++ b/cmd/mdatagen/internal/samplereceiver/generated_component_test.go
@@ -0,0 +1,77 @@
+// Code generated by mdatagen. DO NOT EDIT.
+//go:build !freebsd && !illumos
+
+package samplereceiver
+
+import (
+ "context"
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ "go.opentelemetry.io/collector/component"
+ "go.opentelemetry.io/collector/component/componenttest"
+ "go.opentelemetry.io/collector/confmap/confmaptest"
+ "go.opentelemetry.io/collector/consumer/consumertest"
+ "go.opentelemetry.io/collector/receiver"
+ "go.opentelemetry.io/collector/receiver/receivertest"
+)
+
+func TestComponentLifecycle(t *testing.T) {
+ factory := NewFactory()
+
+ tests := []struct {
+ name string
+ createFn func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error)
+ }{
+
+ {
+ name: "logs",
+ createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) {
+ return factory.CreateLogsReceiver(ctx, set, cfg, consumertest.NewNop())
+ },
+ },
+
+ {
+ name: "metrics",
+ createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) {
+ return factory.CreateMetricsReceiver(ctx, set, cfg, consumertest.NewNop())
+ },
+ },
+
+ {
+ name: "traces",
+ createFn: func(ctx context.Context, set receiver.CreateSettings, cfg component.Config) (component.Component, error) {
+ return factory.CreateTracesReceiver(ctx, set, cfg, consumertest.NewNop())
+ },
+ },
+ }
+
+ cm, err := confmaptest.LoadConf("metadata.yaml")
+ require.NoError(t, err)
+ cfg := factory.CreateDefaultConfig()
+ sub, err := cm.Sub("tests::config")
+ require.NoError(t, err)
+ require.NoError(t, component.UnmarshalConfig(sub, cfg))
+
+ for _, test := range tests {
+ t.Run(test.name+"-shutdown", func(t *testing.T) {
+ c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg)
+ require.NoError(t, err)
+ err = c.Shutdown(context.Background())
+ require.NoError(t, err)
+ })
+ t.Run(test.name+"-lifecycle", func(t *testing.T) {
+ firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg)
+ require.NoError(t, err)
+ host := componenttest.NewNopHost()
+ require.NoError(t, err)
+ require.NoError(t, firstRcvr.Start(context.Background(), host))
+ require.NoError(t, firstRcvr.Shutdown(context.Background()))
+ secondRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg)
+ require.NoError(t, err)
+ require.NoError(t, secondRcvr.Start(context.Background(), host))
+ require.NoError(t, secondRcvr.Shutdown(context.Background()))
+ })
+ }
+}
diff --git a/cmd/mdatagen/internal/metadata/generated_config.go b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_config.go
similarity index 89%
rename from cmd/mdatagen/internal/metadata/generated_config.go
rename to cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_config.go
index ac4e46cd178..512c4c9b083 100644
--- a/cmd/mdatagen/internal/metadata/generated_config.go
+++ b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_config.go
@@ -15,7 +15,7 @@ func (ms *MetricConfig) Unmarshal(parser *confmap.Conf) error {
if parser == nil {
return nil
}
- err := parser.Unmarshal(ms, confmap.WithErrorUnused())
+ err := parser.Unmarshal(ms)
if err != nil {
return err
}
@@ -23,10 +23,11 @@ func (ms *MetricConfig) Unmarshal(parser *confmap.Conf) error {
return nil
}
-// MetricsConfig provides config for file metrics.
+// MetricsConfig provides config for sample metrics.
type MetricsConfig struct {
DefaultMetric MetricConfig `mapstructure:"default.metric"`
DefaultMetricToBeRemoved MetricConfig `mapstructure:"default.metric.to_be_removed"`
+ MetricInputType MetricConfig `mapstructure:"metric.input_type"`
OptionalMetric MetricConfig `mapstructure:"optional.metric"`
OptionalMetricEmptyUnit MetricConfig `mapstructure:"optional.metric.empty_unit"`
}
@@ -39,6 +40,9 @@ func DefaultMetricsConfig() MetricsConfig {
DefaultMetricToBeRemoved: MetricConfig{
Enabled: true,
},
+ MetricInputType: MetricConfig{
+ Enabled: true,
+ },
OptionalMetric: MetricConfig{
Enabled: false,
},
@@ -59,7 +63,7 @@ func (rac *ResourceAttributeConfig) Unmarshal(parser *confmap.Conf) error {
if parser == nil {
return nil
}
- err := parser.Unmarshal(rac, confmap.WithErrorUnused())
+ err := parser.Unmarshal(rac)
if err != nil {
return err
}
@@ -67,7 +71,7 @@ func (rac *ResourceAttributeConfig) Unmarshal(parser *confmap.Conf) error {
return nil
}
-// ResourceAttributesConfig provides config for file resource attributes.
+// ResourceAttributesConfig provides config for sample resource attributes.
type ResourceAttributesConfig struct {
MapResourceAttr ResourceAttributeConfig `mapstructure:"map.resource.attr"`
OptionalResourceAttr ResourceAttributeConfig `mapstructure:"optional.resource.attr"`
@@ -108,7 +112,7 @@ func DefaultResourceAttributesConfig() ResourceAttributesConfig {
}
}
-// MetricsBuilderConfig is a configuration for file metrics builder.
+// MetricsBuilderConfig is a configuration for sample metrics builder.
type MetricsBuilderConfig struct {
Metrics MetricsConfig `mapstructure:"metrics"`
ResourceAttributes ResourceAttributesConfig `mapstructure:"resource_attributes"`
diff --git a/cmd/mdatagen/internal/metadata/generated_config_test.go b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_config_test.go
similarity index 97%
rename from cmd/mdatagen/internal/metadata/generated_config_test.go
rename to cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_config_test.go
index bfb90940386..0f581b137f7 100644
--- a/cmd/mdatagen/internal/metadata/generated_config_test.go
+++ b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_config_test.go
@@ -29,6 +29,7 @@ func TestMetricsBuilderConfig(t *testing.T) {
Metrics: MetricsConfig{
DefaultMetric: MetricConfig{Enabled: true},
DefaultMetricToBeRemoved: MetricConfig{Enabled: true},
+ MetricInputType: MetricConfig{Enabled: true},
OptionalMetric: MetricConfig{Enabled: true},
OptionalMetricEmptyUnit: MetricConfig{Enabled: true},
},
@@ -50,6 +51,7 @@ func TestMetricsBuilderConfig(t *testing.T) {
Metrics: MetricsConfig{
DefaultMetric: MetricConfig{Enabled: false},
DefaultMetricToBeRemoved: MetricConfig{Enabled: false},
+ MetricInputType: MetricConfig{Enabled: false},
OptionalMetric: MetricConfig{Enabled: false},
OptionalMetricEmptyUnit: MetricConfig{Enabled: false},
},
diff --git a/cmd/mdatagen/internal/metadata/generated_metrics.go b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics.go
similarity index 84%
rename from cmd/mdatagen/internal/metadata/generated_metrics.go
rename to cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics.go
index a52195c69df..e038e8443ad 100644
--- a/cmd/mdatagen/internal/metadata/generated_metrics.go
+++ b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics.go
@@ -3,6 +3,8 @@
package metadata
import (
+ "fmt"
+ "strconv"
"time"
"go.opentelemetry.io/collector/component"
@@ -150,6 +152,63 @@ func newMetricDefaultMetricToBeRemoved(cfg MetricConfig) metricDefaultMetricToBe
return m
}
+type metricMetricInputType struct {
+ data pmetric.Metric // data buffer for generated metric.
+ config MetricConfig // metric config provided by user.
+ capacity int // max observed number of data points added to the metric.
+}
+
+// init fills metric.input_type metric with initial data.
+func (m *metricMetricInputType) init() {
+ m.data.SetName("metric.input_type")
+ m.data.SetDescription("Monotonic cumulative sum int metric with string input_type enabled by default.")
+ m.data.SetUnit("s")
+ m.data.SetEmptySum()
+ m.data.Sum().SetIsMonotonic(true)
+ m.data.Sum().SetAggregationTemporality(pmetric.AggregationTemporalityCumulative)
+ m.data.Sum().DataPoints().EnsureCapacity(m.capacity)
+}
+
+func (m *metricMetricInputType) recordDataPoint(start pcommon.Timestamp, ts pcommon.Timestamp, val int64, stringAttrAttributeValue string, overriddenIntAttrAttributeValue int64, enumAttrAttributeValue string, sliceAttrAttributeValue []any, mapAttrAttributeValue map[string]any) {
+ if !m.config.Enabled {
+ return
+ }
+ dp := m.data.Sum().DataPoints().AppendEmpty()
+ dp.SetStartTimestamp(start)
+ dp.SetTimestamp(ts)
+ dp.SetIntValue(val)
+ dp.Attributes().PutStr("string_attr", stringAttrAttributeValue)
+ dp.Attributes().PutInt("state", overriddenIntAttrAttributeValue)
+ dp.Attributes().PutStr("enum_attr", enumAttrAttributeValue)
+ dp.Attributes().PutEmptySlice("slice_attr").FromRaw(sliceAttrAttributeValue)
+ dp.Attributes().PutEmptyMap("map_attr").FromRaw(mapAttrAttributeValue)
+}
+
+// updateCapacity saves max length of data point slices that will be used for the slice capacity.
+func (m *metricMetricInputType) updateCapacity() {
+ if m.data.Sum().DataPoints().Len() > m.capacity {
+ m.capacity = m.data.Sum().DataPoints().Len()
+ }
+}
+
+// emit appends recorded metric data to a metrics slice and prepares it for recording another set of data points.
+func (m *metricMetricInputType) emit(metrics pmetric.MetricSlice) {
+ if m.config.Enabled && m.data.Sum().DataPoints().Len() > 0 {
+ m.updateCapacity()
+ m.data.MoveTo(metrics.AppendEmpty())
+ m.init()
+ }
+}
+
+func newMetricMetricInputType(cfg MetricConfig) metricMetricInputType {
+ m := metricMetricInputType{config: cfg}
+ if cfg.Enabled {
+ m.data = pmetric.NewMetric()
+ m.init()
+ }
+ return m
+}
+
type metricOptionalMetric struct {
data pmetric.Metric // data buffer for generated metric.
config MetricConfig // metric config provided by user.
@@ -264,6 +323,7 @@ type MetricsBuilder struct {
buildInfo component.BuildInfo // contains version information.
metricDefaultMetric metricDefaultMetric
metricDefaultMetricToBeRemoved metricDefaultMetricToBeRemoved
+ metricMetricInputType metricMetricInputType
metricOptionalMetric metricOptionalMetric
metricOptionalMetricEmptyUnit metricOptionalMetricEmptyUnit
}
@@ -307,6 +367,7 @@ func NewMetricsBuilder(mbc MetricsBuilderConfig, settings receiver.CreateSetting
buildInfo: settings.BuildInfo,
metricDefaultMetric: newMetricDefaultMetric(mbc.Metrics.DefaultMetric),
metricDefaultMetricToBeRemoved: newMetricDefaultMetricToBeRemoved(mbc.Metrics.DefaultMetricToBeRemoved),
+ metricMetricInputType: newMetricMetricInputType(mbc.Metrics.MetricInputType),
metricOptionalMetric: newMetricOptionalMetric(mbc.Metrics.OptionalMetric),
metricOptionalMetricEmptyUnit: newMetricOptionalMetricEmptyUnit(mbc.Metrics.OptionalMetricEmptyUnit),
}
@@ -368,11 +429,12 @@ func (mb *MetricsBuilder) EmitForResource(rmo ...ResourceMetricsOption) {
rm := pmetric.NewResourceMetrics()
rm.SetSchemaUrl(conventions.SchemaURL)
ils := rm.ScopeMetrics().AppendEmpty()
- ils.Scope().SetName("otelcol")
+ ils.Scope().SetName("go.opentelemetry.io/collector/internal/receiver/samplereceiver")
ils.Scope().SetVersion(mb.buildInfo.Version)
ils.Metrics().EnsureCapacity(mb.metricsCapacity)
mb.metricDefaultMetric.emit(ils.Metrics())
mb.metricDefaultMetricToBeRemoved.emit(ils.Metrics())
+ mb.metricMetricInputType.emit(ils.Metrics())
mb.metricOptionalMetric.emit(ils.Metrics())
mb.metricOptionalMetricEmptyUnit.emit(ils.Metrics())
@@ -405,6 +467,16 @@ func (mb *MetricsBuilder) RecordDefaultMetricToBeRemovedDataPoint(ts pcommon.Tim
mb.metricDefaultMetricToBeRemoved.recordDataPoint(mb.startTime, ts, val)
}
+// RecordMetricInputTypeDataPoint adds a data point to metric.input_type metric.
+func (mb *MetricsBuilder) RecordMetricInputTypeDataPoint(ts pcommon.Timestamp, inputVal string, stringAttrAttributeValue string, overriddenIntAttrAttributeValue int64, enumAttrAttributeValue AttributeEnumAttr, sliceAttrAttributeValue []any, mapAttrAttributeValue map[string]any) error {
+ val, err := strconv.ParseInt(inputVal, 10, 64)
+ if err != nil {
+ return fmt.Errorf("failed to parse int64 for MetricInputType, value was %s: %w", inputVal, err)
+ }
+ mb.metricMetricInputType.recordDataPoint(mb.startTime, ts, val, stringAttrAttributeValue, overriddenIntAttrAttributeValue, enumAttrAttributeValue.String(), sliceAttrAttributeValue, mapAttrAttributeValue)
+ return nil
+}
+
// RecordOptionalMetricDataPoint adds a data point to optional.metric metric.
func (mb *MetricsBuilder) RecordOptionalMetricDataPoint(ts pcommon.Timestamp, val float64, stringAttrAttributeValue string, booleanAttrAttributeValue bool) {
mb.metricOptionalMetric.recordDataPoint(mb.startTime, ts, val, stringAttrAttributeValue, booleanAttrAttributeValue)
diff --git a/cmd/mdatagen/internal/metadata/generated_metrics_test.go b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics_test.go
similarity index 83%
rename from cmd/mdatagen/internal/metadata/generated_metrics_test.go
rename to cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics_test.go
index 4860ac1ba2b..ac80e2f6608 100644
--- a/cmd/mdatagen/internal/metadata/generated_metrics_test.go
+++ b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_metrics_test.go
@@ -92,6 +92,10 @@ func TestMetricsBuilder(t *testing.T) {
allMetricsCount++
mb.RecordDefaultMetricToBeRemovedDataPoint(ts, 1)
+ defaultMetricsCount++
+ allMetricsCount++
+ mb.RecordMetricInputTypeDataPoint(ts, "1", "string_attr-val", 19, AttributeEnumAttrRed, []any{"slice_attr-item1", "slice_attr-item2"}, map[string]any{"key1": "map_attr-val1", "key2": "map_attr-val2"})
+
allMetricsCount++
mb.RecordOptionalMetricDataPoint(ts, 1, "string_attr-val", true)
@@ -172,6 +176,35 @@ func TestMetricsBuilder(t *testing.T) {
assert.Equal(t, ts, dp.Timestamp())
assert.Equal(t, pmetric.NumberDataPointValueTypeDouble, dp.ValueType())
assert.Equal(t, float64(1), dp.DoubleValue())
+ case "metric.input_type":
+ assert.False(t, validatedMetrics["metric.input_type"], "Found a duplicate in the metrics slice: metric.input_type")
+ validatedMetrics["metric.input_type"] = true
+ assert.Equal(t, pmetric.MetricTypeSum, ms.At(i).Type())
+ assert.Equal(t, 1, ms.At(i).Sum().DataPoints().Len())
+ assert.Equal(t, "Monotonic cumulative sum int metric with string input_type enabled by default.", ms.At(i).Description())
+ assert.Equal(t, "s", ms.At(i).Unit())
+ assert.Equal(t, true, ms.At(i).Sum().IsMonotonic())
+ assert.Equal(t, pmetric.AggregationTemporalityCumulative, ms.At(i).Sum().AggregationTemporality())
+ dp := ms.At(i).Sum().DataPoints().At(0)
+ assert.Equal(t, start, dp.StartTimestamp())
+ assert.Equal(t, ts, dp.Timestamp())
+ assert.Equal(t, pmetric.NumberDataPointValueTypeInt, dp.ValueType())
+ assert.Equal(t, int64(1), dp.IntValue())
+ attrVal, ok := dp.Attributes().Get("string_attr")
+ assert.True(t, ok)
+ assert.EqualValues(t, "string_attr-val", attrVal.Str())
+ attrVal, ok = dp.Attributes().Get("state")
+ assert.True(t, ok)
+ assert.EqualValues(t, 19, attrVal.Int())
+ attrVal, ok = dp.Attributes().Get("enum_attr")
+ assert.True(t, ok)
+ assert.EqualValues(t, "red", attrVal.Str())
+ attrVal, ok = dp.Attributes().Get("slice_attr")
+ assert.True(t, ok)
+ assert.EqualValues(t, []any{"slice_attr-item1", "slice_attr-item2"}, attrVal.Slice().AsRaw())
+ attrVal, ok = dp.Attributes().Get("map_attr")
+ assert.True(t, ok)
+ assert.EqualValues(t, map[string]any{"key1": "map_attr-val1", "key2": "map_attr-val2"}, attrVal.Map().AsRaw())
case "optional.metric":
assert.False(t, validatedMetrics["optional.metric"], "Found a duplicate in the metrics slice: optional.metric")
validatedMetrics["optional.metric"] = true
diff --git a/cmd/mdatagen/internal/metadata/generated_resource.go b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_resource.go
similarity index 100%
rename from cmd/mdatagen/internal/metadata/generated_resource.go
rename to cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_resource.go
diff --git a/cmd/mdatagen/internal/metadata/generated_resource_test.go b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_resource_test.go
similarity index 100%
rename from cmd/mdatagen/internal/metadata/generated_resource_test.go
rename to cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_resource_test.go
diff --git a/cmd/mdatagen/internal/metadata/generated_status.go b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_status.go
similarity index 66%
rename from cmd/mdatagen/internal/metadata/generated_status.go
rename to cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_status.go
index 773067ac829..1fbdb15a241 100644
--- a/cmd/mdatagen/internal/metadata/generated_status.go
+++ b/cmd/mdatagen/internal/samplereceiver/internal/metadata/generated_status.go
@@ -10,19 +10,19 @@ import (
)
var (
- Type = component.MustNewType("file")
+ Type = component.MustNewType("sample")
)
const (
- TracesStability = component.StabilityLevelBeta
LogsStability = component.StabilityLevelDevelopment
+ TracesStability = component.StabilityLevelBeta
MetricsStability = component.StabilityLevelStable
)
func Meter(settings component.TelemetrySettings) metric.Meter {
- return settings.MeterProvider.Meter("otelcol")
+ return settings.MeterProvider.Meter("go.opentelemetry.io/collector/internal/receiver/samplereceiver")
}
func Tracer(settings component.TelemetrySettings) trace.Tracer {
- return settings.TracerProvider.Tracer("otelcol")
+ return settings.TracerProvider.Tracer("go.opentelemetry.io/collector/internal/receiver/samplereceiver")
}
diff --git a/cmd/mdatagen/internal/metadata/testdata/config.yaml b/cmd/mdatagen/internal/samplereceiver/internal/metadata/testdata/config.yaml
similarity index 93%
rename from cmd/mdatagen/internal/metadata/testdata/config.yaml
rename to cmd/mdatagen/internal/samplereceiver/internal/metadata/testdata/config.yaml
index 8283dc2dd70..e0cc02f5ff7 100644
--- a/cmd/mdatagen/internal/metadata/testdata/config.yaml
+++ b/cmd/mdatagen/internal/samplereceiver/internal/metadata/testdata/config.yaml
@@ -5,6 +5,8 @@ all_set:
enabled: true
default.metric.to_be_removed:
enabled: true
+ metric.input_type:
+ enabled: true
optional.metric:
enabled: true
optional.metric.empty_unit:
@@ -32,6 +34,8 @@ none_set:
enabled: false
default.metric.to_be_removed:
enabled: false
+ metric.input_type:
+ enabled: false
optional.metric:
enabled: false
optional.metric.empty_unit:
diff --git a/cmd/mdatagen/metadata-sample.yaml b/cmd/mdatagen/internal/samplereceiver/metadata.yaml
similarity index 85%
rename from cmd/mdatagen/metadata-sample.yaml
rename to cmd/mdatagen/internal/samplereceiver/metadata.yaml
index b9a5f8f6c90..06d544b18af 100644
--- a/cmd/mdatagen/metadata-sample.yaml
+++ b/cmd/mdatagen/internal/samplereceiver/metadata.yaml
@@ -1,6 +1,7 @@
-# Sample metric metadata file with all available configurations.
+# Sample metadata file with all available configurations for a receiver.
-type: file
+type: sample
+scope_name: go.opentelemetry.io/collector/internal/receiver/samplereceiver
sem_conv_version: 1.9.0
@@ -10,7 +11,10 @@ status:
development: [logs]
beta: [traces]
stable: [metrics]
- distributions: [contrib]
+ distributions: []
+ unsupported_platforms: [freebsd, illumos]
+ codeowners:
+ active: [dmitryax]
warnings:
- Any additional information that should be brought to the consumer's attention
@@ -134,3 +138,14 @@ metrics:
aggregation_temporality: delta
warnings:
if_enabled: This metric is deprecated and will be removed soon.
+
+ metric.input_type:
+ enabled: true
+ description: Monotonic cumulative sum int metric with string input_type enabled by default.
+ unit: s
+ sum:
+ value_type: int
+ input_type: string
+ monotonic: true
+ aggregation_temporality: cumulative
+ attributes: [ string_attr, overridden_int_attr, enum_attr, slice_attr, map_attr ]
diff --git a/cmd/mdatagen/internal/samplereceiver/metrics_test.go b/cmd/mdatagen/internal/samplereceiver/metrics_test.go
new file mode 100644
index 00000000000..ec5f67cf0db
--- /dev/null
+++ b/cmd/mdatagen/internal/samplereceiver/metrics_test.go
@@ -0,0 +1,20 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package samplereceiver
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ "go.opentelemetry.io/collector/cmd/mdatagen/internal/samplereceiver/internal/metadata"
+ "go.opentelemetry.io/collector/receiver/receivertest"
+)
+
+// TestGeneratedMetrics verifies that the internal/metadata API is generated correctly.
+func TestGeneratedMetrics(t *testing.T) {
+ mb := metadata.NewMetricsBuilder(metadata.DefaultMetricsBuilderConfig(), receivertest.NewNopCreateSettings())
+ m := mb.Emit()
+ require.Equal(t, 0, m.ResourceMetrics().Len())
+}
diff --git a/cmd/mdatagen/lint_test.go b/cmd/mdatagen/lint_test.go
index 5c470f302d7..f05d6615ea3 100644
--- a/cmd/mdatagen/lint_test.go
+++ b/cmd/mdatagen/lint_test.go
@@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/require"
)
-func Test_formatIdentifier(t *testing.T) {
+func TestFormatIdentifier(t *testing.T) {
var tests = []struct {
input string
want string
diff --git a/cmd/mdatagen/loader.go b/cmd/mdatagen/loader.go
index 322d273e33a..4573e2c8c04 100644
--- a/cmd/mdatagen/loader.go
+++ b/cmd/mdatagen/loader.go
@@ -7,11 +7,12 @@ import (
"context"
"errors"
"fmt"
- "os"
+ "os/exec"
"path/filepath"
"strings"
"go.opentelemetry.io/collector/confmap"
+ "go.opentelemetry.io/collector/confmap/confmaptest"
"go.opentelemetry.io/collector/confmap/provider/fileprovider"
"go.opentelemetry.io/collector/pdata/pcommon"
)
@@ -124,11 +125,7 @@ func (m *metric) Unmarshal(parser *confmap.Conf) error {
if !parser.IsSet("enabled") {
return errors.New("missing required field: `enabled`")
}
- err := parser.Unmarshal(m, confmap.WithErrorUnused())
- if err != nil {
- return err
- }
- return nil
+ return parser.Unmarshal(m)
}
func (m metric) Data() MetricData {
if m.Sum != nil {
@@ -202,6 +199,7 @@ func (a attribute) TestValue() string {
type tests struct {
Config any `mapstructure:"config"`
SkipLifecycle bool `mapstructure:"skip_lifecycle"`
+ SkipShutdown bool `mapstructure:"skip_shutdown"`
ExpectConsumerError bool `mapstructure:"expect_consumer_error"`
}
@@ -221,11 +219,11 @@ type metadata struct {
// Metrics that can be emitted by the component.
Metrics map[metricName]metric `mapstructure:"metrics"`
// ScopeName of the metrics emitted by the component.
- ScopeName string `mapstructure:"-"`
+ ScopeName string `mapstructure:"scope_name"`
// ShortFolderName is the shortened folder name of the component, removing class if present
ShortFolderName string `mapstructure:"-"`
- Tests *tests `mapstructure:"tests"`
+ Tests tests `mapstructure:"tests"`
}
func setAttributesFullName(attrs map[attributeName]attribute) {
@@ -242,7 +240,7 @@ type templateContext struct {
}
func loadMetadata(filePath string) (metadata, error) {
- cp, err := fileprovider.New().Retrieve(context.Background(), "file:"+filePath, nil)
+ cp, err := fileprovider.NewWithSettings(confmaptest.NewNopProviderSettings()).Retrieve(context.Background(), "file:"+filePath, nil)
if err != nil {
return metadata{}, err
}
@@ -252,12 +250,18 @@ func loadMetadata(filePath string) (metadata, error) {
return metadata{}, err
}
- md := metadata{ScopeName: scopeName(filePath), ShortFolderName: shortFolderName(filePath)}
- if err := conf.Unmarshal(&md, confmap.WithErrorUnused()); err != nil {
+ md := metadata{ShortFolderName: shortFolderName(filePath)}
+ if err = conf.Unmarshal(&md); err != nil {
return md, err
}
+ if md.ScopeName == "" {
+ md.ScopeName, err = packageName()
+ if err != nil {
+ return md, err
+ }
+ }
- if err := md.Validate(); err != nil {
+ if err = md.Validate(); err != nil {
return md, err
}
@@ -267,18 +271,18 @@ 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 },
+var componentTypes = []string{
+ "connector",
+ "exporter",
+ "extension",
+ "processor",
+ "scraper",
+ "receiver",
}
func shortFolderName(filePath string) string {
parentFolder := filepath.Base(filepath.Dir(filePath))
- for cType := range componentTypes {
+ for _, cType := range componentTypes {
if strings.HasSuffix(parentFolder, cType) {
return strings.TrimSuffix(parentFolder, cType)
}
@@ -286,23 +290,11 @@ func shortFolderName(filePath string) string {
return parentFolder
}
-func scopeName(filePath string) string {
- sn := "otelcol"
- dirs := strings.Split(filepath.Dir(filePath), string(os.PathSeparator))
- for _, dir := range dirs {
- // skip directory names for component types
- if _, ok := componentTypes[dir]; ok {
- continue
- }
- // 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)
- }
- }
+func packageName() (string, error) {
+ cmd := exec.Command("go", "list", "-f", "{{.ImportPath}}")
+ output, err := cmd.Output()
+ if err != nil {
+ return "", err
}
- return sn
+ return strings.TrimSpace(string(output)), nil
}
diff --git a/cmd/mdatagen/loader_test.go b/cmd/mdatagen/loader_test.go
index 3cb037adae1..cf3d59e07ce 100644
--- a/cmd/mdatagen/loader_test.go
+++ b/cmd/mdatagen/loader_test.go
@@ -8,30 +8,35 @@ import (
"github.com/stretchr/testify/require"
+ "go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/pdata/pcommon"
"go.opentelemetry.io/collector/pdata/pmetric"
)
-func Test_loadMetadata(t *testing.T) {
+func TestLoadMetadata(t *testing.T) {
tests := []struct {
name string
want metadata
wantErr string
}{
{
- name: "metadata-sample.yaml",
+ name: "internal/samplereceiver/metadata.yaml",
want: metadata{
- Type: "file",
+ Type: "sample",
SemConvVersion: "1.9.0",
Status: &Status{
Class: "receiver",
- Stability: map[string][]string{
- "development": {"logs"},
- "beta": {"traces"},
- "stable": {"metrics"},
+ Stability: map[component.StabilityLevel][]string{
+ component.StabilityLevelDevelopment: {"logs"},
+ component.StabilityLevelBeta: {"traces"},
+ component.StabilityLevelStable: {"metrics"},
},
- Distributions: []string{"contrib"},
- Warnings: []string{"Any additional information that should be brought to the consumer's attention"},
+ Distributions: []string{},
+ Codeowners: &Codeowners{
+ Active: []string{"dmitryax"},
+ },
+ Warnings: []string{"Any additional information that should be brought to the consumer's attention"},
+ UnsupportedPlatforms: []string{"freebsd", "illumos"},
},
ResourceAttributes: map[attributeName]attribute{
"string.resource.attr": {
@@ -213,9 +218,21 @@ func Test_loadMetadata(t *testing.T) {
Mono: Mono{Monotonic: false},
},
},
+ "metric.input_type": {
+ Enabled: true,
+ Description: "Monotonic cumulative sum int metric with string input_type enabled by default.",
+ Unit: strPtr("s"),
+ Sum: &sum{
+ MetricValueType: MetricValueType{pmetric.NumberDataPointValueTypeInt},
+ MetricInputType: MetricInputType{InputType: "string"},
+ AggregationTemporality: AggregationTemporality{Aggregation: pmetric.AggregationTemporalityCumulative},
+ Mono: Mono{Monotonic: true},
+ },
+ Attributes: []attributeName{"string_attr", "overridden_int_attr", "enum_attr", "slice_attr", "map_attr"},
+ },
},
- ScopeName: "otelcol",
- ShortFolderName: ".",
+ ScopeName: "go.opentelemetry.io/collector/internal/receiver/samplereceiver",
+ ShortFolderName: "sample",
},
},
{
@@ -223,7 +240,7 @@ func Test_loadMetadata(t *testing.T) {
want: metadata{
Type: "subcomponent",
Parent: "parentComponent",
- ScopeName: "otelcol",
+ ScopeName: "go.opentelemetry.io/collector/cmd/mdatagen",
ShortFolderName: "testdata",
},
},
diff --git a/cmd/mdatagen/main.go b/cmd/mdatagen/main.go
index 4d04bd0696f..aae55b79ade 100644
--- a/cmd/mdatagen/main.go
+++ b/cmd/mdatagen/main.go
@@ -43,6 +43,7 @@ func run(ymlPath string) error {
}
ymlDir := filepath.Dir(ymlPath)
+ packageName := filepath.Base(ymlDir)
md, err := loadMetadata(ymlPath)
if err != nil {
@@ -61,6 +62,12 @@ func run(ymlPath string) error {
filepath.Join(codeDir, "generated_status.go"), md, "metadata"); err != nil {
return err
}
+ if !md.Tests.SkipLifecycle || !md.Tests.SkipShutdown {
+ if err = generateFile(filepath.Join(tmplDir, "component_test.go.tmpl"),
+ filepath.Join(ymlDir, "generated_component_test.go"), md, packageName); err != nil {
+ return err
+ }
+ }
}
if _, err = os.Stat(filepath.Join(ymlDir, "README.md")); err == nil {
@@ -73,13 +80,6 @@ func run(ymlPath string) error {
}
}
- if md.Tests != nil {
- if err = generateFile(filepath.Join(tmplDir, "component_test.go.tmpl"),
- filepath.Join(ymlDir, "generated_component_test.go"), md, md.ShortFolderName+md.Status.Class); err != nil {
- return err
- }
- }
-
if len(md.Metrics) == 0 && len(md.ResourceAttributes) == 0 {
return nil
}
@@ -164,7 +164,8 @@ func templatize(tmplFile string, md metadata) *template.Template {
}
return result
},
- "casesTitle": cases.Title(language.English).String,
+ "casesTitle": cases.Title(language.English).String,
+ "toLowerCase": strings.ToLower,
"toCamelCase": func(s string) string {
caser := cases.Title(language.English).String
parts := strings.Split(s, "_")
@@ -193,9 +194,6 @@ func templatize(tmplFile string, md metadata) *template.Template {
"isConnector": func() bool {
return md.Status.Class == "connector"
},
- "skipLifecycle": func() bool {
- return md.Tests.SkipLifecycle
- },
"supportsLogs": func() bool {
for _, signals := range md.Status.Stability {
for _, s := range signals {
diff --git a/cmd/mdatagen/main_test.go b/cmd/mdatagen/main_test.go
index ce56247a78f..312fe7be461 100644
--- a/cmd/mdatagen/main_test.go
+++ b/cmd/mdatagen/main_test.go
@@ -12,11 +12,10 @@ import (
"github.com/stretchr/testify/require"
- md "go.opentelemetry.io/collector/cmd/mdatagen/internal/metadata"
- "go.opentelemetry.io/collector/receiver/receivertest"
+ "go.opentelemetry.io/collector/component"
)
-func Test_runContents(t *testing.T) {
+func TestRunContents(t *testing.T) {
tests := []struct {
yml string
wantMetricsGenerated bool
@@ -133,7 +132,7 @@ foo
}
}
-func Test_run(t *testing.T) {
+func TestRun(t *testing.T) {
type args struct {
ymlPath string
}
@@ -162,14 +161,14 @@ func Test_run(t *testing.T) {
}
}
-func Test_inlineReplace(t *testing.T) {
+func TestInlineReplace(t *testing.T) {
tests := []struct {
name string
markdown string
outputFile string
componentClass string
warnings []string
- stability map[string][]string
+ stability map[component.StabilityLevel][]string
distros []string
codeowners *Codeowners
}{
@@ -199,6 +198,23 @@ Some info about a component
componentClass: "extension",
distros: []string{"contrib"},
},
+ {
+ name: "readme with status with codeowners and seeking new",
+ markdown: `# Some component
+
+
+
+
+Some info about a component
+`,
+ outputFile: "readme_with_status_codeowners_and_seeking_new.md",
+ componentClass: "receiver",
+ distros: []string{"contrib"},
+ codeowners: &Codeowners{
+ Active: []string{"foo"},
+ SeekingNew: true,
+ },
+ },
{
name: "readme with status with codeowners and emeritus",
markdown: `# Some component
@@ -281,8 +297,11 @@ Some warning there.
Some info about a component
`,
outputFile: "readme_with_multiple_signals.md",
- stability: map[string][]string{"beta": {"metrics"}, "alpha": {"logs"}},
- distros: []string{"contrib"},
+ stability: map[component.StabilityLevel][]string{
+ component.StabilityLevelBeta: {"metrics"},
+ component.StabilityLevelAlpha: {"logs"},
+ },
+ distros: []string{"contrib"},
},
{
name: "readme with cmd class",
@@ -293,15 +312,18 @@ Some info about a component
Some info about a component
`,
- outputFile: "readme_with_cmd_class.md",
- stability: map[string][]string{"beta": {"metrics"}, "alpha": {"logs"}},
+ outputFile: "readme_with_cmd_class.md",
+ stability: map[component.StabilityLevel][]string{
+ component.StabilityLevelBeta: {"metrics"},
+ component.StabilityLevelAlpha: {"logs"},
+ },
componentClass: "cmd",
distros: []string{},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
- stability := map[string][]string{"beta": {"metrics"}}
+ stability := map[component.StabilityLevel][]string{component.StabilityLevelBeta: {"metrics"}}
if len(tt.stability) > 0 {
stability = tt.stability
}
@@ -350,7 +372,9 @@ func TestGenerateStatusMetadata(t *testing.T) {
md: metadata{
Type: "foo",
Status: &Status{
- Stability: map[string][]string{"beta": {"metrics"}},
+ Stability: map[component.StabilityLevel][]string{
+ component.StabilityLevelBeta: {"metrics"},
+ },
Distributions: []string{"contrib"},
Class: "receiver",
},
@@ -387,7 +411,9 @@ func Tracer(settings component.TelemetrySettings) trace.Tracer {
md: metadata{
Type: "foo",
Status: &Status{
- Stability: map[string][]string{"alpha": {"metrics"}},
+ Stability: map[component.StabilityLevel][]string{
+ component.StabilityLevelAlpha: {"metrics"},
+ },
Distributions: []string{"contrib"},
Class: "receiver",
},
@@ -433,10 +459,3 @@ func Tracer(settings component.TelemetrySettings) trace.Tracer {
})
}
}
-
-// TestGenerated verifies that the internal/metadata API is generated correctly.
-func TestGenerated(t *testing.T) {
- mb := md.NewMetricsBuilder(md.DefaultMetricsBuilderConfig(), receivertest.NewNopCreateSettings())
- m := mb.Emit()
- require.Equal(t, 0, m.ResourceMetrics().Len())
-}
diff --git a/cmd/mdatagen/metadata-schema.yaml b/cmd/mdatagen/metadata-schema.yaml
index 879307fdd3d..bb6ae4f412a 100644
--- a/cmd/mdatagen/metadata-schema.yaml
+++ b/cmd/mdatagen/metadata-schema.yaml
@@ -4,6 +4,9 @@ type:
# Required for subcomponents: The type of the parent component.
parent: string
+# Optional: Scope name for the telemetry generated by the component. If not set, name of the go package will be used.
+scope_name: string
+
# Required for components (Optional for subcomponents): A high-level view of the development status and use of this component
status:
# Required: The class of the component (For example receiver)
@@ -109,5 +112,9 @@ metrics:
# Lifecycle tests generated for this component.
tests:
config: # {} by default, specific testing configuration for lifecycle tests.
+ # Skip lifecycle tests for this component. Not recommended for components that are not in development.
skip_lifecycle: false # false by default
+ # Skip shutdown tests for this component. Not recommended for components that are not in development.
+ skip_shutdown: false # false by default
+ # Whether it's expected that the Consume[Logs|Metrics|Traces] method will return an error with the given configuration.
expect_consumer_error: true # false by default
diff --git a/cmd/mdatagen/metricdata.go b/cmd/mdatagen/metricdata.go
index c3448f1722c..5bf77985cc9 100644
--- a/cmd/mdatagen/metricdata.go
+++ b/cmd/mdatagen/metricdata.go
@@ -125,7 +125,7 @@ func (d *gauge) Unmarshal(parser *confmap.Conf) error {
if err := d.MetricValueType.Unmarshal(parser); err != nil {
return err
}
- return parser.Unmarshal(d, confmap.WithErrorUnused())
+ return parser.Unmarshal(d, confmap.WithIgnoreUnused())
}
func (d gauge) Type() string {
@@ -155,7 +155,7 @@ func (d *sum) Unmarshal(parser *confmap.Conf) error {
if err := d.MetricValueType.Unmarshal(parser); err != nil {
return err
}
- return parser.Unmarshal(d, confmap.WithErrorUnused())
+ return parser.Unmarshal(d, confmap.WithIgnoreUnused())
}
// TODO: Currently, this func will not be called because of https://github.com/open-telemetry/opentelemetry-collector/issues/6671. Uncomment function and
@@ -166,7 +166,7 @@ func (d *sum) Unmarshal(parser *confmap.Conf) error {
// if !parser.IsSet("monotonic") {
// return errors.New("missing required field: `monotonic`")
// }
-// return parser.Unmarshal(m, confmap.WithErrorUnused())
+// return parser.Unmarshal(m)
// }
func (d sum) Type() string {
diff --git a/exporter/exporterhelper/internal/package_test.go b/cmd/mdatagen/package_test.go
similarity index 91%
rename from exporter/exporterhelper/internal/package_test.go
rename to cmd/mdatagen/package_test.go
index 4486cdb28aa..5cd502ca564 100644
--- a/exporter/exporterhelper/internal/package_test.go
+++ b/cmd/mdatagen/package_test.go
@@ -1,7 +1,7 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
-package internal
+package main
import (
"testing"
diff --git a/cmd/mdatagen/statusdata.go b/cmd/mdatagen/statusdata.go
index ebe60dc4b78..c157b82a73c 100644
--- a/cmd/mdatagen/statusdata.go
+++ b/cmd/mdatagen/statusdata.go
@@ -4,23 +4,21 @@
package main
import (
+ "errors"
"sort"
+ "strings"
+
+ "go.opentelemetry.io/collector/component"
+ "go.opentelemetry.io/collector/confmap"
)
// distros is a collection of distributions that can be referenced in the metadata.yaml files.
// The rules below apply to every distribution added to this list:
-// - The distribution must be open source.
+// - The distribution is open source and maintained by the OpenTelemetry project.
// - The link must point to a publicly accessible repository.
var distros = map[string]string{
- "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",
- "grafana": "https://github.com/grafana/agent",
- "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",
- "sumo": "https://github.com/SumoLogic/sumologic-otel-collector",
- "liatrio": "https://github.com/liatrio/liatrio-otel-collector",
+ "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",
}
type Codeowners struct {
@@ -28,15 +26,19 @@ type Codeowners struct {
Active []string `mapstructure:"active"`
// Emeritus codeowners
Emeritus []string `mapstructure:"emeritus"`
+ // Whether new codeowners are being sought
+ SeekingNew bool `mapstructure:"seeking_new"`
}
+type StabilityMap map[component.StabilityLevel][]string
+
type Status struct {
- Stability map[string][]string `mapstructure:"stability"`
- Distributions []string `mapstructure:"distributions"`
- Class string `mapstructure:"class"`
- Warnings []string `mapstructure:"warnings"`
- Codeowners *Codeowners `mapstructure:"codeowners"`
- UnsupportedPlatforms []string `mapstructure:"unsupported_platforms"`
+ Stability StabilityMap `mapstructure:"stability"`
+ Distributions []string `mapstructure:"distributions"`
+ Class string `mapstructure:"class"`
+ Warnings []string `mapstructure:"warnings"`
+ Codeowners *Codeowners `mapstructure:"codeowners"`
+ UnsupportedPlatforms []string `mapstructure:"unsupported_platforms"`
}
func (s *Status) SortedDistributions() []string {
@@ -58,3 +60,31 @@ func (s *Status) SortedDistributions() []string {
})
return sorted
}
+
+func (ms *StabilityMap) Unmarshal(parser *confmap.Conf) error {
+ *ms = make(StabilityMap)
+ raw := make(map[string][]string)
+ err := parser.Unmarshal(&raw)
+ if err != nil {
+ return err
+ }
+ for k, v := range raw {
+ switch strings.ToLower(k) {
+ case strings.ToLower(component.StabilityLevelUnmaintained.String()):
+ (*ms)[component.StabilityLevelUnmaintained] = v
+ case strings.ToLower(component.StabilityLevelDeprecated.String()):
+ (*ms)[component.StabilityLevelDeprecated] = v
+ case strings.ToLower(component.StabilityLevelDevelopment.String()):
+ (*ms)[component.StabilityLevelDevelopment] = v
+ case strings.ToLower(component.StabilityLevelAlpha.String()):
+ (*ms)[component.StabilityLevelAlpha] = v
+ case strings.ToLower(component.StabilityLevelBeta.String()):
+ (*ms)[component.StabilityLevelBeta] = v
+ case strings.ToLower(component.StabilityLevelStable.String()):
+ (*ms)[component.StabilityLevelStable] = v
+ default:
+ return errors.New("invalid stability level: " + k)
+ }
+ }
+ return nil
+}
diff --git a/cmd/mdatagen/templates/component_test.go.tmpl b/cmd/mdatagen/templates/component_test.go.tmpl
index 33daa3190e1..f4bb1bc8702 100644
--- a/cmd/mdatagen/templates/component_test.go.tmpl
+++ b/cmd/mdatagen/templates/component_test.go.tmpl
@@ -1,6 +1,6 @@
// Code generated by mdatagen. DO NOT EDIT.
-{{ if len .Status.UnsupportedPlatforms -}}
+{{- if len .Status.UnsupportedPlatforms }}
//go:build {{ range $i, $v := .Status.UnsupportedPlatforms }}{{ if $i }} && {{ end }}!{{ . }}{{ end }}
{{- end }}
@@ -9,64 +9,47 @@ package {{ .Package }}
import (
"context"
"testing"
+ {{- if or isExporter isProcessor }}
+ "time"
+ {{- end }}
- "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/component"
+ {{- if not .Tests.SkipLifecycle }}
"go.opentelemetry.io/collector/component/componenttest"
-{{ if isExporter }}
+ {{- end }}
+ {{- if isExporter }}
"go.opentelemetry.io/collector/exporter"
"go.opentelemetry.io/collector/exporter/exportertest"
-{{ end }}
-{{ if isProcessor }}
+ {{- end }}
+ {{- if isProcessor }}
"go.opentelemetry.io/collector/consumer/consumertest"
"go.opentelemetry.io/collector/processor"
"go.opentelemetry.io/collector/processor/processortest"
-{{ end }}
-{{ if isReceiver }}
+ {{- end }}
+ {{- if isReceiver }}
"go.opentelemetry.io/collector/consumer/consumertest"
"go.opentelemetry.io/collector/receiver"
"go.opentelemetry.io/collector/receiver/receivertest"
-{{ end }}
-{{ if isExtension }}
+ {{- end }}
+ {{- if isExtension }}
"go.opentelemetry.io/collector/extension/extensiontest"
-{{ end }}
-{{ if isConnector }}
+ {{- end }}
+ {{- if isConnector }}
"go.opentelemetry.io/collector/consumer/consumertest"
"go.opentelemetry.io/collector/connector"
"go.opentelemetry.io/collector/connector/connectortest"
-{{ end }}
+ {{- end }}
"go.opentelemetry.io/collector/confmap/confmaptest"
-{{ if or (isExporter) (isProcessor) }}
- "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/testdata"
-{{ end }}
+ {{- if or isExporter isProcessor }}
+ "go.opentelemetry.io/collector/pdata/pcommon"
+ "go.opentelemetry.io/collector/pdata/plog"
+ "go.opentelemetry.io/collector/pdata/pmetric"
+ "go.opentelemetry.io/collector/pdata/ptrace"
+ {{- end }}
)
-// assertNoErrorHost implements a component.Host that asserts that there were no errors.
-type assertNoErrorHost struct {
- component.Host
- *testing.T
-}
-
-var _ component.Host = (*assertNoErrorHost)(nil)
-
-// 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 TestCheckConfigStruct(t *testing.T) {
- componenttest.CheckConfigStruct(NewFactory().CreateDefaultConfig())
-}
-
-{{ if isExporter }}
+{{ if isExporter -}}
func TestComponentLifecycle(t *testing.T) {
factory := NewFactory()
@@ -108,39 +91,44 @@ func TestComponentLifecycle(t *testing.T) {
require.NoError(t, component.UnmarshalConfig(sub, cfg))
for _, test := range tests {
+ {{- if not .Tests.SkipShutdown }}
t.Run(test.name + "-shutdown", func(t *testing.T) {
c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg)
require.NoError(t, err)
err = c.Shutdown(context.Background())
require.NoError(t, err)
})
+ {{- end }}
+ {{- if not .Tests.SkipLifecycle }}
t.Run(test.name + "-lifecycle", func(t *testing.T) {
- {{ if skipLifecycle }}
- // TODO support lifecycle
- t.SkipNow()
- {{ end }}
c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg)
require.NoError(t, err)
- host := newAssertNoErrorHost(t)
+ host := componenttest.NewNopHost()
err = c.Start(context.Background(), host)
require.NoError(t, err)
- assert.NotPanics(t, func() {
- switch e := c.(type) {
- case exporter.Logs:
- logs := testdata.GenerateLogsManyLogRecordsSameResource(2)
+ require.NotPanics(t, func() {
+ switch test.name {
+ case "logs":
+ e, ok := c.(exporter.Logs)
+ require.True(t, ok)
+ logs := generateLifecycleTestLogs()
if !e.Capabilities().MutatesData {
logs.MarkReadOnly()
}
err = e.ConsumeLogs(context.Background(), logs)
- case exporter.Metrics:
- metrics := testdata.GenerateMetricsTwoMetrics()
+ case "metrics":
+ e, ok := c.(exporter.Metrics)
+ require.True(t, ok)
+ metrics := generateLifecycleTestMetrics()
if !e.Capabilities().MutatesData {
metrics.MarkReadOnly()
}
err = e.ConsumeMetrics(context.Background(), metrics)
- case exporter.Traces:
- traces := testdata.GenerateTracesTwoSpansSameResource()
+ case "traces":
+ e, ok := c.(exporter.Traces)
+ require.True(t, ok)
+ traces := generateLifecycleTestTraces()
if !e.Capabilities().MutatesData {
traces.MarkReadOnly()
}
@@ -148,11 +136,12 @@ func TestComponentLifecycle(t *testing.T) {
}
})
{{ if not expectConsumerError }}
- assert.NoError(t, err)
+ require.NoError(t, err)
{{ end }}
err = c.Shutdown(context.Background())
require.NoError(t, err)
})
+ {{- end }}
}
}
{{ end }}
@@ -199,49 +188,55 @@ func TestComponentLifecycle(t *testing.T) {
require.NoError(t, component.UnmarshalConfig(sub, cfg))
for _, test := range tests {
+ {{- if not .Tests.SkipShutdown }}
t.Run(test.name + "-shutdown", func(t *testing.T) {
c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg)
require.NoError(t, err)
err = c.Shutdown(context.Background())
require.NoError(t, err)
})
+ {{- end }}
+ {{- if not .Tests.SkipLifecycle }}
t.Run(test.name + "-lifecycle", func(t *testing.T) {
- {{ if skipLifecycle }}
- // TODO support lifecycle
- t.SkipNow()
- {{ end }}
c, err := test.createFn(context.Background(), processortest.NewNopCreateSettings(), cfg)
require.NoError(t, err)
- host := newAssertNoErrorHost(t)
+ host := componenttest.NewNopHost()
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)
+ require.NotPanics(t, func() {
+ switch test.name {
+ case "logs":
+ e, ok := c.(processor.Logs)
+ require.True(t, ok)
+ logs := generateLifecycleTestLogs()
if !e.Capabilities().MutatesData {
logs.MarkReadOnly()
}
err = e.ConsumeLogs(context.Background(), logs)
- case processor.Metrics:
- metrics := testdata.GenerateMetricsTwoMetrics()
+ case "metrics":
+ e, ok := c.(processor.Metrics)
+ require.True(t, ok)
+ metrics := generateLifecycleTestMetrics()
if !e.Capabilities().MutatesData {
metrics.MarkReadOnly()
}
err = e.ConsumeMetrics(context.Background(), metrics)
- case processor.Traces:
- traces := testdata.GenerateTracesTwoSpansSameResource()
+ case "traces":
+ e, ok := c.(processor.Traces)
+ require.True(t, ok)
+ traces := generateLifecycleTestTraces()
if !e.Capabilities().MutatesData {
traces.MarkReadOnly()
}
err = e.ConsumeTraces(context.Background(), traces)
}
})
- assert.NoError(t, err)
+ require.NoError(t, err)
err = c.Shutdown(context.Background())
require.NoError(t, err)
})
+ {{- end }}
}
}
{{ end }}
@@ -288,21 +283,20 @@ func TestComponentLifecycle(t *testing.T) {
require.NoError(t, component.UnmarshalConfig(sub, cfg))
for _, test := range tests {
+ {{- if not .Tests.SkipShutdown }}
t.Run(test.name + "-shutdown", func(t *testing.T) {
c, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg)
require.NoError(t, err)
err = c.Shutdown(context.Background())
require.NoError(t, err)
})
+ {{- end }}
+ {{- if not .Tests.SkipLifecycle }}
t.Run(test.name + "-lifecycle", func(t *testing.T) {
- {{ if skipLifecycle }}
- // TODO support lifecycle
- t.SkipNow()
- {{ end }}
firstRcvr, err := test.createFn(context.Background(), receivertest.NewNopCreateSettings(), cfg)
require.NoError(t, err)
- host := newAssertNoErrorHost(t)
+ host := componenttest.NewNopHost()
require.NoError(t, err)
require.NoError(t, firstRcvr.Start(context.Background(), host))
require.NoError(t, firstRcvr.Shutdown(context.Background()))
@@ -311,6 +305,7 @@ func TestComponentLifecycle(t *testing.T) {
require.NoError(t, secondRcvr.Start(context.Background(), host))
require.NoError(t, secondRcvr.Shutdown(context.Background()))
})
+ {{- end }}
}
}
{{ end }}
@@ -326,28 +321,28 @@ func TestComponentLifecycle(t *testing.T) {
require.NoError(t, err)
require.NoError(t, component.UnmarshalConfig(sub, cfg))
+ {{- if not .Tests.SkipShutdown }}
t.Run("shutdown", func(t *testing.T) {
e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg)
require.NoError(t, err)
err = e.Shutdown(context.Background())
require.NoError(t, err)
})
+ {{- end }}
+ {{- if not .Tests.SkipLifecycle }}
t.Run("lifecycle", func(t *testing.T) {
- {{ if skipLifecycle }}
- // TODO support lifecycle
- t.SkipNow()
- {{ end }}
firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg)
require.NoError(t, err)
- require.NoError(t, firstExt.Start(context.Background(), newAssertNoErrorHost(t)))
+ require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost()))
require.NoError(t, firstExt.Shutdown(context.Background()))
secondExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg)
require.NoError(t, err)
- require.NoError(t, secondExt.Start(context.Background(), newAssertNoErrorHost(t)))
+ require.NoError(t, secondExt.Start(context.Background(), componenttest.NewNopHost()))
require.NoError(t, secondExt.Shutdown(context.Background()))
})
+ {{- end }}
}
{{ end }}
@@ -441,21 +436,20 @@ func TestComponentLifecycle(t *testing.T) {
require.NoError(t, component.UnmarshalConfig(sub, cfg))
for _, test := range tests {
+ {{- if not .Tests.SkipShutdown }}
t.Run(test.name + "-shutdown", func(t *testing.T) {
c, err := test.createFn(context.Background(), connectortest.NewNopCreateSettings(), cfg)
require.NoError(t, err)
err = c.Shutdown(context.Background())
require.NoError(t, err)
})
+ {{- end }}
+ {{- if not .Tests.SkipLifecycle }}
t.Run(test.name + "-lifecycle", func(t *testing.T) {
- {{ if skipLifecycle }}
- // TODO support lifecycle
- t.SkipNow()
- {{ end }}
firstConnector, err := test.createFn(context.Background(), connectortest.NewNopCreateSettings(), cfg)
require.NoError(t, err)
- host := newAssertNoErrorHost(t)
+ host := componenttest.NewNopHost()
require.NoError(t, err)
require.NoError(t, firstConnector.Start(context.Background(), host))
require.NoError(t, firstConnector.Shutdown(context.Background()))
@@ -464,6 +458,44 @@ func TestComponentLifecycle(t *testing.T) {
require.NoError(t, secondConnector.Start(context.Background(), host))
require.NoError(t, secondConnector.Shutdown(context.Background()))
})
+ {{- end }}
}
}
-{{ end }}
\ No newline at end of file
+{{ end }}
+
+{{ if or isExporter isProcessor -}}
+func generateLifecycleTestLogs() plog.Logs {
+ logs := plog.NewLogs()
+ rl := logs.ResourceLogs().AppendEmpty()
+ rl.Resource().Attributes().PutStr("resource", "R1")
+ l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty()
+ l.Body().SetStr("test log message")
+ l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now()))
+ return logs
+}
+
+func generateLifecycleTestMetrics() pmetric.Metrics {
+ metrics := pmetric.NewMetrics()
+ rm := metrics.ResourceMetrics().AppendEmpty()
+ rm.Resource().Attributes().PutStr("resource", "R1")
+ m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty()
+ m.SetName("test_metric")
+ dp := m.SetEmptyGauge().DataPoints().AppendEmpty()
+ dp.Attributes().PutStr("test_attr", "value_1")
+ dp.SetIntValue(123)
+ dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now()))
+ return metrics
+}
+
+func generateLifecycleTestTraces() ptrace.Traces {
+ traces := ptrace.NewTraces()
+ rs := traces.ResourceSpans().AppendEmpty()
+ rs.Resource().Attributes().PutStr("resource", "R1")
+ span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty()
+ span.Attributes().PutStr("test_attr", "value_1")
+ span.SetName("test_span")
+ span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second)))
+ span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now()))
+ return traces
+}
+{{- end }}
diff --git a/cmd/mdatagen/templates/config.go.tmpl b/cmd/mdatagen/templates/config.go.tmpl
index 02f69788334..712602222e7 100644
--- a/cmd/mdatagen/templates/config.go.tmpl
+++ b/cmd/mdatagen/templates/config.go.tmpl
@@ -19,7 +19,7 @@ func (ms *MetricConfig) Unmarshal(parser *confmap.Conf) error {
if parser == nil {
return nil
}
- err := parser.Unmarshal(ms, confmap.WithErrorUnused())
+ err := parser.Unmarshal(ms)
if err != nil {
return err
}
@@ -57,7 +57,7 @@ func (rac *ResourceAttributeConfig) Unmarshal(parser *confmap.Conf) error {
if parser == nil {
return nil
}
- err := parser.Unmarshal(rac, confmap.WithErrorUnused())
+ err := parser.Unmarshal(rac)
if err != nil {
return err
}
diff --git a/cmd/mdatagen/templates/readme.md.tmpl b/cmd/mdatagen/templates/readme.md.tmpl
index 364d3ad484d..3ead446b982 100644
--- a/cmd/mdatagen/templates/readme.md.tmpl
+++ b/cmd/mdatagen/templates/readme.md.tmpl
@@ -7,10 +7,13 @@
{{- if ne $class "connector" }}
{{- $idx := 0 }}
{{- range $stability, $value := .Status.Stability }}
-| {{ if not $idx }}Stability{{ else }} {{ end }} | [{{ $stability }}]{{ if ne $class "extension" }}: {{ stringsJoin $value ", " }} {{ end }} |
+| {{ if not $idx }}Stability{{ else }} {{ end }} | [{{ toLowerCase $stability.String }}]{{ if ne $class "extension" }}: {{ stringsJoin $value ", " }} {{ end }} |
{{- $idx = inc $idx }}
{{- end }}
{{- end}}
+{{- if .Status.UnsupportedPlatforms }}
+| Unsupported Platforms | {{ stringsJoin .Status.UnsupportedPlatforms ", " }} |
+{{- end }}
{{- if and (ne $class "cmd") (ne $class "pkg") }}
| Distributions | [{{ stringsJoin .Status.SortedDistributions "], [" }}] |
{{- end }}
@@ -23,13 +26,13 @@
{{- if .Status.Codeowners }}
{{- $codeowners := userLinks .Status.Codeowners.Active }}
{{- $emeritus := userLinks .Status.Codeowners.Emeritus }}
-| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | {{ stringsJoin $codeowners ", " }} |
+| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | {{ stringsJoin $codeowners ", " }} {{ if .Status.Codeowners.SeekingNew }}\| Seeking more code owners! {{ end }}|
{{- if $emeritus }}
| Emeritus | {{ stringsJoin $emeritus ", " }} |
{{- end }}
{{- end }}
{{range $stability, $val := .Status.Stability}}
-[{{ $stability }}]: https://github.com/open-telemetry/opentelemetry-collector#{{ $stability }}
+[{{ toLowerCase $stability.String }}]: https://github.com/open-telemetry/opentelemetry-collector#{{ toLowerCase $stability.String }}
{{- end }}
{{- range .Status.SortedDistributions }}
[{{.}}]: {{ distroURL . }}
@@ -43,7 +46,7 @@
{{- range $stability, $pipelines := .Status.Stability }}
{{- range $pipeline := $pipelines }}
{{- $parts := stringsSplit $pipeline "_to_" }}
-| {{index $parts 0}} | {{index $parts 1}} | [{{$stability}}] |
+| {{index $parts 0}} | {{index $parts 1}} | [{{ toLowerCase $stability.String }}] |
{{- end }}
{{- end }}
diff --git a/cmd/mdatagen/templates/status.go.tmpl b/cmd/mdatagen/templates/status.go.tmpl
index 850058b9cfa..8e8ccc25ad5 100644
--- a/cmd/mdatagen/templates/status.go.tmpl
+++ b/cmd/mdatagen/templates/status.go.tmpl
@@ -3,7 +3,7 @@
package {{ .Package }}
import (
- "go.opentelemetry.io/collector/component"
+ "go.opentelemetry.io/collector/component"
"go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/trace"
)
@@ -15,7 +15,7 @@ var (
const (
{{- range $stability, $signals := .Status.Stability }}
{{- range $signal := $signals }}
- {{ toCamelCase $signal }}Stability = component.StabilityLevel{{ casesTitle $stability }}
+ {{ toCamelCase $signal }}Stability = component.StabilityLevel{{ casesTitle $stability.String }}
{{- end }}
{{- end }}
)
diff --git a/cmd/mdatagen/testdata/metrics_and_type.yaml b/cmd/mdatagen/testdata/metrics_and_type.yaml
index 81d66bde9c1..2306a08b35e 100644
--- a/cmd/mdatagen/testdata/metrics_and_type.yaml
+++ b/cmd/mdatagen/testdata/metrics_and_type.yaml
@@ -17,3 +17,7 @@ metrics:
unit: s
gauge:
value_type: double
+
+tests:
+ skip_lifecycle: true
+ skip_shutdown: true
diff --git a/cmd/mdatagen/testdata/readme_with_status_codeowners_and_seeking_new.md b/cmd/mdatagen/testdata/readme_with_status_codeowners_and_seeking_new.md
new file mode 100644
index 00000000000..f396db459d4
--- /dev/null
+++ b/cmd/mdatagen/testdata/readme_with_status_codeowners_and_seeking_new.md
@@ -0,0 +1,15 @@
+# Some component
+
+
+| Status | |
+| ------------- |-----------|
+| Stability | [beta]: metrics |
+| Distributions | [contrib] |
+| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Ffoo%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Ffoo) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Ffoo%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Ffoo) |
+| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@foo](https://www.github.com/foo) \| Seeking more code owners! |
+
+[beta]: https://github.com/open-telemetry/opentelemetry-collector#beta
+[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib
+
+
+Some info about a component
diff --git a/cmd/mdatagen/testdata/resource_attributes_only.yaml b/cmd/mdatagen/testdata/resource_attributes_only.yaml
index 05e031bcf45..a6fe611fe86 100644
--- a/cmd/mdatagen/testdata/resource_attributes_only.yaml
+++ b/cmd/mdatagen/testdata/resource_attributes_only.yaml
@@ -15,3 +15,7 @@ resource_attributes:
description: Resource attribute 1.
type: string
enabled: true
+
+tests:
+ skip_lifecycle: true
+ skip_shutdown: true
diff --git a/cmd/mdatagen/testdata/status_only.yaml b/cmd/mdatagen/testdata/status_only.yaml
index 2365b43f1d9..d66977249dd 100644
--- a/cmd/mdatagen/testdata/status_only.yaml
+++ b/cmd/mdatagen/testdata/status_only.yaml
@@ -4,3 +4,7 @@ status:
stability:
beta: [traces, metrics, logs]
distributions: [contrib]
+
+tests:
+ skip_lifecycle: true
+ skip_shutdown: true
diff --git a/cmd/mdatagen/testdata/with_tests_connector.yaml b/cmd/mdatagen/testdata/with_tests_connector.yaml
index ad05872698e..2c1f542cca2 100644
--- a/cmd/mdatagen/testdata/with_tests_connector.yaml
+++ b/cmd/mdatagen/testdata/with_tests_connector.yaml
@@ -4,6 +4,3 @@ status:
class: connector
stability:
beta: [traces_to_metrics, traces_to_traces, traces_to_logs, metrics_to_logs, metrics_to_metrics, metrics_to_traces, logs_to_logs, logs_to_metrics, logs_to_traces]
-
-tests:
- config:
diff --git a/cmd/mdatagen/testdata/with_tests_exporter.yaml b/cmd/mdatagen/testdata/with_tests_exporter.yaml
index e110f3d10e3..44c9ccc5f9b 100644
--- a/cmd/mdatagen/testdata/with_tests_exporter.yaml
+++ b/cmd/mdatagen/testdata/with_tests_exporter.yaml
@@ -4,6 +4,3 @@ status:
class: exporter
stability:
beta: [traces, logs, metrics]
-
-tests:
- config:
diff --git a/cmd/mdatagen/testdata/with_tests_extension.yaml b/cmd/mdatagen/testdata/with_tests_extension.yaml
index 08eb4d5cf29..1f201264155 100644
--- a/cmd/mdatagen/testdata/with_tests_extension.yaml
+++ b/cmd/mdatagen/testdata/with_tests_extension.yaml
@@ -4,6 +4,3 @@ status:
class: extension
stability:
beta: [extension]
-
-tests:
- config:
diff --git a/cmd/mdatagen/testdata/with_tests_processor.yaml b/cmd/mdatagen/testdata/with_tests_processor.yaml
index fa6a2238f2c..d0df3f84f0e 100644
--- a/cmd/mdatagen/testdata/with_tests_processor.yaml
+++ b/cmd/mdatagen/testdata/with_tests_processor.yaml
@@ -4,6 +4,3 @@ status:
class: processor
stability:
beta: [traces, logs, metrics]
-
-tests:
- config:
diff --git a/cmd/mdatagen/testdata/with_tests_receiver.yaml b/cmd/mdatagen/testdata/with_tests_receiver.yaml
index e55c6190728..f3e35dc659c 100644
--- a/cmd/mdatagen/testdata/with_tests_receiver.yaml
+++ b/cmd/mdatagen/testdata/with_tests_receiver.yaml
@@ -4,6 +4,3 @@ status:
class: receiver
stability:
beta: [traces, logs, metrics]
-
-tests:
- config:
diff --git a/cmd/mdatagen/validate.go b/cmd/mdatagen/validate.go
index bc56375baf9..5871adca83d 100644
--- a/cmd/mdatagen/validate.go
+++ b/cmd/mdatagen/validate.go
@@ -33,6 +33,7 @@ func (md *metadata) Validate() error {
// typeRegexp is used to validate the type of a component.
// A type must start with an ASCII alphabetic character and
// can only contain ASCII alphanumeric characters and '_'.
+// We allow '/' for subcomponents.
// This must be kept in sync with the regex in component/config.go.
var typeRegexp = regexp.MustCompile(`^[a-zA-Z][0-9a-zA-Z_]*$`)
@@ -41,6 +42,11 @@ func (md *metadata) validateType() error {
return errors.New("missing type")
}
+ if md.Parent != "" {
+ // subcomponents are allowed to have a '/' in their type.
+ return nil
+ }
+
if !typeRegexp.MatchString(md.Type) {
return fmt.Errorf("invalid character(s) in type %q", md.Type)
}
@@ -84,10 +90,7 @@ func (s *Status) validateStability() error {
return errors.New("missing stability")
}
for stability, component := range s.Stability {
- if stability != "development" && stability != "alpha" && stability != "beta" && stability != "stable" && stability != "deprecated" && stability != "unmaintained" {
- errs = multierr.Append(errs, fmt.Errorf("invalid stability: %v", stability))
- }
- if component == nil {
+ if len(component) == 0 {
errs = multierr.Append(errs, fmt.Errorf("missing component for stability: %v", stability))
}
for _, c := range component {
diff --git a/cmd/mdatagen/validate_test.go b/cmd/mdatagen/validate_test.go
index 12871a4ab8c..b64ca66e77c 100644
--- a/cmd/mdatagen/validate_test.go
+++ b/cmd/mdatagen/validate_test.go
@@ -40,11 +40,11 @@ func TestValidate(t *testing.T) {
},
{
name: "testdata/invalid_stability.yaml",
- wantErr: "invalid stability: incorrectstability",
+ wantErr: "1 error(s) decoding:\n\n* error decoding 'status.stability': invalid stability level: incorrectstability",
},
{
name: "testdata/no_stability_component.yaml",
- wantErr: "missing component for stability: beta",
+ wantErr: "missing component for stability: Beta",
},
{
name: "testdata/invalid_stability_component.yaml",
@@ -113,7 +113,7 @@ func TestValidateMetricDuplicates(t *testing.T) {
"container.uptime": {"docker_stats", "kubeletstats"},
}
allMetrics := map[string][]string{}
- err := filepath.Walk("../../receiver", func(path string, info fs.FileInfo, err error) error {
+ err := filepath.Walk("../../receiver", func(path string, info fs.FileInfo, _ error) error {
if info.Name() == "metadata.yaml" {
md, err := loadMetadata(path)
require.NoError(t, err)
diff --git a/cmd/otelcorecol/builder-config.yaml b/cmd/otelcorecol/builder-config.yaml
index b653ca696ef..b41a6eeb20a 100644
--- a/cmd/otelcorecol/builder-config.yaml
+++ b/cmd/otelcorecol/builder-config.yaml
@@ -2,25 +2,27 @@ dist:
module: go.opentelemetry.io/collector/cmd/otelcorecol
name: otelcorecol
description: Local OpenTelemetry Collector binary, testing only.
- version: 0.93.0-dev
- otelcol_version: 0.93.0
+ version: 0.97.0-dev
+ otelcol_version: 0.97.0
receivers:
- - gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.93.0
+ - gomod: go.opentelemetry.io/collector/receiver/nopreceiver v0.97.0
+ - gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.97.0
exporters:
- - gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.93.0
- - gomod: go.opentelemetry.io/collector/exporter/loggingexporter v0.93.0
- - gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.93.0
- - gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.93.0
+ - gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.97.0
+ - gomod: go.opentelemetry.io/collector/exporter/loggingexporter v0.97.0
+ - gomod: go.opentelemetry.io/collector/exporter/nopexporter v0.97.0
+ - gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.97.0
+ - gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.97.0
extensions:
- - gomod: go.opentelemetry.io/collector/extension/ballastextension v0.93.0
- - gomod: go.opentelemetry.io/collector/extension/memorylimiterextension v0.93.0
- - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.93.0
+ - gomod: go.opentelemetry.io/collector/extension/ballastextension v0.97.0
+ - gomod: go.opentelemetry.io/collector/extension/memorylimiterextension v0.97.0
+ - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.97.0
processors:
- - gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.93.0
- - gomod: go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.93.0
+ - gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.97.0
+ - gomod: go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.97.0
connectors:
- - gomod: go.opentelemetry.io/collector/connector/forwardconnector v0.93.0
+ - gomod: go.opentelemetry.io/collector/connector/forwardconnector v0.97.0
replaces:
- go.opentelemetry.io/collector => ../../
@@ -37,12 +39,19 @@ replaces:
- go.opentelemetry.io/collector/config/configtls => ../../config/configtls
- go.opentelemetry.io/collector/config/internal => ../../config/internal
- go.opentelemetry.io/collector/confmap => ../../confmap
+ - go.opentelemetry.io/collector/confmap/converter/expandconverter => ../../confmap/converter/expandconverter
+ - go.opentelemetry.io/collector/confmap/provider/envprovider => ../../confmap/provider/envprovider
+ - go.opentelemetry.io/collector/confmap/provider/fileprovider => ../../confmap/provider/fileprovider
+ - go.opentelemetry.io/collector/confmap/provider/httpprovider => ../../confmap/provider/httpprovider
+ - go.opentelemetry.io/collector/confmap/provider/httpsprovider => ../../confmap/provider/httpsprovider
+ - go.opentelemetry.io/collector/confmap/provider/yamlprovider => ../../confmap/provider/yamlprovider
- go.opentelemetry.io/collector/consumer => ../../consumer
- go.opentelemetry.io/collector/connector => ../../connector
- go.opentelemetry.io/collector/connector/forwardconnector => ../../connector/forwardconnector
- go.opentelemetry.io/collector/exporter => ../../exporter
- go.opentelemetry.io/collector/exporter/debugexporter => ../../exporter/debugexporter
- go.opentelemetry.io/collector/exporter/loggingexporter => ../../exporter/loggingexporter
+ - go.opentelemetry.io/collector/exporter/nopexporter => ../../exporter/nopexporter
- go.opentelemetry.io/collector/exporter/otlpexporter => ../../exporter/otlpexporter
- go.opentelemetry.io/collector/exporter/otlphttpexporter => ../../exporter/otlphttpexporter
- go.opentelemetry.io/collector/extension => ../../extension
@@ -54,6 +63,7 @@ replaces:
- go.opentelemetry.io/collector/pdata => ../../pdata
- go.opentelemetry.io/collector/processor => ../../processor
- go.opentelemetry.io/collector/receiver => ../../receiver
+ - go.opentelemetry.io/collector/receiver/nopreceiver => ../../receiver/nopreceiver
- go.opentelemetry.io/collector/receiver/otlpreceiver => ../../receiver/otlpreceiver
- go.opentelemetry.io/collector/processor/batchprocessor => ../../processor/batchprocessor
- go.opentelemetry.io/collector/processor/memorylimiterprocessor => ../../processor/memorylimiterprocessor
diff --git a/cmd/otelcorecol/components.go b/cmd/otelcorecol/components.go
index 786743099b9..9f8a7d45b06 100644
--- a/cmd/otelcorecol/components.go
+++ b/cmd/otelcorecol/components.go
@@ -8,6 +8,7 @@ import (
"go.opentelemetry.io/collector/exporter"
debugexporter "go.opentelemetry.io/collector/exporter/debugexporter"
loggingexporter "go.opentelemetry.io/collector/exporter/loggingexporter"
+ nopexporter "go.opentelemetry.io/collector/exporter/nopexporter"
otlpexporter "go.opentelemetry.io/collector/exporter/otlpexporter"
otlphttpexporter "go.opentelemetry.io/collector/exporter/otlphttpexporter"
"go.opentelemetry.io/collector/extension"
@@ -19,6 +20,7 @@ import (
batchprocessor "go.opentelemetry.io/collector/processor/batchprocessor"
memorylimiterprocessor "go.opentelemetry.io/collector/processor/memorylimiterprocessor"
"go.opentelemetry.io/collector/receiver"
+ nopreceiver "go.opentelemetry.io/collector/receiver/nopreceiver"
otlpreceiver "go.opentelemetry.io/collector/receiver/otlpreceiver"
)
@@ -36,6 +38,7 @@ func components() (otelcol.Factories, error) {
}
factories.Receivers, err = receiver.MakeFactoryMap(
+ nopreceiver.NewFactory(),
otlpreceiver.NewFactory(),
)
if err != nil {
@@ -45,6 +48,7 @@ func components() (otelcol.Factories, error) {
factories.Exporters, err = exporter.MakeFactoryMap(
debugexporter.NewFactory(),
loggingexporter.NewFactory(),
+ nopexporter.NewFactory(),
otlpexporter.NewFactory(),
otlphttpexporter.NewFactory(),
)
diff --git a/cmd/otelcorecol/go.mod b/cmd/otelcorecol/go.mod
index 717cd8fa257..abe1ca210c8 100644
--- a/cmd/otelcorecol/go.mod
+++ b/cmd/otelcorecol/go.mod
@@ -2,36 +2,37 @@
module go.opentelemetry.io/collector/cmd/otelcorecol
-go 1.20
+go 1.21
require (
- github.com/stretchr/testify v1.8.4
- go.opentelemetry.io/collector/component v0.93.0
- go.opentelemetry.io/collector/connector v0.93.0
- go.opentelemetry.io/collector/connector/forwardconnector v0.93.0
- go.opentelemetry.io/collector/exporter v0.93.0
- go.opentelemetry.io/collector/exporter/debugexporter v0.93.0
- go.opentelemetry.io/collector/exporter/loggingexporter v0.93.0
- go.opentelemetry.io/collector/exporter/otlpexporter v0.93.0
- go.opentelemetry.io/collector/exporter/otlphttpexporter v0.93.0
- go.opentelemetry.io/collector/extension v0.93.0
- go.opentelemetry.io/collector/extension/ballastextension v0.93.0
- go.opentelemetry.io/collector/extension/memorylimiterextension v0.93.0
- go.opentelemetry.io/collector/extension/zpagesextension v0.93.0
- go.opentelemetry.io/collector/otelcol v0.93.0
- go.opentelemetry.io/collector/processor v0.93.0
- go.opentelemetry.io/collector/processor/batchprocessor v0.93.0
- go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.93.0
- go.opentelemetry.io/collector/receiver v0.93.0
- go.opentelemetry.io/collector/receiver/otlpreceiver v0.93.0
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector/component v0.97.0
+ go.opentelemetry.io/collector/connector v0.97.0
+ go.opentelemetry.io/collector/connector/forwardconnector v0.97.0
+ go.opentelemetry.io/collector/exporter v0.97.0
+ go.opentelemetry.io/collector/exporter/debugexporter v0.97.0
+ go.opentelemetry.io/collector/exporter/loggingexporter v0.97.0
+ go.opentelemetry.io/collector/exporter/nopexporter v0.97.0
+ go.opentelemetry.io/collector/exporter/otlpexporter v0.97.0
+ go.opentelemetry.io/collector/exporter/otlphttpexporter v0.97.0
+ go.opentelemetry.io/collector/extension v0.97.0
+ go.opentelemetry.io/collector/extension/ballastextension v0.97.0
+ go.opentelemetry.io/collector/extension/memorylimiterextension v0.97.0
+ go.opentelemetry.io/collector/extension/zpagesextension v0.97.0
+ go.opentelemetry.io/collector/otelcol v0.97.0
+ go.opentelemetry.io/collector/processor v0.97.0
+ go.opentelemetry.io/collector/processor/batchprocessor v0.97.0
+ go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.97.0
+ go.opentelemetry.io/collector/receiver v0.97.0
+ go.opentelemetry.io/collector/receiver/nopreceiver v0.97.0
+ go.opentelemetry.io/collector/receiver/otlpreceiver v0.97.0
go.uber.org/goleak v1.3.0
- golang.org/x/sys v0.16.0
+ golang.org/x/sys v0.18.0
)
require (
- cloud.google.com/go/compute/metadata v0.2.4-0.20230617002413-005d2dfb6b68 // indirect
github.com/beorn7/perks v1.0.1 // indirect
- github.com/cenkalti/backoff/v4 v4.2.1 // indirect
+ github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
@@ -39,88 +40,95 @@ require (
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
+ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
- github.com/golang/protobuf v1.5.3 // indirect
+ github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
- github.com/google/uuid v1.5.0 // indirect
- github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
+ github.com/google/uuid v1.6.0 // indirect
+ github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
- github.com/klauspost/compress v1.17.5 // indirect
+ github.com/klauspost/compress v1.17.7 // indirect
github.com/knadh/koanf/maps v0.1.1 // indirect
github.com/knadh/koanf/providers/confmap v0.1.0 // indirect
- github.com/knadh/koanf/v2 v2.0.1 // indirect
+ github.com/knadh/koanf/v2 v2.1.0 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
- github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mostynb/go-grpc-compression v1.2.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
- github.com/prometheus/client_golang v1.18.0 // indirect
- github.com/prometheus/client_model v0.5.0 // indirect
- github.com/prometheus/common v0.46.0 // indirect
+ github.com/prometheus/client_golang v1.19.0 // indirect
+ github.com/prometheus/client_model v0.6.0 // indirect
+ github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/rs/cors v1.10.1 // indirect
- github.com/shirou/gopsutil/v3 v3.23.12 // indirect
+ github.com/shirou/gopsutil/v3 v3.24.3 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // 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
+ github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.opencensus.io v0.24.0 // indirect
- go.opentelemetry.io/collector v0.93.0 // indirect
- go.opentelemetry.io/collector/config/configauth v0.93.0 // indirect
- go.opentelemetry.io/collector/config/configcompression v0.93.0 // indirect
- go.opentelemetry.io/collector/config/configgrpc v0.93.0 // indirect
- go.opentelemetry.io/collector/config/confighttp v0.93.0 // indirect
- go.opentelemetry.io/collector/config/confignet v0.93.0 // indirect
- go.opentelemetry.io/collector/config/configopaque v0.93.0 // indirect
- go.opentelemetry.io/collector/config/configretry v0.93.0 // indirect
- go.opentelemetry.io/collector/config/configtelemetry v0.93.0 // indirect
- go.opentelemetry.io/collector/config/configtls v0.93.0 // indirect
- go.opentelemetry.io/collector/config/internal v0.93.0 // indirect
- go.opentelemetry.io/collector/confmap v0.93.0 // indirect
- go.opentelemetry.io/collector/consumer v0.93.0 // indirect
- go.opentelemetry.io/collector/extension/auth v0.93.0 // indirect
- go.opentelemetry.io/collector/featuregate v1.0.1 // indirect
- go.opentelemetry.io/collector/pdata v1.0.1 // indirect
- go.opentelemetry.io/collector/semconv v0.93.0 // indirect
- go.opentelemetry.io/collector/service v0.93.0 // indirect
- go.opentelemetry.io/contrib/config v0.2.0 // indirect
- go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect
- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect
- go.opentelemetry.io/contrib/propagators/b3 v1.22.0 // indirect
- go.opentelemetry.io/contrib/zpages v0.47.0 // indirect
- go.opentelemetry.io/otel v1.22.0 // indirect
- go.opentelemetry.io/otel/bridge/opencensus v0.45.0 // indirect
- go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.45.0 // indirect
- go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.45.0 // indirect
- go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0 // indirect
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0 // indirect
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0 // indirect
- go.opentelemetry.io/otel/exporters/prometheus v0.45.0 // indirect
- go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.45.0 // indirect
- go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.22.0 // indirect
- go.opentelemetry.io/otel/metric v1.22.0 // indirect
- go.opentelemetry.io/otel/sdk v1.22.0 // indirect
- go.opentelemetry.io/otel/sdk/metric v1.22.0 // indirect
- go.opentelemetry.io/otel/trace v1.22.0 // indirect
- go.opentelemetry.io/proto/otlp v1.0.0 // indirect
+ go.opentelemetry.io/collector v0.97.0 // indirect
+ go.opentelemetry.io/collector/config/configauth v0.97.0 // indirect
+ go.opentelemetry.io/collector/config/configcompression v1.4.0 // indirect
+ go.opentelemetry.io/collector/config/configgrpc v0.97.0 // indirect
+ go.opentelemetry.io/collector/config/confighttp v0.97.0 // indirect
+ go.opentelemetry.io/collector/config/confignet v0.97.0 // indirect
+ go.opentelemetry.io/collector/config/configopaque v1.4.0 // indirect
+ go.opentelemetry.io/collector/config/configretry v0.97.0 // indirect
+ go.opentelemetry.io/collector/config/configtelemetry v0.97.0 // indirect
+ go.opentelemetry.io/collector/config/configtls v0.97.0 // indirect
+ go.opentelemetry.io/collector/config/internal v0.97.0 // indirect
+ go.opentelemetry.io/collector/confmap v0.97.0 // indirect
+ go.opentelemetry.io/collector/confmap/converter/expandconverter v0.97.0 // indirect
+ go.opentelemetry.io/collector/confmap/provider/envprovider v0.97.0 // indirect
+ go.opentelemetry.io/collector/confmap/provider/fileprovider v0.97.0 // indirect
+ go.opentelemetry.io/collector/confmap/provider/httpprovider v0.97.0 // indirect
+ go.opentelemetry.io/collector/confmap/provider/httpsprovider v0.97.0 // indirect
+ go.opentelemetry.io/collector/confmap/provider/yamlprovider v0.97.0 // indirect
+ go.opentelemetry.io/collector/consumer v0.97.0 // indirect
+ go.opentelemetry.io/collector/extension/auth v0.97.0 // indirect
+ go.opentelemetry.io/collector/featuregate v1.4.0 // indirect
+ go.opentelemetry.io/collector/pdata v1.4.0 // indirect
+ go.opentelemetry.io/collector/semconv v0.97.0 // indirect
+ go.opentelemetry.io/collector/service v0.97.0 // indirect
+ go.opentelemetry.io/contrib/config v0.4.0 // indirect
+ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
+ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
+ go.opentelemetry.io/contrib/propagators/b3 v1.24.0 // indirect
+ go.opentelemetry.io/contrib/zpages v0.49.0 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/bridge/opencensus v1.24.0 // indirect
+ go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.24.0 // indirect
+ go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.24.0 // indirect
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 // indirect
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 // indirect
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 // indirect
+ go.opentelemetry.io/otel/exporters/prometheus v0.46.0 // indirect
+ go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.24.0 // indirect
+ go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.24.0 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
+ go.opentelemetry.io/proto/otlp v1.1.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
- go.uber.org/zap v1.26.0 // indirect
- golang.org/x/net v0.20.0 // indirect
+ go.uber.org/zap v1.27.0 // indirect
+ golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
+ golang.org/x/net v0.23.0 // indirect
golang.org/x/text v0.14.0 // indirect
- gonum.org/v1/gonum v0.14.0 // indirect
- google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 // indirect
- google.golang.org/grpc v1.61.0 // indirect
- google.golang.org/protobuf v1.32.0 // indirect
+ gonum.org/v1/gonum v0.15.0 // indirect
+ google.golang.org/genproto/googleapis/api v0.0.0-20240314234333-6e1732d8331c // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240314234333-6e1732d8331c // indirect
+ google.golang.org/grpc v1.62.1 // indirect
+ google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
@@ -152,6 +160,18 @@ replace go.opentelemetry.io/collector/config/internal => ../../config/internal
replace go.opentelemetry.io/collector/confmap => ../../confmap
+replace go.opentelemetry.io/collector/confmap/converter/expandconverter => ../../confmap/converter/expandconverter
+
+replace go.opentelemetry.io/collector/confmap/provider/envprovider => ../../confmap/provider/envprovider
+
+replace go.opentelemetry.io/collector/confmap/provider/fileprovider => ../../confmap/provider/fileprovider
+
+replace go.opentelemetry.io/collector/confmap/provider/httpprovider => ../../confmap/provider/httpprovider
+
+replace go.opentelemetry.io/collector/confmap/provider/httpsprovider => ../../confmap/provider/httpsprovider
+
+replace go.opentelemetry.io/collector/confmap/provider/yamlprovider => ../../confmap/provider/yamlprovider
+
replace go.opentelemetry.io/collector/consumer => ../../consumer
replace go.opentelemetry.io/collector/connector => ../../connector
@@ -164,6 +184,8 @@ replace go.opentelemetry.io/collector/exporter/debugexporter => ../../exporter/d
replace go.opentelemetry.io/collector/exporter/loggingexporter => ../../exporter/loggingexporter
+replace go.opentelemetry.io/collector/exporter/nopexporter => ../../exporter/nopexporter
+
replace go.opentelemetry.io/collector/exporter/otlpexporter => ../../exporter/otlpexporter
replace go.opentelemetry.io/collector/exporter/otlphttpexporter => ../../exporter/otlphttpexporter
@@ -186,6 +208,8 @@ replace go.opentelemetry.io/collector/processor => ../../processor
replace go.opentelemetry.io/collector/receiver => ../../receiver
+replace go.opentelemetry.io/collector/receiver/nopreceiver => ../../receiver/nopreceiver
+
replace go.opentelemetry.io/collector/receiver/otlpreceiver => ../../receiver/otlpreceiver
replace go.opentelemetry.io/collector/processor/batchprocessor => ../../processor/batchprocessor
diff --git a/cmd/otelcorecol/go.sum b/cmd/otelcorecol/go.sum
index e919d7db330..c351f29959a 100644
--- a/cmd/otelcorecol/go.sum
+++ b/cmd/otelcorecol/go.sum
@@ -1,19 +1,14 @@
-cloud.google.com/go v0.26.0 h1:e0WKqKTd5BnrG8aKH3J3h+QvEIQtSUcf2n5UZ5ZgLtQ=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
-cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk=
-cloud.google.com/go/compute/metadata v0.2.4-0.20230617002413-005d2dfb6b68 h1:aRVqY1p2IJaBGStWMsQMpkAa83cPkCDLl80eOj0Rbz4=
-cloud.google.com/go/compute/metadata v0.2.4-0.20230617002413-005d2dfb6b68/go.mod h1:1a3eRNYX12fs5UABBIXS8HXVvQbX9hRB/RkEBPORpe8=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
-github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
-github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
+github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
+github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/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/cncf/xds/go v0.0.0-20231109132714-523115ebc101 h1:7To3pQ+pZo0i3dsWEbinPNFs5gPSBOsJtx3wTT94VBY=
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=
@@ -22,7 +17,6 @@ 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/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
@@ -34,10 +28,11 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
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/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo=
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=
@@ -51,9 +46,8 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W
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/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
+github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
@@ -62,17 +56,16 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
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.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/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/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU=
-github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
-github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms=
-github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg=
+github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
+github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No=
+github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU=
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
@@ -81,22 +74,22 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
-github.com/klauspost/compress v1.17.5 h1:d4vBd+7CHydUqpFBgUEKkSdtSugf9YFmSkvUYPquI5E=
-github.com/klauspost/compress v1.17.5/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
+github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg=
+github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs=
github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI=
github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU=
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/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4=
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -110,21 +103,22 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw=
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
-github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=
-github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA=
+github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU=
+github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
-github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
-github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
-github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y=
-github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ=
+github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=
+github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8=
+github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=
+github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
+github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
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/shirou/gopsutil/v3 v3.23.12 h1:z90NtUkp3bMtmICZKpC4+WaknU1eXtp5vtbQ11DgpE4=
-github.com/shirou/gopsutil/v3 v3.23.12/go.mod h1:1FrWgea594Jp7qmjHUUPlJDTPgcsb9mGnXDxavtikzM=
+github.com/shirou/gopsutil/v3 v3.24.3 h1:eoUGJSmdfLzJ3mxIhmOAhgKEKgQkeOwKpz1NbhVnuPE=
+github.com/shirou/gopsutil/v3 v3.24.3/go.mod h1:JpND7O217xa72ewWz9zN2eIIkPWsDN/3pl0H8Qt0uwg=
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=
@@ -136,73 +130,76 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
+github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
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/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU=
github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI=
github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk=
github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw=
-github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
+github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
+github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
-go.opentelemetry.io/contrib/config v0.2.0 h1:VRYXnoE2ug3QOtaKka4eV9OgHXMJ0q6ggFtx6s+Jvy0=
-go.opentelemetry.io/contrib/config v0.2.0/go.mod h1:iBfwdwpZBKsVXMOAWHyGS8//dcVNJORYnFm6VNqsOG8=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 h1:UNQQKPfTDe1J81ViolILjTKPr9WetKW6uei2hFgJmFs=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0/go.mod h1:r9vWsPS/3AQItv3OSlEJ/E4mbrhUbbw18meOjArPtKQ=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 h1:sv9kVfal0MK0wBMCOGr+HeJm9v803BkJxGrk2au7j08=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0/go.mod h1:SK2UL73Zy1quvRPonmOmRDiWk1KBV3LyIeeIxcEApWw=
-go.opentelemetry.io/contrib/propagators/b3 v1.22.0 h1:Okbgv0pWHMQq+mF7H2o1mucJ5PvxKFq2c8cyqoXfeaQ=
-go.opentelemetry.io/contrib/propagators/b3 v1.22.0/go.mod h1:N3z0ycFRhsVZ+tG/uavMxHvOvFE95QM6gwW1zSqT9dQ=
-go.opentelemetry.io/contrib/zpages v0.47.0 h1:ekpdNa2wqOvAfwZIGDIIV02zmR+z08aWPt21KrPJnaU=
-go.opentelemetry.io/contrib/zpages v0.47.0/go.mod h1:rBeFA/UxnMjRlEGpmClIqzf1mCIKtl7ahjww3wsSdGs=
-go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y=
-go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI=
-go.opentelemetry.io/otel/bridge/opencensus v0.45.0 h1:kEOlv9Exuv3J8GCf1nLMHfrTPGnZOuIkN8YlRM14TtQ=
-go.opentelemetry.io/otel/bridge/opencensus v0.45.0/go.mod h1:tkVMJeFOr43+zzwbxtIWsNcCCDT7rI5/c9rhMfMIENg=
-go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.45.0 h1:tfil6di0PoNV7FZdsCS7A5izZoVVQ7AuXtyekbOpG/I=
-go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.45.0/go.mod h1:AKFZIEPOnqB00P63bTjOiah4ZTaRzl1TKwUWpZdYUHI=
-go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.45.0 h1:+RbSCde0ERway5FwKvXR3aRJIFeDu9rtwC6E7BC6uoM=
-go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.45.0/go.mod h1:zcI8u2EJxbLPyoZ3SkVAAcQPgYb1TDRzW93xLFnsggU=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0 h1:9M3+rhx7kZCIQQhQRYaZCdNu1V73tm4TvXs2ntl98C4=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0/go.mod h1:noq80iT8rrHP1SfybmPiRGc9dc5M8RPmGvtwo7Oo7tc=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0 h1:H2JFgRcGiyHg7H7bwcwaQJYrNFqCqrbTQ8K4p1OvDu8=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0/go.mod h1:WfCWp1bGoYK8MeULtI15MmQVczfR+bFkk0DF3h06QmQ=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0 h1:FyjCyI9jVEfqhUh2MoSkmolPjfh5fp2hnV0b0irxH4Q=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0/go.mod h1:hYwym2nDEeZfG/motx0p7L7J1N1vyzIThemQsb4g2qY=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0 h1:BeIK2KGho0oCWa7LxEGSqfDZbs7Fpv/Viz+FS4P8CXE=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0/go.mod h1:UVJZPLnfDSvHj+eJuZE+E1GjIBD267mEMfAAHJdghWg=
-go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.45.0 h1:NjN6zc7Mwy9torqa3mo+pMJ3mHoPI0uzVSYcqB2t72A=
-go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.45.0/go.mod h1:U+T5v2bk4fCC8XdSEWZja3Pm/ZhvV/zE7JwX/ELJKts=
-go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.22.0 h1:zr8ymM5OWWjjiWRzwTfZ67c905+2TMHYp2lMJ52QTyM=
-go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.22.0/go.mod h1:sQs7FT2iLVJ+67vYngGJkPe1qr39IzaBzaj9IDNNY8k=
-go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg=
-go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY=
-go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw=
-go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc=
-go.opentelemetry.io/otel/sdk/metric v1.22.0 h1:ARrRetm1HCVxq0cbnaZQlfwODYJHo3gFL8Z3tSmHBcI=
-go.opentelemetry.io/otel/sdk/metric v1.22.0/go.mod h1:KjQGeMIDlBNEOo6HvjhxIec1p/69/kULDcp4gr0oLQQ=
-go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0=
-go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo=
-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.opentelemetry.io/contrib/config v0.4.0 h1:Xb+ncYOqseLroMuBesGNRgVQolXcXOhMj7EhGwJCdHs=
+go.opentelemetry.io/contrib/config v0.4.0/go.mod h1:drNk2xRqLWW4/amk6Uh1S+sDAJTc7bcEEN1GfJzj418=
+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg=
+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw=
+go.opentelemetry.io/contrib/propagators/b3 v1.24.0 h1:n4xwCdTx3pZqZs2CjS/CUZAs03y3dZcGhC/FepKtEUY=
+go.opentelemetry.io/contrib/propagators/b3 v1.24.0/go.mod h1:k5wRxKRU2uXx2F8uNJ4TaonuEO/V7/5xoz7kdsDACT8=
+go.opentelemetry.io/contrib/zpages v0.49.0 h1:Wk217PkNBxcKWnIQpwtbZZE286K4ZY9uajnM5woSeLU=
+go.opentelemetry.io/contrib/zpages v0.49.0/go.mod h1:6alLi5mmkZWbAtZMRPd1ffIgkTcsU9OTHQF2NbSOhrQ=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/bridge/opencensus v1.24.0 h1:Vlhy5ee5k5R0zASpH+9AgHiJH7xnKACI3XopO1tUZfY=
+go.opentelemetry.io/otel/bridge/opencensus v1.24.0/go.mod h1:jRjVXV/X38jyrnHtvMGN8+9cejZB21JvXAAvooF2s+Q=
+go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.24.0 h1:f2jriWfOdldanBwS9jNBdeOKAQN7b4ugAMaNu1/1k9g=
+go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.24.0/go.mod h1:B+bcQI1yTY+N0vqMpoZbEN7+XU4tNM0DmUiOwebFJWI=
+go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.24.0 h1:mM8nKi6/iFQ0iqst80wDHU2ge198Ye/TfN0WBS5U24Y=
+go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.24.0/go.mod h1:0PrIIzDteLSmNyxqcGYRL4mDIo8OTuBAOI/Bn1URxac=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 h1:t6wl9SPayj+c7lEIFgm4ooDBZVb01IhLB4InpomhRw8=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0/go.mod h1:iSDOcsnSA5INXzZtwaBPrKp/lWu/V14Dd+llD0oI2EA=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 h1:Mw5xcxMwlqoJd97vwPxA8isEaIoxsta9/Q51+TTJLGE=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0/go.mod h1:CQNu9bj7o7mC6U7+CA/schKEYakYXWr79ucDHTMGhCM=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 h1:Xw8U6u2f8DK2XAkGRFV7BBLENgnTGX9i4rQRxJf+/vs=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0/go.mod h1:6KW1Fm6R/s6Z3PGXwSJN2K4eT6wQB3vXX6CVnYX9NmM=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0 h1:I8WIFXR351FoLJYuloU4EgXbtNX2URfU/85pUPheIEQ=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0/go.mod h1:ztwVUHe5DTR/1v7PeuGRnU5Bbd4QKYwApWmuutKsJSs=
+go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.24.0 h1:JYE2HM7pZbOt5Jhk8ndWZTUWYOVift2cHjXVMkPdmdc=
+go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.24.0/go.mod h1:yMb/8c6hVsnma0RpsBMNo0fEiQKeclawtgaIaOp2MLY=
+go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.24.0 h1:s0PHtIkN+3xrbDOpt2M8OTG92cWqUESvzh2MxiR5xY8=
+go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.24.0/go.mod h1:hZlFbDbRt++MMPCCfSJfmhkGIWnX1h3XjkfxZUjLrIA=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/sdk/metric v1.24.0 h1:yyMQrPzF+k88/DbH7o4FMAs80puqd+9osbiBrJrz/w8=
+go.opentelemetry.io/otel/sdk/metric v1.24.0/go.mod h1:I6Y5FjH6rvEnTTAYQz3Mmv2kl6Ek5IIrmwTLqMrrOE0=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
+go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI=
+go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
-go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
-go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
-golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug=
+golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ=
+golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE=
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=
@@ -217,10 +214,9 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
-golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
+golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
+golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
-golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ=
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=
@@ -234,9 +230,8 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
-golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
+golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
@@ -253,26 +248,24 @@ 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=
-gonum.org/v1/gonum v0.14.0 h1:2NiG67LD1tEH0D7kM+ps2V+fXmsAnpUeec7n8tcr4S0=
-gonum.org/v1/gonum v0.14.0/go.mod h1:AoWeoz0becf9QMWtE8iWXNXc27fK4fNeHNf/oMejGfU=
+gonum.org/v1/gonum v0.15.0 h1:2lYxjRbTYyxkJxlhC+LvJIx3SsANPdRybu1tGj9/OrQ=
+gonum.org/v1/gonum v0.15.0/go.mod h1:xzZVBJBtS+Mz4q0Yl2LJTk+OxOg4jiXZ7qBoM0uISGo=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
-google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=
google.golang.org/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-20231212172506-995d672761c0 h1:YJ5pD9rF8o9Qtta0Cmy9rdBwkSjrTCT6XTiUQVOtIos=
-google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 h1:rcS6EyEaoCO52hQDupoSfrxI3R6C2Tq741is7X8OvnM=
-google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917/go.mod h1:CmlNWB9lSezaYELKS5Ym1r44VrrbPUa7JTvw+6MbpJ0=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917 h1:6G8oQ016D88m1xAKljMlBOOGWDZkes4kMhgGFlf8WcQ=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20240102182953-50ed04b92917/go.mod h1:xtjpI3tXFPP051KaWnhvxkiubL/6dJ18vLVf7q2pTOU=
+google.golang.org/genproto/googleapis/api v0.0.0-20240314234333-6e1732d8331c h1:kaI7oewGK5YnVwj+Y+EJBO/YN1ht8iTL9XkFHtVZLsc=
+google.golang.org/genproto/googleapis/api v0.0.0-20240314234333-6e1732d8331c/go.mod h1:VQW3tUculP/D4B+xVCo+VgSq8As6wA9ZjHl//pmk+6s=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240314234333-6e1732d8331c h1:lfpJ/2rWPa/kJgxyyXM8PrNnfCzcmxJ265mADgwmvLI=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240314234333-6e1732d8331c/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
-google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
-google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
+google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=
+google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
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=
@@ -282,12 +275,11 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
-google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
-google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
-google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/cmd/otelcorecol/main.go b/cmd/otelcorecol/main.go
index d12f690ce9c..e801ece6238 100644
--- a/cmd/otelcorecol/main.go
+++ b/cmd/otelcorecol/main.go
@@ -14,7 +14,7 @@ func main() {
info := component.BuildInfo{
Command: "otelcorecol",
Description: "Local OpenTelemetry Collector binary, testing only.",
- Version: "0.93.0-dev",
+ Version: "0.97.0-dev",
}
if err := run(otelcol.CollectorSettings{BuildInfo: info, Factories: components}); err != nil {
diff --git a/component/component.go b/component/component.go
index e5f9e78c978..c7f6408680a 100644
--- a/component/component.go
+++ b/component/component.go
@@ -9,10 +9,6 @@ import (
)
var (
- // ErrNilNextConsumer can be returned by receiver, or processor Start factory funcs that create the Component if the
- // expected next Consumer is nil.
- ErrNilNextConsumer = errors.New("nil next Consumer")
-
// ErrDataTypeIsNotSupported can be returned by receiver, exporter or processor factory funcs that create the
// Component if the particular telemetry data type is not supported by the receiver, exporter or processor.
ErrDataTypeIsNotSupported = errors.New("telemetry type is not supported")
diff --git a/component/componenttest/nop_host.go b/component/componenttest/nop_host.go
index 4accfab0d8c..ea85ccc8bbe 100644
--- a/component/componenttest/nop_host.go
+++ b/component/componenttest/nop_host.go
@@ -15,9 +15,7 @@ func NewNopHost() component.Host {
return &nopHost{}
}
-func (nh *nopHost) ReportFatalError(_ error) {}
-
-func (nh *nopHost) GetFactory(_ component.Kind, _ component.Type) component.Factory {
+func (nh *nopHost) GetFactory(component.Kind, component.Type) component.Factory {
return nil
}
diff --git a/component/componenttest/nop_host_test.go b/component/componenttest/nop_host_test.go
index 99d323681ca..4aada24b1be 100644
--- a/component/componenttest/nop_host_test.go
+++ b/component/componenttest/nop_host_test.go
@@ -4,7 +4,6 @@
package componenttest
import (
- "errors"
"testing"
"github.com/stretchr/testify/assert"
@@ -18,7 +17,6 @@ func TestNewNopHost(t *testing.T) {
require.NotNil(t, nh)
require.IsType(t, &nopHost{}, nh)
- nh.ReportFatalError(errors.New("TestError"))
assert.Nil(t, nh.GetExporters()) // nolint: staticcheck
assert.Nil(t, nh.GetExtensions())
assert.Nil(t, nh.GetFactory(component.KindReceiver, component.MustNewType("test")))
diff --git a/component/config.go b/component/config.go
index f54b3a176c2..d86df1801bd 100644
--- a/component/config.go
+++ b/component/config.go
@@ -110,11 +110,18 @@ func callValidateIfPossible(v reflect.Value) error {
}
// Type is the component type as it is used in the config.
-type Type string
+type Type struct {
+ name string
+}
// String returns the string representation of the type.
func (t Type) String() string {
- return string(t)
+ return t.name
+}
+
+// MarshalText marshals returns the Type name.
+func (t Type) MarshalText() ([]byte, error) {
+ return []byte(t.name), nil
}
// typeRegexp is used to validate the type of a component.
@@ -130,12 +137,12 @@ var typeRegexp = regexp.MustCompile(`^[a-zA-Z][0-9a-zA-Z_]*$`)
// - can only contain ASCII alphanumeric characters and '_'.
func NewType(ty string) (Type, error) {
if len(ty) == 0 {
- return Type(""), fmt.Errorf("id must not be empty")
+ return Type{}, fmt.Errorf("id must not be empty")
}
if !typeRegexp.MatchString(ty) {
- return Type(""), fmt.Errorf("invalid character(s) in type %q", ty)
+ return Type{}, fmt.Errorf("invalid character(s) in type %q", ty)
}
- return Type(ty), nil
+ return Type{name: ty}, nil
}
// MustNewType creates a type. It panics if the type is invalid.
@@ -155,14 +162,18 @@ func MustNewType(strType string) Type {
// collecting metrics, traces and logs, this can expand in the future.
type DataType = Type
+func mustNewDataType(strType string) DataType {
+ return MustNewType(strType)
+}
+
// Currently supported data types. Add new data types here when new types are supported in the future.
-const (
+var (
// DataTypeTraces is the data type tag for traces.
- DataTypeTraces DataType = "traces"
+ DataTypeTraces = mustNewDataType("traces")
// DataTypeMetrics is the data type tag for metrics.
- DataTypeMetrics DataType = "metrics"
+ DataTypeMetrics = mustNewDataType("metrics")
// DataTypeLogs is the data type tag for logs.
- DataTypeLogs DataType = "logs"
+ DataTypeLogs = mustNewDataType("logs")
)
diff --git a/component/config_test.go b/component/config_test.go
index fcddc343d20..f1c3c65b395 100644
--- a/component/config_test.go
+++ b/component/config_test.go
@@ -11,9 +11,11 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+
+ "go.opentelemetry.io/collector/confmap"
)
-var _ fmt.Stringer = (Type)("")
+var _ fmt.Stringer = Type{}
type configChildStruct struct {
Child errConfig
@@ -417,3 +419,28 @@ func TestNewType(t *testing.T) {
})
}
}
+
+type configWithEmbeddedStruct struct {
+ String string `mapstructure:"string"`
+ Num int `mapstructure:"num"`
+ embeddedUnmarshallingConfig
+}
+
+type embeddedUnmarshallingConfig struct {
+}
+
+func (euc *embeddedUnmarshallingConfig) Unmarshal(_ *confmap.Conf) error {
+ return nil // do nothing.
+}
+func TestStructWithEmbeddedUnmarshaling(t *testing.T) {
+ t.Skip("Skipping, to be fixed with https://github.com/open-telemetry/opentelemetry-collector/issues/7102")
+ cfgMap := confmap.NewFromStringMap(map[string]any{
+ "string": "foo",
+ "num": 123,
+ })
+ tc := &configWithEmbeddedStruct{}
+ err := UnmarshalConfig(cfgMap, tc)
+ require.NoError(t, err)
+ assert.Equal(t, "foo", tc.String)
+ assert.Equal(t, 123, tc.Num)
+}
diff --git a/component/doc.go b/component/doc.go
index cef6b568edf..c7ac848a1ef 100644
--- a/component/doc.go
+++ b/component/doc.go
@@ -4,5 +4,5 @@
// Package component outlines the components used in the collector
// and provides a foundation for the component’s creation and
// termination process. A component can be either a receiver, exporter,
-// processor, or an extension.
+// processor, an extension, or a connector.
package component // import "go.opentelemetry.io/collector/component"
diff --git a/component/go.mod b/component/go.mod
index 835ac8de9fb..e37f15709bb 100644
--- a/component/go.mod
+++ b/component/go.mod
@@ -1,24 +1,24 @@
module go.opentelemetry.io/collector/component
-go 1.20
+go 1.21
require (
- github.com/prometheus/client_golang v1.18.0
- github.com/prometheus/client_model v0.5.0
- github.com/prometheus/common v0.46.0
- github.com/stretchr/testify v1.8.4
- go.opentelemetry.io/collector/config/configtelemetry v0.93.0
- go.opentelemetry.io/collector/confmap v0.93.0
- go.opentelemetry.io/collector/pdata v1.0.1
- go.opentelemetry.io/otel v1.22.0
- go.opentelemetry.io/otel/exporters/prometheus v0.45.0
- go.opentelemetry.io/otel/metric v1.22.0
- go.opentelemetry.io/otel/sdk v1.22.0
- go.opentelemetry.io/otel/sdk/metric v1.22.0
- go.opentelemetry.io/otel/trace v1.22.0
+ github.com/prometheus/client_golang v1.19.0
+ github.com/prometheus/client_model v0.6.0
+ github.com/prometheus/common v0.48.0
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector/config/configtelemetry v0.97.0
+ go.opentelemetry.io/collector/confmap v0.97.0
+ go.opentelemetry.io/collector/pdata v1.4.0
+ go.opentelemetry.io/otel v1.24.0
+ go.opentelemetry.io/otel/exporters/prometheus v0.46.0
+ go.opentelemetry.io/otel/metric v1.24.0
+ go.opentelemetry.io/otel/sdk v1.24.0
+ go.opentelemetry.io/otel/sdk/metric v1.24.0
+ go.opentelemetry.io/otel/trace v1.24.0
go.uber.org/goleak v1.3.0
go.uber.org/multierr v1.11.0
- go.uber.org/zap v1.26.0
+ go.uber.org/zap v1.27.0
)
require (
@@ -27,22 +27,22 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
+ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
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/knadh/koanf/v2 v2.1.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
- github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
- golang.org/x/net v0.20.0 // indirect
- golang.org/x/sys v0.16.0 // indirect
+ golang.org/x/net v0.23.0 // indirect
+ golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
- google.golang.org/grpc v1.61.0 // indirect
- google.golang.org/protobuf v1.32.0 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
+ google.golang.org/grpc v1.62.1 // indirect
+ google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/component/go.sum b/component/go.sum
index 86549631f90..05709b8b26f 100644
--- a/component/go.sum
+++ b/component/go.sum
@@ -9,6 +9,8 @@ github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
@@ -16,55 +18,57 @@ 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.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/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/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=
-github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA=
-github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
-github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
-github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y=
-github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ=
+github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU=
+github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k=
+github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=
+github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8=
+github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=
+github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/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/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y=
-go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0 h1:BeIK2KGho0oCWa7LxEGSqfDZbs7Fpv/Viz+FS4P8CXE=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0/go.mod h1:UVJZPLnfDSvHj+eJuZE+E1GjIBD267mEMfAAHJdghWg=
-go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg=
-go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY=
-go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw=
-go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc=
-go.opentelemetry.io/otel/sdk/metric v1.22.0 h1:ARrRetm1HCVxq0cbnaZQlfwODYJHo3gFL8Z3tSmHBcI=
-go.opentelemetry.io/otel/sdk/metric v1.22.0/go.mod h1:KjQGeMIDlBNEOo6HvjhxIec1p/69/kULDcp4gr0oLQQ=
-go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0=
-go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0 h1:I8WIFXR351FoLJYuloU4EgXbtNX2URfU/85pUPheIEQ=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0/go.mod h1:ztwVUHe5DTR/1v7PeuGRnU5Bbd4QKYwApWmuutKsJSs=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/sdk/metric v1.24.0 h1:yyMQrPzF+k88/DbH7o4FMAs80puqd+9osbiBrJrz/w8=
+go.opentelemetry.io/otel/sdk/metric v1.24.0/go.mod h1:I6Y5FjH6rvEnTTAYQz3Mmv2kl6Ek5IIrmwTLqMrrOE0=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
-go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
-go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -74,16 +78,16 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
-golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
+golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
+golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
-golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
+golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
@@ -96,15 +100,16 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA=
-google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
-google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s=
+google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=
+google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
-google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/component/host.go b/component/host.go
index 732e37c8c44..4b6933baaef 100644
--- a/component/host.go
+++ b/component/host.go
@@ -6,16 +6,6 @@ package component // import "go.opentelemetry.io/collector/component"
// Host represents the entity that is hosting a Component. It is used to allow communication
// between the Component and its host (normally the service.Collector is the host).
type Host interface {
- // ReportFatalError is used to report to the host that the component
- // encountered a fatal error (i.e.: an error that the instance can't recover
- // from) after its start function had already returned.
- //
- // ReportFatalError should be called by the component anytime after Component.Start() ends and
- // before Component.Shutdown() begins.
- // Deprecated: [0.87.0] Use TelemetrySettings.ReportComponentStatus instead (with an event
- // component.StatusFatalError)
- ReportFatalError(err error)
-
// GetFactory of the specified kind. Returns the factory for a component type.
// This allows components to create other components. For example:
// func (r MyReceiver) Start(host component.Host) error {
diff --git a/component/telemetry.go b/component/telemetry.go
index 572b4bdd916..17ca3dcab67 100644
--- a/component/telemetry.go
+++ b/component/telemetry.go
@@ -15,7 +15,7 @@ import (
// TelemetrySettings provides components with APIs to report telemetry.
//
// Note: there is a service version of this struct, servicetelemetry.TelemetrySettings, that mirrors
-// this struct with the exception of ReportComponentStatus. When adding or removing anything from
+// this struct with the exception of ReportStatus. When adding or removing anything from
// this struct consider whether or not the same should be done for the service version.
type TelemetrySettings struct {
// Logger that the factory can use during creation and can pass to the created
diff --git a/config/configauth/go.mod b/config/configauth/go.mod
index 5771d64db2a..d319eafe5c4 100644
--- a/config/configauth/go.mod
+++ b/config/configauth/go.mod
@@ -1,40 +1,40 @@
module go.opentelemetry.io/collector/config/configauth
-go 1.20
+go 1.21
require (
- github.com/stretchr/testify v1.8.4
- go.opentelemetry.io/collector/component v0.93.0
- go.opentelemetry.io/collector/extension v0.93.0
- go.opentelemetry.io/collector/extension/auth v0.93.0
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector/component v0.97.0
+ go.opentelemetry.io/collector/extension v0.97.0
+ go.opentelemetry.io/collector/extension/auth v0.97.0
go.uber.org/goleak v1.3.0
)
require (
github.com/davecgh/go-spew v1.1.1 // indirect
+ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // 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/knadh/koanf/v2 v2.1.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
- github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
- go.opentelemetry.io/collector/config/configtelemetry v0.93.0 // indirect
- go.opentelemetry.io/collector/confmap v0.93.0 // indirect
- go.opentelemetry.io/collector/pdata v1.0.1 // indirect
- go.opentelemetry.io/otel v1.22.0 // indirect
- go.opentelemetry.io/otel/metric v1.22.0 // indirect
- go.opentelemetry.io/otel/trace v1.22.0 // indirect
+ go.opentelemetry.io/collector/config/configtelemetry v0.97.0 // indirect
+ go.opentelemetry.io/collector/confmap v0.97.0 // indirect
+ go.opentelemetry.io/collector/pdata v1.4.0 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
- go.uber.org/zap v1.26.0 // indirect
- golang.org/x/net v0.20.0 // indirect
- golang.org/x/sys v0.16.0 // indirect
+ go.uber.org/zap v1.27.0 // indirect
+ golang.org/x/net v0.23.0 // indirect
+ golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
- google.golang.org/grpc v1.61.0 // indirect
- google.golang.org/protobuf v1.32.0 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
+ google.golang.org/grpc v1.62.1 // indirect
+ google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/config/configauth/go.sum b/config/configauth/go.sum
index a7ce46f3bbb..825a8a67022 100644
--- a/config/configauth/go.sum
+++ b/config/configauth/go.sum
@@ -1,9 +1,15 @@
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
+github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
+github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
+github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
+github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
@@ -11,48 +17,57 @@ 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.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/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/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=
-github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
-github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y=
+github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU=
+github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k=
+github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=
+github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8=
+github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=
+github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
+github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/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/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y=
-go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0 h1:BeIK2KGho0oCWa7LxEGSqfDZbs7Fpv/Viz+FS4P8CXE=
-go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg=
-go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY=
-go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw=
-go.opentelemetry.io/otel/sdk/metric v1.22.0 h1:ARrRetm1HCVxq0cbnaZQlfwODYJHo3gFL8Z3tSmHBcI=
-go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0=
-go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0 h1:I8WIFXR351FoLJYuloU4EgXbtNX2URfU/85pUPheIEQ=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0/go.mod h1:ztwVUHe5DTR/1v7PeuGRnU5Bbd4QKYwApWmuutKsJSs=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/sdk/metric v1.24.0 h1:yyMQrPzF+k88/DbH7o4FMAs80puqd+9osbiBrJrz/w8=
+go.opentelemetry.io/otel/sdk/metric v1.24.0/go.mod h1:I6Y5FjH6rvEnTTAYQz3Mmv2kl6Ek5IIrmwTLqMrrOE0=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
-go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
-go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -62,16 +77,16 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
-golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
+golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
+golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
-golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
+golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
@@ -84,15 +99,16 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA=
-google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
-google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s=
+google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=
+google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
-google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/config/configcompression/compressiontype.go b/config/configcompression/compressiontype.go
index 2c595ac7737..004e9558665 100644
--- a/config/configcompression/compressiontype.go
+++ b/config/configcompression/compressiontype.go
@@ -5,43 +5,37 @@ package configcompression // import "go.opentelemetry.io/collector/config/config
import "fmt"
-type CompressionType string
+// Type represents a compression method
+type Type string
const (
- Gzip CompressionType = "gzip"
- Zlib CompressionType = "zlib"
- Deflate CompressionType = "deflate"
- Snappy CompressionType = "snappy"
- Zstd CompressionType = "zstd"
- none CompressionType = "none"
- empty CompressionType = ""
+ TypeGzip Type = "gzip"
+ TypeZlib Type = "zlib"
+ TypeDeflate Type = "deflate"
+ TypeSnappy Type = "snappy"
+ TypeZstd Type = "zstd"
+ typeNone Type = "none"
+ typeEmpty Type = ""
)
-// IsCompressed returns false if CompressionType is nil, none, or empty. Otherwise it returns true.
-//
-// Deprecated: [0.94.0] use member function CompressionType.IsCompressed instead
-func IsCompressed(compressionType CompressionType) bool {
- return compressionType.IsCompressed()
-}
-
// IsCompressed returns false if CompressionType is nil, none, or empty.
// Otherwise, returns true.
-func (ct *CompressionType) IsCompressed() bool {
- return ct != nil && *ct != empty && *ct != none
+func (ct *Type) IsCompressed() bool {
+ return *ct != typeEmpty && *ct != typeNone
}
-func (ct *CompressionType) UnmarshalText(in []byte) error {
- switch typ := CompressionType(in); typ {
- case Gzip,
- Zlib,
- Deflate,
- Snappy,
- Zstd,
- none,
- empty:
+func (ct *Type) UnmarshalText(in []byte) error {
+ typ := Type(in)
+ if typ == TypeGzip ||
+ typ == TypeZlib ||
+ typ == TypeDeflate ||
+ typ == TypeSnappy ||
+ typ == TypeZstd ||
+ typ == typeNone ||
+ typ == typeEmpty {
*ct = typ
return nil
- default:
- return fmt.Errorf("unsupported compression type %q", typ)
}
+ return fmt.Errorf("unsupported compression type %q", typ)
+
}
diff --git a/config/configcompression/compressiontype_test.go b/config/configcompression/compressiontype_test.go
index 229d54f4d33..cf8166d5a24 100644
--- a/config/configcompression/compressiontype_test.go
+++ b/config/configcompression/compressiontype_test.go
@@ -65,14 +65,14 @@ func TestUnmarshalText(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
- temp := none
+ temp := typeNone
err := temp.UnmarshalText(tt.compressionName)
if tt.shouldError {
assert.Error(t, err)
return
}
require.NoError(t, err)
- ct := CompressionType(tt.compressionName)
+ ct := Type(tt.compressionName)
assert.Equal(t, temp, ct)
assert.Equal(t, tt.isCompressed, ct.IsCompressed())
})
diff --git a/config/configcompression/go.mod b/config/configcompression/go.mod
index 5f303bfb0a1..a79f2d91f3d 100644
--- a/config/configcompression/go.mod
+++ b/config/configcompression/go.mod
@@ -1,9 +1,9 @@
module go.opentelemetry.io/collector/config/configcompression
-go 1.20
+go 1.21
require (
- github.com/stretchr/testify v1.8.4
+ github.com/stretchr/testify v1.9.0
go.uber.org/goleak v1.3.0
)
diff --git a/config/configcompression/go.sum b/config/configcompression/go.sum
index b4eccab6a53..bdd6d70ba4d 100644
--- a/config/configcompression/go.sum
+++ b/config/configcompression/go.sum
@@ -14,8 +14,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
-github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
-github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
diff --git a/config/configgrpc/configgrpc.go b/config/configgrpc/configgrpc.go
index 967c98c510b..9f753c5fd8f 100644
--- a/config/configgrpc/configgrpc.go
+++ b/config/configgrpc/configgrpc.go
@@ -8,7 +8,6 @@ import (
"crypto/tls"
"errors"
"fmt"
- "net"
"strings"
"time"
@@ -49,10 +48,6 @@ type KeepaliveClientConfig struct {
PermitWithoutStream bool `mapstructure:"permit_without_stream"`
}
-// GRPCClientSettings defines common settings for a gRPC client configuration.
-// Deprecated: [v0.94.0] Use ClientConfig instead
-type GRPCClientSettings = ClientConfig
-
// ClientConfig defines common settings for a gRPC client configuration.
type ClientConfig struct {
// The target to which the exporter is going to send traces or metrics,
@@ -61,10 +56,10 @@ type ClientConfig struct {
Endpoint string `mapstructure:"endpoint"`
// The compression key for supported compression types within collector.
- Compression configcompression.CompressionType `mapstructure:"compression"`
+ Compression configcompression.Type `mapstructure:"compression"`
// TLSSetting struct exposes TLS client configuration.
- TLSSetting configtls.TLSClientSetting `mapstructure:"tls"`
+ TLSSetting configtls.ClientConfig `mapstructure:"tls"`
// The keepalive parameters for gRPC client. See grpc.WithKeepaliveParams.
// (https://godoc.org/google.golang.org/grpc#WithKeepaliveParams).
@@ -122,18 +117,14 @@ type KeepaliveEnforcementPolicy struct {
PermitWithoutStream bool `mapstructure:"permit_without_stream"`
}
-// GRPCServerSettings defines common settings for a gRPC server configuration.
-// Deprecated: [v0.94.0] Use ServerConfig instead
-type GRPCServerSettings = ServerConfig
-
// ServerConfig defines common settings for a gRPC server configuration.
type ServerConfig struct {
// Server net.Addr config. For transport only "tcp" and "unix" are valid options.
- NetAddr confignet.NetAddr `mapstructure:",squash"`
+ NetAddr confignet.AddrConfig `mapstructure:",squash"`
// Configures the protocol to use TLS.
// The default value is nil, which will cause the protocol to not use TLS.
- TLSSetting *configtls.TLSServerSetting `mapstructure:"tls"`
+ TLSSetting *configtls.ServerConfig `mapstructure:"tls"`
// MaxRecvMsgSizeMiB sets the maximum size (in MiB) of messages accepted by the server.
MaxRecvMsgSizeMiB uint64 `mapstructure:"max_recv_msg_size_mib"`
@@ -161,8 +152,8 @@ type ServerConfig struct {
IncludeMetadata bool `mapstructure:"include_metadata"`
}
-// SanitizedEndpoint strips the prefix of either http:// or https:// from configgrpc.ClientConfig.Endpoint.
-func (gcs *ClientConfig) SanitizedEndpoint() string {
+// sanitizedEndpoint strips the prefix of either http:// or https:// from configgrpc.ClientConfig.Endpoint.
+func (gcs *ClientConfig) sanitizedEndpoint() string {
switch {
case gcs.isSchemeHTTP():
return strings.TrimPrefix(gcs.Endpoint, "http://")
@@ -191,7 +182,7 @@ func (gcs *ClientConfig) ToClientConn(ctx context.Context, host component.Host,
return nil, err
}
opts = append(opts, extraOpts...)
- return grpc.DialContext(ctx, gcs.SanitizedEndpoint(), opts...)
+ return grpc.DialContext(ctx, gcs.sanitizedEndpoint(), opts...)
}
func (gcs *ClientConfig) toDialOptions(host component.Host, settings component.TelemetrySettings) ([]grpc.DialOption, error) {
@@ -204,7 +195,7 @@ func (gcs *ClientConfig) toDialOptions(host component.Host, settings component.T
opts = append(opts, grpc.WithDefaultCallOptions(grpc.UseCompressor(cp)))
}
- tlsCfg, err := gcs.TLSSetting.LoadTLSConfig()
+ tlsCfg, err := gcs.TLSSetting.LoadTLSConfigContext(context.Background())
if err != nil {
return nil, err
}
@@ -278,18 +269,8 @@ func validateBalancerName(balancerName string) bool {
return balancer.Get(balancerName) != nil
}
-// ToListenerContext returns the net.Listener constructed from the settings.
-func (gss *ServerConfig) ToListenerContext(ctx context.Context) (net.Listener, error) {
- return gss.NetAddr.Listen(ctx)
-}
-
-// ToListener returns the net.Listener constructed from the settings.
-// Deprecated: [v0.94.0] use ToListenerContext instead.
-func (gss *ServerConfig) ToListener() (net.Listener, error) {
- return gss.ToListenerContext(context.Background())
-}
-
-func (gss *ServerConfig) ToServer(host component.Host, settings component.TelemetrySettings, extraOpts ...grpc.ServerOption) (*grpc.Server, error) {
+// ToServer returns a grpc.Server for the configuration
+func (gss *ServerConfig) ToServer(_ context.Context, host component.Host, settings component.TelemetrySettings, extraOpts ...grpc.ServerOption) (*grpc.Server, error) {
opts, err := gss.toServerOption(host, settings)
if err != nil {
return nil, err
@@ -302,14 +283,14 @@ func (gss *ServerConfig) ToServer(host component.Host, settings component.Teleme
func (gss *ServerConfig) toServerOption(host component.Host, settings component.TelemetrySettings) ([]grpc.ServerOption, error) {
switch gss.NetAddr.Transport {
- case "tcp", "tcp4", "tcp6", "udp", "udp4", "udp6":
+ case confignet.TransportTypeTCP, confignet.TransportTypeTCP4, confignet.TransportTypeTCP6, confignet.TransportTypeUDP, confignet.TransportTypeUDP4, confignet.TransportTypeUDP6:
internal.WarnOnUnspecifiedHost(settings.Logger, gss.NetAddr.Endpoint)
}
var opts []grpc.ServerOption
if gss.TLSSetting != nil {
- tlsCfg, err := gss.TLSSetting.LoadTLSConfig()
+ tlsCfg, err := gss.TLSSetting.LoadTLSConfigContext(context.Background())
if err != nil {
return nil, err
}
@@ -394,13 +375,13 @@ func (gss *ServerConfig) toServerOption(host component.Host, settings component.
}
// getGRPCCompressionName returns compression name registered in grpc.
-func getGRPCCompressionName(compressionType configcompression.CompressionType) (string, error) {
+func getGRPCCompressionName(compressionType configcompression.Type) (string, error) {
switch compressionType {
- case configcompression.Gzip:
+ case configcompression.TypeGzip:
return gzip.Name, nil
- case configcompression.Snappy:
+ case configcompression.TypeSnappy:
return snappy.Name, nil
- case configcompression.Zstd:
+ case configcompression.TypeZstd:
return zstd.Name, nil
default:
return "", fmt.Errorf("unsupported compression type %q", compressionType)
diff --git a/config/configgrpc/configgrpc_test.go b/config/configgrpc/configgrpc_test.go
index 3edbcaf141c..2a1b34cb4ee 100644
--- a/config/configgrpc/configgrpc_test.go
+++ b/config/configgrpc/configgrpc_test.go
@@ -38,7 +38,7 @@ import (
// testBalancerBuilder facilitates testing validateBalancerName().
type testBalancerBuilder struct{}
-func (testBalancerBuilder) Build(_ balancer.ClientConn, _ balancer.BuildOptions) balancer.Balancer {
+func (testBalancerBuilder) Build(balancer.ClientConn, balancer.BuildOptions) balancer.Balancer {
return nil
}
@@ -63,7 +63,7 @@ func TestDefaultGrpcClientSettings(t *testing.T) {
t.Cleanup(func() { require.NoError(t, tt.Shutdown(context.Background())) })
gcs := &ClientConfig{
- TLSSetting: configtls.TLSClientSetting{
+ TLSSetting: configtls.ClientConfig{
Insecure: true,
},
}
@@ -89,8 +89,8 @@ func TestAllGrpcClientSettings(t *testing.T) {
"test": "test",
},
Endpoint: "localhost:1234",
- Compression: configcompression.Gzip,
- TLSSetting: configtls.TLSClientSetting{
+ Compression: configcompression.TypeGzip,
+ TLSSetting: configtls.ClientConfig{
Insecure: false,
},
Keepalive: &KeepaliveClientConfig{
@@ -118,8 +118,8 @@ func TestAllGrpcClientSettings(t *testing.T) {
"test": "test",
},
Endpoint: "localhost:1234",
- Compression: configcompression.Snappy,
- TLSSetting: configtls.TLSClientSetting{
+ Compression: configcompression.TypeSnappy,
+ TLSSetting: configtls.ClientConfig{
Insecure: false,
},
Keepalive: &KeepaliveClientConfig{
@@ -147,8 +147,8 @@ func TestAllGrpcClientSettings(t *testing.T) {
"test": "test",
},
Endpoint: "localhost:1234",
- Compression: configcompression.Zstd,
- TLSSetting: configtls.TLSClientSetting{
+ Compression: configcompression.TypeZstd,
+ TLSSetting: configtls.ClientConfig{
Insecure: false,
},
Keepalive: &KeepaliveClientConfig{
@@ -181,7 +181,7 @@ func TestAllGrpcClientSettings(t *testing.T) {
func TestDefaultGrpcServerSettings(t *testing.T) {
gss := &ServerConfig{
- NetAddr: confignet.NetAddr{
+ NetAddr: confignet.AddrConfig{
Endpoint: "0.0.0.0:1234",
},
}
@@ -192,12 +192,12 @@ func TestDefaultGrpcServerSettings(t *testing.T) {
func TestAllGrpcServerSettingsExceptAuth(t *testing.T) {
gss := &ServerConfig{
- NetAddr: confignet.NetAddr{
+ NetAddr: confignet.AddrConfig{
Endpoint: "localhost:1234",
- Transport: "tcp",
+ Transport: confignet.TransportTypeTCP,
},
- TLSSetting: &configtls.TLSServerSetting{
- TLSSetting: configtls.TLSSetting{},
+ TLSSetting: &configtls.ServerConfig{
+ Config: configtls.Config{},
ClientCAFile: "",
},
MaxRecvMsgSizeMiB: 1,
@@ -225,7 +225,7 @@ func TestAllGrpcServerSettingsExceptAuth(t *testing.T) {
func TestGrpcServerAuthSettings(t *testing.T) {
gss := &ServerConfig{
- NetAddr: confignet.NetAddr{
+ NetAddr: confignet.AddrConfig{
Endpoint: "0.0.0.0:1234",
},
}
@@ -237,7 +237,7 @@ func TestGrpcServerAuthSettings(t *testing.T) {
mockID: auth.NewServer(),
},
}
- srv, err := gss.ToServer(host, componenttest.NewNopTelemetrySettings())
+ srv, err := gss.ToServer(context.Background(), host, componenttest.NewNopTelemetrySettings())
assert.NoError(t, err)
assert.NotNil(t, srv)
}
@@ -258,8 +258,8 @@ func TestGRPCClientSettingsError(t *testing.T) {
Headers: nil,
Endpoint: "",
Compression: "",
- TLSSetting: configtls.TLSClientSetting{
- TLSSetting: configtls.TLSSetting{
+ TLSSetting: configtls.ClientConfig{
+ Config: configtls.Config{
CAFile: "/doesnt/exist",
},
Insecure: false,
@@ -274,8 +274,8 @@ func TestGRPCClientSettingsError(t *testing.T) {
Headers: nil,
Endpoint: "",
Compression: "",
- TLSSetting: configtls.TLSClientSetting{
- TLSSetting: configtls.TLSSetting{
+ TLSSetting: configtls.ClientConfig{
+ Config: configtls.Config{
CertFile: "/doesnt/exist",
},
Insecure: false,
@@ -292,7 +292,7 @@ func TestGRPCClientSettingsError(t *testing.T) {
},
Endpoint: "localhost:1234",
Compression: "gzip",
- TLSSetting: configtls.TLSClientSetting{
+ TLSSetting: configtls.ClientConfig{
Insecure: false,
},
Keepalive: &KeepaliveClientConfig{
@@ -326,7 +326,7 @@ func TestGRPCClientSettingsError(t *testing.T) {
err: "unsupported compression type \"zlib\"",
settings: ClientConfig{
Endpoint: "localhost:1234",
- TLSSetting: configtls.TLSClientSetting{
+ TLSSetting: configtls.ClientConfig{
Insecure: true,
},
Compression: "zlib",
@@ -337,7 +337,7 @@ func TestGRPCClientSettingsError(t *testing.T) {
err: "unsupported compression type \"deflate\"",
settings: ClientConfig{
Endpoint: "localhost:1234",
- TLSSetting: configtls.TLSClientSetting{
+ TLSSetting: configtls.ClientConfig{
Insecure: true,
},
Compression: "deflate",
@@ -348,7 +348,7 @@ func TestGRPCClientSettingsError(t *testing.T) {
err: "unsupported compression type \"bad\"",
settings: ClientConfig{
Endpoint: "localhost:1234",
- TLSSetting: configtls.TLSClientSetting{
+ TLSSetting: configtls.ClientConfig{
Insecure: true,
},
Compression: "bad",
@@ -374,7 +374,7 @@ func TestUseSecure(t *testing.T) {
Headers: nil,
Endpoint: "",
Compression: "",
- TLSSetting: configtls.TLSClientSetting{},
+ TLSSetting: configtls.ClientConfig{},
Keepalive: nil,
}
dialOpts, err := gcs.toDialOptions(componenttest.NewNopHost(), tt.TelemetrySettings())
@@ -390,27 +390,27 @@ func TestGRPCServerWarning(t *testing.T) {
}{
{
settings: ServerConfig{
- NetAddr: confignet.NetAddr{
+ NetAddr: confignet.AddrConfig{
Endpoint: "0.0.0.0:1234",
- Transport: "tcp",
+ Transport: confignet.TransportTypeTCP,
},
},
len: 1,
},
{
settings: ServerConfig{
- NetAddr: confignet.NetAddr{
+ NetAddr: confignet.AddrConfig{
Endpoint: "127.0.0.1:1234",
- Transport: "tcp",
+ Transport: confignet.TransportTypeTCP,
},
},
len: 0,
},
{
settings: ServerConfig{
- NetAddr: confignet.NetAddr{
+ NetAddr: confignet.AddrConfig{
Endpoint: "0.0.0.0:1234",
- Transport: "unix",
+ Transport: confignet.TransportTypeUnix,
},
},
len: 0,
@@ -441,12 +441,12 @@ func TestGRPCServerSettingsError(t *testing.T) {
{
err: "^failed to load TLS config: failed to load CA CertPool File: failed to load cert /doesnt/exist:",
settings: ServerConfig{
- NetAddr: confignet.NetAddr{
+ NetAddr: confignet.AddrConfig{
Endpoint: "127.0.0.1:1234",
- Transport: "tcp",
+ Transport: confignet.TransportTypeTCP,
},
- TLSSetting: &configtls.TLSServerSetting{
- TLSSetting: configtls.TLSSetting{
+ TLSSetting: &configtls.ServerConfig{
+ Config: configtls.Config{
CAFile: "/doesnt/exist",
},
},
@@ -455,12 +455,12 @@ func TestGRPCServerSettingsError(t *testing.T) {
{
err: "^failed to load TLS config: failed to load TLS cert and key: for auth via TLS, provide both certificate and key, or neither",
settings: ServerConfig{
- NetAddr: confignet.NetAddr{
+ NetAddr: confignet.AddrConfig{
Endpoint: "127.0.0.1:1234",
- Transport: "tcp",
+ Transport: confignet.TransportTypeTCP,
},
- TLSSetting: &configtls.TLSServerSetting{
- TLSSetting: configtls.TLSSetting{
+ TLSSetting: &configtls.ServerConfig{
+ Config: configtls.Config{
CertFile: "/doesnt/exist",
},
},
@@ -469,11 +469,11 @@ func TestGRPCServerSettingsError(t *testing.T) {
{
err: "^failed to load client CA CertPool: failed to load CA /doesnt/exist:",
settings: ServerConfig{
- NetAddr: confignet.NetAddr{
+ NetAddr: confignet.AddrConfig{
Endpoint: "127.0.0.1:1234",
- Transport: "tcp",
+ Transport: confignet.TransportTypeTCP,
},
- TLSSetting: &configtls.TLSServerSetting{
+ TLSSetting: &configtls.ServerConfig{
ClientCAFile: "/doesnt/exist",
},
},
@@ -481,7 +481,7 @@ func TestGRPCServerSettingsError(t *testing.T) {
}
for _, test := range tests {
t.Run(test.err, func(t *testing.T) {
- _, err := test.settings.ToServer(componenttest.NewNopHost(), componenttest.NewNopTelemetrySettings())
+ _, err := test.settings.ToServer(context.Background(), componenttest.NewNopHost(), componenttest.NewNopTelemetrySettings())
assert.Regexp(t, test.err, err)
})
}
@@ -489,18 +489,12 @@ func TestGRPCServerSettingsError(t *testing.T) {
func TestGRPCServerSettings_ToListener_Error(t *testing.T) {
settings := ServerConfig{
- NetAddr: confignet.NetAddr{
+ NetAddr: confignet.AddrConfig{
Endpoint: "127.0.0.1:1234567",
- Transport: "tcp",
+ Transport: confignet.TransportTypeTCP,
},
- TLSSetting: &configtls.TLSServerSetting{
- TLSSetting: configtls.TLSSetting{
- CertFile: "/doesnt/exist",
- },
- },
- Keepalive: nil,
}
- _, err := settings.ToListenerContext(context.Background())
+ _, err := settings.NetAddr.Listen(context.Background())
assert.Error(t, err)
}
@@ -511,28 +505,28 @@ func TestHttpReception(t *testing.T) {
tests := []struct {
name string
- tlsServerCreds *configtls.TLSServerSetting
- tlsClientCreds *configtls.TLSClientSetting
+ tlsServerCreds *configtls.ServerConfig
+ tlsClientCreds *configtls.ClientConfig
hasError bool
}{
{
name: "noTLS",
tlsServerCreds: nil,
- tlsClientCreds: &configtls.TLSClientSetting{
+ tlsClientCreds: &configtls.ClientConfig{
Insecure: true,
},
},
{
name: "TLS",
- tlsServerCreds: &configtls.TLSServerSetting{
- TLSSetting: configtls.TLSSetting{
+ tlsServerCreds: &configtls.ServerConfig{
+ Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "server.crt"),
KeyFile: filepath.Join("testdata", "server.key"),
},
},
- tlsClientCreds: &configtls.TLSClientSetting{
- TLSSetting: configtls.TLSSetting{
+ tlsClientCreds: &configtls.ClientConfig{
+ Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
},
ServerName: "localhost",
@@ -540,13 +534,13 @@ func TestHttpReception(t *testing.T) {
},
{
name: "NoServerCertificates",
- tlsServerCreds: &configtls.TLSServerSetting{
- TLSSetting: configtls.TLSSetting{
+ tlsServerCreds: &configtls.ServerConfig{
+ Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
},
},
- tlsClientCreds: &configtls.TLSClientSetting{
- TLSSetting: configtls.TLSSetting{
+ tlsClientCreds: &configtls.ClientConfig{
+ Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
},
ServerName: "localhost",
@@ -555,16 +549,16 @@ func TestHttpReception(t *testing.T) {
},
{
name: "mTLS",
- tlsServerCreds: &configtls.TLSServerSetting{
- TLSSetting: configtls.TLSSetting{
+ tlsServerCreds: &configtls.ServerConfig{
+ Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "server.crt"),
KeyFile: filepath.Join("testdata", "server.key"),
},
ClientCAFile: filepath.Join("testdata", "ca.crt"),
},
- tlsClientCreds: &configtls.TLSClientSetting{
- TLSSetting: configtls.TLSSetting{
+ tlsClientCreds: &configtls.ClientConfig{
+ Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "client.crt"),
KeyFile: filepath.Join("testdata", "client.key"),
@@ -574,16 +568,16 @@ func TestHttpReception(t *testing.T) {
},
{
name: "NoClientCertificate",
- tlsServerCreds: &configtls.TLSServerSetting{
- TLSSetting: configtls.TLSSetting{
+ tlsServerCreds: &configtls.ServerConfig{
+ Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "server.crt"),
KeyFile: filepath.Join("testdata", "server.key"),
},
ClientCAFile: filepath.Join("testdata", "ca.crt"),
},
- tlsClientCreds: &configtls.TLSClientSetting{
- TLSSetting: configtls.TLSSetting{
+ tlsClientCreds: &configtls.ClientConfig{
+ Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
},
ServerName: "localhost",
@@ -592,16 +586,16 @@ func TestHttpReception(t *testing.T) {
},
{
name: "WrongClientCA",
- tlsServerCreds: &configtls.TLSServerSetting{
- TLSSetting: configtls.TLSSetting{
+ tlsServerCreds: &configtls.ServerConfig{
+ Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "server.crt"),
KeyFile: filepath.Join("testdata", "server.key"),
},
ClientCAFile: filepath.Join("testdata", "server.crt"),
},
- tlsClientCreds: &configtls.TLSClientSetting{
- TLSSetting: configtls.TLSSetting{
+ tlsClientCreds: &configtls.ClientConfig{
+ Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "client.crt"),
KeyFile: filepath.Join("testdata", "client.key"),
@@ -616,15 +610,15 @@ func TestHttpReception(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
gss := &ServerConfig{
- NetAddr: confignet.NetAddr{
+ NetAddr: confignet.AddrConfig{
Endpoint: "localhost:0",
- Transport: "tcp",
+ Transport: confignet.TransportTypeTCP,
},
TLSSetting: test.tlsServerCreds,
}
- ln, err := gss.ToListenerContext(context.Background())
+ ln, err := gss.NetAddr.Listen(context.Background())
assert.NoError(t, err)
- s, err := gss.ToServer(componenttest.NewNopHost(), componenttest.NewNopTelemetrySettings())
+ s, err := gss.ToServer(context.Background(), componenttest.NewNopHost(), componenttest.NewNopTelemetrySettings())
assert.NoError(t, err)
ptraceotlp.RegisterGRPCServer(s, &grpcTraceServer{})
@@ -638,6 +632,7 @@ func TestHttpReception(t *testing.T) {
}
grpcClientConn, errClient := gcs.ToClientConn(context.Background(), componenttest.NewNopHost(), tt.TelemetrySettings())
assert.NoError(t, errClient)
+ defer func() { assert.NoError(t, grpcClientConn.Close()) }()
c := ptraceotlp.NewGRPCClient(grpcClientConn)
ctx, cancelFunc := context.WithTimeout(context.Background(), 2*time.Second)
resp, errResp := c.Export(ctx, ptraceotlp.NewExportRequest(), grpc.WaitForReady(true))
@@ -663,14 +658,14 @@ func TestReceiveOnUnixDomainSocket(t *testing.T) {
socketName := tempSocketName(t)
gss := &ServerConfig{
- NetAddr: confignet.NetAddr{
+ NetAddr: confignet.AddrConfig{
Endpoint: socketName,
- Transport: "unix",
+ Transport: confignet.TransportTypeUnix,
},
}
- ln, err := gss.ToListenerContext(context.Background())
+ ln, err := gss.NetAddr.Listen(context.Background())
assert.NoError(t, err)
- srv, err := gss.ToServer(componenttest.NewNopHost(), componenttest.NewNopTelemetrySettings())
+ srv, err := gss.ToServer(context.Background(), componenttest.NewNopHost(), componenttest.NewNopTelemetrySettings())
assert.NoError(t, err)
ptraceotlp.RegisterGRPCServer(srv, &grpcTraceServer{})
@@ -680,12 +675,13 @@ func TestReceiveOnUnixDomainSocket(t *testing.T) {
gcs := &ClientConfig{
Endpoint: "unix://" + ln.Addr().String(),
- TLSSetting: configtls.TLSClientSetting{
+ TLSSetting: configtls.ClientConfig{
Insecure: true,
},
}
grpcClientConn, errClient := gcs.ToClientConn(context.Background(), componenttest.NewNopHost(), tt.TelemetrySettings())
assert.NoError(t, errClient)
+ defer func() { assert.NoError(t, grpcClientConn.Close()) }()
c := ptraceotlp.NewGRPCClient(grpcClientConn)
ctx, cancelFunc := context.WithTimeout(context.Background(), 2*time.Second)
resp, errResp := c.Export(ctx, ptraceotlp.NewExportRequest(), grpc.WaitForReady(true))
@@ -810,7 +806,7 @@ func TestStreamInterceptorEnhancesClient(t *testing.T) {
ctx: inCtx,
}
- handler := func(srv any, stream grpc.ServerStream) error {
+ handler := func(_ any, stream grpc.ServerStream) error {
outContext = stream.Context()
return nil
}
@@ -858,18 +854,18 @@ func TestClientInfoInterceptors(t *testing.T) {
// prepare the server
{
gss := &ServerConfig{
- NetAddr: confignet.NetAddr{
+ NetAddr: confignet.AddrConfig{
Endpoint: "localhost:0",
- Transport: "tcp",
+ Transport: confignet.TransportTypeTCP,
},
}
- srv, err := gss.ToServer(componenttest.NewNopHost(), componenttest.NewNopTelemetrySettings())
+ srv, err := gss.ToServer(context.Background(), componenttest.NewNopHost(), componenttest.NewNopTelemetrySettings())
require.NoError(t, err)
ptraceotlp.RegisterGRPCServer(srv, mock)
defer srv.Stop()
- l, err = gss.ToListenerContext(context.Background())
+ l, err = gss.NetAddr.Listen(context.Background())
require.NoError(t, err)
go func() {
@@ -881,7 +877,7 @@ func TestClientInfoInterceptors(t *testing.T) {
{
gcs := &ClientConfig{
Endpoint: l.Addr().String(),
- TLSSetting: configtls.TLSClientSetting{
+ TLSSetting: configtls.ClientConfig{
Insecure: true,
},
}
@@ -894,6 +890,7 @@ func TestClientInfoInterceptors(t *testing.T) {
grpcClientConn, errClient := gcs.ToClientConn(context.Background(), componenttest.NewNopHost(), tt.TelemetrySettings())
require.NoError(t, errClient)
+ defer func() { assert.NoError(t, grpcClientConn.Close()) }()
cl := ptraceotlp.NewGRPCClient(grpcClientConn)
ctx, cancelFunc := context.WithTimeout(context.Background(), 2*time.Second)
@@ -924,7 +921,7 @@ func TestDefaultUnaryInterceptorAuthSucceeded(t *testing.T) {
return ctx, nil
}
- handler := func(ctx context.Context, req any) (any, error) {
+ handler := func(ctx context.Context, _ any) (any, error) {
handlerCalled = true
cl := client.FromContext(ctx)
assert.Equal(t, "1.2.3.4", cl.Addr.String())
@@ -950,7 +947,7 @@ func TestDefaultUnaryInterceptorAuthFailure(t *testing.T) {
authCalled = true
return context.Background(), expectedErr
}
- handler := func(ctx context.Context, req any) (any, error) {
+ handler := func(context.Context, any) (any, error) {
assert.FailNow(t, "the handler should not have been called on auth failure!")
return nil, nil
}
@@ -971,7 +968,7 @@ func TestDefaultUnaryInterceptorMissingMetadata(t *testing.T) {
assert.FailNow(t, "the auth func should not have been called!")
return context.Background(), nil
}
- handler := func(ctx context.Context, req any) (any, error) {
+ handler := func(context.Context, any) (any, error) {
assert.FailNow(t, "the handler should not have been called!")
return nil, nil
}
@@ -995,7 +992,7 @@ func TestDefaultStreamInterceptorAuthSucceeded(t *testing.T) {
})
return ctx, nil
}
- handler := func(srv any, stream grpc.ServerStream) error {
+ handler := func(_ any, stream grpc.ServerStream) error {
// ensure that the client information is propagated down to the underlying stream
cl := client.FromContext(stream.Context())
assert.Equal(t, "1.2.3.4", cl.Addr.String())
@@ -1024,7 +1021,7 @@ func TestDefaultStreamInterceptorAuthFailure(t *testing.T) {
authCalled = true
return context.Background(), expectedErr
}
- handler := func(srv any, stream grpc.ServerStream) error {
+ handler := func(any, grpc.ServerStream) error {
assert.FailNow(t, "the handler should not have been called on auth failure!")
return nil
}
@@ -1047,7 +1044,7 @@ func TestDefaultStreamInterceptorMissingMetadata(t *testing.T) {
assert.FailNow(t, "the auth func should not have been called!")
return context.Background(), nil
}
- handler := func(srv any, stream grpc.ServerStream) error {
+ handler := func(any, grpc.ServerStream) error {
assert.FailNow(t, "the handler should not have been called!")
return nil
}
diff --git a/config/configgrpc/go.mod b/config/configgrpc/go.mod
index df7a7fe6208..953e3b6d521 100644
--- a/config/configgrpc/go.mod
+++ b/config/configgrpc/go.mod
@@ -1,34 +1,35 @@
module go.opentelemetry.io/collector/config/configgrpc
-go 1.20
+go 1.21
require (
github.com/mostynb/go-grpc-compression v1.2.2
- github.com/stretchr/testify v1.8.4
- go.opentelemetry.io/collector v0.93.0
- go.opentelemetry.io/collector/component v0.93.0
- go.opentelemetry.io/collector/config/configauth v0.93.0
- go.opentelemetry.io/collector/config/configcompression v0.93.0
- go.opentelemetry.io/collector/config/confignet v0.93.0
- go.opentelemetry.io/collector/config/configopaque v0.93.0
- go.opentelemetry.io/collector/config/configtls v0.93.0
- go.opentelemetry.io/collector/config/internal v0.93.0
- go.opentelemetry.io/collector/extension/auth v0.93.0
- go.opentelemetry.io/collector/pdata v1.0.1
- go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0
- go.opentelemetry.io/otel v1.22.0
- go.uber.org/zap v1.26.0
- google.golang.org/grpc v1.61.0
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector v0.97.0
+ go.opentelemetry.io/collector/component v0.97.0
+ go.opentelemetry.io/collector/config/configauth v0.97.0
+ go.opentelemetry.io/collector/config/configcompression v1.4.0
+ go.opentelemetry.io/collector/config/confignet v0.97.0
+ go.opentelemetry.io/collector/config/configopaque v1.4.0
+ go.opentelemetry.io/collector/config/configtls v0.97.0
+ go.opentelemetry.io/collector/config/internal v0.97.0
+ go.opentelemetry.io/collector/extension/auth v0.97.0
+ go.opentelemetry.io/collector/pdata v1.4.0
+ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0
+ go.opentelemetry.io/otel v1.24.0
+ go.uber.org/goleak v1.3.0
+ go.uber.org/zap v1.27.0
+ google.golang.org/grpc v1.62.1
)
require (
- cloud.google.com/go/compute/metadata v0.2.4-0.20230617002413-005d2dfb6b68 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
+ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
@@ -37,32 +38,31 @@ require (
github.com/klauspost/compress v1.17.2 // indirect
github.com/knadh/koanf/maps v0.1.1 // indirect
github.com/knadh/koanf/providers/confmap v0.1.0 // indirect
- github.com/knadh/koanf/v2 v2.0.1 // indirect
+ github.com/knadh/koanf/v2 v2.1.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
- github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
- github.com/prometheus/client_golang v1.18.0 // indirect
- github.com/prometheus/client_model v0.5.0 // indirect
- github.com/prometheus/common v0.46.0 // indirect
+ github.com/prometheus/client_golang v1.19.0 // indirect
+ github.com/prometheus/client_model v0.6.0 // indirect
+ github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
- go.opentelemetry.io/collector/config/configtelemetry v0.93.0 // indirect
- go.opentelemetry.io/collector/confmap v0.93.0 // indirect
- go.opentelemetry.io/collector/extension v0.93.0 // indirect
- go.opentelemetry.io/collector/featuregate v1.0.1 // indirect
- go.opentelemetry.io/otel/exporters/prometheus v0.45.0 // indirect
- go.opentelemetry.io/otel/metric v1.22.0 // indirect
- go.opentelemetry.io/otel/sdk v1.22.0 // indirect
- go.opentelemetry.io/otel/sdk/metric v1.22.0 // indirect
- go.opentelemetry.io/otel/trace v1.22.0 // indirect
+ go.opentelemetry.io/collector/config/configtelemetry v0.97.0 // indirect
+ go.opentelemetry.io/collector/confmap v0.97.0 // indirect
+ go.opentelemetry.io/collector/extension v0.97.0 // indirect
+ go.opentelemetry.io/collector/featuregate v1.4.0 // indirect
+ go.opentelemetry.io/otel/exporters/prometheus v0.46.0 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
- golang.org/x/net v0.20.0 // indirect
- golang.org/x/sys v0.16.0 // indirect
+ golang.org/x/net v0.23.0 // indirect
+ golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
- google.golang.org/protobuf v1.32.0 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
+ google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/config/configgrpc/go.sum b/config/configgrpc/go.sum
index ca7af778c51..c192bfbc907 100644
--- a/config/configgrpc/go.sum
+++ b/config/configgrpc/go.sum
@@ -1,15 +1,10 @@
-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=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
-github.com/cncf/xds/go v0.0.0-20231109132714-523115ebc101 h1:7To3pQ+pZo0i3dsWEbinPNFs5gPSBOsJtx3wTT94VBY=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
@@ -17,6 +12,8 @@ github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
@@ -26,6 +23,7 @@ github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
@@ -39,14 +37,14 @@ github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NI
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/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -58,40 +56,42 @@ github.com/mostynb/go-grpc-compression v1.2.2 h1:XaDbnRvt2+1vgr0b/l0qh4mJAfIxE0b
github.com/mostynb/go-grpc-compression v1.2.2/go.mod h1:GOCr2KBxXcblCuczg3YdLQlcin1/NfyDA348ckuCH6w=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=
-github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA=
-github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
-github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
-github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y=
-github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ=
+github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU=
+github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k=
+github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=
+github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8=
+github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=
+github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
+github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
-github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 h1:UNQQKPfTDe1J81ViolILjTKPr9WetKW6uei2hFgJmFs=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0/go.mod h1:r9vWsPS/3AQItv3OSlEJ/E4mbrhUbbw18meOjArPtKQ=
-go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y=
-go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0 h1:BeIK2KGho0oCWa7LxEGSqfDZbs7Fpv/Viz+FS4P8CXE=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0/go.mod h1:UVJZPLnfDSvHj+eJuZE+E1GjIBD267mEMfAAHJdghWg=
-go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg=
-go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY=
-go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw=
-go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc=
-go.opentelemetry.io/otel/sdk/metric v1.22.0 h1:ARrRetm1HCVxq0cbnaZQlfwODYJHo3gFL8Z3tSmHBcI=
-go.opentelemetry.io/otel/sdk/metric v1.22.0/go.mod h1:KjQGeMIDlBNEOo6HvjhxIec1p/69/kULDcp4gr0oLQQ=
-go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0=
-go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo=
+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg=
+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0 h1:I8WIFXR351FoLJYuloU4EgXbtNX2URfU/85pUPheIEQ=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0/go.mod h1:ztwVUHe5DTR/1v7PeuGRnU5Bbd4QKYwApWmuutKsJSs=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/sdk/metric v1.24.0 h1:yyMQrPzF+k88/DbH7o4FMAs80puqd+9osbiBrJrz/w8=
+go.opentelemetry.io/otel/sdk/metric v1.24.0/go.mod h1:I6Y5FjH6rvEnTTAYQz3Mmv2kl6Ek5IIrmwTLqMrrOE0=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
+go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
-go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
-go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -101,17 +101,16 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
-golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
-golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ=
+golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
+golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
-golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
+golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
@@ -124,16 +123,16 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA=
-google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
-google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s=
+google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=
+google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
-google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/config/configgrpc/package_test.go b/config/configgrpc/package_test.go
new file mode 100644
index 00000000000..519657748da
--- /dev/null
+++ b/config/configgrpc/package_test.go
@@ -0,0 +1,17 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package configgrpc
+
+import (
+ "testing"
+
+ "go.uber.org/goleak"
+)
+
+// The IgnoreTopFunction call prevents catching the leak generated by opencensus
+// defaultWorker.Start which at this time is part of the package's init call.
+// See https://github.com/open-telemetry/opentelemetry-collector/issues/9165#issuecomment-1874836336 for more context.
+func TestMain(m *testing.M) {
+ goleak.VerifyTestMain(m, goleak.IgnoreTopFunction("go.opencensus.io/stats/view.(*worker).start"))
+}
diff --git a/config/confighttp/README.md b/config/confighttp/README.md
index 0cc0503f539..a0227c2402b 100644
--- a/config/confighttp/README.md
+++ b/config/confighttp/README.md
@@ -16,7 +16,10 @@ README](../configtls/README.md).
- `endpoint`: address:port
- [`tls`](../configtls/README.md)
-- `headers`: name/value pairs added to the HTTP request headers
+- [`headers`](https://pkg.go.dev/net/http#Request): name/value pairs added to the HTTP request headers
+ - certain headers such as Content-Length and Connection are automatically written when needed and values in Header may be ignored.
+ - `Host` header is automatically derived from `endpoint` value. However, this automatic assignment can be overridden by explicitly setting the Host field in the headers field.
+ - if `Host` header is provided then it overrides `Host` field in [Request](https://pkg.go.dev/net/http#Request) which results as an override of `Host` header value.
- [`read_buffer_size`](https://golang.org/pkg/net/http/#Transport)
- [`timeout`](https://golang.org/pkg/net/http/#Client)
- [`write_buffer_size`](https://golang.org/pkg/net/http/#Transport)
@@ -36,7 +39,7 @@ Example:
```yaml
exporter:
- otlp:
+ otlphttp:
endpoint: otelcol2:55690
auth:
authenticator: some-authenticator-extension
diff --git a/config/confighttp/compression.go b/config/confighttp/compression.go
index faa716c4414..88ecafe78da 100644
--- a/config/confighttp/compression.go
+++ b/config/confighttp/compression.go
@@ -13,6 +13,7 @@ import (
"io"
"net/http"
+ "github.com/golang/snappy"
"github.com/klauspost/compress/zstd"
"go.opentelemetry.io/collector/config/configcompression"
@@ -20,11 +21,11 @@ import (
type compressRoundTripper struct {
rt http.RoundTripper
- compressionType configcompression.CompressionType
+ compressionType configcompression.Type
compressor *compressor
}
-func newCompressRoundTripper(rt http.RoundTripper, compressionType configcompression.CompressionType) (*compressRoundTripper, error) {
+func newCompressRoundTripper(rt http.RoundTripper, compressionType configcompression.Type) (*compressRoundTripper, error) {
encoder, err := newCompressor(compressionType)
if err != nil {
return nil, err
@@ -85,7 +86,7 @@ func httpContentDecompressor(h http.Handler, eh func(w http.ResponseWriter, r *h
errHandler: errHandler,
base: h,
decoders: map[string]func(body io.ReadCloser) (io.ReadCloser, error){
- "": func(body io.ReadCloser) (io.ReadCloser, error) {
+ "": func(io.ReadCloser) (io.ReadCloser, error) {
// Not a compressed payload. Nothing to do.
return nil, nil
},
@@ -117,6 +118,18 @@ func httpContentDecompressor(h http.Handler, eh func(w http.ResponseWriter, r *h
}
return zr, nil
},
+ "snappy": func(body io.ReadCloser) (io.ReadCloser, error) {
+ sr := snappy.NewReader(body)
+ sb := new(bytes.Buffer)
+ _, err := io.Copy(sb, sr)
+ if err != nil {
+ return nil, err
+ }
+ if err = body.Close(); err != nil {
+ return nil, err
+ }
+ return io.NopCloser(sb), nil
+ },
},
}
d.decoders["deflate"] = d.decoders["zlib"]
diff --git a/config/confighttp/compression_test.go b/config/confighttp/compression_test.go
index d7fc44cd474..63d9ba02ab9 100644
--- a/config/confighttp/compression_test.go
+++ b/config/confighttp/compression_test.go
@@ -33,7 +33,7 @@ func TestHTTPClientCompression(t *testing.T) {
tests := []struct {
name string
- encoding configcompression.CompressionType
+ encoding configcompression.Type
reqBody []byte
shouldError bool
}{
@@ -51,31 +51,31 @@ func TestHTTPClientCompression(t *testing.T) {
},
{
name: "ValidGzip",
- encoding: configcompression.Gzip,
+ encoding: configcompression.TypeGzip,
reqBody: compressedGzipBody.Bytes(),
shouldError: false,
},
{
name: "ValidZlib",
- encoding: configcompression.Zlib,
+ encoding: configcompression.TypeZlib,
reqBody: compressedZlibBody.Bytes(),
shouldError: false,
},
{
name: "ValidDeflate",
- encoding: configcompression.Deflate,
+ encoding: configcompression.TypeDeflate,
reqBody: compressedDeflateBody.Bytes(),
shouldError: false,
},
{
name: "ValidSnappy",
- encoding: configcompression.Snappy,
+ encoding: configcompression.TypeSnappy,
reqBody: compressedSnappyBody.Bytes(),
shouldError: false,
},
{
name: "ValidZstd",
- encoding: configcompression.Zstd,
+ encoding: configcompression.TypeZstd,
reqBody: compressedZstdBody.Bytes(),
shouldError: false,
},
@@ -190,6 +190,12 @@ func TestHTTPContentDecompressionHandler(t *testing.T) {
reqBody: compressZstd(t, testBody),
respCode: http.StatusOK,
},
+ {
+ name: "ValidSnappy",
+ encoding: "snappy",
+ reqBody: compressSnappy(t, testBody),
+ respCode: http.StatusOK,
+ },
{
name: "InvalidDeflate",
encoding: "deflate",
@@ -218,6 +224,13 @@ func TestHTTPContentDecompressionHandler(t *testing.T) {
respCode: http.StatusBadRequest,
respBody: "invalid input: magic number mismatch",
},
+ {
+ name: "InvalidSnappy",
+ encoding: "snappy",
+ reqBody: bytes.NewBuffer(testBody),
+ respCode: http.StatusBadRequest,
+ respBody: "snappy: corrupt input\n",
+ },
{
name: "UnsupportedCompression",
encoding: "nosuchcompression",
@@ -274,7 +287,7 @@ func TestHTTPContentCompressionRequestWithNilBody(t *testing.T) {
require.NoError(t, err, "failed to create request to test handler")
client := http.Client{}
- client.Transport, err = newCompressRoundTripper(http.DefaultTransport, configcompression.Gzip)
+ client.Transport, err = newCompressRoundTripper(http.DefaultTransport, configcompression.TypeGzip)
require.NoError(t, err)
res, err := client.Do(req)
require.NoError(t, err)
@@ -287,7 +300,7 @@ func TestHTTPContentCompressionRequestWithNilBody(t *testing.T) {
type copyFailBody struct {
}
-func (*copyFailBody) Read(_ []byte) (n int, err error) {
+func (*copyFailBody) Read([]byte) (n int, err error) {
return 0, fmt.Errorf("read failed")
}
@@ -296,7 +309,7 @@ func (*copyFailBody) Close() error {
}
func TestHTTPContentCompressionCopyError(t *testing.T) {
- server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)
}))
t.Cleanup(server.Close)
@@ -305,7 +318,7 @@ func TestHTTPContentCompressionCopyError(t *testing.T) {
require.NoError(t, err)
client := http.Client{}
- client.Transport, err = newCompressRoundTripper(http.DefaultTransport, configcompression.Gzip)
+ client.Transport, err = newCompressRoundTripper(http.DefaultTransport, configcompression.TypeGzip)
require.NoError(t, err)
_, err = client.Do(req)
require.Error(t, err)
@@ -320,7 +333,7 @@ func (*closeFailBody) Close() error {
}
func TestHTTPContentCompressionRequestBodyCloseError(t *testing.T) {
- server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)
}))
t.Cleanup(server.Close)
@@ -329,7 +342,7 @@ func TestHTTPContentCompressionRequestBodyCloseError(t *testing.T) {
require.NoError(t, err)
client := http.Client{}
- client.Transport, err = newCompressRoundTripper(http.DefaultTransport, configcompression.Gzip)
+ client.Transport, err = newCompressRoundTripper(http.DefaultTransport, configcompression.TypeGzip)
require.NoError(t, err)
_, err = client.Do(req)
require.Error(t, err)
diff --git a/config/confighttp/compressor.go b/config/confighttp/compressor.go
index 0ff951d4130..3e085bead0d 100644
--- a/config/confighttp/compressor.go
+++ b/config/confighttp/compressor.go
@@ -39,15 +39,15 @@ type compressor struct {
// writerFactory defines writer field in CompressRoundTripper.
// The validity of input is already checked when NewCompressRoundTripper was called in confighttp,
-func newCompressor(compressionType configcompression.CompressionType) (*compressor, error) {
+func newCompressor(compressionType configcompression.Type) (*compressor, error) {
switch compressionType {
- case configcompression.Gzip:
+ case configcompression.TypeGzip:
return gZipPool, nil
- case configcompression.Snappy:
+ case configcompression.TypeSnappy:
return snappyPool, nil
- case configcompression.Zstd:
+ case configcompression.TypeZstd:
return zStdPool, nil
- case configcompression.Zlib, configcompression.Deflate:
+ case configcompression.TypeZlib, configcompression.TypeDeflate:
return zLibPool, nil
}
return nil, errors.New("unsupported compression type, ")
diff --git a/config/confighttp/confighttp.go b/config/confighttp/confighttp.go
index 44b15695f46..80482513f56 100644
--- a/config/confighttp/confighttp.go
+++ b/config/confighttp/confighttp.go
@@ -4,6 +4,7 @@
package confighttp // import "go.opentelemetry.io/collector/config/confighttp"
import (
+ "context"
"crypto/tls"
"errors"
"fmt"
@@ -29,10 +30,6 @@ import (
const headerContentEncoding = "Content-Encoding"
-// HTTPClientSettings defines settings for creating an HTTP client.
-// Deprecated: [v0.94.0] Use ClientConfig instead
-type HTTPClientSettings = ClientConfig
-
// ClientConfig defines settings for creating an HTTP client.
type ClientConfig struct {
// The target URL to send data to (e.g.: http://some.url:9411/v1/traces).
@@ -42,7 +39,7 @@ type ClientConfig struct {
ProxyURL string `mapstructure:"proxy_url"`
// TLSSetting struct exposes TLS client configuration.
- TLSSetting configtls.TLSClientSetting `mapstructure:"tls"`
+ TLSSetting configtls.ClientConfig `mapstructure:"tls"`
// ReadBufferSize for HTTP client. See http.Transport.ReadBufferSize.
ReadBufferSize int `mapstructure:"read_buffer_size"`
@@ -65,7 +62,7 @@ type ClientConfig struct {
Auth *configauth.Authentication `mapstructure:"auth"`
// The compression key for supported compression types within collector.
- Compression configcompression.CompressionType `mapstructure:"compression"`
+ Compression configcompression.Type `mapstructure:"compression"`
// MaxIdleConns is used to set a limit to the maximum idle HTTP connections the client can keep open.
// There's an already set value, and we want to override it only if an explicit value provided
@@ -103,15 +100,6 @@ type ClientConfig struct {
HTTP2PingTimeout time.Duration `mapstructure:"http2_ping_timeout"`
}
-// NewDefaultHTTPClientSettings returns HTTPClientSettings type object with
-// the default values of 'MaxIdleConns' and 'IdleConnTimeout'.
-// Other config options are not added as they are initialized with 'zero value' by GoLang as default.
-// We encourage to use this function to create an object of HTTPClientSettings.
-// Deprecated: [v0.94.0] Use NewDefaultClientConfig instead
-func NewDefaultHTTPClientSettings() ClientConfig {
- return NewDefaultClientConfig()
-}
-
// NewDefaultClientConfig returns ClientConfig type object with
// the default values of 'MaxIdleConns' and 'IdleConnTimeout'.
// Other config options are not added as they are initialized with 'zero value' by GoLang as default.
@@ -129,7 +117,7 @@ func NewDefaultClientConfig() ClientConfig {
// ToClient creates an HTTP client.
func (hcs *ClientConfig) ToClient(host component.Host, settings component.TelemetrySettings) (*http.Client, error) {
- tlsCfg, err := hcs.TLSSetting.LoadTLSConfig()
+ tlsCfg, err := hcs.TLSSetting.LoadTLSConfigContext(context.Background())
if err != nil {
return nil, err
}
@@ -249,24 +237,27 @@ type headerRoundTripper struct {
// RoundTrip is a custom RoundTripper that adds headers to the request.
func (interceptor *headerRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
+ // Set Host header if provided
+ hostHeader, found := interceptor.headers["Host"]
+ if found && hostHeader != "" {
+ // `Host` field should be set to override default `Host` header value which is Endpoint
+ req.Host = string(hostHeader)
+ }
for k, v := range interceptor.headers {
req.Header.Set(k, string(v))
}
+
// Send the request to next transport.
return interceptor.transport.RoundTrip(req)
}
-// HTTPServerSettings defines settings for creating an HTTP server.
-// Deprecated: [v0.94.0] Use ServerConfig instead
-type HTTPServerSettings = ServerConfig
-
// ServerConfig defines settings for creating an HTTP server.
type ServerConfig struct {
// Endpoint configures the listening address for the server.
Endpoint string `mapstructure:"endpoint"`
// TLSSetting struct exposes TLS client configuration.
- TLSSetting *configtls.TLSServerSetting `mapstructure:"tls"`
+ TLSSetting *configtls.ServerConfig `mapstructure:"tls"`
// CORS configures the server for HTTP cross-origin resource sharing (CORS).
CORS *CORSConfig `mapstructure:"cors"`
@@ -295,13 +286,14 @@ func (hss *ServerConfig) ToListener() (net.Listener, error) {
if hss.TLSSetting != nil {
var tlsCfg *tls.Config
- tlsCfg, err = hss.TLSSetting.LoadTLSConfig()
+ tlsCfg, err = hss.TLSSetting.LoadTLSConfigContext(context.Background())
if err != nil {
return nil, err
}
tlsCfg.NextProtos = []string{http2.NextProtoTLS, "http/1.1"}
listener = tls.NewListener(listener, tlsCfg)
}
+
return listener, nil
}
@@ -384,7 +376,7 @@ func (hss *ServerConfig) ToServer(host component.Host, settings component.Teleme
otelhttp.WithTracerProvider(settings.TracerProvider),
otelhttp.WithMeterProvider(settings.MeterProvider),
otelhttp.WithPropagators(otel.GetTextMapPropagator()),
- otelhttp.WithSpanNameFormatter(func(operation string, r *http.Request) string {
+ otelhttp.WithSpanNameFormatter(func(_ string, r *http.Request) string {
return r.URL.Path
}),
)
@@ -412,11 +404,6 @@ func responseHeadersHandler(handler http.Handler, headers map[string]configopaqu
})
}
-// CORSSettings configures a receiver for HTTP cross-origin resource sharing (CORS).
-// See the underlying https://github.com/rs/cors package for details.
-// Deprecated: [v0.94.0] Use CORSConfig instead
-type CORSSettings = CORSConfig
-
// CORSConfig configures a receiver for HTTP cross-origin resource sharing (CORS).
// See the underlying https://github.com/rs/cors package for details.
type CORSConfig struct {
diff --git a/config/confighttp/confighttp_test.go b/config/confighttp/confighttp_test.go
index 7eaf1cb314f..c49a6c80d8a 100644
--- a/config/confighttp/confighttp_test.go
+++ b/config/confighttp/confighttp_test.go
@@ -38,7 +38,7 @@ type customRoundTripper struct {
var _ http.RoundTripper = (*customRoundTripper)(nil)
-func (c *customRoundTripper) RoundTrip(_ *http.Request) (*http.Response, error) {
+func (c *customRoundTripper) RoundTrip(*http.Request) (*http.Response, error) {
return nil, nil
}
@@ -70,7 +70,7 @@ func TestAllHTTPClientSettings(t *testing.T) {
name: "all_valid_settings",
settings: ClientConfig{
Endpoint: "localhost:1234",
- TLSSetting: configtls.TLSClientSetting{
+ TLSSetting: configtls.ClientConfig{
Insecure: false,
},
ReadBufferSize: 1024,
@@ -91,7 +91,7 @@ func TestAllHTTPClientSettings(t *testing.T) {
name: "all_valid_settings_with_none_compression",
settings: ClientConfig{
Endpoint: "localhost:1234",
- TLSSetting: configtls.TLSClientSetting{
+ TLSSetting: configtls.ClientConfig{
Insecure: false,
},
ReadBufferSize: 1024,
@@ -112,7 +112,7 @@ func TestAllHTTPClientSettings(t *testing.T) {
name: "all_valid_settings_with_gzip_compression",
settings: ClientConfig{
Endpoint: "localhost:1234",
- TLSSetting: configtls.TLSClientSetting{
+ TLSSetting: configtls.ClientConfig{
Insecure: false,
},
ReadBufferSize: 1024,
@@ -133,7 +133,7 @@ func TestAllHTTPClientSettings(t *testing.T) {
name: "all_valid_settings_http2_health_check",
settings: ClientConfig{
Endpoint: "localhost:1234",
- TLSSetting: configtls.TLSClientSetting{
+ TLSSetting: configtls.ClientConfig{
Insecure: false,
},
ReadBufferSize: 1024,
@@ -154,12 +154,12 @@ func TestAllHTTPClientSettings(t *testing.T) {
name: "error_round_tripper_returned",
settings: ClientConfig{
Endpoint: "localhost:1234",
- TLSSetting: configtls.TLSClientSetting{
+ TLSSetting: configtls.ClientConfig{
Insecure: false,
},
ReadBufferSize: 1024,
WriteBufferSize: 512,
- CustomRoundTripper: func(next http.RoundTripper) (http.RoundTripper, error) { return nil, errors.New("error") },
+ CustomRoundTripper: func(http.RoundTripper) (http.RoundTripper, error) { return nil, errors.New("error") },
},
shouldError: true,
},
@@ -207,7 +207,7 @@ func TestPartialHTTPClientSettings(t *testing.T) {
name: "valid_partial_settings",
settings: ClientConfig{
Endpoint: "localhost:1234",
- TLSSetting: configtls.TLSClientSetting{
+ TLSSetting: configtls.ClientConfig{
Insecure: false,
},
ReadBufferSize: 1024,
@@ -310,8 +310,8 @@ func TestHTTPClientSettingsError(t *testing.T) {
err: "^failed to load TLS config: failed to load CA CertPool File: failed to load cert /doesnt/exist:",
settings: ClientConfig{
Endpoint: "",
- TLSSetting: configtls.TLSClientSetting{
- TLSSetting: configtls.TLSSetting{
+ TLSSetting: configtls.ClientConfig{
+ Config: configtls.Config{
CAFile: "/doesnt/exist",
},
Insecure: false,
@@ -323,8 +323,8 @@ func TestHTTPClientSettingsError(t *testing.T) {
err: "^failed to load TLS config: failed to load TLS cert and key: for auth via TLS, provide both certificate and key, or neither",
settings: ClientConfig{
Endpoint: "",
- TLSSetting: configtls.TLSClientSetting{
- TLSSetting: configtls.TLSSetting{
+ TLSSetting: configtls.ClientConfig{
+ Config: configtls.Config{
CertFile: "/doesnt/exist",
},
Insecure: false,
@@ -423,8 +423,8 @@ func TestHTTPClientSettingWithAuthConfig(t *testing.T) {
name: "with_auth_configuration_has_extension_and_compression",
settings: ClientConfig{
Endpoint: "localhost:1234",
- Auth: &configauth.Authentication{AuthenticatorID: mockID},
- Compression: configcompression.Gzip,
+ Auth: &configauth.Authentication{AuthenticatorID: component.MustNewID("mock")},
+ Compression: configcompression.TypeGzip,
},
shouldErr: false,
host: &mockHost{
@@ -493,8 +493,8 @@ func TestHTTPServerSettingsError(t *testing.T) {
err: "^failed to load TLS config: failed to load CA CertPool File: failed to load cert /doesnt/exist:",
settings: ServerConfig{
Endpoint: "localhost:0",
- TLSSetting: &configtls.TLSServerSetting{
- TLSSetting: configtls.TLSSetting{
+ TLSSetting: &configtls.ServerConfig{
+ Config: configtls.Config{
CAFile: "/doesnt/exist",
},
},
@@ -504,8 +504,8 @@ func TestHTTPServerSettingsError(t *testing.T) {
err: "^failed to load TLS config: failed to load TLS cert and key: for auth via TLS, provide both certificate and key, or neither",
settings: ServerConfig{
Endpoint: "localhost:0",
- TLSSetting: &configtls.TLSServerSetting{
- TLSSetting: configtls.TLSSetting{
+ TLSSetting: &configtls.ServerConfig{
+ Config: configtls.Config{
CertFile: "/doesnt/exist",
},
},
@@ -515,7 +515,7 @@ func TestHTTPServerSettingsError(t *testing.T) {
err: "failed to load client CA CertPool: failed to load CA /doesnt/exist:",
settings: ServerConfig{
Endpoint: "localhost:0",
- TLSSetting: &configtls.TLSServerSetting{
+ TLSSetting: &configtls.ServerConfig{
ClientCAFile: "/doesnt/exist",
},
},
@@ -557,7 +557,7 @@ func TestHTTPServerWarning(t *testing.T) {
_, err := test.settings.ToServer(
componenttest.NewNopHost(),
set,
- http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
_, errWrite := fmt.Fprint(w, "test")
assert.NoError(t, errWrite)
}))
@@ -571,29 +571,29 @@ func TestHTTPServerWarning(t *testing.T) {
func TestHttpReception(t *testing.T) {
tests := []struct {
name string
- tlsServerCreds *configtls.TLSServerSetting
- tlsClientCreds *configtls.TLSClientSetting
+ tlsServerCreds *configtls.ServerConfig
+ tlsClientCreds *configtls.ClientConfig
hasError bool
forceHTTP1 bool
}{
{
name: "noTLS",
tlsServerCreds: nil,
- tlsClientCreds: &configtls.TLSClientSetting{
+ tlsClientCreds: &configtls.ClientConfig{
Insecure: true,
},
},
{
name: "TLS",
- tlsServerCreds: &configtls.TLSServerSetting{
- TLSSetting: configtls.TLSSetting{
+ tlsServerCreds: &configtls.ServerConfig{
+ Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "server.crt"),
KeyFile: filepath.Join("testdata", "server.key"),
},
},
- tlsClientCreds: &configtls.TLSClientSetting{
- TLSSetting: configtls.TLSSetting{
+ tlsClientCreds: &configtls.ClientConfig{
+ Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
},
ServerName: "localhost",
@@ -601,15 +601,15 @@ func TestHttpReception(t *testing.T) {
},
{
name: "TLS (HTTP/1.1)",
- tlsServerCreds: &configtls.TLSServerSetting{
- TLSSetting: configtls.TLSSetting{
+ tlsServerCreds: &configtls.ServerConfig{
+ Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "server.crt"),
KeyFile: filepath.Join("testdata", "server.key"),
},
},
- tlsClientCreds: &configtls.TLSClientSetting{
- TLSSetting: configtls.TLSSetting{
+ tlsClientCreds: &configtls.ClientConfig{
+ Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
},
ServerName: "localhost",
@@ -618,13 +618,13 @@ func TestHttpReception(t *testing.T) {
},
{
name: "NoServerCertificates",
- tlsServerCreds: &configtls.TLSServerSetting{
- TLSSetting: configtls.TLSSetting{
+ tlsServerCreds: &configtls.ServerConfig{
+ Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
},
},
- tlsClientCreds: &configtls.TLSClientSetting{
- TLSSetting: configtls.TLSSetting{
+ tlsClientCreds: &configtls.ClientConfig{
+ Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
},
ServerName: "localhost",
@@ -633,16 +633,16 @@ func TestHttpReception(t *testing.T) {
},
{
name: "mTLS",
- tlsServerCreds: &configtls.TLSServerSetting{
- TLSSetting: configtls.TLSSetting{
+ tlsServerCreds: &configtls.ServerConfig{
+ Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "server.crt"),
KeyFile: filepath.Join("testdata", "server.key"),
},
ClientCAFile: filepath.Join("testdata", "ca.crt"),
},
- tlsClientCreds: &configtls.TLSClientSetting{
- TLSSetting: configtls.TLSSetting{
+ tlsClientCreds: &configtls.ClientConfig{
+ Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "client.crt"),
KeyFile: filepath.Join("testdata", "client.key"),
@@ -652,16 +652,16 @@ func TestHttpReception(t *testing.T) {
},
{
name: "NoClientCertificate",
- tlsServerCreds: &configtls.TLSServerSetting{
- TLSSetting: configtls.TLSSetting{
+ tlsServerCreds: &configtls.ServerConfig{
+ Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "server.crt"),
KeyFile: filepath.Join("testdata", "server.key"),
},
ClientCAFile: filepath.Join("testdata", "ca.crt"),
},
- tlsClientCreds: &configtls.TLSClientSetting{
- TLSSetting: configtls.TLSSetting{
+ tlsClientCreds: &configtls.ClientConfig{
+ Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
},
ServerName: "localhost",
@@ -670,16 +670,16 @@ func TestHttpReception(t *testing.T) {
},
{
name: "WrongClientCA",
- tlsServerCreds: &configtls.TLSServerSetting{
- TLSSetting: configtls.TLSSetting{
+ tlsServerCreds: &configtls.ServerConfig{
+ Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "server.crt"),
KeyFile: filepath.Join("testdata", "server.key"),
},
ClientCAFile: filepath.Join("testdata", "server.crt"),
},
- tlsClientCreds: &configtls.TLSClientSetting{
- TLSSetting: configtls.TLSSetting{
+ tlsClientCreds: &configtls.ClientConfig{
+ Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "client.crt"),
KeyFile: filepath.Join("testdata", "client.key"),
@@ -703,7 +703,7 @@ func TestHttpReception(t *testing.T) {
s, err := hss.ToServer(
componenttest.NewNopHost(),
componenttest.NewNopTelemetrySettings(),
- http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
_, errWrite := fmt.Fprint(w, "test")
assert.NoError(t, errWrite)
}))
@@ -816,7 +816,7 @@ func TestHttpCors(t *testing.T) {
s, err := hss.ToServer(
componenttest.NewNopHost(),
componenttest.NewNopTelemetrySettings(),
- http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)
}))
require.NoError(t, err)
@@ -856,7 +856,7 @@ func TestHttpCorsInvalidSettings(t *testing.T) {
s, err := hss.ToServer(
componenttest.NewNopHost(),
componenttest.NewNopTelemetrySettings(),
- http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {}))
+ http.HandlerFunc(func(http.ResponseWriter, *http.Request) {}))
require.NoError(t, err)
require.NotNil(t, s)
require.NoError(t, s.Close())
@@ -876,7 +876,7 @@ func TestHttpCorsWithSettings(t *testing.T) {
host := &mockHost{
ext: map[component.ID]component.Component{
mockID: auth.NewServer(
- auth.WithServerAuthenticate(func(ctx context.Context, headers map[string][]string) (context.Context, error) {
+ auth.WithServerAuthenticate(func(ctx context.Context, _ map[string][]string) (context.Context, error) {
return ctx, errors.New("Settings failed")
}),
),
@@ -932,7 +932,7 @@ func TestHttpServerHeaders(t *testing.T) {
s, err := hss.ToServer(
componenttest.NewNopHost(),
componenttest.NewNopTelemetrySettings(),
- http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)
}))
require.NoError(t, err)
@@ -1008,7 +1008,7 @@ func verifyHeadersResp(t *testing.T, url string, expected map[string]configopaqu
}
}
-func ExampleHTTPServerSettings() {
+func ExampleServerConfig() {
settings := ServerConfig{
Endpoint: "localhost:443",
}
@@ -1053,7 +1053,7 @@ func TestHttpClientHeaders(t *testing.T) {
serverURL, _ := url.Parse(server.URL)
setting := ClientConfig{
Endpoint: serverURL.String(),
- TLSSetting: configtls.TLSClientSetting{},
+ TLSSetting: configtls.ClientConfig{},
ReadBufferSize: 0,
WriteBufferSize: 0,
Timeout: 0,
@@ -1068,6 +1068,41 @@ func TestHttpClientHeaders(t *testing.T) {
}
}
+func TestHttpClientHostHeader(t *testing.T) {
+ hostHeader := "th"
+ tt := struct {
+ name string
+ headers map[string]configopaque.String
+ }{
+ name: "with_host_header",
+ headers: map[string]configopaque.String{
+ "Host": configopaque.String(hostHeader),
+ },
+ }
+
+ t.Run(tt.name, func(t *testing.T) {
+ server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ assert.Equal(t, hostHeader, r.Host)
+ w.WriteHeader(http.StatusOK)
+ }))
+ defer server.Close()
+ serverURL, _ := url.Parse(server.URL)
+ setting := ClientConfig{
+ Endpoint: serverURL.String(),
+ TLSSetting: configtls.ClientConfig{},
+ ReadBufferSize: 0,
+ WriteBufferSize: 0,
+ Timeout: 0,
+ Headers: tt.headers,
+ }
+ client, _ := setting.ToClient(componenttest.NewNopHost(), componenttest.NewNopTelemetrySettings())
+ req, err := http.NewRequest(http.MethodGet, setting.Endpoint, nil)
+ assert.NoError(t, err)
+ _, err = client.Do(req)
+ assert.NoError(t, err)
+ })
+}
+
func TestContextWithClient(t *testing.T) {
testCases := []struct {
desc string
@@ -1142,7 +1177,7 @@ func TestServerAuth(t *testing.T) {
host := &mockHost{
ext: map[component.ID]component.Component{
mockID: auth.NewServer(
- auth.WithServerAuthenticate(func(ctx context.Context, headers map[string][]string) (context.Context, error) {
+ auth.WithServerAuthenticate(func(ctx context.Context, _ map[string][]string) (context.Context, error) {
authCalled = true
return ctx, nil
}),
@@ -1151,7 +1186,7 @@ func TestServerAuth(t *testing.T) {
}
handlerCalled := false
- handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ handler := http.HandlerFunc(func(http.ResponseWriter, *http.Request) {
handlerCalled = true
})
@@ -1189,14 +1224,14 @@ func TestFailedServerAuth(t *testing.T) {
host := &mockHost{
ext: map[component.ID]component.Component{
mockID: auth.NewServer(
- auth.WithServerAuthenticate(func(ctx context.Context, headers map[string][]string) (context.Context, error) {
+ auth.WithServerAuthenticate(func(ctx context.Context, _ map[string][]string) (context.Context, error) {
return ctx, errors.New("Settings failed")
}),
),
},
}
- srv, err := hss.ToServer(host, componenttest.NewNopTelemetrySettings(), http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {}))
+ srv, err := hss.ToServer(host, componenttest.NewNopTelemetrySettings(), http.HandlerFunc(func(http.ResponseWriter, *http.Request) {}))
require.NoError(t, err)
// test
@@ -1213,17 +1248,16 @@ func TestServerWithErrorHandler(t *testing.T) {
hss := ServerConfig{
Endpoint: "localhost:0",
}
- eh := func(w http.ResponseWriter, r *http.Request, errorMsg string, statusCode int) {
+ eh := func(w http.ResponseWriter, _ *http.Request, _ string, statusCode int) {
assert.Equal(t, statusCode, http.StatusBadRequest)
// custom error handler changes returned status code
http.Error(w, "invalid request", http.StatusInternalServerError)
-
}
srv, err := hss.ToServer(
componenttest.NewNopHost(),
componenttest.NewNopTelemetrySettings(),
- http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {}),
+ http.HandlerFunc(func(http.ResponseWriter, *http.Request) {}),
WithErrorHandler(eh),
)
require.NoError(t, err)
@@ -1251,7 +1285,7 @@ func TestServerWithDecoder(t *testing.T) {
srv, err := hss.ToServer(
componenttest.NewNopHost(),
componenttest.NewNopTelemetrySettings(),
- http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {}),
+ http.HandlerFunc(func(http.ResponseWriter, *http.Request) {}),
WithDecoder("something-else", decoder),
)
require.NoError(t, err)
@@ -1305,15 +1339,15 @@ func BenchmarkHttpRequest(b *testing.B) {
},
}
- tlsServerCreds := &configtls.TLSServerSetting{
- TLSSetting: configtls.TLSSetting{
+ tlsServerCreds := &configtls.ServerConfig{
+ Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "server.crt"),
KeyFile: filepath.Join("testdata", "server.key"),
},
}
- tlsClientCreds := &configtls.TLSClientSetting{
- TLSSetting: configtls.TLSSetting{
+ tlsClientCreds := &configtls.ClientConfig{
+ Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
},
ServerName: "localhost",
@@ -1327,7 +1361,7 @@ func BenchmarkHttpRequest(b *testing.B) {
s, err := hss.ToServer(
componenttest.NewNopHost(),
componenttest.NewNopTelemetrySettings(),
- http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
_, errWrite := fmt.Fprint(w, "test")
require.NoError(b, errWrite)
}))
diff --git a/config/confighttp/go.mod b/config/confighttp/go.mod
index 0d8e1a7e4b3..79bb0402d89 100644
--- a/config/confighttp/go.mod
+++ b/config/confighttp/go.mod
@@ -1,26 +1,26 @@
module go.opentelemetry.io/collector/config/confighttp
-go 1.20
+go 1.21
require (
github.com/golang/snappy v0.0.4
- github.com/klauspost/compress v1.17.5
+ github.com/klauspost/compress v1.17.7
github.com/rs/cors v1.10.1
- github.com/stretchr/testify v1.8.4
- go.opentelemetry.io/collector v0.93.0
- go.opentelemetry.io/collector/component v0.93.0
- go.opentelemetry.io/collector/config/configauth v0.93.0
- go.opentelemetry.io/collector/config/configcompression v0.93.0
- go.opentelemetry.io/collector/config/configopaque v0.93.0
- go.opentelemetry.io/collector/config/configtelemetry v0.93.0
- go.opentelemetry.io/collector/config/configtls v0.93.0
- go.opentelemetry.io/collector/config/internal v0.93.0
- go.opentelemetry.io/collector/extension/auth v0.93.0
- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0
- go.opentelemetry.io/otel v1.22.0
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector v0.97.0
+ go.opentelemetry.io/collector/component v0.97.0
+ go.opentelemetry.io/collector/config/configauth v0.97.0
+ go.opentelemetry.io/collector/config/configcompression v1.4.0
+ go.opentelemetry.io/collector/config/configopaque v1.4.0
+ go.opentelemetry.io/collector/config/configtelemetry v0.97.0
+ go.opentelemetry.io/collector/config/configtls v0.97.0
+ go.opentelemetry.io/collector/config/internal v0.97.0
+ go.opentelemetry.io/collector/extension/auth v0.97.0
+ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0
+ go.opentelemetry.io/otel v1.24.0
go.uber.org/goleak v1.3.0
- go.uber.org/zap v1.26.0
- golang.org/x/net v0.20.0
+ go.uber.org/zap v1.27.0
+ golang.org/x/net v0.23.0
)
require (
@@ -31,35 +31,35 @@ require (
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
+ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/knadh/koanf/maps v0.1.1 // indirect
github.com/knadh/koanf/providers/confmap v0.1.0 // indirect
- github.com/knadh/koanf/v2 v2.0.1 // indirect
+ github.com/knadh/koanf/v2 v2.1.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
- github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
- github.com/prometheus/client_golang v1.18.0 // indirect
- github.com/prometheus/client_model v0.5.0 // indirect
- github.com/prometheus/common v0.46.0 // indirect
+ github.com/prometheus/client_golang v1.19.0 // indirect
+ github.com/prometheus/client_model v0.6.0 // indirect
+ github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
- go.opentelemetry.io/collector/confmap v0.93.0 // indirect
- go.opentelemetry.io/collector/extension v0.93.0 // indirect
- go.opentelemetry.io/collector/featuregate v1.0.1 // indirect
- go.opentelemetry.io/collector/pdata v1.0.1 // indirect
- go.opentelemetry.io/otel/exporters/prometheus v0.45.0 // indirect
- go.opentelemetry.io/otel/metric v1.22.0 // indirect
- go.opentelemetry.io/otel/sdk v1.22.0 // indirect
- go.opentelemetry.io/otel/sdk/metric v1.22.0 // indirect
- go.opentelemetry.io/otel/trace v1.22.0 // indirect
+ go.opentelemetry.io/collector/confmap v0.97.0 // indirect
+ go.opentelemetry.io/collector/extension v0.97.0 // indirect
+ go.opentelemetry.io/collector/featuregate v1.4.0 // indirect
+ go.opentelemetry.io/collector/pdata v1.4.0 // indirect
+ go.opentelemetry.io/otel/exporters/prometheus v0.46.0 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
- golang.org/x/sys v0.16.0 // indirect
+ golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
- google.golang.org/grpc v1.61.0 // indirect
- google.golang.org/protobuf v1.32.0 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
+ google.golang.org/grpc v1.62.1 // indirect
+ google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/config/confighttp/go.sum b/config/confighttp/go.sum
index bc1b22d490b..f269a8810a3 100644
--- a/config/confighttp/go.sum
+++ b/config/confighttp/go.sum
@@ -13,6 +13,8 @@ github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
@@ -22,66 +24,71 @@ github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
+github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
-github.com/klauspost/compress v1.17.5 h1:d4vBd+7CHydUqpFBgUEKkSdtSugf9YFmSkvUYPquI5E=
-github.com/klauspost/compress v1.17.5/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
+github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg=
+github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs=
github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI=
github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU=
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/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
+github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
+github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=
-github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA=
-github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
-github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
-github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y=
-github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ=
+github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU=
+github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k=
+github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=
+github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8=
+github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=
+github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
+github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo=
github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
-github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
-github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 h1:sv9kVfal0MK0wBMCOGr+HeJm9v803BkJxGrk2au7j08=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0/go.mod h1:SK2UL73Zy1quvRPonmOmRDiWk1KBV3LyIeeIxcEApWw=
-go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y=
-go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0 h1:BeIK2KGho0oCWa7LxEGSqfDZbs7Fpv/Viz+FS4P8CXE=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0/go.mod h1:UVJZPLnfDSvHj+eJuZE+E1GjIBD267mEMfAAHJdghWg=
-go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg=
-go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY=
-go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw=
-go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc=
-go.opentelemetry.io/otel/sdk/metric v1.22.0 h1:ARrRetm1HCVxq0cbnaZQlfwODYJHo3gFL8Z3tSmHBcI=
-go.opentelemetry.io/otel/sdk/metric v1.22.0/go.mod h1:KjQGeMIDlBNEOo6HvjhxIec1p/69/kULDcp4gr0oLQQ=
-go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0=
-go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0 h1:I8WIFXR351FoLJYuloU4EgXbtNX2URfU/85pUPheIEQ=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0/go.mod h1:ztwVUHe5DTR/1v7PeuGRnU5Bbd4QKYwApWmuutKsJSs=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/sdk/metric v1.24.0 h1:yyMQrPzF+k88/DbH7o4FMAs80puqd+9osbiBrJrz/w8=
+go.opentelemetry.io/otel/sdk/metric v1.24.0/go.mod h1:I6Y5FjH6rvEnTTAYQz3Mmv2kl6Ek5IIrmwTLqMrrOE0=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
-go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
-go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -91,16 +98,16 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
-golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
+golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
+golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
-golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
+golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
@@ -113,15 +120,16 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA=
-google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
-google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s=
+google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=
+google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
-google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/config/confignet/confignet.go b/config/confignet/confignet.go
index 21c854586d2..0f34aebb69f 100644
--- a/config/confignet/confignet.go
+++ b/config/confignet/confignet.go
@@ -5,10 +5,56 @@ package confignet // import "go.opentelemetry.io/collector/config/confignet"
import (
"context"
+ "fmt"
"net"
"time"
)
+// TransportType represents a type of network transport protocol
+type TransportType string
+
+const (
+ TransportTypeTCP TransportType = "tcp"
+ TransportTypeTCP4 TransportType = "tcp4"
+ TransportTypeTCP6 TransportType = "tcp6"
+ TransportTypeUDP TransportType = "udp"
+ TransportTypeUDP4 TransportType = "udp4"
+ TransportTypeUDP6 TransportType = "udp6"
+ TransportTypeIP TransportType = "ip"
+ TransportTypeIP4 TransportType = "ip4"
+ TransportTypeIP6 TransportType = "ip6"
+ TransportTypeUnix TransportType = "unix"
+ TransportTypeUnixgram TransportType = "unixgram"
+ TransportTypeUnixPacket TransportType = "unixpacket"
+ transportTypeEmpty TransportType = ""
+)
+
+// UnmarshalText unmarshalls text to a TransportType.
+// Valid values are "tcp", "tcp4", "tcp6", "udp", "udp4",
+// "udp6", "ip", "ip4", "ip6", "unix", "unixgram" and "unixpacket"
+func (tt *TransportType) UnmarshalText(in []byte) error {
+ typ := TransportType(in)
+ switch typ {
+ case TransportTypeTCP,
+ TransportTypeTCP4,
+ TransportTypeTCP6,
+ TransportTypeUDP,
+ TransportTypeUDP4,
+ TransportTypeUDP6,
+ TransportTypeIP,
+ TransportTypeIP4,
+ TransportTypeIP6,
+ TransportTypeUnix,
+ TransportTypeUnixgram,
+ TransportTypeUnixPacket,
+ transportTypeEmpty:
+ *tt = typ
+ return nil
+ default:
+ return fmt.Errorf("unsupported transport type %q", typ)
+ }
+}
+
// DialerConfig contains options for connecting to an address.
type DialerConfig struct {
// Timeout is the maximum amount of time a dial will wait for
@@ -16,8 +62,13 @@ type DialerConfig struct {
Timeout time.Duration `mapstructure:"timeout"`
}
-// NetAddr represents a network endpoint address.
-type NetAddr struct {
+// NewDefaultDialerConfig creates a new DialerConfig with any default values set
+func NewDefaultDialerConfig() DialerConfig {
+ return DialerConfig{}
+}
+
+// AddrConfig represents a network endpoint address.
+type AddrConfig struct {
// Endpoint configures the address for this network connection.
// For TCP and UDP networks, the address has the form "host:port". The host must be a literal IP address,
// or a host name that can be resolved to IP addresses. The port must be a literal port number or a service name.
@@ -25,28 +76,55 @@ type NetAddr struct {
// "[fe80::1%zone]:80". The zone specifies the scope of the literal IPv6 address as defined in RFC 4007.
Endpoint string `mapstructure:"endpoint"`
- // Transport to use. Known protocols are "tcp", "tcp4" (IPv4-only), "tcp6" (IPv6-only), "udp", "udp4" (IPv4-only),
+ // Transport to use. Allowed protocols are "tcp", "tcp4" (IPv4-only), "tcp6" (IPv6-only), "udp", "udp4" (IPv4-only),
// "udp6" (IPv6-only), "ip", "ip4" (IPv4-only), "ip6" (IPv6-only), "unix", "unixgram" and "unixpacket".
- Transport string `mapstructure:"transport"`
+ Transport TransportType `mapstructure:"transport"`
// DialerConfig contains options for connecting to an address.
DialerConfig DialerConfig `mapstructure:"dialer"`
}
+// NewDefaultAddrConfig creates a new AddrConfig with any default values set
+func NewDefaultAddrConfig() AddrConfig {
+ return AddrConfig{
+ DialerConfig: NewDefaultDialerConfig(),
+ }
+}
+
// Dial equivalent with net.Dialer's DialContext for this address.
-func (na *NetAddr) Dial(ctx context.Context) (net.Conn, error) {
+func (na *AddrConfig) Dial(ctx context.Context) (net.Conn, error) {
d := net.Dialer{Timeout: na.DialerConfig.Timeout}
- return d.DialContext(ctx, na.Transport, na.Endpoint)
+ return d.DialContext(ctx, string(na.Transport), na.Endpoint)
}
// Listen equivalent with net.ListenConfig's Listen for this address.
-func (na *NetAddr) Listen(ctx context.Context) (net.Listener, error) {
+func (na *AddrConfig) Listen(ctx context.Context) (net.Listener, error) {
lc := net.ListenConfig{}
- return lc.Listen(ctx, na.Transport, na.Endpoint)
+ return lc.Listen(ctx, string(na.Transport), na.Endpoint)
+}
+
+func (na *AddrConfig) Validate() error {
+ switch na.Transport {
+ case TransportTypeTCP,
+ TransportTypeTCP4,
+ TransportTypeTCP6,
+ TransportTypeUDP,
+ TransportTypeUDP4,
+ TransportTypeUDP6,
+ TransportTypeIP,
+ TransportTypeIP4,
+ TransportTypeIP6,
+ TransportTypeUnix,
+ TransportTypeUnixgram,
+ TransportTypeUnixPacket:
+ return nil
+ default:
+ return fmt.Errorf("invalid transport type %q", na.Transport)
+ }
}
-// TCPAddr represents a TCP endpoint address.
-type TCPAddr struct {
+// TCPAddrConfig represents a TCP endpoint address.
+type TCPAddrConfig struct {
// Endpoint configures the address for this network connection.
// The address has the form "host:port". The host must be a literal IP address, or a host name that can be
// resolved to IP addresses. The port must be a literal port number or a service name.
@@ -58,14 +136,21 @@ type TCPAddr struct {
DialerConfig DialerConfig `mapstructure:"dialer"`
}
+// NewDefaultTCPAddrConfig creates a new TCPAddrConfig with any default values set
+func NewDefaultTCPAddrConfig() TCPAddrConfig {
+ return TCPAddrConfig{
+ DialerConfig: NewDefaultDialerConfig(),
+ }
+}
+
// Dial equivalent with net.Dialer's DialContext for this address.
-func (na *TCPAddr) Dial(ctx context.Context) (net.Conn, error) {
+func (na *TCPAddrConfig) Dial(ctx context.Context) (net.Conn, error) {
d := net.Dialer{Timeout: na.DialerConfig.Timeout}
- return d.DialContext(ctx, "tcp", na.Endpoint)
+ return d.DialContext(ctx, string(TransportTypeTCP), na.Endpoint)
}
// Listen equivalent with net.ListenConfig's Listen for this address.
-func (na *TCPAddr) Listen(ctx context.Context) (net.Listener, error) {
+func (na *TCPAddrConfig) Listen(ctx context.Context) (net.Listener, error) {
lc := net.ListenConfig{}
- return lc.Listen(ctx, "tcp", na.Endpoint)
+ return lc.Listen(ctx, string(TransportTypeTCP), na.Endpoint)
}
diff --git a/config/confignet/confignet_test.go b/config/confignet/confignet_test.go
index fff9d6b4bd5..9375561dc39 100644
--- a/config/confignet/confignet_test.go
+++ b/config/confignet/confignet_test.go
@@ -11,12 +11,31 @@ import (
"time"
"github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
)
-func TestNetAddrTimeout(t *testing.T) {
- nac := &NetAddr{
+func TestNewDefaultDialerConfig(t *testing.T) {
+ expectedDialerConfig := DialerConfig{}
+ dialerConfig := NewDefaultDialerConfig()
+ require.Equal(t, expectedDialerConfig, dialerConfig)
+}
+
+func TestNewDefaultAddrConfig(t *testing.T) {
+ expectedAddrConfig := AddrConfig{}
+ addrConfig := NewDefaultAddrConfig()
+ require.Equal(t, expectedAddrConfig, addrConfig)
+}
+
+func TestNewDefaultTCPAddrConfig(t *testing.T) {
+ expectedTCPAddrConfig := TCPAddrConfig{}
+ tcpAddrconfig := NewDefaultTCPAddrConfig()
+ require.Equal(t, expectedTCPAddrConfig, tcpAddrconfig)
+}
+
+func TestAddrConfigTimeout(t *testing.T) {
+ nac := &AddrConfig{
Endpoint: "localhost:0",
- Transport: "tcp",
+ Transport: TransportTypeTCP,
DialerConfig: DialerConfig{
Timeout: -1 * time.Second,
},
@@ -31,8 +50,8 @@ func TestNetAddrTimeout(t *testing.T) {
}
}
-func TestTCPAddrTimeout(t *testing.T) {
- nac := &TCPAddr{
+func TestTCPAddrConfigTimeout(t *testing.T) {
+ nac := &TCPAddrConfig{
Endpoint: "localhost:0",
DialerConfig: DialerConfig{
Timeout: -1 * time.Second,
@@ -48,10 +67,10 @@ func TestTCPAddrTimeout(t *testing.T) {
}
}
-func TestNetAddr(t *testing.T) {
- nas := &NetAddr{
+func TestAddrConfig(t *testing.T) {
+ nas := &AddrConfig{
Endpoint: "localhost:0",
- Transport: "tcp",
+ Transport: TransportTypeTCP,
}
ln, err := nas.Listen(context.Background())
assert.NoError(t, err)
@@ -69,9 +88,9 @@ func TestNetAddr(t *testing.T) {
done <- true
}()
- nac := &NetAddr{
+ nac := &AddrConfig{
Endpoint: ln.Addr().String(),
- Transport: "tcp",
+ Transport: TransportTypeTCP,
}
var conn net.Conn
conn, err = nac.Dial(context.Background())
@@ -83,8 +102,25 @@ func TestNetAddr(t *testing.T) {
assert.NoError(t, ln.Close())
}
-func TestTCPAddr(t *testing.T) {
- nas := &TCPAddr{
+func Test_NetAddr_Validate(t *testing.T) {
+ na := &AddrConfig{
+ Transport: TransportTypeTCP,
+ }
+ assert.NoError(t, na.Validate())
+
+ na = &AddrConfig{
+ Transport: transportTypeEmpty,
+ }
+ assert.Error(t, na.Validate())
+
+ na = &AddrConfig{
+ Transport: "random string",
+ }
+ assert.Error(t, na.Validate())
+}
+
+func TestTCPAddrConfig(t *testing.T) {
+ nas := &TCPAddrConfig{
Endpoint: "localhost:0",
}
ln, err := nas.Listen(context.Background())
@@ -103,7 +139,7 @@ func TestTCPAddr(t *testing.T) {
done <- true
}()
- nac := &TCPAddr{
+ nac := &TCPAddrConfig{
Endpoint: ln.Addr().String(),
}
var conn net.Conn
@@ -115,3 +151,11 @@ func TestTCPAddr(t *testing.T) {
<-done
assert.NoError(t, ln.Close())
}
+
+func Test_TransportType_UnmarshalText(t *testing.T) {
+ var tt TransportType
+ err := tt.UnmarshalText([]byte("tcp"))
+ require.NoError(t, err)
+ err = tt.UnmarshalText([]byte("invalid"))
+ require.Error(t, err)
+}
diff --git a/config/confignet/go.mod b/config/confignet/go.mod
index 1199bef0116..4d1f2b4813a 100644
--- a/config/confignet/go.mod
+++ b/config/confignet/go.mod
@@ -1,9 +1,9 @@
module go.opentelemetry.io/collector/config/confignet
-go 1.20
+go 1.21
require (
- github.com/stretchr/testify v1.8.4
+ github.com/stretchr/testify v1.9.0
go.uber.org/goleak v1.3.0
)
diff --git a/config/confignet/go.sum b/config/confignet/go.sum
index b4eccab6a53..bdd6d70ba4d 100644
--- a/config/confignet/go.sum
+++ b/config/confignet/go.sum
@@ -14,8 +14,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
-github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
-github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
diff --git a/config/configopaque/go.mod b/config/configopaque/go.mod
index 941f44de6b6..902bd18e6b1 100644
--- a/config/configopaque/go.mod
+++ b/config/configopaque/go.mod
@@ -1,26 +1,27 @@
module go.opentelemetry.io/collector/config/configopaque
-go 1.20
+go 1.21
require (
- github.com/stretchr/testify v1.8.4
- go.opentelemetry.io/collector/confmap v0.93.0
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector/confmap v0.97.0
go.uber.org/goleak v1.3.0
gopkg.in/yaml.v3 v3.0.1
)
require (
github.com/davecgh/go-spew v1.1.1 // indirect
+ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
github.com/knadh/koanf/maps v0.1.1 // indirect
github.com/knadh/koanf/providers/confmap v0.1.0 // indirect
- github.com/knadh/koanf/v2 v2.0.1 // indirect
+ github.com/knadh/koanf/v2 v2.1.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
- github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
+ go.uber.org/zap v1.27.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)
diff --git a/config/configopaque/go.sum b/config/configopaque/go.sum
index 5958fc39f5c..bd31001f0e1 100644
--- a/config/configopaque/go.sum
+++ b/config/configopaque/go.sum
@@ -1,12 +1,14 @@
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs=
github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI=
github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU=
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/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
@@ -16,8 +18,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
@@ -26,12 +26,14 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
-github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
-github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
diff --git a/config/configretry/backoff.go b/config/configretry/backoff.go
index f872600846d..1fc3f8c5852 100644
--- a/config/configretry/backoff.go
+++ b/config/configretry/backoff.go
@@ -59,7 +59,16 @@ func (bs *BackOffConfig) Validate() error {
return errors.New("'max_interval' must be non-negative")
}
if bs.MaxElapsedTime < 0 {
- return errors.New("'max_elapsed' time must be non-negative")
+ return errors.New("'max_elapsed_time' must be non-negative")
+ }
+ if bs.MaxElapsedTime > 0 {
+ if bs.MaxElapsedTime < bs.InitialInterval {
+ return errors.New("'max_elapsed_time' must not be less than 'initial_interval'")
+ }
+ if bs.MaxElapsedTime < bs.MaxInterval {
+ return errors.New("'max_elapsed_time' must not be less than 'max_interval'")
+ }
+
}
return nil
}
diff --git a/config/configretry/backoff_test.go b/config/configretry/backoff_test.go
index 417ebe86161..a0adb3ceaf3 100644
--- a/config/configretry/backoff_test.go
+++ b/config/configretry/backoff_test.go
@@ -66,6 +66,18 @@ func TestInvalidMaxElapsedTime(t *testing.T) {
assert.NoError(t, cfg.Validate())
cfg.MaxElapsedTime = -1
assert.Error(t, cfg.Validate())
+ cfg.MaxElapsedTime = 60
+ // MaxElapsedTime is 60, InitialInterval is 5s, so it should be invalid
+ assert.Error(t, cfg.Validate())
+ cfg.InitialInterval = 0
+ // MaxElapsedTime is 60, MaxInterval is 30s, so it should be invalid
+ assert.Error(t, cfg.Validate())
+ cfg.MaxInterval = 0
+ assert.NoError(t, cfg.Validate())
+ cfg.InitialInterval = 50
+ // MaxElapsedTime is 0, so it should be valid
+ cfg.MaxElapsedTime = 0
+ assert.NoError(t, cfg.Validate())
}
func TestDisabledWithInvalidValues(t *testing.T) {
diff --git a/config/configretry/go.mod b/config/configretry/go.mod
index b08340a1970..9458227d2ca 100644
--- a/config/configretry/go.mod
+++ b/config/configretry/go.mod
@@ -1,10 +1,10 @@
module go.opentelemetry.io/collector/config/configretry
-go 1.20
+go 1.21
require (
- github.com/cenkalti/backoff/v4 v4.2.1
- github.com/stretchr/testify v1.8.4
+ github.com/cenkalti/backoff/v4 v4.3.0
+ github.com/stretchr/testify v1.9.0
go.uber.org/goleak v1.3.0
)
diff --git a/config/configretry/go.sum b/config/configretry/go.sum
index 33516e2c95b..ac136ad8627 100644
--- a/config/configretry/go.sum
+++ b/config/configretry/go.sum
@@ -1,5 +1,5 @@
-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/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
+github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -16,8 +16,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
-github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
-github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
diff --git a/config/configtelemetry/go.mod b/config/configtelemetry/go.mod
index de01f3eecf1..49af6aa800f 100644
--- a/config/configtelemetry/go.mod
+++ b/config/configtelemetry/go.mod
@@ -1,9 +1,9 @@
module go.opentelemetry.io/collector/config/configtelemetry
-go 1.20
+go 1.21
require (
- github.com/stretchr/testify v1.8.4
+ github.com/stretchr/testify v1.9.0
go.uber.org/goleak v1.3.0
)
diff --git a/config/configtelemetry/go.sum b/config/configtelemetry/go.sum
index b4eccab6a53..bdd6d70ba4d 100644
--- a/config/configtelemetry/go.sum
+++ b/config/configtelemetry/go.sum
@@ -14,8 +14,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
-github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
-github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
diff --git a/config/configtls/README.md b/config/configtls/README.md
index 8732bf82f9b..aecfc284b41 100644
--- a/config/configtls/README.md
+++ b/config/configtls/README.md
@@ -31,6 +31,11 @@ A certificate authority may also need to be defined:
system root CA. Should only be used if `insecure` is set to false.
- `ca_pem`: Alternative to `ca_file`. Provide the CA cert contents as a string instead of a filepath.
+You can also combine defining a certificate authority with the system certificate authorities.
+
+- `include_system_ca_certs_pool` (default = false): whether to load the system certificate authorities pool
+ alongside the certificate authority.
+
Additionally you can configure TLS to be enabled but skip verifying the server's
certificate chain. This cannot be combined with `insecure` since `insecure`
won't use TLS at all.
diff --git a/config/configtls/configtls.go b/config/configtls/configtls.go
index b93f016c44c..4f97346e6af 100644
--- a/config/configtls/configtls.go
+++ b/config/configtls/configtls.go
@@ -4,6 +4,7 @@
package configtls // import "go.opentelemetry.io/collector/config/configtls"
import (
+ "context"
"crypto/tls"
"crypto/x509"
"errors"
@@ -23,10 +24,12 @@ const defaultMinTLSVersion = tls.VersionTLS12
// Uses the default MaxVersion from "crypto/tls" which is the maximum supported version
const defaultMaxTLSVersion = 0
-// TLSSetting exposes the common client and server TLS configurations.
+var systemCertPool = x509.SystemCertPool
+
+// Config exposes the common client and server TLS configurations.
// Note: Since there isn't anything specific to a server connection. Components
-// with server connections should use TLSSetting.
-type TLSSetting struct {
+// with server connections should use Config.
+type Config struct {
// Path to the CA cert. For a client this verifies the server certificate.
// For a server this verifies client certificates. If empty uses system root CA.
// (optional)
@@ -35,6 +38,10 @@ type TLSSetting struct {
// In memory PEM encoded cert. (optional)
CAPem configopaque.String `mapstructure:"ca_pem"`
+ // If true, load system CA certificates pool in addition to the certificates
+ // configured in this struct.
+ IncludeSystemCACertsPool bool `mapstructure:"include_system_ca_certs_pool"`
+
// Path to the TLS cert to use for TLS required connections. (optional)
CertFile string `mapstructure:"cert_file"`
@@ -65,12 +72,12 @@ type TLSSetting struct {
ReloadInterval time.Duration `mapstructure:"reload_interval"`
}
-// TLSClientSetting contains TLS configurations that are specific to client
+// ClientConfig contains TLS configurations that are specific to client
// connections in addition to the common configurations. This should be used by
// components configuring TLS client connections.
-type TLSClientSetting struct {
+type ClientConfig struct {
// squash ensures fields are correctly decoded in embedded struct.
- TLSSetting `mapstructure:",squash"`
+ Config `mapstructure:",squash"`
// These are config options specific to client connections.
@@ -89,12 +96,12 @@ type TLSClientSetting struct {
ServerName string `mapstructure:"server_name_override"`
}
-// TLSServerSetting contains TLS configurations that are specific to server
+// ServerConfig contains TLS configurations that are specific to server
// connections in addition to the common configurations. This should be used by
// components configuring TLS server connections.
-type TLSServerSetting struct {
+type ServerConfig struct {
// squash ensures fields are correctly decoded in embedded struct.
- TLSSetting `mapstructure:",squash"`
+ Config `mapstructure:",squash"`
// These are config options specific to server connections.
@@ -115,10 +122,10 @@ type certReloader struct {
nextReload time.Time
cert *tls.Certificate
lock sync.RWMutex
- tls TLSSetting
+ tls Config
}
-func (c TLSSetting) newCertReloader() (*certReloader, error) {
+func (c Config) newCertReloader() (*certReloader, error) {
cert, err := c.loadCertificate()
if err != nil {
return nil, err
@@ -153,9 +160,31 @@ func (r *certReloader) GetCertificate() (*tls.Certificate, error) {
return r.cert, nil
}
+func (c Config) Validate() error {
+ if c.hasCAFile() && c.hasCAPem() {
+ return fmt.Errorf("provide either a CA file or the PEM-encoded string, but not both")
+ }
+
+ minTLS, err := convertVersion(c.MinVersion, defaultMinTLSVersion)
+ if err != nil {
+ return fmt.Errorf("invalid TLS min_version: %w", err)
+ }
+
+ maxTLS, err := convertVersion(c.MaxVersion, defaultMaxTLSVersion)
+ if err != nil {
+ return fmt.Errorf("invalid TLS max_version: %w", err)
+ }
+
+ if maxTLS < minTLS && maxTLS != defaultMaxTLSVersion {
+ return errors.New("invalid TLS configuration: min_version cannot be greater than max_version")
+ }
+
+ return nil
+}
+
// loadTLSConfig loads TLS certificates and returns a tls.Config.
// This will set the RootCAs and Certificates of a tls.Config.
-func (c TLSSetting) loadTLSConfig() (*tls.Config, error) {
+func (c Config) loadTLSConfig() (*tls.Config, error) {
certPool, err := c.loadCACertPool()
if err != nil {
return nil, err
@@ -169,8 +198,8 @@ func (c TLSSetting) loadTLSConfig() (*tls.Config, error) {
if err != nil {
return nil, fmt.Errorf("failed to load TLS cert and key: %w", err)
}
- getCertificate = func(chi *tls.ClientHelloInfo) (*tls.Certificate, error) { return certReloader.GetCertificate() }
- getClientCertificate = func(cri *tls.CertificateRequestInfo) (*tls.Certificate, error) { return certReloader.GetCertificate() }
+ getCertificate = func(*tls.ClientHelloInfo) (*tls.Certificate, error) { return certReloader.GetCertificate() }
+ getClientCertificate = func(*tls.CertificateRequestInfo) (*tls.Certificate, error) { return certReloader.GetCertificate() }
}
minTLS, err := convertVersion(c.MinVersion, defaultMinTLSVersion)
@@ -215,7 +244,7 @@ func convertCipherSuites(cipherSuites []string) ([]uint16, error) {
return result, errors.Join(errs...)
}
-func (c TLSSetting) loadCACertPool() (*x509.CertPool, error) {
+func (c Config) loadCACertPool() (*x509.CertPool, error) {
// There is no need to load the System Certs for RootCAs because
// if the value is nil, it will default to checking against th System Certs.
var err error
@@ -241,7 +270,7 @@ func (c TLSSetting) loadCACertPool() (*x509.CertPool, error) {
return certPool, nil
}
-func (c TLSSetting) loadCertFile(certPath string) (*x509.CertPool, error) {
+func (c Config) loadCertFile(certPath string) (*x509.CertPool, error) {
certPem, err := os.ReadFile(filepath.Clean(certPath))
if err != nil {
return nil, fmt.Errorf("failed to load cert %s: %w", certPath, err)
@@ -250,15 +279,24 @@ func (c TLSSetting) loadCertFile(certPath string) (*x509.CertPool, error) {
return c.loadCertPem(certPem)
}
-func (c TLSSetting) loadCertPem(certPem []byte) (*x509.CertPool, error) {
+func (c Config) loadCertPem(certPem []byte) (*x509.CertPool, error) {
certPool := x509.NewCertPool()
+ if c.IncludeSystemCACertsPool {
+ scp, err := systemCertPool()
+ if err != nil {
+ return nil, err
+ }
+ if scp != nil {
+ certPool = scp
+ }
+ }
if !certPool.AppendCertsFromPEM(certPem) {
return nil, fmt.Errorf("failed to parse cert")
}
return certPool, nil
}
-func (c TLSSetting) loadCertificate() (tls.Certificate, error) {
+func (c Config) loadCertificate() (tls.Certificate, error) {
switch {
case c.hasCert() != c.hasKey():
return tls.Certificate{}, fmt.Errorf("for auth via TLS, provide both certificate and key, or neither")
@@ -298,26 +336,34 @@ func (c TLSSetting) loadCertificate() (tls.Certificate, error) {
return certificate, err
}
-func (c TLSSetting) loadCert(caPath string) (*x509.CertPool, error) {
+func (c Config) loadCert(caPath string) (*x509.CertPool, error) {
caPEM, err := os.ReadFile(filepath.Clean(caPath))
if err != nil {
return nil, fmt.Errorf("failed to load CA %s: %w", caPath, err)
}
- certPool := x509.NewCertPool()
+ var certPool *x509.CertPool
+ if c.IncludeSystemCACertsPool {
+ if certPool, err = systemCertPool(); err != nil {
+ return nil, err
+ }
+ }
+ if certPool == nil {
+ certPool = x509.NewCertPool()
+ }
if !certPool.AppendCertsFromPEM(caPEM) {
return nil, fmt.Errorf("failed to parse CA %s", caPath)
}
return certPool, nil
}
-// LoadTLSConfig loads the TLS configuration.
-func (c TLSClientSetting) LoadTLSConfig() (*tls.Config, error) {
+// LoadTLSConfigContext loads the TLS configuration.
+func (c ClientConfig) LoadTLSConfigContext(_ context.Context) (*tls.Config, error) {
if c.Insecure && !c.hasCA() {
return nil, nil
}
- tlsCfg, err := c.TLSSetting.loadTLSConfig()
+ tlsCfg, err := c.loadTLSConfig()
if err != nil {
return nil, fmt.Errorf("failed to load TLS config: %w", err)
}
@@ -327,7 +373,13 @@ func (c TLSClientSetting) LoadTLSConfig() (*tls.Config, error) {
}
// LoadTLSConfig loads the TLS configuration.
-func (c TLSServerSetting) LoadTLSConfig() (*tls.Config, error) {
+// Deprecated: [v0.97.0] Use LoadTLSConfigContext instead.
+func (c ClientConfig) LoadTLSConfig() (*tls.Config, error) {
+ return c.LoadTLSConfigContext(context.Background())
+}
+
+// LoadTLSConfigContext loads the TLS configuration.
+func (c ServerConfig) LoadTLSConfigContext(_ context.Context) (*tls.Config, error) {
tlsCfg, err := c.loadTLSConfig()
if err != nil {
return nil, fmt.Errorf("failed to load TLS config: %w", err)
@@ -342,7 +394,7 @@ func (c TLSServerSetting) LoadTLSConfig() (*tls.Config, error) {
if err != nil {
return nil, err
}
- tlsCfg.GetConfigForClient = func(t *tls.ClientHelloInfo) (*tls.Config, error) { return reloader.getClientConfig(tlsCfg) }
+ tlsCfg.GetConfigForClient = func(*tls.ClientHelloInfo) (*tls.Config, error) { return reloader.getClientConfig(tlsCfg) }
}
tlsCfg.ClientCAs = reloader.certPool
tlsCfg.ClientAuth = tls.RequireAndVerifyClientCert
@@ -350,22 +402,28 @@ func (c TLSServerSetting) LoadTLSConfig() (*tls.Config, error) {
return tlsCfg, nil
}
-func (c TLSServerSetting) loadClientCAFile() (*x509.CertPool, error) {
+// LoadTLSConfig loads the TLS configuration.
+// Deprecated: [v0.97.0] Use LoadTLSConfigContext instead.
+func (c ServerConfig) LoadTLSConfig() (*tls.Config, error) {
+ return c.LoadTLSConfigContext(context.Background())
+}
+
+func (c ServerConfig) loadClientCAFile() (*x509.CertPool, error) {
return c.loadCert(c.ClientCAFile)
}
-func (c TLSSetting) hasCA() bool { return c.hasCAFile() || c.hasCAPem() }
-func (c TLSSetting) hasCert() bool { return c.hasCertFile() || c.hasCertPem() }
-func (c TLSSetting) hasKey() bool { return c.hasKeyFile() || c.hasKeyPem() }
+func (c Config) hasCA() bool { return c.hasCAFile() || c.hasCAPem() }
+func (c Config) hasCert() bool { return c.hasCertFile() || c.hasCertPem() }
+func (c Config) hasKey() bool { return c.hasKeyFile() || c.hasKeyPem() }
-func (c TLSSetting) hasCAFile() bool { return c.CAFile != "" }
-func (c TLSSetting) hasCAPem() bool { return len(c.CAPem) != 0 }
+func (c Config) hasCAFile() bool { return c.CAFile != "" }
+func (c Config) hasCAPem() bool { return len(c.CAPem) != 0 }
-func (c TLSSetting) hasCertFile() bool { return c.CertFile != "" }
-func (c TLSSetting) hasCertPem() bool { return len(c.CertPem) != 0 }
+func (c Config) hasCertFile() bool { return c.CertFile != "" }
+func (c Config) hasCertPem() bool { return len(c.CertPem) != 0 }
-func (c TLSSetting) hasKeyFile() bool { return c.KeyFile != "" }
-func (c TLSSetting) hasKeyPem() bool { return len(c.KeyPem) != 0 }
+func (c Config) hasKeyFile() bool { return c.KeyFile != "" }
+func (c Config) hasKeyPem() bool { return len(c.KeyPem) != 0 }
func convertVersion(v string, defaultVersion uint16) (uint16, error) {
// Use a default that is explicitly defined
diff --git a/config/configtls/configtls_test.go b/config/configtls/configtls_test.go
index ca705434810..b6c26cb0beb 100644
--- a/config/configtls/configtls_test.go
+++ b/config/configtls/configtls_test.go
@@ -4,8 +4,10 @@
package configtls
import (
+ "context"
"crypto/tls"
"crypto/x509"
+ "errors"
"fmt"
"io"
"os"
@@ -22,30 +24,34 @@ import (
func TestOptionsToConfig(t *testing.T) {
tests := []struct {
name string
- options TLSSetting
+ options Config
expectError string
}{
{
name: "should load system CA",
- options: TLSSetting{CAFile: ""},
+ options: Config{CAFile: ""},
},
{
name: "should load custom CA",
- options: TLSSetting{CAFile: filepath.Join("testdata", "ca-1.crt")},
+ options: Config{CAFile: filepath.Join("testdata", "ca-1.crt")},
+ },
+ {
+ name: "should load system CA and custom CA",
+ options: Config{IncludeSystemCACertsPool: true, CAFile: filepath.Join("testdata", "ca-1.crt")},
},
{
name: "should fail with invalid CA file path",
- options: TLSSetting{CAFile: filepath.Join("testdata", "not/valid")},
+ options: Config{CAFile: filepath.Join("testdata", "not/valid")},
expectError: "failed to load CA",
},
{
name: "should fail with invalid CA file content",
- options: TLSSetting{CAFile: filepath.Join("testdata", "testCA-bad.txt")},
+ options: Config{CAFile: filepath.Join("testdata", "testCA-bad.txt")},
expectError: "failed to parse cert",
},
{
name: "should load valid TLS settings",
- options: TLSSetting{
+ options: Config{
CAFile: filepath.Join("testdata", "ca-1.crt"),
CertFile: filepath.Join("testdata", "server-1.crt"),
KeyFile: filepath.Join("testdata", "server-1.key"),
@@ -53,7 +59,7 @@ func TestOptionsToConfig(t *testing.T) {
},
{
name: "should fail with missing TLS KeyFile",
- options: TLSSetting{
+ options: Config{
CAFile: filepath.Join("testdata", "ca-1.crt"),
CertFile: filepath.Join("testdata", "server-1.crt"),
},
@@ -61,7 +67,7 @@ func TestOptionsToConfig(t *testing.T) {
},
{
name: "should fail with invalid TLS KeyFile",
- options: TLSSetting{
+ options: Config{
CAFile: filepath.Join("testdata", "ca-1.crt"),
CertFile: filepath.Join("testdata", "server-1.crt"),
KeyFile: filepath.Join("testdata", "not/valid"),
@@ -70,7 +76,7 @@ func TestOptionsToConfig(t *testing.T) {
},
{
name: "should fail with missing TLS Cert",
- options: TLSSetting{
+ options: Config{
CAFile: filepath.Join("testdata", "ca-1.crt"),
KeyFile: filepath.Join("testdata", "server-1.key"),
},
@@ -78,7 +84,7 @@ func TestOptionsToConfig(t *testing.T) {
},
{
name: "should fail with invalid TLS Cert",
- options: TLSSetting{
+ options: Config{
CAFile: filepath.Join("testdata", "ca-1.crt"),
CertFile: filepath.Join("testdata", "not/valid"),
KeyFile: filepath.Join("testdata", "server-1.key"),
@@ -87,52 +93,52 @@ func TestOptionsToConfig(t *testing.T) {
},
{
name: "should fail with invalid TLS CA",
- options: TLSSetting{
+ options: Config{
CAFile: filepath.Join("testdata", "not/valid"),
},
expectError: "failed to load CA",
},
{
name: "should fail with invalid CA pool",
- options: TLSSetting{
+ options: Config{
CAFile: filepath.Join("testdata", "testCA-bad.txt"),
},
expectError: "failed to parse cert",
},
{
name: "should pass with valid CA pool",
- options: TLSSetting{
+ options: Config{
CAFile: filepath.Join("testdata", "ca-1.crt"),
},
},
{
name: "should pass with valid min and max version",
- options: TLSSetting{
+ options: Config{
MinVersion: "1.1",
MaxVersion: "1.2",
},
},
{
name: "should pass with invalid min",
- options: TLSSetting{
+ options: Config{
MinVersion: "1.7",
},
expectError: "invalid TLS min_",
},
{
name: "should pass with invalid max",
- options: TLSSetting{
+ options: Config{
MaxVersion: "1.7",
},
expectError: "invalid TLS max_",
},
{
name: "should load custom CA PEM",
- options: TLSSetting{CAPem: readFilePanics("testdata/ca-1.crt")},
+ options: Config{CAPem: readFilePanics("testdata/ca-1.crt")},
},
{
name: "should load valid TLS settings with PEMs",
- options: TLSSetting{
+ options: Config{
CAPem: readFilePanics("testdata/ca-1.crt"),
CertPem: readFilePanics("testdata/server-1.crt"),
KeyPem: readFilePanics("testdata/server-1.key"),
@@ -140,26 +146,26 @@ func TestOptionsToConfig(t *testing.T) {
},
{
name: "mix Cert file and Key PEM provided",
- options: TLSSetting{
+ options: Config{
CertFile: "testdata/server-1.crt",
KeyPem: readFilePanics("testdata/server-1.key"),
},
},
{
name: "mix Cert PEM and Key File provided",
- options: TLSSetting{
+ options: Config{
CertPem: readFilePanics("testdata/server-1.crt"),
KeyFile: "testdata/server-1.key",
},
},
{
name: "should fail with invalid CA PEM",
- options: TLSSetting{CAPem: readFilePanics("testdata/testCA-bad.txt")},
+ options: Config{CAPem: readFilePanics("testdata/testCA-bad.txt")},
expectError: "failed to parse cert",
},
{
name: "should fail CA file and PEM both provided",
- options: TLSSetting{
+ options: Config{
CAFile: "testdata/ca-1.crt",
CAPem: readFilePanics("testdata/ca-1.crt"),
},
@@ -167,7 +173,7 @@ func TestOptionsToConfig(t *testing.T) {
},
{
name: "should fail Cert file and PEM both provided",
- options: TLSSetting{
+ options: Config{
CertFile: "testdata/server-1.crt",
CertPem: readFilePanics("testdata/server-1.crt"),
KeyFile: "testdata/server-1.key",
@@ -176,7 +182,7 @@ func TestOptionsToConfig(t *testing.T) {
},
{
name: "should fail Key file and PEM both provided",
- options: TLSSetting{
+ options: Config{
CertFile: "testdata/server-1.crt",
KeyFile: "testdata/ca-1.crt",
KeyPem: readFilePanics("testdata/server-1.key"),
@@ -185,7 +191,7 @@ func TestOptionsToConfig(t *testing.T) {
},
{
name: "should fail to load valid TLS settings with bad Cert PEM",
- options: TLSSetting{
+ options: Config{
CAPem: readFilePanics("testdata/ca-1.crt"),
CertPem: readFilePanics("testdata/testCA-bad.txt"),
KeyPem: readFilePanics("testdata/server-1.key"),
@@ -194,7 +200,7 @@ func TestOptionsToConfig(t *testing.T) {
},
{
name: "should fail to load valid TLS settings with bad Key PEM",
- options: TLSSetting{
+ options: Config{
CAPem: readFilePanics("testdata/ca-1.crt"),
CertPem: readFilePanics("testdata/server-1.crt"),
KeyPem: readFilePanics("testdata/testCA-bad.txt"),
@@ -203,7 +209,7 @@ func TestOptionsToConfig(t *testing.T) {
},
{
name: "should fail with missing TLS KeyPem",
- options: TLSSetting{
+ options: Config{
CAPem: readFilePanics("testdata/ca-1.crt"),
CertPem: readFilePanics("testdata/server-1.crt"),
},
@@ -211,7 +217,7 @@ func TestOptionsToConfig(t *testing.T) {
},
{
name: "should fail with missing TLS Cert PEM",
- options: TLSSetting{
+ options: Config{
CAPem: readFilePanics("testdata/ca-1.crt"),
KeyPem: readFilePanics("testdata/server-1.key"),
},
@@ -243,58 +249,58 @@ func readFilePanics(filePath string) configopaque.String {
}
func TestLoadTLSClientConfigError(t *testing.T) {
- tlsSetting := TLSClientSetting{
- TLSSetting: TLSSetting{
+ tlsSetting := ClientConfig{
+ Config: Config{
CertFile: "doesnt/exist",
KeyFile: "doesnt/exist",
},
}
- _, err := tlsSetting.LoadTLSConfig()
+ _, err := tlsSetting.LoadTLSConfigContext(context.Background())
assert.Error(t, err)
}
func TestLoadTLSClientConfig(t *testing.T) {
- tlsSetting := TLSClientSetting{
+ tlsSetting := ClientConfig{
Insecure: true,
}
- tlsCfg, err := tlsSetting.LoadTLSConfig()
+ tlsCfg, err := tlsSetting.LoadTLSConfigContext(context.Background())
assert.NoError(t, err)
assert.Nil(t, tlsCfg)
- tlsSetting = TLSClientSetting{}
- tlsCfg, err = tlsSetting.LoadTLSConfig()
+ tlsSetting = ClientConfig{}
+ tlsCfg, err = tlsSetting.LoadTLSConfigContext(context.Background())
assert.NoError(t, err)
assert.NotNil(t, tlsCfg)
- tlsSetting = TLSClientSetting{
+ tlsSetting = ClientConfig{
InsecureSkipVerify: true,
}
- tlsCfg, err = tlsSetting.LoadTLSConfig()
+ tlsCfg, err = tlsSetting.LoadTLSConfigContext(context.Background())
assert.NoError(t, err)
assert.NotNil(t, tlsCfg)
assert.True(t, tlsCfg.InsecureSkipVerify)
}
func TestLoadTLSServerConfigError(t *testing.T) {
- tlsSetting := TLSServerSetting{
- TLSSetting: TLSSetting{
+ tlsSetting := ServerConfig{
+ Config: Config{
CertFile: "doesnt/exist",
KeyFile: "doesnt/exist",
},
}
- _, err := tlsSetting.LoadTLSConfig()
+ _, err := tlsSetting.LoadTLSConfigContext(context.Background())
assert.Error(t, err)
- tlsSetting = TLSServerSetting{
+ tlsSetting = ServerConfig{
ClientCAFile: "doesnt/exist",
}
- _, err = tlsSetting.LoadTLSConfig()
+ _, err = tlsSetting.LoadTLSConfigContext(context.Background())
assert.Error(t, err)
}
func TestLoadTLSServerConfig(t *testing.T) {
- tlsSetting := TLSServerSetting{}
- tlsCfg, err := tlsSetting.LoadTLSConfig()
+ tlsSetting := ServerConfig{}
+ tlsCfg, err := tlsSetting.LoadTLSConfigContext(context.Background())
assert.NoError(t, err)
assert.NotNil(t, tlsCfg)
}
@@ -305,12 +311,12 @@ func TestLoadTLSServerConfigReload(t *testing.T) {
overwriteClientCA(t, tmpCaPath, "ca-1.crt")
- tlsSetting := TLSServerSetting{
+ tlsSetting := ServerConfig{
ClientCAFile: tmpCaPath,
ReloadClientCAFile: true,
}
- tlsCfg, err := tlsSetting.LoadTLSConfig()
+ tlsCfg, err := tlsSetting.LoadTLSConfigContext(context.Background())
assert.NoError(t, err)
assert.NotNil(t, tlsCfg)
@@ -336,12 +342,12 @@ func TestLoadTLSServerConfigFailingReload(t *testing.T) {
overwriteClientCA(t, tmpCaPath, "ca-1.crt")
- tlsSetting := TLSServerSetting{
+ tlsSetting := ServerConfig{
ClientCAFile: tmpCaPath,
ReloadClientCAFile: true,
}
- tlsCfg, err := tlsSetting.LoadTLSConfig()
+ tlsCfg, err := tlsSetting.LoadTLSConfigContext(context.Background())
assert.NoError(t, err)
assert.NotNil(t, tlsCfg)
@@ -367,12 +373,12 @@ func TestLoadTLSServerConfigFailingInitialLoad(t *testing.T) {
overwriteClientCA(t, tmpCaPath, "testCA-bad.txt")
- tlsSetting := TLSServerSetting{
+ tlsSetting := ServerConfig{
ClientCAFile: tmpCaPath,
ReloadClientCAFile: true,
}
- tlsCfg, err := tlsSetting.LoadTLSConfig()
+ tlsCfg, err := tlsSetting.LoadTLSConfigContext(context.Background())
assert.Error(t, err)
assert.Nil(t, tlsCfg)
}
@@ -381,12 +387,12 @@ func TestLoadTLSServerConfigWrongPath(t *testing.T) {
tmpCaPath := createTempClientCaFile(t)
- tlsSetting := TLSServerSetting{
+ tlsSetting := ServerConfig{
ClientCAFile: tmpCaPath + "wrong-path",
ReloadClientCAFile: true,
}
- tlsCfg, err := tlsSetting.LoadTLSConfig()
+ tlsCfg, err := tlsSetting.LoadTLSConfigContext(context.Background())
assert.Error(t, err)
assert.Nil(t, tlsCfg)
}
@@ -397,12 +403,12 @@ func TestLoadTLSServerConfigFailing(t *testing.T) {
overwriteClientCA(t, tmpCaPath, "ca-1.crt")
- tlsSetting := TLSServerSetting{
+ tlsSetting := ServerConfig{
ClientCAFile: tmpCaPath,
ReloadClientCAFile: true,
}
- tlsCfg, err := tlsSetting.LoadTLSConfig()
+ tlsCfg, err := tlsSetting.LoadTLSConfigContext(context.Background())
assert.NoError(t, err)
assert.NotNil(t, tlsCfg)
@@ -443,7 +449,7 @@ func createTempClientCaFile(t *testing.T) string {
}
func TestEagerlyLoadCertificate(t *testing.T) {
- options := TLSSetting{
+ options := Config{
CertFile: filepath.Join("testdata", "client-1.crt"),
KeyFile: filepath.Join("testdata", "client-1.key"),
}
@@ -530,7 +536,7 @@ func TestCertificateReload(t *testing.T) {
assert.NoError(t, err)
assert.NoError(t, fdk.Close())
- options := TLSSetting{
+ options := Config{
CertFile: certFile.Name(),
KeyFile: keyFile.Name(),
ReloadInterval: test.reloadInterval,
@@ -611,7 +617,7 @@ func TestMinMaxTLSVersions(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
- setting := TLSSetting{
+ setting := Config{
MinVersion: test.minVersion,
MaxVersion: test.maxVersion,
}
@@ -628,35 +634,66 @@ func TestMinMaxTLSVersions(t *testing.T) {
}
}
+func TestConfigValidate(t *testing.T) {
+ tests := []struct {
+ name string
+ tlsConfig Config
+ errorTxt string
+ }{
+ {name: `TLS Config ["", ""] to be valid`, tlsConfig: Config{MinVersion: "", MaxVersion: ""}},
+ {name: `TLS Config ["", "1.3"] to be valid`, tlsConfig: Config{MinVersion: "", MaxVersion: "1.3"}},
+ {name: `TLS Config ["1.2", ""] to be valid`, tlsConfig: Config{MinVersion: "1.2", MaxVersion: ""}},
+ {name: `TLS Config ["1.3", "1.3"] to be valid`, tlsConfig: Config{MinVersion: "1.3", MaxVersion: "1.3"}},
+ {name: `TLS Config ["1.0", "1.1"] to be valid`, tlsConfig: Config{MinVersion: "1.0", MaxVersion: "1.1"}},
+ {name: `TLS Config ["asd", ""] to give [Error]`, tlsConfig: Config{MinVersion: "asd", MaxVersion: ""}, errorTxt: `invalid TLS min_version: unsupported TLS version: "asd"`},
+ {name: `TLS Config ["", "asd"] to give [Error]`, tlsConfig: Config{MinVersion: "", MaxVersion: "asd"}, errorTxt: `invalid TLS max_version: unsupported TLS version: "asd"`},
+ {name: `TLS Config ["0.4", ""] to give [Error]`, tlsConfig: Config{MinVersion: "0.4", MaxVersion: ""}, errorTxt: `invalid TLS min_version: unsupported TLS version: "0.4"`},
+ {name: `TLS Config ["1.2", "1.1"] to give [Error]`, tlsConfig: Config{MinVersion: "1.2", MaxVersion: "1.1"}, errorTxt: `invalid TLS configuration: min_version cannot be greater than max_version`},
+ {name: `TLS Config with both CA File and PEM`, tlsConfig: Config{CAFile: "test", CAPem: "test"}, errorTxt: `provide either a CA file or the PEM-encoded string, but not both`},
+ }
+
+ for _, test := range tests {
+ t.Run(test.name, func(t *testing.T) {
+ err := test.tlsConfig.Validate()
+
+ if test.errorTxt == "" {
+ assert.Nil(t, err)
+ } else {
+ assert.EqualError(t, err, test.errorTxt)
+ }
+ })
+ }
+}
+
func TestCipherSuites(t *testing.T) {
tests := []struct {
name string
- tlsSetting TLSSetting
+ tlsSetting Config
wantErr string
result []uint16
}{
{
name: "no suites set",
- tlsSetting: TLSSetting{},
+ tlsSetting: Config{},
result: nil,
},
{
name: "one cipher suite set",
- tlsSetting: TLSSetting{
+ tlsSetting: Config{
CipherSuites: []string{"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA"},
},
result: []uint16{tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA},
},
{
name: "invalid cipher suite set",
- tlsSetting: TLSSetting{
+ tlsSetting: Config{
CipherSuites: []string{"FOO"},
},
wantErr: `invalid TLS cipher suite: "FOO"`,
},
{
name: "multiple invalid cipher suites set",
- tlsSetting: TLSSetting{
+ tlsSetting: Config{
CipherSuites: []string{"FOO", "BAR"},
},
wantErr: `invalid TLS cipher suite: "FOO"
@@ -676,3 +713,145 @@ invalid TLS cipher suite: "BAR"`,
})
}
}
+
+func TestSystemCertPool(t *testing.T) {
+ anError := errors.New("my error")
+ tests := []struct {
+ name string
+ tlsConfig Config
+ wantErr error
+ systemCertFn func() (*x509.CertPool, error)
+ }{
+ {
+ name: "not using system cert pool",
+ tlsConfig: Config{
+ IncludeSystemCACertsPool: false,
+ CAFile: filepath.Join("testdata", "ca-1.crt"),
+ },
+ wantErr: nil,
+ systemCertFn: x509.SystemCertPool,
+ },
+ {
+ name: "using system cert pool",
+ tlsConfig: Config{
+ IncludeSystemCACertsPool: true,
+ CAFile: filepath.Join("testdata", "ca-1.crt"),
+ },
+ wantErr: nil,
+ systemCertFn: x509.SystemCertPool,
+ },
+ {
+ name: "error loading system cert pool",
+ tlsConfig: Config{
+ IncludeSystemCACertsPool: true,
+ CAFile: filepath.Join("testdata", "ca-1.crt"),
+ },
+ wantErr: anError,
+ systemCertFn: func() (*x509.CertPool, error) {
+ return nil, anError
+ },
+ },
+ {
+ name: "nil system cert pool",
+ tlsConfig: Config{
+ IncludeSystemCACertsPool: true,
+ CAFile: filepath.Join("testdata", "ca-1.crt"),
+ },
+ wantErr: nil,
+ systemCertFn: func() (*x509.CertPool, error) {
+ return nil, nil
+ },
+ },
+ }
+ for _, test := range tests {
+ t.Run(test.name, func(t *testing.T) {
+ oldSystemCertPool := systemCertPool
+ systemCertPool = test.systemCertFn
+ defer func() {
+ systemCertPool = oldSystemCertPool
+ }()
+
+ serverConfig := ServerConfig{
+ Config: test.tlsConfig,
+ }
+ c, err := serverConfig.LoadTLSConfig()
+ if test.wantErr != nil {
+ assert.ErrorContains(t, err, test.wantErr.Error())
+ } else {
+ assert.NotNil(t, c.RootCAs)
+ }
+
+ clientConfig := ClientConfig{
+ Config: test.tlsConfig,
+ }
+ c, err = clientConfig.LoadTLSConfig()
+ if test.wantErr != nil {
+ assert.ErrorContains(t, err, test.wantErr.Error())
+ } else {
+ assert.NotNil(t, c.RootCAs)
+ }
+ })
+ }
+}
+
+func TestSystemCertPool_loadCert(t *testing.T) {
+ anError := errors.New("my error")
+ tests := []struct {
+ name string
+ tlsConfig Config
+ wantErr error
+ systemCertFn func() (*x509.CertPool, error)
+ }{
+ {
+ name: "not using system cert pool",
+ tlsConfig: Config{
+ IncludeSystemCACertsPool: false,
+ },
+ wantErr: nil,
+ systemCertFn: x509.SystemCertPool,
+ },
+ {
+ name: "using system cert pool",
+ tlsConfig: Config{
+ IncludeSystemCACertsPool: true,
+ },
+ wantErr: nil,
+ systemCertFn: x509.SystemCertPool,
+ },
+ {
+ name: "error loading system cert pool",
+ tlsConfig: Config{
+ IncludeSystemCACertsPool: true,
+ },
+ wantErr: anError,
+ systemCertFn: func() (*x509.CertPool, error) {
+ return nil, anError
+ },
+ },
+ {
+ name: "nil system cert pool",
+ tlsConfig: Config{
+ IncludeSystemCACertsPool: true,
+ },
+ wantErr: nil,
+ systemCertFn: func() (*x509.CertPool, error) {
+ return nil, nil
+ },
+ },
+ }
+ for _, test := range tests {
+ t.Run(test.name, func(t *testing.T) {
+ oldSystemCertPool := systemCertPool
+ systemCertPool = test.systemCertFn
+ defer func() {
+ systemCertPool = oldSystemCertPool
+ }()
+ certPool, err := test.tlsConfig.loadCert(filepath.Join("testdata", "ca-1.crt"))
+ if test.wantErr != nil {
+ assert.Equal(t, test.wantErr, err)
+ } else {
+ assert.NotNil(t, certPool)
+ }
+ })
+ }
+}
diff --git a/config/configtls/go.mod b/config/configtls/go.mod
index 5d13acf23fe..2c08e884878 100644
--- a/config/configtls/go.mod
+++ b/config/configtls/go.mod
@@ -1,11 +1,11 @@
module go.opentelemetry.io/collector/config/configtls
-go 1.20
+go 1.21
require (
github.com/fsnotify/fsnotify v1.7.0
- github.com/stretchr/testify v1.8.4
- go.opentelemetry.io/collector/config/configopaque v0.93.0
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector/config/configopaque v1.4.0
)
require (
diff --git a/config/configtls/go.sum b/config/configtls/go.sum
index 5f8dd9a79cb..9f31b005f5c 100644
--- a/config/configtls/go.sum
+++ b/config/configtls/go.sum
@@ -3,25 +3,38 @@ 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/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-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/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/v2 v2.0.1 h1:1dYGITt1I23x8cfx8ZnldtezdyaZtfAuRtIFOiRzK7g=
+github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU=
+github.com/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE=
+github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
+github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
-github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
-github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
+go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
+go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/config/internal/go.mod b/config/internal/go.mod
index 657944d11c8..ea86a9a5207 100644
--- a/config/internal/go.mod
+++ b/config/internal/go.mod
@@ -1,19 +1,19 @@
module go.opentelemetry.io/collector/config/internal
-go 1.20
+go 1.21
require (
- github.com/stretchr/testify v1.8.4
- go.opentelemetry.io/collector v0.93.0
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector v0.97.0
go.uber.org/goleak v1.3.0
- go.uber.org/zap v1.26.0
+ go.uber.org/zap v1.27.0
)
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
- go.opentelemetry.io/collector/featuregate v1.0.1 // indirect
+ go.opentelemetry.io/collector/featuregate v1.4.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/config/internal/go.sum b/config/internal/go.sum
index d06a0e0bd77..c961debf0d0 100644
--- a/config/internal/go.sum
+++ b/config/internal/go.sum
@@ -3,19 +3,23 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
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/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
-github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
-github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
-go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
-go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/config/internal/warning.go b/config/internal/warning.go
index 28d55bfd4dc..f9e32fc1c64 100644
--- a/config/internal/warning.go
+++ b/config/internal/warning.go
@@ -38,7 +38,7 @@ func shouldWarn(endpoint string) bool {
// WarnOnUnspecifiedHost emits a warning if an endpoint has an unspecified host.
func WarnOnUnspecifiedHost(logger *zap.Logger, endpoint string) {
- if shouldWarn(endpoint) {
+ if !localhostgate.UseLocalHostAsDefaultHostfeatureGate.IsEnabled() && shouldWarn(endpoint) {
logger.Warn(
"Using the 0.0.0.0 address exposes this server to every network interface, which may facilitate Denial of Service attacks. Enable the feature gate to change the default and remove this warning.",
zap.String(
diff --git a/confmap/confmap.go b/confmap/confmap.go
index 9817694dd63..5bd6d356016 100644
--- a/confmap/confmap.go
+++ b/confmap/confmap.go
@@ -5,13 +5,16 @@ package confmap // import "go.opentelemetry.io/collector/confmap"
import (
"encoding"
+ "errors"
"fmt"
"reflect"
+ "slices"
+ "strings"
+ "github.com/go-viper/mapstructure/v2"
"github.com/knadh/koanf/maps"
"github.com/knadh/koanf/providers/confmap"
"github.com/knadh/koanf/v2"
- "github.com/mitchellh/mapstructure"
encoder "go.opentelemetry.io/collector/confmap/internal/mapstructure"
)
@@ -54,16 +57,6 @@ type unmarshalOption struct {
ignoreUnused bool
}
-// WithErrorUnused sets an option to error when there are existing
-// keys in the original Conf that were unused in the decoding process
-// (extra keys). This option is enabled by default and can be disabled with `WithIgnoreUnused`.
-// Deprecated: [v0.92.0] this is now enabled by default. Use `WithIgnoreUnused` to disable.
-func WithErrorUnused() UnmarshalOption {
- return unmarshalOptionFunc(func(uo *unmarshalOption) {
- uo.ignoreUnused = false
- })
-}
-
// WithIgnoreUnused sets an option to ignore errors if existing
// keys in the original Conf were unused in the decoding process
// (extra keys).
@@ -167,6 +160,9 @@ func decodeConfig(m *Conf, result any, errorUnused bool) error {
mapstructure.StringToTimeDurationHookFunc(),
mapstructure.TextUnmarshallerHookFunc(),
unmarshalerHookFunc(result),
+ // after the main unmarshaler hook is called,
+ // we unmarshal the embedded structs if present to merge with the result:
+ unmarshalerEmbeddedStructsHookFunc(),
zeroSliceHookFunc(),
),
}
@@ -174,7 +170,13 @@ func decodeConfig(m *Conf, result any, errorUnused bool) error {
if err != nil {
return err
}
- return decoder.Decode(m.ToStringMap())
+ if err = decoder.Decode(m.ToStringMap()); err != nil {
+ if strings.HasPrefix(err.Error(), "error decoding ''") {
+ return errors.Unwrap(err)
+ }
+ return err
+ }
+ return nil
}
// encoderConfig returns a default encoder.EncoderConfig that includes
@@ -271,6 +273,43 @@ func mapKeyStringToMapKeyTextUnmarshalerHookFunc() mapstructure.DecodeHookFuncTy
}
}
+// unmarshalerEmbeddedStructsHookFunc provides a mechanism for embedded structs to define their own unmarshal logic,
+// by implementing the Unmarshaler interface.
+func unmarshalerEmbeddedStructsHookFunc() mapstructure.DecodeHookFuncValue {
+ return func(from reflect.Value, to reflect.Value) (any, error) {
+ if to.Type().Kind() != reflect.Struct {
+ return from.Interface(), nil
+ }
+ fromAsMap, ok := from.Interface().(map[string]any)
+ if !ok {
+ return from.Interface(), nil
+ }
+ for i := 0; i < to.Type().NumField(); i++ {
+ // embedded structs passed in via `squash` cannot be pointers. We just check if they are structs:
+ f := to.Type().Field(i)
+ if f.IsExported() && slices.Contains(strings.Split(f.Tag.Get("mapstructure"), ","), "squash") {
+ if unmarshaler, ok := to.Field(i).Addr().Interface().(Unmarshaler); ok {
+ if err := unmarshaler.Unmarshal(NewFromStringMap(fromAsMap)); err != nil {
+ return nil, err
+ }
+ // the struct we receive from this unmarshaling only contains fields related to the embedded struct.
+ // we merge this partially unmarshaled struct with the rest of the result.
+ // note we already unmarshaled the main struct earlier, and therefore merge with it.
+ conf := New()
+ if err := conf.Marshal(unmarshaler); err != nil {
+ return nil, err
+ }
+ resultMap := conf.ToStringMap()
+ for k, v := range resultMap {
+ fromAsMap[k] = v
+ }
+ }
+ }
+ }
+ return fromAsMap, nil
+ }
+}
+
// Provides a mechanism for individual structs to define their own unmarshal logic,
// by implementing the Unmarshaler interface.
func unmarshalerHookFunc(result any) mapstructure.DecodeHookFuncValue {
diff --git a/confmap/confmap_test.go b/confmap/confmap_test.go
index 7cfab3fb4cb..c334b7d18b9 100644
--- a/confmap/confmap_test.go
+++ b/confmap/confmap_test.go
@@ -143,7 +143,7 @@ func TestExpandNilStructPointersHookFuncDefaultNotNilConfigNil(t *testing.T) {
assert.Equal(t, &Struct{}, cfg.MapStruct["struct"])
}
-func TestUnmarshalWithErrorUnused(t *testing.T) {
+func TestUnmarshalWithIgnoreUnused(t *testing.T) {
stringMap := map[string]any{
"boolean": true,
"string": "this is a string",
@@ -309,8 +309,78 @@ func newConfFromFile(t testing.TB, fileName string) map[string]any {
}
type testConfig struct {
- Next *nextConfig `mapstructure:"next"`
- Another string `mapstructure:"another"`
+ Next *nextConfig `mapstructure:"next"`
+ Another string `mapstructure:"another"`
+ EmbeddedConfig `mapstructure:",squash"`
+ EmbeddedConfig2 `mapstructure:",squash"`
+}
+
+type testConfigWithoutUnmarshaler struct {
+ Next *nextConfig `mapstructure:"next"`
+ Another string `mapstructure:"another"`
+ EmbeddedConfig `mapstructure:",squash"`
+ EmbeddedConfig2 `mapstructure:",squash"`
+}
+
+type testConfigWithEmbeddedError struct {
+ Next *nextConfig `mapstructure:"next"`
+ Another string `mapstructure:"another"`
+ EmbeddedConfigWithError `mapstructure:",squash"`
+}
+
+type testConfigWithMarshalError struct {
+ Next *nextConfig `mapstructure:"next"`
+ Another string `mapstructure:"another"`
+ EmbeddedConfigWithMarshalError `mapstructure:",squash"`
+}
+
+func (tc *testConfigWithEmbeddedError) Unmarshal(component *Conf) error {
+ if err := component.Unmarshal(tc, WithIgnoreUnused()); err != nil {
+ return err
+ }
+ return nil
+}
+
+type EmbeddedConfig struct {
+ Some string `mapstructure:"some"`
+}
+
+func (ec *EmbeddedConfig) Unmarshal(component *Conf) error {
+ if err := component.Unmarshal(ec, WithIgnoreUnused()); err != nil {
+ return err
+ }
+ ec.Some += " is also called"
+ return nil
+}
+
+type EmbeddedConfig2 struct {
+ Some2 string `mapstructure:"some_2"`
+}
+
+func (ec *EmbeddedConfig2) Unmarshal(component *Conf) error {
+ if err := component.Unmarshal(ec, WithIgnoreUnused()); err != nil {
+ return err
+ }
+ ec.Some2 += " also called2"
+ return nil
+}
+
+type EmbeddedConfigWithError struct {
+}
+
+func (ecwe *EmbeddedConfigWithError) Unmarshal(_ *Conf) error {
+ return errors.New("embedded error")
+}
+
+type EmbeddedConfigWithMarshalError struct {
+}
+
+func (ecwe EmbeddedConfigWithMarshalError) Marshal(_ *Conf) error {
+ return errors.New("marshaling error")
+}
+
+func (ecwe EmbeddedConfigWithMarshalError) Unmarshal(_ *Conf) error {
+ return nil
}
func (tc *testConfig) Unmarshal(component *Conf) error {
@@ -340,12 +410,59 @@ func TestUnmarshaler(t *testing.T) {
"string": "make sure this",
},
"another": "make sure this",
+ "some": "make sure this",
+ "some_2": "this better be",
})
tc := &testConfig{}
assert.NoError(t, cfgMap.Unmarshal(tc))
assert.Equal(t, "make sure this", tc.Another)
assert.Equal(t, "make sure this is called", tc.Next.String)
+ assert.Equal(t, "make sure this is also called", tc.EmbeddedConfig.Some)
+ assert.Equal(t, "this better be also called2", tc.EmbeddedConfig2.Some2)
+}
+
+func TestEmbeddedUnmarshaler(t *testing.T) {
+ cfgMap := NewFromStringMap(map[string]any{
+ "next": map[string]any{
+ "string": "make sure this",
+ },
+ "another": "make sure this",
+ "some": "make sure this",
+ "some_2": "this better be",
+ })
+
+ tc := &testConfigWithoutUnmarshaler{}
+ assert.NoError(t, cfgMap.Unmarshal(tc))
+ assert.Equal(t, "make sure this", tc.Another)
+ assert.Equal(t, "make sure this is called", tc.Next.String)
+ assert.Equal(t, "make sure this is also called", tc.EmbeddedConfig.Some)
+ assert.Equal(t, "this better be also called2", tc.EmbeddedConfig2.Some2)
+}
+
+func TestEmbeddedUnmarshalerError(t *testing.T) {
+ cfgMap := NewFromStringMap(map[string]any{
+ "next": map[string]any{
+ "string": "make sure this",
+ },
+ "another": "make sure this",
+ "some": "make sure this",
+ })
+
+ tc := &testConfigWithEmbeddedError{}
+ assert.EqualError(t, cfgMap.Unmarshal(tc), "embedded error")
+}
+
+func TestEmbeddedMarshalerError(t *testing.T) {
+ cfgMap := NewFromStringMap(map[string]any{
+ "next": map[string]any{
+ "string": "make sure this",
+ },
+ "another": "make sure this",
+ })
+
+ tc := &testConfigWithMarshalError{}
+ assert.EqualError(t, cfgMap.Unmarshal(tc), "error running encode hook: marshaling error")
}
func TestUnmarshalerKeepAlreadyInitialized(t *testing.T) {
@@ -394,7 +511,7 @@ type errConfig struct {
Foo string `mapstructure:"foo"`
}
-func (tc *errConfig) Unmarshal(_ *Conf) error {
+func (tc *errConfig) Unmarshal(*Conf) error {
return errors.New("never works")
}
@@ -496,3 +613,148 @@ func TestZeroSliceHookFunc(t *testing.T) {
})
}
}
+
+type C struct {
+ Modifiers []string `mapstructure:"modifiers"`
+}
+
+func (c *C) Unmarshal(conf *Conf) error {
+ if err := conf.Unmarshal(c); err != nil {
+ return err
+ }
+ c.Modifiers = append(c.Modifiers, "C.Unmarshal")
+ return nil
+}
+
+type B struct {
+ Modifiers []string `mapstructure:"modifiers"`
+ C C `mapstructure:"c"`
+}
+
+func (b *B) Unmarshal(conf *Conf) error {
+ if err := conf.Unmarshal(b); err != nil {
+ return err
+ }
+ b.Modifiers = append(b.Modifiers, "B.Unmarshal")
+ b.C.Modifiers = append(b.C.Modifiers, "B.Unmarshal")
+ return nil
+}
+
+type A struct {
+ Modifiers []string `mapstructure:"modifiers"`
+ B B `mapstructure:"b"`
+}
+
+func (a *A) Unmarshal(conf *Conf) error {
+ if err := conf.Unmarshal(a); err != nil {
+ return err
+ }
+ a.Modifiers = append(a.Modifiers, "A.Unmarshal")
+ a.B.Modifiers = append(a.B.Modifiers, "A.Unmarshal")
+ a.B.C.Modifiers = append(a.B.C.Modifiers, "A.Unmarshal")
+ return nil
+}
+
+type Wrapper struct {
+ A A `mapstructure:"a"`
+}
+
+// Test that calling the Unmarshal method on configuration structs is done from the inside out.
+func TestNestedUnmarshalerImplementations(t *testing.T) {
+ conf := NewFromStringMap(map[string]any{"a": map[string]any{
+ "modifiers": []string{"conf.Unmarshal"},
+ "b": map[string]any{
+ "modifiers": []string{"conf.Unmarshal"},
+ "c": map[string]any{
+ "modifiers": []string{"conf.Unmarshal"},
+ },
+ },
+ }})
+
+ // Use a wrapper struct until we deprecate component.UnmarshalConfig
+ w := &Wrapper{}
+ assert.NoError(t, conf.Unmarshal(w))
+
+ a := w.A
+ assert.Equal(t, []string{"conf.Unmarshal", "A.Unmarshal"}, a.Modifiers)
+ assert.Equal(t, []string{"conf.Unmarshal", "B.Unmarshal", "A.Unmarshal"}, a.B.Modifiers)
+ assert.Equal(t, []string{"conf.Unmarshal", "C.Unmarshal", "B.Unmarshal", "A.Unmarshal"}, a.B.C.Modifiers)
+}
+
+// Test that unmarshaling the same conf twice works.
+func TestUnmarshalDouble(t *testing.T) {
+ conf := NewFromStringMap(map[string]any{
+ "str": "test",
+ })
+
+ type Struct struct {
+ Str string `mapstructure:"str"`
+ }
+ s := &Struct{}
+ assert.NoError(t, conf.Unmarshal(s))
+ assert.Equal(t, "test", s.Str)
+
+ type Struct2 struct {
+ Str string `mapstructure:"str"`
+ }
+ s2 := &Struct2{}
+ assert.NoError(t, conf.Unmarshal(s2))
+ assert.Equal(t, "test", s2.Str)
+}
+
+type EmbeddedStructWithUnmarshal struct {
+ Foo string `mapstructure:"foo"`
+ success string
+}
+
+func (e *EmbeddedStructWithUnmarshal) Unmarshal(c *Conf) error {
+ if err := c.Unmarshal(e, WithIgnoreUnused()); err != nil {
+ return err
+ }
+ e.success = "success"
+ return nil
+}
+
+type configWithUnmarshalFromEmbeddedStruct struct {
+ EmbeddedStructWithUnmarshal
+}
+
+type topLevel struct {
+ Cfg *configWithUnmarshalFromEmbeddedStruct `mapstructure:"toplevel"`
+}
+
+// Test that Unmarshal is called on the embedded struct on the struct.
+func TestUnmarshalThroughEmbeddedStruct(t *testing.T) {
+ c := NewFromStringMap(map[string]any{
+ "toplevel": map[string]any{
+ "foo": "bar",
+ },
+ })
+ cfg := &topLevel{}
+ err := c.Unmarshal(cfg)
+ require.NoError(t, err)
+ require.Equal(t, "success", cfg.Cfg.EmbeddedStructWithUnmarshal.success)
+ require.Equal(t, "bar", cfg.Cfg.EmbeddedStructWithUnmarshal.Foo)
+}
+
+type configWithOwnUnmarshalAndEmbeddedSquashedStruct struct {
+ EmbeddedStructWithUnmarshal `mapstructure:",squash"`
+}
+
+type topLevelSquashedEmbedded struct {
+ Cfg *configWithOwnUnmarshalAndEmbeddedSquashedStruct `mapstructure:"toplevel"`
+}
+
+// Test that the Unmarshal method is called on the squashed, embedded struct.
+func TestUnmarshalOwnThroughEmbeddedSquashedStruct(t *testing.T) {
+ c := NewFromStringMap(map[string]any{
+ "toplevel": map[string]any{
+ "foo": "bar",
+ },
+ })
+ cfg := &topLevelSquashedEmbedded{}
+ err := c.Unmarshal(cfg)
+ require.NoError(t, err)
+ require.Equal(t, "success", cfg.Cfg.EmbeddedStructWithUnmarshal.success)
+ require.Equal(t, "bar", cfg.Cfg.EmbeddedStructWithUnmarshal.Foo)
+}
diff --git a/confmap/confmaptest/configtest_test.go b/confmap/confmaptest/configtest_test.go
index 4a885d9655f..151a1c9275a 100644
--- a/confmap/confmaptest/configtest_test.go
+++ b/confmap/confmaptest/configtest_test.go
@@ -54,6 +54,6 @@ func (s schemeProvider) Scheme() string {
return s.scheme
}
-func (s schemeProvider) Shutdown(_ context.Context) error {
+func (s schemeProvider) Shutdown(context.Context) error {
return nil
}
diff --git a/confmap/confmaptest/provider_settings.go b/confmap/confmaptest/provider_settings.go
new file mode 100644
index 00000000000..8d36b36efca
--- /dev/null
+++ b/confmap/confmaptest/provider_settings.go
@@ -0,0 +1,14 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package confmaptest // import "go.opentelemetry.io/collector/confmap/confmaptest"
+
+import (
+ "go.uber.org/zap"
+
+ "go.opentelemetry.io/collector/confmap"
+)
+
+func NewNopProviderSettings() confmap.ProviderSettings {
+ return confmap.ProviderSettings{Logger: zap.NewNop()}
+}
diff --git a/confmap/converter/expandconverter/Makefile b/confmap/converter/expandconverter/Makefile
new file mode 100644
index 00000000000..bdd863a203b
--- /dev/null
+++ b/confmap/converter/expandconverter/Makefile
@@ -0,0 +1 @@
+include ../../../Makefile.Common
diff --git a/confmap/converter/expandconverter/expand.go b/confmap/converter/expandconverter/expand.go
index 0296b4b21ed..4ea461fcf7e 100644
--- a/confmap/converter/expandconverter/expand.go
+++ b/confmap/converter/expandconverter/expand.go
@@ -5,42 +5,54 @@ package expandconverter // import "go.opentelemetry.io/collector/confmap/convert
import (
"context"
+ "fmt"
"os"
+ "regexp"
+
+ "go.uber.org/zap"
"go.opentelemetry.io/collector/confmap"
)
-type converter struct{}
+type converter struct {
+ logger *zap.Logger
+
+ // Record of which env vars we have logged a warning for
+ loggedDeprecations map[string]struct{}
+}
// New returns a confmap.Converter, that expands all environment variables for a given confmap.Conf.
//
// Notice: This API is experimental.
func New(_ confmap.ConverterSettings) confmap.Converter {
- return converter{}
+ return converter{
+ loggedDeprecations: make(map[string]struct{}),
+ logger: zap.NewNop(), // TODO: pass logger in ConverterSettings
+ }
}
-func (converter) Convert(_ context.Context, conf *confmap.Conf) error {
+func (c converter) Convert(_ context.Context, conf *confmap.Conf) error {
out := make(map[string]any)
for _, k := range conf.AllKeys() {
- out[k] = expandStringValues(conf.Get(k))
+ out[k] = c.expandStringValues(conf.Get(k))
}
return conf.Merge(confmap.NewFromStringMap(out))
}
-func expandStringValues(value any) any {
+func (c converter) expandStringValues(value any) any {
switch v := value.(type) {
case string:
- return expandEnv(v)
+ return c.expandEnv(v)
case []any:
nslice := make([]any, 0, len(v))
for _, vint := range v {
- nslice = append(nslice, expandStringValues(vint))
+ nslice = append(nslice, c.expandStringValues(vint))
}
return nslice
case map[string]any:
nmap := map[string]any{}
for mk, mv := range v {
- nmap[mk] = expandStringValues(mv)
+ nmap[mk] = c.expandStringValues(mv)
}
return nmap
default:
@@ -48,8 +60,16 @@ func expandStringValues(value any) any {
}
}
-func expandEnv(s string) string {
+func (c converter) expandEnv(s string) string {
return os.Expand(s, func(str string) string {
+ // Matches on $VAR style environment variables
+ // in order to make sure we don't log a warning for ${VAR}
+ var regex = regexp.MustCompile(fmt.Sprintf(`\$%s`, regexp.QuoteMeta(str)))
+ if _, exists := c.loggedDeprecations[str]; !exists && regex.MatchString(s) {
+ msg := fmt.Sprintf("Variable substitution using $VAR will be deprecated in favor of ${VAR} and ${env:VAR}, please update $%s", str)
+ c.logger.Warn(msg, zap.String("variable", str))
+ c.loggedDeprecations[str] = struct{}{}
+ }
// This allows escaping environment variable substitution via $$, e.g.
// - $FOO will be substituted with env var FOO
// - $$FOO will be replaced with $FOO
diff --git a/confmap/converter/expandconverter/expand_test.go b/confmap/converter/expandconverter/expand_test.go
index 731dd52e9b6..7837c2de912 100644
--- a/confmap/converter/expandconverter/expand_test.go
+++ b/confmap/converter/expandconverter/expand_test.go
@@ -5,11 +5,15 @@ package expandconverter
import (
"context"
+ "fmt"
"path/filepath"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+ "go.uber.org/zap"
+ "go.uber.org/zap/zapcore"
+ "go.uber.org/zap/zaptest/observer"
"go.opentelemetry.io/collector/confmap"
"go.opentelemetry.io/collector/confmap/confmaptest"
@@ -159,3 +163,92 @@ func TestNewExpandConverterHostPort(t *testing.T) {
})
}
}
+
+func NewTestConverter() (confmap.Converter, *observer.ObservedLogs) {
+ core, logs := observer.New(zapcore.InfoLevel)
+ conv := converter{loggedDeprecations: make(map[string]struct{}), logger: zap.New(core)}
+ return conv, logs
+}
+
+func TestDeprecatedWarning(t *testing.T) {
+ msgTemplate := `Variable substitution using $VAR will be deprecated in favor of ${VAR} and ${env:VAR}, please update $%s`
+ t.Setenv("HOST", "127.0.0.1")
+ t.Setenv("PORT", "4317")
+
+ t.Setenv("HOST_NAME", "127.0.0.2")
+ t.Setenv("HOST.NAME", "127.0.0.3")
+
+ var testCases = []struct {
+ name string
+ input map[string]any
+ expectedOutput map[string]any
+ expectedWarnings []string
+ }{
+ {
+ name: "no warning",
+ input: map[string]any{
+ "test": "${HOST}:${PORT}",
+ },
+ expectedOutput: map[string]any{
+ "test": "127.0.0.1:4317",
+ },
+ expectedWarnings: []string{},
+ },
+ {
+ name: "one deprecated var",
+ input: map[string]any{
+ "test": "${HOST}:$PORT",
+ },
+ expectedOutput: map[string]any{
+ "test": "127.0.0.1:4317",
+ },
+ expectedWarnings: []string{"PORT"},
+ },
+ {
+ name: "two deprecated vars",
+ input: map[string]any{
+ "test": "$HOST:$PORT",
+ },
+ expectedOutput: map[string]any{
+ "test": "127.0.0.1:4317",
+ },
+ expectedWarnings: []string{"HOST", "PORT"},
+ },
+ {
+ name: "one depracated serveral times",
+ input: map[string]any{
+ "test": "$HOST,$HOST",
+ "test2": "$HOST",
+ },
+ expectedOutput: map[string]any{
+ "test": "127.0.0.1,127.0.0.1",
+ "test2": "127.0.0.1",
+ },
+ expectedWarnings: []string{"HOST"},
+ },
+ {
+ name: "one warning",
+ input: map[string]any{
+ "test": "$HOST_NAME,${HOST.NAME}",
+ },
+ expectedOutput: map[string]any{
+ "test": "127.0.0.2,127.0.0.3",
+ },
+ expectedWarnings: []string{"HOST_NAME"},
+ },
+ }
+ for _, tt := range testCases {
+ t.Run(tt.name, func(t *testing.T) {
+ conf := confmap.NewFromStringMap(tt.input)
+ conv, logs := NewTestConverter()
+ require.NoError(t, conv.Convert(context.Background(), conf))
+
+ assert.Equal(t, tt.expectedOutput, conf.ToStringMap())
+ assert.Equal(t, len(tt.expectedWarnings), len(logs.All()))
+ for i, variable := range tt.expectedWarnings {
+ errorMsg := fmt.Sprintf(msgTemplate, variable)
+ assert.Equal(t, errorMsg, logs.All()[i].Message)
+ }
+ })
+ }
+}
diff --git a/confmap/converter/expandconverter/go.mod b/confmap/converter/expandconverter/go.mod
new file mode 100644
index 00000000000..15b65f060b1
--- /dev/null
+++ b/confmap/converter/expandconverter/go.mod
@@ -0,0 +1,25 @@
+module go.opentelemetry.io/collector/confmap/converter/expandconverter
+
+go 1.21
+
+require (
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector/confmap v0.97.0
+ go.uber.org/goleak v1.3.0
+ go.uber.org/zap v1.27.0
+)
+
+require (
+ github.com/davecgh/go-spew v1.1.1 // indirect
+ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
+ github.com/knadh/koanf/maps v0.1.1 // indirect
+ github.com/knadh/koanf/providers/confmap v0.1.0 // indirect
+ github.com/knadh/koanf/v2 v2.1.0 // indirect
+ github.com/mitchellh/copystructure v1.2.0 // indirect
+ github.com/mitchellh/reflectwalk v1.0.2 // indirect
+ github.com/pmezard/go-difflib v1.0.0 // indirect
+ go.uber.org/multierr v1.11.0 // indirect
+ gopkg.in/yaml.v3 v3.0.1 // indirect
+)
+
+replace go.opentelemetry.io/collector/confmap => ../../
diff --git a/confmap/converter/expandconverter/go.sum b/confmap/converter/expandconverter/go.sum
new file mode 100644
index 00000000000..b6947dd7ac4
--- /dev/null
+++ b/confmap/converter/expandconverter/go.sum
@@ -0,0 +1,33 @@
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
+github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs=
+github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI=
+github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU=
+github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU=
+github.com/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
+github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
+github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
+github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
+github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
+github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
+github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
+github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
+go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
+go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
+go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
+go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/confmap/doc_test.go b/confmap/doc_test.go
new file mode 100644
index 00000000000..d026bc2d733
--- /dev/null
+++ b/confmap/doc_test.go
@@ -0,0 +1,97 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package confmap_test
+
+import (
+ "fmt"
+ "slices"
+ "time"
+
+ "go.opentelemetry.io/collector/confmap"
+)
+
+type DiskScrape struct {
+ Disk string `mapstructure:"disk"`
+ Scrape time.Duration `mapstructure:"scrape"`
+}
+
+// We can annotate a struct with mapstructure field annotations.
+func Example_simpleUnmarshaling() {
+ conf := confmap.NewFromStringMap(map[string]any{
+ "disk": "c",
+ "scrape": "5s",
+ })
+ scrapeInfo := &DiskScrape{}
+ if err := conf.Unmarshal(scrapeInfo); err != nil {
+ panic(err)
+ }
+ fmt.Printf("Configuration contains the following:\nDisk: %q\nScrape: %s\n", scrapeInfo.Disk, scrapeInfo.Scrape)
+ //Output: Configuration contains the following:
+ // Disk: "c"
+ // Scrape: 5s
+}
+
+type CPUScrape struct {
+ Enabled bool `mapstructure:"enabled"`
+}
+
+type ComputerScrape struct {
+ DiskScrape `mapstructure:",squash"`
+ CPUScrape `mapstructure:",squash"`
+}
+
+// We can unmarshal embedded structs with mapstructure field annotations.
+func Example_embeddedUnmarshaling() {
+ conf := confmap.NewFromStringMap(map[string]any{
+ "disk": "c",
+ "scrape": "5s",
+ "enabled": true,
+ })
+ scrapeInfo := &ComputerScrape{}
+ if err := conf.Unmarshal(scrapeInfo); err != nil {
+ panic(err)
+ }
+ fmt.Printf("Configuration contains the following:\nDisk: %q\nScrape: %s\nEnabled: %v\n", scrapeInfo.Disk, scrapeInfo.Scrape, scrapeInfo.Enabled)
+ //Output: Configuration contains the following:
+ // Disk: "c"
+ // Scrape: 5s
+ // Enabled: true
+}
+
+type NetworkScrape struct {
+ Enabled bool `mapstructure:"enabled"`
+ Networks []string `mapstructure:"networks"`
+ Wifi bool `mapstructure:"wifi"`
+}
+
+func (n *NetworkScrape) Unmarshal(c *confmap.Conf) error {
+ if err := c.Unmarshal(n, confmap.WithIgnoreUnused()); err != nil {
+ return err
+ }
+ if slices.Contains(n.Networks, "wlan0") {
+ n.Wifi = true
+ }
+ return nil
+}
+
+type RouterScrape struct {
+ NetworkScrape `mapstructure:",squash"`
+}
+
+// We can unmarshal an embedded struct with a custom `Unmarshal` method.
+func Example_embeddedManualUnmarshaling() {
+ conf := confmap.NewFromStringMap(map[string]any{
+ "networks": []string{"eth0", "eth1", "wlan0"},
+ "enabled": true,
+ })
+ scrapeInfo := &RouterScrape{}
+ if err := conf.Unmarshal(scrapeInfo); err != nil {
+ panic(err)
+ }
+ fmt.Printf("Configuration contains the following:\nNetworks: %q\nWifi: %v\nEnabled: %v\n", scrapeInfo.Networks, scrapeInfo.Wifi, scrapeInfo.Enabled)
+ //Output: Configuration contains the following:
+ // Networks: ["eth0" "eth1" "wlan0"]
+ // Wifi: true
+ // Enabled: true
+}
diff --git a/confmap/go.mod b/confmap/go.mod
index 07cf775c6e6..09372fce1a1 100644
--- a/confmap/go.mod
+++ b/confmap/go.mod
@@ -1,21 +1,21 @@
module go.opentelemetry.io/collector/confmap
-go 1.20
+go 1.21
require (
+ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1
github.com/knadh/koanf/maps v0.1.1
github.com/knadh/koanf/providers/confmap v0.1.0
- github.com/knadh/koanf/v2 v2.0.1
- github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c
- github.com/stretchr/testify v1.8.4
+ github.com/knadh/koanf/v2 v2.1.0
+ github.com/stretchr/testify v1.9.0
go.uber.org/goleak v1.3.0
go.uber.org/multierr v1.11.0
+ go.uber.org/zap v1.27.0
gopkg.in/yaml.v3 v3.0.1
)
require (
github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/kr/text v0.2.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
diff --git a/confmap/go.sum b/confmap/go.sum
index 2c0539dd53c..b6947dd7ac4 100644
--- a/confmap/go.sum
+++ b/confmap/go.sum
@@ -1,30 +1,33 @@
-github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs=
github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI=
github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU=
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/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
+github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
-github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/confmap/internal/mapstructure/encoder.go b/confmap/internal/mapstructure/encoder.go
index feb5eefa76b..408560e2262 100644
--- a/confmap/internal/mapstructure/encoder.go
+++ b/confmap/internal/mapstructure/encoder.go
@@ -10,7 +10,7 @@ import (
"reflect"
"strings"
- "github.com/mitchellh/mapstructure"
+ "github.com/go-viper/mapstructure/v2"
)
const (
diff --git a/confmap/internal/mapstructure/encoder_test.go b/confmap/internal/mapstructure/encoder_test.go
index b557c91735a..fac12e8a6df 100644
--- a/confmap/internal/mapstructure/encoder_test.go
+++ b/confmap/internal/mapstructure/encoder_test.go
@@ -10,7 +10,7 @@ import (
"strings"
"testing"
- "github.com/mitchellh/mapstructure"
+ "github.com/go-viper/mapstructure/v2"
"github.com/stretchr/testify/require"
)
diff --git a/confmap/provider.go b/confmap/provider.go
index 91c2a60065a..8fd31e376ce 100644
--- a/confmap/provider.go
+++ b/confmap/provider.go
@@ -6,11 +6,15 @@ package confmap // import "go.opentelemetry.io/collector/confmap"
import (
"context"
"fmt"
+
+ "go.uber.org/zap"
)
// ProviderSettings are the settings to initialize a Provider.
// Any Provider should take this as a parameter in its constructor.
-type ProviderSettings struct{}
+type ProviderSettings struct {
+ Logger *zap.Logger
+}
// Provider is an interface that helps to retrieve a config map and watch for any
// changes to the config map. Implementations may load the config from a file,
diff --git a/confmap/provider/envprovider/Makefile b/confmap/provider/envprovider/Makefile
new file mode 100644
index 00000000000..bdd863a203b
--- /dev/null
+++ b/confmap/provider/envprovider/Makefile
@@ -0,0 +1 @@
+include ../../../Makefile.Common
diff --git a/confmap/provider/envprovider/go.mod b/confmap/provider/envprovider/go.mod
new file mode 100644
index 00000000000..4ebe14f9676
--- /dev/null
+++ b/confmap/provider/envprovider/go.mod
@@ -0,0 +1,25 @@
+module go.opentelemetry.io/collector/confmap/provider/envprovider
+
+go 1.21
+
+require (
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector/confmap v0.97.0
+ go.uber.org/goleak v1.3.0
+ go.uber.org/zap v1.27.0
+)
+
+require (
+ github.com/davecgh/go-spew v1.1.1 // indirect
+ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
+ github.com/knadh/koanf/maps v0.1.1 // indirect
+ github.com/knadh/koanf/providers/confmap v0.1.0 // indirect
+ github.com/knadh/koanf/v2 v2.1.0 // indirect
+ github.com/mitchellh/copystructure v1.2.0 // indirect
+ github.com/mitchellh/reflectwalk v1.0.2 // indirect
+ github.com/pmezard/go-difflib v1.0.0 // indirect
+ go.uber.org/multierr v1.11.0 // indirect
+ gopkg.in/yaml.v3 v3.0.1 // indirect
+)
+
+replace go.opentelemetry.io/collector/confmap => ../../
diff --git a/confmap/provider/envprovider/go.sum b/confmap/provider/envprovider/go.sum
new file mode 100644
index 00000000000..b6947dd7ac4
--- /dev/null
+++ b/confmap/provider/envprovider/go.sum
@@ -0,0 +1,33 @@
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
+github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs=
+github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI=
+github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU=
+github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU=
+github.com/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
+github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
+github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
+github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
+github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
+github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
+github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
+github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
+go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
+go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
+go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
+go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/confmap/provider/envprovider/provider.go b/confmap/provider/envprovider/provider.go
index 941d235a447..9a69f958838 100644
--- a/confmap/provider/envprovider/provider.go
+++ b/confmap/provider/envprovider/provider.go
@@ -9,37 +9,41 @@ import (
"os"
"strings"
+ "go.uber.org/zap"
+
"go.opentelemetry.io/collector/confmap"
"go.opentelemetry.io/collector/confmap/provider/internal"
)
const schemeName = "env"
-type provider struct{}
-
-// NewWithSettings returns a new confmap.Provider that reads the configuration from the given environment variable.
-//
-// This Provider supports "env" scheme, and can be called with a selector:
-// `env:NAME_OF_ENVIRONMENT_VARIABLE`
-func NewWithSettings(_ confmap.ProviderSettings) confmap.Provider {
- return &provider{}
+type provider struct {
+ logger *zap.Logger
}
-// New returns a new confmap.Provider that reads the configuration from the given environment variable.
+// NewWithSettings returns a new confmap.Provider that reads the configuration from the given environment variable.
//
// This Provider supports "env" scheme, and can be called with a selector:
// `env:NAME_OF_ENVIRONMENT_VARIABLE`
-// Deprecated: [v0.94.0] Use NewWithSettings instead.
-func New() confmap.Provider {
- return NewWithSettings(confmap.ProviderSettings{})
+func NewWithSettings(ps confmap.ProviderSettings) confmap.Provider {
+ return &provider{
+ logger: ps.Logger,
+ }
}
func (emp *provider) Retrieve(_ context.Context, uri string, _ confmap.WatcherFunc) (*confmap.Retrieved, error) {
if !strings.HasPrefix(uri, schemeName+":") {
return nil, fmt.Errorf("%q uri is not supported by %q provider", uri, schemeName)
}
+ envVarName := uri[len(schemeName)+1:]
+ val, exists := os.LookupEnv(envVarName)
+ if !exists {
+ emp.logger.Warn("Configuration references unset environment variable", zap.String("name", envVarName))
+ } else if len(val) == 0 {
+ emp.logger.Info("Configuration references empty environment variable", zap.String("name", envVarName))
+ }
- return internal.NewRetrievedFromYAML([]byte(os.Getenv(uri[len(schemeName)+1:])))
+ return internal.NewRetrievedFromYAML([]byte(val))
}
func (*provider) Scheme() string {
diff --git a/confmap/provider/envprovider/provider_test.go b/confmap/provider/envprovider/provider_test.go
index d7bb0e2d992..52ddb826de4 100644
--- a/confmap/provider/envprovider/provider_test.go
+++ b/confmap/provider/envprovider/provider_test.go
@@ -9,6 +9,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+ "go.uber.org/zap"
+ "go.uber.org/zap/zaptest/observer"
"go.opentelemetry.io/collector/confmap"
"go.opentelemetry.io/collector/confmap/confmaptest"
@@ -25,18 +27,18 @@ exporters:
`
func TestValidateProviderScheme(t *testing.T) {
- assert.NoError(t, confmaptest.ValidateProviderScheme(New()))
+ assert.NoError(t, confmaptest.ValidateProviderScheme(NewWithSettings(confmaptest.NewNopProviderSettings())))
}
func TestEmptyName(t *testing.T) {
- env := New()
+ env := NewWithSettings(confmaptest.NewNopProviderSettings())
_, err := env.Retrieve(context.Background(), "", nil)
require.Error(t, err)
assert.NoError(t, env.Shutdown(context.Background()))
}
func TestUnsupportedScheme(t *testing.T) {
- env := New()
+ env := NewWithSettings(confmaptest.NewNopProviderSettings())
_, err := env.Retrieve(context.Background(), "https://", nil)
assert.Error(t, err)
assert.NoError(t, env.Shutdown(context.Background()))
@@ -45,7 +47,7 @@ func TestUnsupportedScheme(t *testing.T) {
func TestInvalidYAML(t *testing.T) {
const envName = "invalid-yaml"
t.Setenv(envName, "[invalid,")
- env := New()
+ env := NewWithSettings(confmaptest.NewNopProviderSettings())
_, err := env.Retrieve(context.Background(), envSchemePrefix+envName, nil)
assert.Error(t, err)
assert.NoError(t, env.Shutdown(context.Background()))
@@ -55,7 +57,7 @@ func TestEnv(t *testing.T) {
const envName = "default-config"
t.Setenv(envName, validYAML)
- env := New()
+ env := NewWithSettings(confmaptest.NewNopProviderSettings())
ret, err := env.Retrieve(context.Background(), envSchemePrefix+envName, nil)
require.NoError(t, err)
retMap, err := ret.AsConf()
@@ -68,3 +70,70 @@ func TestEnv(t *testing.T) {
assert.NoError(t, env.Shutdown(context.Background()))
}
+
+func TestEnvWithLogger(t *testing.T) {
+ const envName = "default-config"
+ t.Setenv(envName, validYAML)
+ core, ol := observer.New(zap.WarnLevel)
+ logger := zap.New(core)
+
+ env := NewWithSettings(confmap.ProviderSettings{Logger: logger})
+ ret, err := env.Retrieve(context.Background(), envSchemePrefix+envName, nil)
+ require.NoError(t, err)
+ retMap, err := ret.AsConf()
+ assert.NoError(t, err)
+ expectedMap := confmap.NewFromStringMap(map[string]any{
+ "processors::batch": nil,
+ "exporters::otlp::endpoint": "localhost:4317",
+ })
+ assert.Equal(t, expectedMap.ToStringMap(), retMap.ToStringMap())
+
+ assert.NoError(t, env.Shutdown(context.Background()))
+ assert.Equal(t, 0, ol.Len())
+}
+
+func TestUnsetEnvWithLoggerWarn(t *testing.T) {
+ const envName = "default-config"
+ core, ol := observer.New(zap.WarnLevel)
+ logger := zap.New(core)
+
+ env := NewWithSettings(confmap.ProviderSettings{Logger: logger})
+ ret, err := env.Retrieve(context.Background(), envSchemePrefix+envName, nil)
+ require.NoError(t, err)
+ retMap, err := ret.AsConf()
+ assert.NoError(t, err)
+ expectedMap := confmap.NewFromStringMap(map[string]any{})
+ assert.Equal(t, expectedMap.ToStringMap(), retMap.ToStringMap())
+
+ assert.NoError(t, env.Shutdown(context.Background()))
+
+ assert.Equal(t, 1, ol.Len())
+ logLine := ol.All()[0]
+ assert.Equal(t, "Configuration references unset environment variable", logLine.Message)
+ assert.Equal(t, zap.WarnLevel, logLine.Level)
+ assert.Equal(t, envName, logLine.Context[0].String)
+}
+
+func TestEmptyEnvWithLoggerWarn(t *testing.T) {
+ const envName = "default-config"
+ t.Setenv(envName, "")
+
+ core, ol := observer.New(zap.InfoLevel)
+ logger := zap.New(core)
+
+ env := NewWithSettings(confmap.ProviderSettings{Logger: logger})
+ ret, err := env.Retrieve(context.Background(), envSchemePrefix+envName, nil)
+ require.NoError(t, err)
+ retMap, err := ret.AsConf()
+ assert.NoError(t, err)
+ expectedMap := confmap.NewFromStringMap(map[string]any{})
+ assert.Equal(t, expectedMap.ToStringMap(), retMap.ToStringMap())
+
+ assert.NoError(t, env.Shutdown(context.Background()))
+
+ assert.Equal(t, 1, ol.Len())
+ logLine := ol.All()[0]
+ assert.Equal(t, "Configuration references empty environment variable", logLine.Message)
+ assert.Equal(t, zap.InfoLevel, logLine.Level)
+ assert.Equal(t, envName, logLine.Context[0].String)
+}
diff --git a/confmap/provider/fileprovider/Makefile b/confmap/provider/fileprovider/Makefile
new file mode 100644
index 00000000000..bdd863a203b
--- /dev/null
+++ b/confmap/provider/fileprovider/Makefile
@@ -0,0 +1 @@
+include ../../../Makefile.Common
diff --git a/confmap/provider/fileprovider/go.mod b/confmap/provider/fileprovider/go.mod
new file mode 100644
index 00000000000..e48781a44a8
--- /dev/null
+++ b/confmap/provider/fileprovider/go.mod
@@ -0,0 +1,25 @@
+module go.opentelemetry.io/collector/confmap/provider/fileprovider
+
+go 1.21
+
+require (
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector/confmap v0.97.0
+ go.uber.org/goleak v1.3.0
+)
+
+require (
+ github.com/davecgh/go-spew v1.1.1 // indirect
+ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
+ github.com/knadh/koanf/maps v0.1.1 // indirect
+ github.com/knadh/koanf/providers/confmap v0.1.0 // indirect
+ github.com/knadh/koanf/v2 v2.1.0 // indirect
+ github.com/mitchellh/copystructure v1.2.0 // indirect
+ github.com/mitchellh/reflectwalk v1.0.2 // indirect
+ github.com/pmezard/go-difflib v1.0.0 // indirect
+ go.uber.org/multierr v1.11.0 // indirect
+ go.uber.org/zap v1.27.0 // indirect
+ gopkg.in/yaml.v3 v3.0.1 // indirect
+)
+
+replace go.opentelemetry.io/collector/confmap => ../../
diff --git a/confmap/provider/fileprovider/go.sum b/confmap/provider/fileprovider/go.sum
new file mode 100644
index 00000000000..b6947dd7ac4
--- /dev/null
+++ b/confmap/provider/fileprovider/go.sum
@@ -0,0 +1,33 @@
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
+github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs=
+github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI=
+github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU=
+github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU=
+github.com/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
+github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
+github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
+github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
+github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
+github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
+github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
+github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
+go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
+go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
+go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
+go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/confmap/provider/fileprovider/provider.go b/confmap/provider/fileprovider/provider.go
index 5fb5cab70d9..3d7c3340f08 100644
--- a/confmap/provider/fileprovider/provider.go
+++ b/confmap/provider/fileprovider/provider.go
@@ -18,7 +18,7 @@ const schemeName = "file"
type provider struct{}
-// New returns a new confmap.Provider that reads the configuration from a file.
+// NewWithSettings returns a new confmap.Provider that reads the configuration from a file.
//
// This Provider supports "file" scheme, and can be called with a "uri" that follows:
//
@@ -33,30 +33,10 @@ type provider struct{}
// `file:/path/to/file` - absolute path (unix, windows)
// `file:c:/path/to/file` - absolute path including drive-letter (windows)
// `file:c:\path\to\file` - absolute path including drive-letter (windows)
-func NewWithSettings(_ confmap.ProviderSettings) confmap.Provider {
+func NewWithSettings(confmap.ProviderSettings) confmap.Provider {
return &provider{}
}
-// New returns a new confmap.Provider that reads the configuration from a file.
-//
-// This Provider supports "file" scheme, and can be called with a "uri" that follows:
-//
-// file-uri = "file:" local-path
-// local-path = [ drive-letter ] file-path
-// drive-letter = ALPHA ":"
-//
-// The "file-path" can be relative or absolute, and it can be any OS supported format.
-//
-// Examples:
-// `file:path/to/file` - relative path (unix, windows)
-// `file:/path/to/file` - absolute path (unix, windows)
-// `file:c:/path/to/file` - absolute path including drive-letter (windows)
-// `file:c:\path\to\file` - absolute path including drive-letter (windows)
-// Deprecated: [v0.94.0] Use NewWithSettings instead.
-func New() confmap.Provider {
- return NewWithSettings(confmap.ProviderSettings{})
-}
-
func (fmp *provider) Retrieve(_ context.Context, uri string, _ confmap.WatcherFunc) (*confmap.Retrieved, error) {
if !strings.HasPrefix(uri, schemeName+":") {
return nil, fmt.Errorf("%q uri is not supported by %q provider", uri, schemeName)
diff --git a/confmap/provider/fileprovider/provider_test.go b/confmap/provider/fileprovider/provider_test.go
index dfc70756d99..d2202740dc1 100644
--- a/confmap/provider/fileprovider/provider_test.go
+++ b/confmap/provider/fileprovider/provider_test.go
@@ -19,25 +19,25 @@ import (
const fileSchemePrefix = schemeName + ":"
func TestValidateProviderScheme(t *testing.T) {
- assert.NoError(t, confmaptest.ValidateProviderScheme(New()))
+ assert.NoError(t, confmaptest.ValidateProviderScheme(NewWithSettings(confmaptest.NewNopProviderSettings())))
}
func TestEmptyName(t *testing.T) {
- fp := New()
+ fp := NewWithSettings(confmaptest.NewNopProviderSettings())
_, err := fp.Retrieve(context.Background(), "", nil)
require.Error(t, err)
require.NoError(t, fp.Shutdown(context.Background()))
}
func TestUnsupportedScheme(t *testing.T) {
- fp := New()
+ fp := NewWithSettings(confmaptest.NewNopProviderSettings())
_, err := fp.Retrieve(context.Background(), "https://", nil)
assert.Error(t, err)
assert.NoError(t, fp.Shutdown(context.Background()))
}
func TestNonExistent(t *testing.T) {
- fp := New()
+ fp := NewWithSettings(confmaptest.NewNopProviderSettings())
_, err := fp.Retrieve(context.Background(), fileSchemePrefix+filepath.Join("testdata", "non-existent.yaml"), nil)
assert.Error(t, err)
_, err = fp.Retrieve(context.Background(), fileSchemePrefix+absolutePath(t, filepath.Join("testdata", "non-existent.yaml")), nil)
@@ -46,7 +46,7 @@ func TestNonExistent(t *testing.T) {
}
func TestInvalidYAML(t *testing.T) {
- fp := New()
+ fp := NewWithSettings(confmaptest.NewNopProviderSettings())
_, err := fp.Retrieve(context.Background(), fileSchemePrefix+filepath.Join("testdata", "invalid-yaml.yaml"), nil)
assert.Error(t, err)
_, err = fp.Retrieve(context.Background(), fileSchemePrefix+absolutePath(t, filepath.Join("testdata", "invalid-yaml.yaml")), nil)
@@ -55,7 +55,7 @@ func TestInvalidYAML(t *testing.T) {
}
func TestRelativePath(t *testing.T) {
- fp := New()
+ fp := NewWithSettings(confmaptest.NewNopProviderSettings())
ret, err := fp.Retrieve(context.Background(), fileSchemePrefix+filepath.Join("testdata", "default-config.yaml"), nil)
require.NoError(t, err)
retMap, err := ret.AsConf()
@@ -69,7 +69,7 @@ func TestRelativePath(t *testing.T) {
}
func TestAbsolutePath(t *testing.T) {
- fp := New()
+ fp := NewWithSettings(confmaptest.NewNopProviderSettings())
ret, err := fp.Retrieve(context.Background(), fileSchemePrefix+absolutePath(t, filepath.Join("testdata", "default-config.yaml")), nil)
require.NoError(t, err)
retMap, err := ret.AsConf()
diff --git a/confmap/provider/httpprovider/Makefile b/confmap/provider/httpprovider/Makefile
new file mode 100644
index 00000000000..bdd863a203b
--- /dev/null
+++ b/confmap/provider/httpprovider/Makefile
@@ -0,0 +1 @@
+include ../../../Makefile.Common
diff --git a/confmap/provider/httpprovider/go.mod b/confmap/provider/httpprovider/go.mod
new file mode 100644
index 00000000000..ca9db6f5ccf
--- /dev/null
+++ b/confmap/provider/httpprovider/go.mod
@@ -0,0 +1,25 @@
+module go.opentelemetry.io/collector/confmap/provider/httpprovider
+
+go 1.21
+
+require (
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector/confmap v0.97.0
+ go.uber.org/goleak v1.3.0
+)
+
+require (
+ github.com/davecgh/go-spew v1.1.1 // indirect
+ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
+ github.com/knadh/koanf/maps v0.1.1 // indirect
+ github.com/knadh/koanf/providers/confmap v0.1.0 // indirect
+ github.com/knadh/koanf/v2 v2.1.0 // indirect
+ github.com/mitchellh/copystructure v1.2.0 // indirect
+ github.com/mitchellh/reflectwalk v1.0.2 // indirect
+ github.com/pmezard/go-difflib v1.0.0 // indirect
+ go.uber.org/multierr v1.11.0 // indirect
+ go.uber.org/zap v1.27.0 // indirect
+ gopkg.in/yaml.v3 v3.0.1 // indirect
+)
+
+replace go.opentelemetry.io/collector/confmap => ../../
diff --git a/confmap/provider/httpprovider/go.sum b/confmap/provider/httpprovider/go.sum
new file mode 100644
index 00000000000..b6947dd7ac4
--- /dev/null
+++ b/confmap/provider/httpprovider/go.sum
@@ -0,0 +1,33 @@
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
+github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs=
+github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI=
+github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU=
+github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU=
+github.com/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
+github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
+github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
+github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
+github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
+github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
+github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
+github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
+go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
+go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
+go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
+go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/confmap/provider/httpprovider/provider.go b/confmap/provider/httpprovider/provider.go
index 966faa510fb..4c762adc237 100644
--- a/confmap/provider/httpprovider/provider.go
+++ b/confmap/provider/httpprovider/provider.go
@@ -16,13 +16,3 @@ import (
func NewWithSettings(set confmap.ProviderSettings) confmap.Provider {
return configurablehttpprovider.New(configurablehttpprovider.HTTPScheme, set)
}
-
-// New returns a new confmap.Provider that reads the configuration from a http server.
-//
-// This Provider supports "http" scheme.
-//
-// One example for HTTP URI is: http://localhost:3333/getConfig
-// Deprecated: [v0.94.0] Use NewWithSettings instead.
-func New() confmap.Provider {
- return NewWithSettings(confmap.ProviderSettings{})
-}
diff --git a/confmap/provider/httpprovider/provider_test.go b/confmap/provider/httpprovider/provider_test.go
index b649b5d3d08..3e3e866e126 100644
--- a/confmap/provider/httpprovider/provider_test.go
+++ b/confmap/provider/httpprovider/provider_test.go
@@ -9,10 +9,12 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+
+ "go.opentelemetry.io/collector/confmap/confmaptest"
)
func TestSupportedScheme(t *testing.T) {
- fp := New()
+ fp := NewWithSettings(confmaptest.NewNopProviderSettings())
assert.Equal(t, "http", fp.Scheme())
require.NoError(t, fp.Shutdown(context.Background()))
}
diff --git a/confmap/provider/httpsprovider/Makefile b/confmap/provider/httpsprovider/Makefile
new file mode 100644
index 00000000000..bdd863a203b
--- /dev/null
+++ b/confmap/provider/httpsprovider/Makefile
@@ -0,0 +1 @@
+include ../../../Makefile.Common
diff --git a/confmap/provider/httpsprovider/go.mod b/confmap/provider/httpsprovider/go.mod
new file mode 100644
index 00000000000..15edf6032f2
--- /dev/null
+++ b/confmap/provider/httpsprovider/go.mod
@@ -0,0 +1,25 @@
+module go.opentelemetry.io/collector/confmap/provider/httpsprovider
+
+go 1.21
+
+require (
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector/confmap v0.97.0
+ go.uber.org/goleak v1.3.0
+)
+
+require (
+ github.com/davecgh/go-spew v1.1.1 // indirect
+ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
+ github.com/knadh/koanf/maps v0.1.1 // indirect
+ github.com/knadh/koanf/providers/confmap v0.1.0 // indirect
+ github.com/knadh/koanf/v2 v2.1.0 // indirect
+ github.com/mitchellh/copystructure v1.2.0 // indirect
+ github.com/mitchellh/reflectwalk v1.0.2 // indirect
+ github.com/pmezard/go-difflib v1.0.0 // indirect
+ go.uber.org/multierr v1.11.0 // indirect
+ go.uber.org/zap v1.27.0 // indirect
+ gopkg.in/yaml.v3 v3.0.1 // indirect
+)
+
+replace go.opentelemetry.io/collector/confmap => ../../
diff --git a/confmap/provider/httpsprovider/go.sum b/confmap/provider/httpsprovider/go.sum
new file mode 100644
index 00000000000..b6947dd7ac4
--- /dev/null
+++ b/confmap/provider/httpsprovider/go.sum
@@ -0,0 +1,33 @@
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
+github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs=
+github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI=
+github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU=
+github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU=
+github.com/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
+github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
+github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
+github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
+github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
+github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
+github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
+github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
+go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
+go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
+go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
+go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/confmap/provider/httpsprovider/provider.go b/confmap/provider/httpsprovider/provider.go
index 6db2cc9b151..c228a29621d 100644
--- a/confmap/provider/httpsprovider/provider.go
+++ b/confmap/provider/httpsprovider/provider.go
@@ -17,14 +17,3 @@ import (
func NewWithSettings(set confmap.ProviderSettings) confmap.Provider {
return configurablehttpprovider.New(configurablehttpprovider.HTTPSScheme, set)
}
-
-// New returns a new confmap.Provider that reads the configuration from a https server.
-//
-// This Provider supports "https" scheme. One example of an HTTPS URI is: https://localhost:3333/getConfig
-//
-// To add extra CA certificates you need to install certificates in the system pool. This procedure is operating system
-// dependent. E.g.: on Linux please refer to the `update-ca-trust` command.
-// Deprecated: [v0.94.0] Use NewWithSettings instead.
-func New() confmap.Provider {
- return NewWithSettings(confmap.ProviderSettings{})
-}
diff --git a/confmap/provider/httpsprovider/provider_test.go b/confmap/provider/httpsprovider/provider_test.go
index f488fcc6abd..20c1fd40607 100644
--- a/confmap/provider/httpsprovider/provider_test.go
+++ b/confmap/provider/httpsprovider/provider_test.go
@@ -7,9 +7,11 @@ import (
"testing"
"github.com/stretchr/testify/assert"
+
+ "go.opentelemetry.io/collector/confmap/confmaptest"
)
func TestSupportedScheme(t *testing.T) {
- fp := New()
+ fp := NewWithSettings(confmaptest.NewNopProviderSettings())
assert.Equal(t, "https", fp.Scheme())
}
diff --git a/confmap/provider/internal/configurablehttpprovider/provider_test.go b/confmap/provider/internal/configurablehttpprovider/provider_test.go
index 323ab79ab7c..125c1cbdd80 100644
--- a/confmap/provider/internal/configurablehttpprovider/provider_test.go
+++ b/confmap/provider/internal/configurablehttpprovider/provider_test.go
@@ -123,7 +123,7 @@ func generateCertificate(hostname string) (cert string, key string, err error) {
}
func TestFunctionalityDownloadFileHTTP(t *testing.T) {
- fp := newConfigurableHTTPProvider(HTTPScheme, confmap.ProviderSettings{})
+ fp := newConfigurableHTTPProvider(HTTPScheme, confmaptest.NewNopProviderSettings())
ts := httptest.NewServer(http.HandlerFunc(answerGet))
defer ts.Close()
_, err := fp.Retrieve(context.Background(), ts.URL, nil)
@@ -211,7 +211,7 @@ func TestFunctionalityDownloadFileHTTPS(t *testing.T) {
for _, tt := range tests {
t.Run(tt.testName, func(t *testing.T) {
- fp := newConfigurableHTTPProvider(HTTPSScheme, confmap.ProviderSettings{})
+ fp := newConfigurableHTTPProvider(HTTPSScheme, confmaptest.NewNopProviderSettings())
// Parse url of the test server to get the port number.
tsURL, err := url.Parse(ts.URL)
require.NoError(t, err)
@@ -230,20 +230,20 @@ func TestFunctionalityDownloadFileHTTPS(t *testing.T) {
}
func TestUnsupportedScheme(t *testing.T) {
- fp := New(HTTPScheme, confmap.ProviderSettings{})
+ fp := New(HTTPScheme, confmaptest.NewNopProviderSettings())
_, err := fp.Retrieve(context.Background(), "https://...", nil)
assert.Error(t, err)
assert.NoError(t, fp.Shutdown(context.Background()))
- fp = New(HTTPSScheme, confmap.ProviderSettings{})
+ fp = New(HTTPSScheme, confmaptest.NewNopProviderSettings())
_, err = fp.Retrieve(context.Background(), "http://...", nil)
assert.Error(t, err)
assert.NoError(t, fp.Shutdown(context.Background()))
}
func TestEmptyURI(t *testing.T) {
- fp := New(HTTPScheme, confmap.ProviderSettings{})
- ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ fp := New(HTTPScheme, confmaptest.NewNopProviderSettings())
+ ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusBadRequest)
}))
defer ts.Close()
@@ -253,8 +253,8 @@ func TestEmptyURI(t *testing.T) {
}
func TestRetrieveFromShutdownServer(t *testing.T) {
- fp := New(HTTPScheme, confmap.ProviderSettings{})
- ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {}))
+ fp := New(HTTPScheme, confmaptest.NewNopProviderSettings())
+ ts := httptest.NewServer(http.HandlerFunc(func(http.ResponseWriter, *http.Request) {}))
ts.Close()
_, err := fp.Retrieve(context.Background(), ts.URL, nil)
assert.Error(t, err)
@@ -262,8 +262,8 @@ func TestRetrieveFromShutdownServer(t *testing.T) {
}
func TestNonExistent(t *testing.T) {
- fp := New(HTTPScheme, confmap.ProviderSettings{})
- ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ fp := New(HTTPScheme, confmaptest.NewNopProviderSettings())
+ ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusNotFound)
}))
defer ts.Close()
@@ -273,8 +273,8 @@ func TestNonExistent(t *testing.T) {
}
func TestInvalidYAML(t *testing.T) {
- fp := New(HTTPScheme, confmap.ProviderSettings{})
- ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ fp := New(HTTPScheme, confmaptest.NewNopProviderSettings())
+ ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)
_, err := w.Write([]byte("wrong : ["))
if err != nil {
@@ -288,17 +288,17 @@ func TestInvalidYAML(t *testing.T) {
}
func TestScheme(t *testing.T) {
- fp := New(HTTPScheme, confmap.ProviderSettings{})
+ fp := New(HTTPScheme, confmaptest.NewNopProviderSettings())
assert.Equal(t, "http", fp.Scheme())
require.NoError(t, fp.Shutdown(context.Background()))
}
func TestValidateProviderScheme(t *testing.T) {
- assert.NoError(t, confmaptest.ValidateProviderScheme(New(HTTPScheme, confmap.ProviderSettings{})))
+ assert.NoError(t, confmaptest.ValidateProviderScheme(New(HTTPScheme, confmaptest.NewNopProviderSettings())))
}
func TestInvalidTransport(t *testing.T) {
- fp := New("foo", confmap.ProviderSettings{})
+ fp := New("foo", confmaptest.NewNopProviderSettings())
_, err := fp.Retrieve(context.Background(), "foo://..", nil)
assert.Error(t, err)
diff --git a/confmap/provider/yamlprovider/Makefile b/confmap/provider/yamlprovider/Makefile
new file mode 100644
index 00000000000..bdd863a203b
--- /dev/null
+++ b/confmap/provider/yamlprovider/Makefile
@@ -0,0 +1 @@
+include ../../../Makefile.Common
diff --git a/confmap/provider/yamlprovider/go.mod b/confmap/provider/yamlprovider/go.mod
new file mode 100644
index 00000000000..587bf430bab
--- /dev/null
+++ b/confmap/provider/yamlprovider/go.mod
@@ -0,0 +1,25 @@
+module go.opentelemetry.io/collector/confmap/provider/yamlprovider
+
+go 1.21
+
+require (
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector/confmap v0.97.0
+ go.uber.org/goleak v1.3.0
+)
+
+require (
+ github.com/davecgh/go-spew v1.1.1 // indirect
+ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
+ github.com/knadh/koanf/maps v0.1.1 // indirect
+ github.com/knadh/koanf/providers/confmap v0.1.0 // indirect
+ github.com/knadh/koanf/v2 v2.1.0 // indirect
+ github.com/mitchellh/copystructure v1.2.0 // indirect
+ github.com/mitchellh/reflectwalk v1.0.2 // indirect
+ github.com/pmezard/go-difflib v1.0.0 // indirect
+ go.uber.org/multierr v1.11.0 // indirect
+ go.uber.org/zap v1.27.0 // indirect
+ gopkg.in/yaml.v3 v3.0.1 // indirect
+)
+
+replace go.opentelemetry.io/collector/confmap => ../../
diff --git a/confmap/provider/yamlprovider/go.sum b/confmap/provider/yamlprovider/go.sum
new file mode 100644
index 00000000000..b6947dd7ac4
--- /dev/null
+++ b/confmap/provider/yamlprovider/go.sum
@@ -0,0 +1,33 @@
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
+github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs=
+github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI=
+github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU=
+github.com/knadh/koanf/providers/confmap v0.1.0/go.mod h1:2uLhxQzJnyHKfxG927awZC7+fyHFdQkd697K4MdLnIU=
+github.com/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
+github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
+github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
+github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
+github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
+github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
+github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
+github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
+go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
+go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
+go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
+go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/confmap/provider/yamlprovider/provider.go b/confmap/provider/yamlprovider/provider.go
index 3e9a1f9e8f2..01a4875580d 100644
--- a/confmap/provider/yamlprovider/provider.go
+++ b/confmap/provider/yamlprovider/provider.go
@@ -25,24 +25,10 @@ type provider struct{}
// Examples:
// `yaml:processors::batch::timeout: 2s`
// `yaml:processors::batch/foo::timeout: 3s`
-func NewWithSettings(_ confmap.ProviderSettings) confmap.Provider {
+func NewWithSettings(confmap.ProviderSettings) confmap.Provider {
return &provider{}
}
-// New returns a new confmap.Provider that allows to provide yaml bytes.
-//
-// This Provider supports "yaml" scheme, and can be called with a "uri" that follows:
-//
-// bytes-uri = "yaml:" yaml-bytes
-//
-// Examples:
-// `yaml:processors::batch::timeout: 2s`
-// `yaml:processors::batch/foo::timeout: 3s`
-// Deprecated: [v0.94.0] Use NewWithSettings instead.
-func New() confmap.Provider {
- return NewWithSettings(confmap.ProviderSettings{})
-}
-
func (s *provider) Retrieve(_ context.Context, uri string, _ confmap.WatcherFunc) (*confmap.Retrieved, error) {
if !strings.HasPrefix(uri, schemeName+":") {
return nil, fmt.Errorf("%q uri is not supported by %q provider", uri, schemeName)
diff --git a/confmap/provider/yamlprovider/provider_test.go b/confmap/provider/yamlprovider/provider_test.go
index 6e366c1c273..02b030299f4 100644
--- a/confmap/provider/yamlprovider/provider_test.go
+++ b/confmap/provider/yamlprovider/provider_test.go
@@ -13,25 +13,25 @@ import (
)
func TestValidateProviderScheme(t *testing.T) {
- assert.NoError(t, confmaptest.ValidateProviderScheme(New()))
+ assert.NoError(t, confmaptest.ValidateProviderScheme(NewWithSettings(confmaptest.NewNopProviderSettings())))
}
func TestEmpty(t *testing.T) {
- sp := New()
+ sp := NewWithSettings(confmaptest.NewNopProviderSettings())
_, err := sp.Retrieve(context.Background(), "", nil)
assert.Error(t, err)
assert.NoError(t, sp.Shutdown(context.Background()))
}
func TestInvalidYAML(t *testing.T) {
- sp := New()
+ sp := NewWithSettings(confmaptest.NewNopProviderSettings())
_, err := sp.Retrieve(context.Background(), "yaml:[invalid,", nil)
assert.Error(t, err)
assert.NoError(t, sp.Shutdown(context.Background()))
}
func TestOneValue(t *testing.T) {
- sp := New()
+ sp := NewWithSettings(confmaptest.NewNopProviderSettings())
ret, err := sp.Retrieve(context.Background(), "yaml:processors::batch::timeout: 2s", nil)
assert.NoError(t, err)
retMap, err := ret.AsConf()
@@ -47,7 +47,7 @@ func TestOneValue(t *testing.T) {
}
func TestNamedComponent(t *testing.T) {
- sp := New()
+ sp := NewWithSettings(confmaptest.NewNopProviderSettings())
ret, err := sp.Retrieve(context.Background(), "yaml:processors::batch/foo::timeout: 3s", nil)
assert.NoError(t, err)
retMap, err := ret.AsConf()
@@ -63,7 +63,7 @@ func TestNamedComponent(t *testing.T) {
}
func TestMapEntry(t *testing.T) {
- sp := New()
+ sp := NewWithSettings(confmaptest.NewNopProviderSettings())
ret, err := sp.Retrieve(context.Background(), "yaml:processors: {batch/foo::timeout: 3s, batch::timeout: 2s}", nil)
assert.NoError(t, err)
retMap, err := ret.AsConf()
@@ -82,7 +82,7 @@ func TestMapEntry(t *testing.T) {
}
func TestArrayEntry(t *testing.T) {
- sp := New()
+ sp := NewWithSettings(confmaptest.NewNopProviderSettings())
ret, err := sp.Retrieve(context.Background(), "yaml:service::extensions: [zpages, zpages/foo]", nil)
assert.NoError(t, err)
retMap, err := ret.AsConf()
@@ -99,7 +99,7 @@ func TestArrayEntry(t *testing.T) {
}
func TestNewLine(t *testing.T) {
- sp := New()
+ sp := NewWithSettings(confmaptest.NewNopProviderSettings())
ret, err := sp.Retrieve(context.Background(), "yaml:processors::batch/foo::timeout: 3s\nprocessors::batch::timeout: 2s", nil)
assert.NoError(t, err)
retMap, err := ret.AsConf()
@@ -118,7 +118,7 @@ func TestNewLine(t *testing.T) {
}
func TestDotSeparator(t *testing.T) {
- sp := New()
+ sp := NewWithSettings(confmaptest.NewNopProviderSettings())
ret, err := sp.Retrieve(context.Background(), "yaml:processors.batch.timeout: 4s", nil)
assert.NoError(t, err)
retMap, err := ret.AsConf()
diff --git a/confmap/resolver_test.go b/confmap/resolver_test.go
index 08e2088dad2..aa1442d161a 100644
--- a/confmap/resolver_test.go
+++ b/confmap/resolver_test.go
@@ -155,7 +155,7 @@ func TestResolverErrors(t *testing.T) {
locations: []string{"mock:", "err:"},
providers: []Provider{
&mockProvider{},
- &mockProvider{scheme: "err", retM: map[string]any{}, closeFunc: func(ctx context.Context) error { return errors.New("close_err") }},
+ &mockProvider{scheme: "err", retM: map[string]any{}, closeFunc: func(context.Context) error { return errors.New("close_err") }},
},
expectCloseErr: true,
},
@@ -270,7 +270,7 @@ func TestResolver(t *testing.T) {
numCalls := atomic.Int32{}
resolver, err := NewResolver(ResolverSettings{
URIs: []string{"mock:"},
- Providers: makeMapProvidersMap(&mockProvider{retM: map[string]any{}, closeFunc: func(ctx context.Context) error {
+ Providers: makeMapProvidersMap(&mockProvider{retM: map[string]any{}, closeFunc: func(context.Context) error {
numCalls.Add(1)
return nil
}}),
diff --git a/connector/connector.go b/connector/connector.go
index 9fc576cb54e..94927092117 100644
--- a/connector/connector.go
+++ b/connector/connector.go
@@ -5,6 +5,7 @@ package connector // import "go.opentelemetry.io/collector/connector"
import (
"context"
+ "errors"
"fmt"
"go.uber.org/zap"
@@ -13,6 +14,10 @@ import (
"go.opentelemetry.io/collector/consumer"
)
+var (
+ errNilNextConsumer = errors.New("nil next Consumer")
+)
+
// A Traces connector acts as an exporter from a traces pipeline and a receiver
// to one or more traces, metrics, or logs pipelines.
// Traces feeds a consumer.Traces, consumer.Metrics, or consumer.Logs with data.
@@ -456,6 +461,9 @@ func NewBuilder(cfgs map[component.ID]component.Config, factories map[component.
// CreateTracesToTraces creates a Traces connector based on the settings and config.
func (b *Builder) CreateTracesToTraces(ctx context.Context, set CreateSettings, next consumer.Traces) (Traces, error) {
+ if next == nil {
+ return nil, errNilNextConsumer
+ }
cfg, existsCfg := b.cfgs[set.ID]
if !existsCfg {
return nil, fmt.Errorf("connector %q is not configured", set.ID)
@@ -472,6 +480,9 @@ func (b *Builder) CreateTracesToTraces(ctx context.Context, set CreateSettings,
// CreateTracesToMetrics creates a Traces connector based on the settings and config.
func (b *Builder) CreateTracesToMetrics(ctx context.Context, set CreateSettings, next consumer.Metrics) (Traces, error) {
+ if next == nil {
+ return nil, errNilNextConsumer
+ }
cfg, existsCfg := b.cfgs[set.ID]
if !existsCfg {
return nil, fmt.Errorf("connector %q is not configured", set.ID)
@@ -488,6 +499,9 @@ func (b *Builder) CreateTracesToMetrics(ctx context.Context, set CreateSettings,
// CreateTracesToLogs creates a Traces connector based on the settings and config.
func (b *Builder) CreateTracesToLogs(ctx context.Context, set CreateSettings, next consumer.Logs) (Traces, error) {
+ if next == nil {
+ return nil, errNilNextConsumer
+ }
cfg, existsCfg := b.cfgs[set.ID]
if !existsCfg {
return nil, fmt.Errorf("connector %q is not configured", set.ID)
@@ -504,6 +518,9 @@ func (b *Builder) CreateTracesToLogs(ctx context.Context, set CreateSettings, ne
// CreateMetricsToTraces creates a Metrics connector based on the settings and config.
func (b *Builder) CreateMetricsToTraces(ctx context.Context, set CreateSettings, next consumer.Traces) (Metrics, error) {
+ if next == nil {
+ return nil, errNilNextConsumer
+ }
cfg, existsCfg := b.cfgs[set.ID]
if !existsCfg {
return nil, fmt.Errorf("connector %q is not configured", set.ID)
@@ -520,6 +537,9 @@ func (b *Builder) CreateMetricsToTraces(ctx context.Context, set CreateSettings,
// CreateMetricsToMetrics creates a Metrics connector based on the settings and config.
func (b *Builder) CreateMetricsToMetrics(ctx context.Context, set CreateSettings, next consumer.Metrics) (Metrics, error) {
+ if next == nil {
+ return nil, errNilNextConsumer
+ }
cfg, existsCfg := b.cfgs[set.ID]
if !existsCfg {
return nil, fmt.Errorf("connector %q is not configured", set.ID)
@@ -536,6 +556,9 @@ func (b *Builder) CreateMetricsToMetrics(ctx context.Context, set CreateSettings
// CreateMetricsToLogs creates a Metrics connector based on the settings and config.
func (b *Builder) CreateMetricsToLogs(ctx context.Context, set CreateSettings, next consumer.Logs) (Metrics, error) {
+ if next == nil {
+ return nil, errNilNextConsumer
+ }
cfg, existsCfg := b.cfgs[set.ID]
if !existsCfg {
return nil, fmt.Errorf("connector %q is not configured", set.ID)
@@ -552,6 +575,9 @@ func (b *Builder) CreateMetricsToLogs(ctx context.Context, set CreateSettings, n
// CreateLogsToTraces creates a Logs connector based on the settings and config.
func (b *Builder) CreateLogsToTraces(ctx context.Context, set CreateSettings, next consumer.Traces) (Logs, error) {
+ if next == nil {
+ return nil, errNilNextConsumer
+ }
cfg, existsCfg := b.cfgs[set.ID]
if !existsCfg {
return nil, fmt.Errorf("connector %q is not configured", set.ID)
@@ -568,6 +594,9 @@ func (b *Builder) CreateLogsToTraces(ctx context.Context, set CreateSettings, ne
// CreateLogsToMetrics creates a Logs connector based on the settings and config.
func (b *Builder) CreateLogsToMetrics(ctx context.Context, set CreateSettings, next consumer.Metrics) (Logs, error) {
+ if next == nil {
+ return nil, errNilNextConsumer
+ }
cfg, existsCfg := b.cfgs[set.ID]
if !existsCfg {
return nil, fmt.Errorf("connector %q is not configured", set.ID)
@@ -584,6 +613,9 @@ func (b *Builder) CreateLogsToMetrics(ctx context.Context, set CreateSettings, n
// CreateLogsToLogs creates a Logs connector based on the settings and config.
func (b *Builder) CreateLogsToLogs(ctx context.Context, set CreateSettings, next consumer.Logs) (Logs, error) {
+ if next == nil {
+ return nil, errNilNextConsumer
+ }
cfg, existsCfg := b.cfgs[set.ID]
if !existsCfg {
return nil, fmt.Errorf("connector %q is not configured", set.ID)
diff --git a/connector/connector_test.go b/connector/connector_test.go
index 851add885d7..7384b50621d 100644
--- a/connector/connector_test.go
+++ b/connector/connector_test.go
@@ -28,25 +28,25 @@ func TestNewFactoryNoOptions(t *testing.T) {
assert.EqualValues(t, testType, factory.Type())
assert.EqualValues(t, &defaultCfg, factory.CreateDefaultConfig())
- _, err := factory.CreateTracesToTraces(context.Background(), CreateSettings{ID: testID}, &defaultCfg, nil)
+ _, err := factory.CreateTracesToTraces(context.Background(), CreateSettings{ID: testID}, &defaultCfg, consumertest.NewNop())
assert.Equal(t, err, errDataTypes(testID, component.DataTypeTraces, component.DataTypeTraces))
- _, err = factory.CreateTracesToMetrics(context.Background(), CreateSettings{ID: testID}, &defaultCfg, nil)
+ _, err = factory.CreateTracesToMetrics(context.Background(), CreateSettings{ID: testID}, &defaultCfg, consumertest.NewNop())
assert.Equal(t, err, errDataTypes(testID, component.DataTypeTraces, component.DataTypeMetrics))
- _, err = factory.CreateTracesToLogs(context.Background(), CreateSettings{ID: testID}, &defaultCfg, nil)
+ _, err = factory.CreateTracesToLogs(context.Background(), CreateSettings{ID: testID}, &defaultCfg, consumertest.NewNop())
assert.Equal(t, err, errDataTypes(testID, component.DataTypeTraces, component.DataTypeLogs))
- _, err = factory.CreateMetricsToTraces(context.Background(), CreateSettings{ID: testID}, &defaultCfg, nil)
+ _, err = factory.CreateMetricsToTraces(context.Background(), CreateSettings{ID: testID}, &defaultCfg, consumertest.NewNop())
assert.Equal(t, err, errDataTypes(testID, component.DataTypeMetrics, component.DataTypeTraces))
- _, err = factory.CreateMetricsToMetrics(context.Background(), CreateSettings{ID: testID}, &defaultCfg, nil)
+ _, err = factory.CreateMetricsToMetrics(context.Background(), CreateSettings{ID: testID}, &defaultCfg, consumertest.NewNop())
assert.Equal(t, err, errDataTypes(testID, component.DataTypeMetrics, component.DataTypeMetrics))
- _, err = factory.CreateMetricsToLogs(context.Background(), CreateSettings{ID: testID}, &defaultCfg, nil)
+ _, err = factory.CreateMetricsToLogs(context.Background(), CreateSettings{ID: testID}, &defaultCfg, consumertest.NewNop())
assert.Equal(t, err, errDataTypes(testID, component.DataTypeMetrics, component.DataTypeLogs))
- _, err = factory.CreateLogsToTraces(context.Background(), CreateSettings{ID: testID}, &defaultCfg, nil)
+ _, err = factory.CreateLogsToTraces(context.Background(), CreateSettings{ID: testID}, &defaultCfg, consumertest.NewNop())
assert.Equal(t, err, errDataTypes(testID, component.DataTypeLogs, component.DataTypeTraces))
- _, err = factory.CreateLogsToMetrics(context.Background(), CreateSettings{ID: testID}, &defaultCfg, nil)
+ _, err = factory.CreateLogsToMetrics(context.Background(), CreateSettings{ID: testID}, &defaultCfg, consumertest.NewNop())
assert.Equal(t, err, errDataTypes(testID, component.DataTypeLogs, component.DataTypeMetrics))
- _, err = factory.CreateLogsToLogs(context.Background(), CreateSettings{ID: testID}, &defaultCfg, nil)
+ _, err = factory.CreateLogsToLogs(context.Background(), CreateSettings{ID: testID}, &defaultCfg, consumertest.NewNop())
assert.Equal(t, err, errDataTypes(testID, component.DataTypeLogs, component.DataTypeLogs))
}
@@ -60,30 +60,30 @@ func TestNewFactoryWithSameTypes(t *testing.T) {
assert.EqualValues(t, &defaultCfg, factory.CreateDefaultConfig())
assert.Equal(t, component.StabilityLevelAlpha, factory.TracesToTracesStability())
- _, err := factory.CreateTracesToTraces(context.Background(), CreateSettings{ID: testID}, &defaultCfg, nil)
+ _, err := factory.CreateTracesToTraces(context.Background(), CreateSettings{ID: testID}, &defaultCfg, consumertest.NewNop())
assert.NoError(t, err)
assert.Equal(t, component.StabilityLevelBeta, factory.MetricsToMetricsStability())
- _, err = factory.CreateMetricsToMetrics(context.Background(), CreateSettings{ID: testID}, &defaultCfg, nil)
+ _, err = factory.CreateMetricsToMetrics(context.Background(), CreateSettings{ID: testID}, &defaultCfg, consumertest.NewNop())
assert.NoError(t, err)
assert.Equal(t, component.StabilityLevelUnmaintained, factory.LogsToLogsStability())
- _, err = factory.CreateLogsToLogs(context.Background(), CreateSettings{ID: testID}, &defaultCfg, nil)
+ _, err = factory.CreateLogsToLogs(context.Background(), CreateSettings{ID: testID}, &defaultCfg, consumertest.NewNop())
assert.NoError(t, err)
- _, err = factory.CreateTracesToMetrics(context.Background(), CreateSettings{ID: testID}, &defaultCfg, nil)
+ _, err = factory.CreateTracesToMetrics(context.Background(), CreateSettings{ID: testID}, &defaultCfg, consumertest.NewNop())
assert.Equal(t, err, errDataTypes(testID, component.DataTypeTraces, component.DataTypeMetrics))
- _, err = factory.CreateTracesToLogs(context.Background(), CreateSettings{ID: testID}, &defaultCfg, nil)
+ _, err = factory.CreateTracesToLogs(context.Background(), CreateSettings{ID: testID}, &defaultCfg, consumertest.NewNop())
assert.Equal(t, err, errDataTypes(testID, component.DataTypeTraces, component.DataTypeLogs))
- _, err = factory.CreateMetricsToTraces(context.Background(), CreateSettings{ID: testID}, &defaultCfg, nil)
+ _, err = factory.CreateMetricsToTraces(context.Background(), CreateSettings{ID: testID}, &defaultCfg, consumertest.NewNop())
assert.Equal(t, err, errDataTypes(testID, component.DataTypeMetrics, component.DataTypeTraces))
- _, err = factory.CreateMetricsToLogs(context.Background(), CreateSettings{ID: testID}, &defaultCfg, nil)
+ _, err = factory.CreateMetricsToLogs(context.Background(), CreateSettings{ID: testID}, &defaultCfg, consumertest.NewNop())
assert.Equal(t, err, errDataTypes(testID, component.DataTypeMetrics, component.DataTypeLogs))
- _, err = factory.CreateLogsToTraces(context.Background(), CreateSettings{ID: testID}, &defaultCfg, nil)
+ _, err = factory.CreateLogsToTraces(context.Background(), CreateSettings{ID: testID}, &defaultCfg, consumertest.NewNop())
assert.Equal(t, err, errDataTypes(testID, component.DataTypeLogs, component.DataTypeTraces))
- _, err = factory.CreateLogsToMetrics(context.Background(), CreateSettings{ID: testID}, &defaultCfg, nil)
+ _, err = factory.CreateLogsToMetrics(context.Background(), CreateSettings{ID: testID}, &defaultCfg, consumertest.NewNop())
assert.Equal(t, err, errDataTypes(testID, component.DataTypeLogs, component.DataTypeMetrics))
}
@@ -99,35 +99,35 @@ func TestNewFactoryWithTranslateTypes(t *testing.T) {
assert.EqualValues(t, testType, factory.Type())
assert.EqualValues(t, &defaultCfg, factory.CreateDefaultConfig())
- _, err := factory.CreateTracesToTraces(context.Background(), CreateSettings{ID: testID}, &defaultCfg, nil)
+ _, err := factory.CreateTracesToTraces(context.Background(), CreateSettings{ID: testID}, &defaultCfg, consumertest.NewNop())
assert.Equal(t, err, errDataTypes(testID, component.DataTypeTraces, component.DataTypeTraces))
- _, err = factory.CreateMetricsToMetrics(context.Background(), CreateSettings{ID: testID}, &defaultCfg, nil)
+ _, err = factory.CreateMetricsToMetrics(context.Background(), CreateSettings{ID: testID}, &defaultCfg, consumertest.NewNop())
assert.Equal(t, err, errDataTypes(testID, component.DataTypeMetrics, component.DataTypeMetrics))
- _, err = factory.CreateLogsToLogs(context.Background(), CreateSettings{ID: testID}, &defaultCfg, nil)
+ _, err = factory.CreateLogsToLogs(context.Background(), CreateSettings{ID: testID}, &defaultCfg, consumertest.NewNop())
assert.Equal(t, err, errDataTypes(testID, component.DataTypeLogs, component.DataTypeLogs))
assert.Equal(t, component.StabilityLevelDevelopment, factory.TracesToMetricsStability())
- _, err = factory.CreateTracesToMetrics(context.Background(), CreateSettings{ID: testID}, &defaultCfg, nil)
+ _, err = factory.CreateTracesToMetrics(context.Background(), CreateSettings{ID: testID}, &defaultCfg, consumertest.NewNop())
assert.NoError(t, err)
assert.Equal(t, component.StabilityLevelAlpha, factory.TracesToLogsStability())
- _, err = factory.CreateTracesToLogs(context.Background(), CreateSettings{ID: testID}, &defaultCfg, nil)
+ _, err = factory.CreateTracesToLogs(context.Background(), CreateSettings{ID: testID}, &defaultCfg, consumertest.NewNop())
assert.NoError(t, err)
assert.Equal(t, component.StabilityLevelBeta, factory.MetricsToTracesStability())
- _, err = factory.CreateMetricsToTraces(context.Background(), CreateSettings{ID: testID}, &defaultCfg, nil)
+ _, err = factory.CreateMetricsToTraces(context.Background(), CreateSettings{ID: testID}, &defaultCfg, consumertest.NewNop())
assert.NoError(t, err)
assert.Equal(t, component.StabilityLevelStable, factory.MetricsToLogsStability())
- _, err = factory.CreateMetricsToLogs(context.Background(), CreateSettings{ID: testID}, &defaultCfg, nil)
+ _, err = factory.CreateMetricsToLogs(context.Background(), CreateSettings{ID: testID}, &defaultCfg, consumertest.NewNop())
assert.NoError(t, err)
assert.Equal(t, component.StabilityLevelDeprecated, factory.LogsToTracesStability())
- _, err = factory.CreateLogsToTraces(context.Background(), CreateSettings{ID: testID}, &defaultCfg, nil)
+ _, err = factory.CreateLogsToTraces(context.Background(), CreateSettings{ID: testID}, &defaultCfg, consumertest.NewNop())
assert.NoError(t, err)
assert.Equal(t, component.StabilityLevelUnmaintained, factory.LogsToMetricsStability())
- _, err = factory.CreateLogsToMetrics(context.Background(), CreateSettings{ID: testID}, &defaultCfg, nil)
+ _, err = factory.CreateLogsToMetrics(context.Background(), CreateSettings{ID: testID}, &defaultCfg, consumertest.NewNop())
assert.NoError(t, err)
}
@@ -147,33 +147,33 @@ func TestNewFactoryWithAllTypes(t *testing.T) {
assert.EqualValues(t, &defaultCfg, factory.CreateDefaultConfig())
assert.Equal(t, component.StabilityLevelAlpha, factory.TracesToTracesStability())
- _, err := factory.CreateTracesToTraces(context.Background(), CreateSettings{}, &defaultCfg, nil)
+ _, err := factory.CreateTracesToTraces(context.Background(), CreateSettings{}, &defaultCfg, consumertest.NewNop())
assert.NoError(t, err)
assert.Equal(t, component.StabilityLevelDevelopment, factory.TracesToMetricsStability())
- _, err = factory.CreateTracesToMetrics(context.Background(), CreateSettings{}, &defaultCfg, nil)
+ _, err = factory.CreateTracesToMetrics(context.Background(), CreateSettings{}, &defaultCfg, consumertest.NewNop())
assert.NoError(t, err)
assert.Equal(t, component.StabilityLevelAlpha, factory.TracesToLogsStability())
- _, err = factory.CreateTracesToLogs(context.Background(), CreateSettings{}, &defaultCfg, nil)
+ _, err = factory.CreateTracesToLogs(context.Background(), CreateSettings{}, &defaultCfg, consumertest.NewNop())
assert.NoError(t, err)
assert.Equal(t, component.StabilityLevelBeta, factory.MetricsToTracesStability())
- _, err = factory.CreateMetricsToTraces(context.Background(), CreateSettings{}, &defaultCfg, nil)
+ _, err = factory.CreateMetricsToTraces(context.Background(), CreateSettings{}, &defaultCfg, consumertest.NewNop())
assert.NoError(t, err)
assert.Equal(t, component.StabilityLevelBeta, factory.MetricsToMetricsStability())
- _, err = factory.CreateMetricsToMetrics(context.Background(), CreateSettings{}, &defaultCfg, nil)
+ _, err = factory.CreateMetricsToMetrics(context.Background(), CreateSettings{}, &defaultCfg, consumertest.NewNop())
assert.NoError(t, err)
assert.Equal(t, component.StabilityLevelStable, factory.MetricsToLogsStability())
- _, err = factory.CreateMetricsToLogs(context.Background(), CreateSettings{}, &defaultCfg, nil)
+ _, err = factory.CreateMetricsToLogs(context.Background(), CreateSettings{}, &defaultCfg, consumertest.NewNop())
assert.NoError(t, err)
assert.Equal(t, component.StabilityLevelDeprecated, factory.LogsToTracesStability())
- _, err = factory.CreateLogsToTraces(context.Background(), CreateSettings{}, &defaultCfg, nil)
+ _, err = factory.CreateLogsToTraces(context.Background(), CreateSettings{}, &defaultCfg, consumertest.NewNop())
assert.NoError(t, err)
assert.Equal(t, component.StabilityLevelUnmaintained, factory.LogsToMetricsStability())
- _, err = factory.CreateLogsToMetrics(context.Background(), CreateSettings{}, &defaultCfg, nil)
+ _, err = factory.CreateLogsToMetrics(context.Background(), CreateSettings{}, &defaultCfg, consumertest.NewNop())
assert.NoError(t, err)
assert.Equal(t, component.StabilityLevelUnmaintained, factory.LogsToLogsStability())
- _, err = factory.CreateLogsToLogs(context.Background(), CreateSettings{}, &defaultCfg, nil)
+ _, err = factory.CreateLogsToLogs(context.Background(), CreateSettings{}, &defaultCfg, consumertest.NewNop())
assert.NoError(t, err)
}
@@ -236,16 +236,22 @@ func TestBuilder(t *testing.T) {
require.NoError(t, err)
testCases := []struct {
- name string
- id component.ID
- err func(component.DataType, component.DataType) string
+ name string
+ id component.ID
+ err func(component.DataType, component.DataType) string
+ nextTraces consumer.Traces
+ nextLogs consumer.Logs
+ nextMetrics consumer.Metrics
}{
{
name: "unknown",
id: component.MustNewID("unknown"),
- err: func(_, _ component.DataType) string {
+ err: func(component.DataType, component.DataType) string {
return "connector factory not available for: \"unknown\""
},
+ nextTraces: consumertest.NewNop(),
+ nextLogs: consumertest.NewNop(),
+ nextMetrics: consumertest.NewNop(),
},
{
name: "err",
@@ -253,20 +259,39 @@ func TestBuilder(t *testing.T) {
err: func(expType, rcvType component.DataType) string {
return fmt.Sprintf("connector \"err\" cannot connect from %s to %s: telemetry type is not supported", expType, rcvType)
},
+ nextTraces: consumertest.NewNop(),
+ nextLogs: consumertest.NewNop(),
+ nextMetrics: consumertest.NewNop(),
},
{
name: "all",
id: component.MustNewID("all"),
- err: func(_, _ component.DataType) string {
+ err: func(component.DataType, component.DataType) string {
return ""
},
+ nextTraces: consumertest.NewNop(),
+ nextLogs: consumertest.NewNop(),
+ nextMetrics: consumertest.NewNop(),
},
{
name: "all/named",
id: component.MustNewIDWithName("all", "named"),
- err: func(_, _ component.DataType) string {
+ err: func(component.DataType, component.DataType) string {
return ""
},
+ nextTraces: consumertest.NewNop(),
+ nextLogs: consumertest.NewNop(),
+ nextMetrics: consumertest.NewNop(),
+ },
+ {
+ name: "no next consumer",
+ id: component.MustNewID("unknown"),
+ err: func(_, _ component.DataType) string {
+ return "nil next Consumer"
+ },
+ nextTraces: nil,
+ nextLogs: nil,
+ nextMetrics: nil,
},
}
@@ -275,7 +300,7 @@ func TestBuilder(t *testing.T) {
cfgs := map[component.ID]component.Config{tt.id: defaultCfg}
b := NewBuilder(cfgs, factories)
- t2t, err := b.CreateTracesToTraces(context.Background(), createSettings(tt.id), nil)
+ t2t, err := b.CreateTracesToTraces(context.Background(), createSettings(tt.id), tt.nextTraces)
if expectedErr := tt.err(component.DataTypeTraces, component.DataTypeTraces); expectedErr != "" {
assert.EqualError(t, err, expectedErr)
assert.Nil(t, t2t)
@@ -283,7 +308,7 @@ func TestBuilder(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, nopInstance, t2t)
}
- t2m, err := b.CreateTracesToMetrics(context.Background(), createSettings(tt.id), nil)
+ t2m, err := b.CreateTracesToMetrics(context.Background(), createSettings(tt.id), tt.nextMetrics)
if expectedErr := tt.err(component.DataTypeTraces, component.DataTypeMetrics); expectedErr != "" {
assert.EqualError(t, err, expectedErr)
assert.Nil(t, t2m)
@@ -291,7 +316,7 @@ func TestBuilder(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, nopInstance, t2m)
}
- t2l, err := b.CreateTracesToLogs(context.Background(), createSettings(tt.id), nil)
+ t2l, err := b.CreateTracesToLogs(context.Background(), createSettings(tt.id), tt.nextLogs)
if expectedErr := tt.err(component.DataTypeTraces, component.DataTypeLogs); expectedErr != "" {
assert.EqualError(t, err, expectedErr)
assert.Nil(t, t2l)
@@ -300,7 +325,7 @@ func TestBuilder(t *testing.T) {
assert.Equal(t, nopInstance, t2l)
}
- m2t, err := b.CreateMetricsToTraces(context.Background(), createSettings(tt.id), nil)
+ m2t, err := b.CreateMetricsToTraces(context.Background(), createSettings(tt.id), tt.nextTraces)
if expectedErr := tt.err(component.DataTypeMetrics, component.DataTypeTraces); expectedErr != "" {
assert.EqualError(t, err, expectedErr)
assert.Nil(t, m2t)
@@ -309,7 +334,7 @@ func TestBuilder(t *testing.T) {
assert.Equal(t, nopInstance, m2t)
}
- m2m, err := b.CreateMetricsToMetrics(context.Background(), createSettings(tt.id), nil)
+ m2m, err := b.CreateMetricsToMetrics(context.Background(), createSettings(tt.id), tt.nextMetrics)
if expectedErr := tt.err(component.DataTypeMetrics, component.DataTypeMetrics); expectedErr != "" {
assert.EqualError(t, err, expectedErr)
assert.Nil(t, m2m)
@@ -318,7 +343,7 @@ func TestBuilder(t *testing.T) {
assert.Equal(t, nopInstance, m2m)
}
- m2l, err := b.CreateMetricsToLogs(context.Background(), createSettings(tt.id), nil)
+ m2l, err := b.CreateMetricsToLogs(context.Background(), createSettings(tt.id), tt.nextLogs)
if expectedErr := tt.err(component.DataTypeMetrics, component.DataTypeLogs); expectedErr != "" {
assert.EqualError(t, err, expectedErr)
assert.Nil(t, m2l)
@@ -327,7 +352,7 @@ func TestBuilder(t *testing.T) {
assert.Equal(t, nopInstance, m2l)
}
- l2t, err := b.CreateLogsToTraces(context.Background(), createSettings(tt.id), nil)
+ l2t, err := b.CreateLogsToTraces(context.Background(), createSettings(tt.id), tt.nextTraces)
if expectedErr := tt.err(component.DataTypeLogs, component.DataTypeTraces); expectedErr != "" {
assert.EqualError(t, err, expectedErr)
assert.Nil(t, l2t)
@@ -336,7 +361,7 @@ func TestBuilder(t *testing.T) {
assert.Equal(t, nopInstance, l2t)
}
- l2m, err := b.CreateLogsToMetrics(context.Background(), createSettings(tt.id), nil)
+ l2m, err := b.CreateLogsToMetrics(context.Background(), createSettings(tt.id), tt.nextMetrics)
if expectedErr := tt.err(component.DataTypeLogs, component.DataTypeMetrics); expectedErr != "" {
assert.EqualError(t, err, expectedErr)
assert.Nil(t, l2m)
@@ -345,7 +370,7 @@ func TestBuilder(t *testing.T) {
assert.Equal(t, nopInstance, l2m)
}
- l2l, err := b.CreateLogsToLogs(context.Background(), createSettings(tt.id), nil)
+ l2l, err := b.CreateLogsToLogs(context.Background(), createSettings(tt.id), tt.nextLogs)
if expectedErr := tt.err(component.DataTypeLogs, component.DataTypeLogs); expectedErr != "" {
assert.EqualError(t, err, expectedErr)
assert.Nil(t, l2l)
@@ -380,39 +405,39 @@ func TestBuilderMissingConfig(t *testing.T) {
bErr := NewBuilder(map[component.ID]component.Config{}, factories)
missingID := component.MustNewIDWithName("all", "missing")
- t2t, err := bErr.CreateTracesToTraces(context.Background(), createSettings(missingID), nil)
+ t2t, err := bErr.CreateTracesToTraces(context.Background(), createSettings(missingID), consumertest.NewNop())
assert.EqualError(t, err, "connector \"all/missing\" is not configured")
assert.Nil(t, t2t)
- t2m, err := bErr.CreateTracesToMetrics(context.Background(), createSettings(missingID), nil)
+ t2m, err := bErr.CreateTracesToMetrics(context.Background(), createSettings(missingID), consumertest.NewNop())
assert.EqualError(t, err, "connector \"all/missing\" is not configured")
assert.Nil(t, t2m)
- t2l, err := bErr.CreateTracesToLogs(context.Background(), createSettings(missingID), nil)
+ t2l, err := bErr.CreateTracesToLogs(context.Background(), createSettings(missingID), consumertest.NewNop())
assert.EqualError(t, err, "connector \"all/missing\" is not configured")
assert.Nil(t, t2l)
- m2t, err := bErr.CreateMetricsToTraces(context.Background(), createSettings(missingID), nil)
+ m2t, err := bErr.CreateMetricsToTraces(context.Background(), createSettings(missingID), consumertest.NewNop())
assert.EqualError(t, err, "connector \"all/missing\" is not configured")
assert.Nil(t, m2t)
- m2m, err := bErr.CreateMetricsToMetrics(context.Background(), createSettings(missingID), nil)
+ m2m, err := bErr.CreateMetricsToMetrics(context.Background(), createSettings(missingID), consumertest.NewNop())
assert.EqualError(t, err, "connector \"all/missing\" is not configured")
assert.Nil(t, m2m)
- m2l, err := bErr.CreateMetricsToLogs(context.Background(), createSettings(missingID), nil)
+ m2l, err := bErr.CreateMetricsToLogs(context.Background(), createSettings(missingID), consumertest.NewNop())
assert.EqualError(t, err, "connector \"all/missing\" is not configured")
assert.Nil(t, m2l)
- l2t, err := bErr.CreateLogsToTraces(context.Background(), createSettings(missingID), nil)
+ l2t, err := bErr.CreateLogsToTraces(context.Background(), createSettings(missingID), consumertest.NewNop())
assert.EqualError(t, err, "connector \"all/missing\" is not configured")
assert.Nil(t, l2t)
- l2m, err := bErr.CreateLogsToMetrics(context.Background(), createSettings(missingID), nil)
+ l2m, err := bErr.CreateLogsToMetrics(context.Background(), createSettings(missingID), consumertest.NewNop())
assert.EqualError(t, err, "connector \"all/missing\" is not configured")
assert.Nil(t, l2m)
- l2l, err := bErr.CreateLogsToLogs(context.Background(), createSettings(missingID), nil)
+ l2l, err := bErr.CreateLogsToLogs(context.Background(), createSettings(missingID), consumertest.NewNop())
assert.EqualError(t, err, "connector \"all/missing\" is not configured")
assert.Nil(t, l2l)
}
diff --git a/connector/connectortest/connector.go b/connector/connectortest/connector.go
index d30fb65b6a5..0aad0b71142 100644
--- a/connector/connectortest/connector.go
+++ b/connector/connectortest/connector.go
@@ -6,6 +6,8 @@ package connectortest // import "go.opentelemetry.io/collector/connector/connect
import (
"context"
+ "github.com/google/uuid"
+
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/connector"
@@ -18,7 +20,7 @@ var nopType = component.MustNewType("nop")
// NewNopCreateSettings returns a new nop settings for Create* functions.
func NewNopCreateSettings() connector.CreateSettings {
return connector.CreateSettings{
- ID: component.NewID(nopType),
+ ID: component.NewIDWithName(nopType, uuid.NewString()),
TelemetrySettings: componenttest.NewNopTelemetrySettings(),
BuildInfo: component.NewDefaultBuildInfo(),
}
diff --git a/connector/forwardconnector/generated_component_test.go b/connector/forwardconnector/generated_component_test.go
new file mode 100644
index 00000000000..27af252dad1
--- /dev/null
+++ b/connector/forwardconnector/generated_component_test.go
@@ -0,0 +1,76 @@
+// Code generated by mdatagen. DO NOT EDIT.
+
+package forwardconnector
+
+import (
+ "context"
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ "go.opentelemetry.io/collector/component"
+ "go.opentelemetry.io/collector/component/componenttest"
+ "go.opentelemetry.io/collector/confmap/confmaptest"
+ "go.opentelemetry.io/collector/connector"
+ "go.opentelemetry.io/collector/connector/connectortest"
+ "go.opentelemetry.io/collector/consumer/consumertest"
+)
+
+func TestComponentLifecycle(t *testing.T) {
+ factory := NewFactory()
+
+ tests := []struct {
+ name string
+ createFn func(ctx context.Context, set connector.CreateSettings, cfg component.Config) (component.Component, error)
+ }{
+
+ {
+ name: "logs_to_logs",
+ createFn: func(ctx context.Context, set connector.CreateSettings, cfg component.Config) (component.Component, error) {
+ return factory.CreateLogsToLogs(ctx, set, cfg, consumertest.NewNop())
+ },
+ },
+
+ {
+ name: "metrics_to_metrics",
+ createFn: func(ctx context.Context, set connector.CreateSettings, cfg component.Config) (component.Component, error) {
+ return factory.CreateMetricsToMetrics(ctx, set, cfg, consumertest.NewNop())
+ },
+ },
+
+ {
+ name: "traces_to_traces",
+ createFn: func(ctx context.Context, set connector.CreateSettings, cfg component.Config) (component.Component, error) {
+ return factory.CreateTracesToTraces(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(), connectortest.NewNopCreateSettings(), cfg)
+ require.NoError(t, err)
+ err = c.Shutdown(context.Background())
+ require.NoError(t, err)
+ })
+ t.Run(test.name+"-lifecycle", func(t *testing.T) {
+ firstConnector, err := test.createFn(context.Background(), connectortest.NewNopCreateSettings(), cfg)
+ require.NoError(t, err)
+ host := componenttest.NewNopHost()
+ require.NoError(t, err)
+ require.NoError(t, firstConnector.Start(context.Background(), host))
+ require.NoError(t, firstConnector.Shutdown(context.Background()))
+ secondConnector, err := test.createFn(context.Background(), connectortest.NewNopCreateSettings(), cfg)
+ require.NoError(t, err)
+ require.NoError(t, secondConnector.Start(context.Background(), host))
+ require.NoError(t, secondConnector.Shutdown(context.Background()))
+ })
+ }
+}
diff --git a/connector/forwardconnector/go.mod b/connector/forwardconnector/go.mod
index 99826faa03f..e51c3eca8b0 100644
--- a/connector/forwardconnector/go.mod
+++ b/connector/forwardconnector/go.mod
@@ -1,15 +1,16 @@
module go.opentelemetry.io/collector/connector/forwardconnector
-go 1.20
+go 1.21
require (
- github.com/stretchr/testify v1.8.4
- go.opentelemetry.io/collector/component v0.93.0
- go.opentelemetry.io/collector/connector v0.93.0
- go.opentelemetry.io/collector/consumer v0.93.0
- go.opentelemetry.io/collector/pdata v1.0.1
- go.opentelemetry.io/otel/metric v1.22.0
- go.opentelemetry.io/otel/trace v1.22.0
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector/component v0.97.0
+ go.opentelemetry.io/collector/confmap v0.97.0
+ go.opentelemetry.io/collector/connector v0.97.0
+ go.opentelemetry.io/collector/consumer v0.97.0
+ go.opentelemetry.io/collector/pdata v1.4.0
+ go.opentelemetry.io/otel/metric v1.24.0
+ go.opentelemetry.io/otel/trace v1.24.0
go.uber.org/goleak v1.3.0
)
@@ -19,37 +20,37 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
+ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
+ github.com/google/uuid 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/knadh/koanf/v2 v2.1.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
- github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
- github.com/prometheus/client_golang v1.18.0 // indirect
- github.com/prometheus/client_model v0.5.0 // indirect
- github.com/prometheus/common v0.46.0 // indirect
+ github.com/prometheus/client_golang v1.19.0 // indirect
+ github.com/prometheus/client_model v0.6.0 // indirect
+ github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
- go.opentelemetry.io/collector v0.93.0 // indirect
- go.opentelemetry.io/collector/config/configtelemetry v0.93.0 // indirect
- go.opentelemetry.io/collector/confmap v0.93.0 // indirect
- go.opentelemetry.io/otel v1.22.0 // indirect
- go.opentelemetry.io/otel/exporters/prometheus v0.45.0 // indirect
- go.opentelemetry.io/otel/sdk v1.22.0 // indirect
- go.opentelemetry.io/otel/sdk/metric v1.22.0 // indirect
+ go.opentelemetry.io/collector v0.97.0 // indirect
+ go.opentelemetry.io/collector/config/configtelemetry v0.97.0 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/exporters/prometheus v0.46.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk/metric v1.24.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
- go.uber.org/zap v1.26.0 // indirect
- golang.org/x/net v0.20.0 // indirect
- golang.org/x/sys v0.16.0 // indirect
+ go.uber.org/zap v1.27.0 // indirect
+ golang.org/x/net v0.23.0 // indirect
+ golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
- google.golang.org/grpc v1.61.0 // indirect
- google.golang.org/protobuf v1.32.0 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
+ google.golang.org/grpc v1.62.1 // indirect
+ google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/connector/forwardconnector/go.sum b/connector/forwardconnector/go.sum
index 1a3cf2a28f2..267b9a3ccd8 100644
--- a/connector/forwardconnector/go.sum
+++ b/connector/forwardconnector/go.sum
@@ -10,6 +10,8 @@ github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
@@ -17,7 +19,10 @@ 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.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
+github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
+github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
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=
@@ -26,14 +31,14 @@ github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NI
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/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -43,39 +48,40 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=
-github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA=
-github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
-github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
-github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y=
-github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ=
+github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU=
+github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k=
+github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=
+github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8=
+github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=
+github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
+github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
-github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y=
-go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0 h1:BeIK2KGho0oCWa7LxEGSqfDZbs7Fpv/Viz+FS4P8CXE=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0/go.mod h1:UVJZPLnfDSvHj+eJuZE+E1GjIBD267mEMfAAHJdghWg=
-go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg=
-go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY=
-go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw=
-go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc=
-go.opentelemetry.io/otel/sdk/metric v1.22.0 h1:ARrRetm1HCVxq0cbnaZQlfwODYJHo3gFL8Z3tSmHBcI=
-go.opentelemetry.io/otel/sdk/metric v1.22.0/go.mod h1:KjQGeMIDlBNEOo6HvjhxIec1p/69/kULDcp4gr0oLQQ=
-go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0=
-go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0 h1:I8WIFXR351FoLJYuloU4EgXbtNX2URfU/85pUPheIEQ=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0/go.mod h1:ztwVUHe5DTR/1v7PeuGRnU5Bbd4QKYwApWmuutKsJSs=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/sdk/metric v1.24.0 h1:yyMQrPzF+k88/DbH7o4FMAs80puqd+9osbiBrJrz/w8=
+go.opentelemetry.io/otel/sdk/metric v1.24.0/go.mod h1:I6Y5FjH6rvEnTTAYQz3Mmv2kl6Ek5IIrmwTLqMrrOE0=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
-go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
-go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -85,16 +91,16 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
-golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
+golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
+golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
-golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
+golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
@@ -107,15 +113,16 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA=
-google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
-google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s=
+google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=
+google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
-google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/connector/forwardconnector/internal/metadata/generated_status.go b/connector/forwardconnector/internal/metadata/generated_status.go
index 9505adb84d7..4cc68caccad 100644
--- a/connector/forwardconnector/internal/metadata/generated_status.go
+++ b/connector/forwardconnector/internal/metadata/generated_status.go
@@ -20,9 +20,9 @@ const (
)
func Meter(settings component.TelemetrySettings) metric.Meter {
- return settings.MeterProvider.Meter("otelcol/forward")
+ return settings.MeterProvider.Meter("go.opentelemetry.io/collector/connector/forwardconnector")
}
func Tracer(settings component.TelemetrySettings) trace.Tracer {
- return settings.TracerProvider.Tracer("otelcol/forward")
+ return settings.TracerProvider.Tracer("go.opentelemetry.io/collector/connector/forwardconnector")
}
diff --git a/connector/go.mod b/connector/go.mod
index 479da206954..3f4214fe48e 100644
--- a/connector/go.mod
+++ b/connector/go.mod
@@ -1,16 +1,17 @@
module go.opentelemetry.io/collector/connector
-go 1.20
+go 1.21
require (
- github.com/stretchr/testify v1.8.4
- go.opentelemetry.io/collector v0.93.0
- go.opentelemetry.io/collector/component v0.93.0
- go.opentelemetry.io/collector/consumer v0.93.0
- go.opentelemetry.io/collector/pdata v1.0.1
+ github.com/google/uuid v1.6.0
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector v0.97.0
+ go.opentelemetry.io/collector/component v0.97.0
+ go.opentelemetry.io/collector/consumer v0.97.0
+ go.opentelemetry.io/collector/pdata v1.4.0
go.uber.org/goleak v1.3.0
go.uber.org/multierr v1.11.0
- go.uber.org/zap v1.26.0
+ go.uber.org/zap v1.27.0
)
require (
@@ -19,36 +20,36 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
+ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
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/knadh/koanf/v2 v2.1.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
- github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
- github.com/prometheus/client_golang v1.18.0 // indirect
- github.com/prometheus/client_model v0.5.0 // indirect
- github.com/prometheus/common v0.46.0 // indirect
+ github.com/prometheus/client_golang v1.19.0 // indirect
+ github.com/prometheus/client_model v0.6.0 // indirect
+ github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
- go.opentelemetry.io/collector/config/configtelemetry v0.93.0 // indirect
- go.opentelemetry.io/collector/confmap v0.93.0 // indirect
- go.opentelemetry.io/otel v1.22.0 // indirect
- go.opentelemetry.io/otel/exporters/prometheus v0.45.0 // indirect
- go.opentelemetry.io/otel/metric v1.22.0 // indirect
- go.opentelemetry.io/otel/sdk v1.22.0 // indirect
- go.opentelemetry.io/otel/sdk/metric v1.22.0 // indirect
- go.opentelemetry.io/otel/trace v1.22.0 // indirect
- golang.org/x/net v0.20.0 // indirect
- golang.org/x/sys v0.16.0 // indirect
+ go.opentelemetry.io/collector/config/configtelemetry v0.97.0 // indirect
+ go.opentelemetry.io/collector/confmap v0.97.0 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/exporters/prometheus v0.46.0 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
+ golang.org/x/net v0.23.0 // indirect
+ golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
- google.golang.org/grpc v1.61.0 // indirect
- google.golang.org/protobuf v1.32.0 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
+ google.golang.org/grpc v1.62.1 // indirect
+ google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/connector/go.sum b/connector/go.sum
index 1a3cf2a28f2..267b9a3ccd8 100644
--- a/connector/go.sum
+++ b/connector/go.sum
@@ -10,6 +10,8 @@ github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
@@ -17,7 +19,10 @@ 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.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
+github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
+github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
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=
@@ -26,14 +31,14 @@ github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NI
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/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -43,39 +48,40 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=
-github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA=
-github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
-github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
-github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y=
-github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ=
+github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU=
+github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k=
+github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=
+github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8=
+github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=
+github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
+github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
-github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y=
-go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0 h1:BeIK2KGho0oCWa7LxEGSqfDZbs7Fpv/Viz+FS4P8CXE=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0/go.mod h1:UVJZPLnfDSvHj+eJuZE+E1GjIBD267mEMfAAHJdghWg=
-go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg=
-go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY=
-go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw=
-go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc=
-go.opentelemetry.io/otel/sdk/metric v1.22.0 h1:ARrRetm1HCVxq0cbnaZQlfwODYJHo3gFL8Z3tSmHBcI=
-go.opentelemetry.io/otel/sdk/metric v1.22.0/go.mod h1:KjQGeMIDlBNEOo6HvjhxIec1p/69/kULDcp4gr0oLQQ=
-go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0=
-go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0 h1:I8WIFXR351FoLJYuloU4EgXbtNX2URfU/85pUPheIEQ=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0/go.mod h1:ztwVUHe5DTR/1v7PeuGRnU5Bbd4QKYwApWmuutKsJSs=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/sdk/metric v1.24.0 h1:yyMQrPzF+k88/DbH7o4FMAs80puqd+9osbiBrJrz/w8=
+go.opentelemetry.io/otel/sdk/metric v1.24.0/go.mod h1:I6Y5FjH6rvEnTTAYQz3Mmv2kl6Ek5IIrmwTLqMrrOE0=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
-go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
-go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -85,16 +91,16 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
-golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
+golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
+golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
-golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
+golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
@@ -107,15 +113,16 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA=
-google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
-google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s=
+google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=
+google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
-google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/connector/logs_router.go b/connector/logs_router.go
index e5594327ffc..2d642c94315 100644
--- a/connector/logs_router.go
+++ b/connector/logs_router.go
@@ -13,12 +13,6 @@ import (
"go.opentelemetry.io/collector/internal/fanoutconsumer"
)
-// Deprecated: [v0.92.0] use LogsRouterAndConsumer
-type LogsRouter interface {
- Consumer(...component.ID) (consumer.Logs, error)
- PipelineIDs() []component.ID
-}
-
// LogsRouterAndConsumer feeds the first consumer.Logs in each of the specified pipelines.
type LogsRouterAndConsumer interface {
consumer.Logs
diff --git a/connector/metrics_router.go b/connector/metrics_router.go
index 8e2b8e900a1..ad572782225 100644
--- a/connector/metrics_router.go
+++ b/connector/metrics_router.go
@@ -13,12 +13,6 @@ import (
"go.opentelemetry.io/collector/internal/fanoutconsumer"
)
-// Deprecated: [v0.92.0] use MetricsRouterAndConsumer.
-type MetricsRouter interface {
- Consumer(...component.ID) (consumer.Metrics, error)
- PipelineIDs() []component.ID
-}
-
// MetricsRouterAndConsumer feeds the first consumer.Metrics in each of the specified pipelines.
type MetricsRouterAndConsumer interface {
consumer.Metrics
diff --git a/connector/traces_router.go b/connector/traces_router.go
index 97c31d7920c..293fd723dc7 100644
--- a/connector/traces_router.go
+++ b/connector/traces_router.go
@@ -13,12 +13,6 @@ import (
"go.opentelemetry.io/collector/internal/fanoutconsumer"
)
-// Deprecated: [v0.92.0] use TracesRouterAndConsumer
-type TracesRouter interface {
- Consumer(...component.ID) (consumer.Traces, error)
- PipelineIDs() []component.ID
-}
-
// TracesRouterAndConsumer feeds the first consumer.Traces in each of the specified pipelines.
type TracesRouterAndConsumer interface {
consumer.Traces
diff --git a/consumer/consumertest/err.go b/consumer/consumertest/err.go
index 279cf4baf29..d147453aaf7 100644
--- a/consumer/consumertest/err.go
+++ b/consumer/consumertest/err.go
@@ -13,8 +13,8 @@ import (
// NewErr returns a Consumer that just drops all received data and returns the specified error to Consume* callers.
func NewErr(err error) Consumer {
return &baseConsumer{
- ConsumeTracesFunc: func(ctx context.Context, td ptrace.Traces) error { return err },
- ConsumeMetricsFunc: func(ctx context.Context, md pmetric.Metrics) error { return err },
- ConsumeLogsFunc: func(ctx context.Context, ld plog.Logs) error { return err },
+ ConsumeTracesFunc: func(context.Context, ptrace.Traces) error { return err },
+ ConsumeMetricsFunc: func(context.Context, pmetric.Metrics) error { return err },
+ ConsumeLogsFunc: func(context.Context, plog.Logs) error { return err },
}
}
diff --git a/consumer/consumertest/nop.go b/consumer/consumertest/nop.go
index 157d0e4b3b2..fbb01e3bb98 100644
--- a/consumer/consumertest/nop.go
+++ b/consumer/consumertest/nop.go
@@ -14,8 +14,8 @@ import (
// NewNop returns a Consumer that just drops all received data and returns no error.
func NewNop() Consumer {
return &baseConsumer{
- ConsumeTracesFunc: func(ctx context.Context, td ptrace.Traces) error { return nil },
- ConsumeMetricsFunc: func(ctx context.Context, md pmetric.Metrics) error { return nil },
- ConsumeLogsFunc: func(ctx context.Context, ld plog.Logs) error { return nil },
+ ConsumeTracesFunc: func(context.Context, ptrace.Traces) error { return nil },
+ ConsumeMetricsFunc: func(context.Context, pmetric.Metrics) error { return nil },
+ ConsumeLogsFunc: func(context.Context, plog.Logs) error { return nil },
}
}
diff --git a/consumer/go.mod b/consumer/go.mod
index 9d09be94688..e304cc0c4e5 100644
--- a/consumer/go.mod
+++ b/consumer/go.mod
@@ -1,11 +1,11 @@
module go.opentelemetry.io/collector/consumer
-go 1.20
+go 1.21
require (
- github.com/stretchr/testify v1.8.4
- go.opentelemetry.io/collector v0.93.0
- go.opentelemetry.io/collector/pdata v1.0.1
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector v0.97.0
+ go.opentelemetry.io/collector/pdata v1.4.0
go.uber.org/goleak v1.3.0
)
@@ -19,12 +19,12 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
- golang.org/x/net v0.20.0 // indirect
- golang.org/x/sys v0.16.0 // indirect
+ golang.org/x/net v0.23.0 // indirect
+ golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
- google.golang.org/grpc v1.61.0 // indirect
- google.golang.org/protobuf v1.32.0 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
+ google.golang.org/grpc v1.62.1 // indirect
+ google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/consumer/go.sum b/consumer/go.sum
index 0dfa6e2e510..7ccffd120df 100644
--- a/consumer/go.sum
+++ b/consumer/go.sum
@@ -9,12 +9,14 @@ 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.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -25,10 +27,11 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
+github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
-github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
@@ -44,16 +47,16 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
-golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
+golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
+golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
-golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
+golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
@@ -66,15 +69,16 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA=
-google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
-google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s=
+google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=
+google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
-google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/docs/design.md b/docs/design.md
deleted file mode 100644
index 17cf2f6b853..00000000000
--- a/docs/design.md
+++ /dev/null
@@ -1,205 +0,0 @@
-# OpenTelemetry Collector Architecture
-
-This document describes the architecture design and implementation of the
-OpenTelemetry Collector.
-
-## Summary
-
-OpenTelemetry Collector is an executable that can receive telemetry data, optionally process it, and export it further.
-
-The Collector supports several popular open-source protocols for receiving and sending telemetry data as well as offering a pluggable architecture for adding more protocols.
-
-Data receiving, processing, and exporting is done using [Pipelines](#pipelines). The Collector can be configured to have one or more pipelines. Each pipeline includes:
-
-- a set of [Receivers](#receivers) that receive the data
-- a series of optional [Processors](#processors) that get the data from receivers and process it
-- a set of [Exporters](#exporters) which get the data from processors and send it further outside the Collector.
-
-The same receiver can be included in multiple pipelines and multiple pipelines can include the same Exporter.
-
-## Pipelines
-
-A pipeline defines a path the data follows in the Collector starting from reception, then further processing or modification and finally exiting the Collector via exporters.
-
-Pipelines can operate on 3 telemetry data types: traces, metrics, and logs. The data type is a property of the pipeline defined by its configuration. Receivers, processors, and exporters used in a pipeline must support the particular data type otherwise `ErrDataTypeIsNotSupported` will be reported when the configuration is loaded. A pipeline can be depicted the following way:
-
-![Pipelines](images/design-pipelines.png)
-
-There can be one or more receivers in a pipeline. Data from all receivers is pushed to the first processor, which performs a processing on it and then pushes it to the next processor (or it may drop the data, e.g. if it is a “sampling” processor) and so on until the last processor in the pipeline pushes the data to the exporters. Each exporter gets a copy of each data element. The last processor uses a `fanoutconsumer` to fan out the data to multiple exporters.
-
-The pipeline is constructed during Collector startup based on pipeline definition in the configuration.
-
-A pipeline configuration typically looks like this:
-
-```yaml
-service:
- pipelines: # section that can contain multiple subsections, one per pipeline
- traces: # type of the pipeline
- receivers: [otlp, jaeger, zipkin]
- processors: [memory_limiter, batch]
- exporters: [otlp, jaeger, zipkin]
-```
-
-The above example defines a pipeline for “traces” type of telemetry data, with 3 receivers, 2 processors and 3 exporters.
-
-For details of config file format see [this document](https://docs.google.com/document/d/1NeheFG7DmcUYo_h2vLtNRlia9x5wOJMlV4QKEK05FhQ/edit#).
-
-### Receivers
-
-Receivers typically listen on a network port and receive telemetry data. Usually one receiver is configured to send received data to one pipeline, however it is also possible to configure the same receiver to send the same received data to multiple pipelines. This can be done by simply listing the same receiver in the “receivers” key of several pipelines:
-
-```yaml
-receivers:
- otlp:
- protocols:
- grpc:
- endpoint: localhost:4317
-
-service:
- pipelines:
- traces: # a pipeline of “traces” type
- receivers: [otlp]
- processors: [memory_limiter, batch]
- exporters: [jaeger]
- traces/2: # another pipeline of “traces” type
- receivers: [otlp]
- processors: [batch]
- exporters: [opencensus]
-```
-
-In the above example `otlp` receiver will send the same data to pipeline `traces` and to pipeline `traces/2`. (Note: the configuration uses composite key names in the form of `type[/name]` as defined in [this document](https://docs.google.com/document/d/1NeheFG7DmcUYo_h2vLtNRlia9x5wOJMlV4QKEK05FhQ/edit#)).
-
-When the Collector loads this config the result will look like this (part of processors and exporters are omitted from the diagram for brevity):
-
-
-![Receivers](images/design-receivers.png)
-
-Important: when the same receiver is referenced in more than one pipeline the Collector will create only one receiver instance at runtime that will send the data to a fan out consumer, which in turn will send the data to the first processor of each pipeline. The data propagation from receiver to the fan out consumer and then to processors is done via a synchronous function call. This means that if one processor blocks the call the other pipelines that are attached to this receiver will be blocked from receiving the same data and the receiver itself will stop processing and forwarding newly received data.
-
-### Exporters
-
-Exporters typically forward the data they get to a destination on a network (but they can also send it elsewhere, e.g `logging` exporter writes the telemetry data to the logging destination).
-
-The configuration allows to have multiple exporters of the same type, even in the same pipeline. For example one can have 2 `otlp` exporters defined each one sending to a different OTLP endpoint, e.g.:
-
-```yaml
-exporters:
- otlp/1:
- endpoint: example.com:4317
- otlp/2:
- endpoint: localhost:14317
-```
-
-Usually an exporter gets the data from one pipeline, however it is possible to configure multiple pipelines to send data to the same exporter, e.g.:
-
-```yaml
-exporters:
- jaeger:
- protocols:
- grpc:
- endpoint: localhost:14250
-
-service:
- pipelines:
- traces: # a pipeline of “traces” type
- receivers: [zipkin]
- processors: [memory_limiter]
- exporters: [jaeger]
- traces/2: # another pipeline of “traces” type
- receivers: [otlp]
- processors: [batch]
- exporters: [jaeger]
-```
-
-In the above example `jaeger` exporter will get data from pipeline `traces` and from pipeline `traces/2`. When the Collector loads this config the result will look like this (part of processors and receivers are omitted from the diagram for brevity):
-
-
-![Exporters](images/design-exporters.png)
-
-### Processors
-
-A pipeline can contain sequentially connected processors. The first processor gets the data from one or more receivers that are configured for the pipeline, the last processor sends the data to one or more exporters that are configured for the pipeline. All processors between the first and last receive the data strictly only from one preceding processor and send data strictly only to the succeeding processor.
-
-Processors can transform the data before forwarding it (i.e. add or remove attributes from spans), they can drop the data simply by deciding not to forward it (this is for example how the `probabilisticsampler` processor works), they can also generate new data. This is how a `spanmetrics` processor can produce metrics for spans processed by the pipeline.
-
-The same name of the processor can be referenced in the `processors` key of multiple pipelines. In this case the same configuration will be used for each of these processors however each pipeline will always get its own instance of the processor. Each of these processors will have its own state, the processors are never shared between pipelines. For example if `batch` processor is used in several pipelines each pipeline will have its own batch processor (although each batch processor will be configured exactly the same way if they reference the same key in the configuration). As an example, given the following configuration:
-
-```yaml
-processors:
- batch:
- send_batch_size: 10000
- timeout: 10s
-
-service:
- pipelines:
- traces: # a pipeline of “traces” type
- receivers: [zipkin]
- processors: [batch]
- exporters: [jaeger]
- traces/2: # another pipeline of “traces” type
- receivers: [otlp]
- processors: [batch]
- exporters: [otlp]
-```
-
-When the Collector loads this config the result will look like this:
-
-
-![Processors](images/design-processors.png)
-
-Note that each `batch` processor is an independent instance, although both are configured the same way, i.e. each have a `send_batch_size` of 10000.
-
-The same name of the processor MUST NOT be referenced multiple times in the `processors` key of a single pipeline.
-
-## Running as an Agent
-
-On a typical VM/container, there are user applications running in some
-processes/pods with OpenTelemetry Library (Library). Previously, Library did
-all the recording, collecting, sampling and aggregation on traces/metrics/logs,
-and exported them to other persistent storage backends via the Library
-exporters, or displayed them on local zpages. This pattern has several
-drawbacks, for example:
-
-1. For each OpenTelemetry Library, exporters/zpages need to be re-implemented
- in native languages.
-2. In some programming languages (e.g Ruby, PHP), it is difficult to do the
- stats aggregation in process.
-3. To enable exporting OpenTelemetry spans/stats/metrics, application users
- need to manually add library exporters and redeploy their binaries. This is
- especially difficult when there’s already an incident and users want to use
- OpenTelemetry to investigate what’s going on right away.
-4. Application users need to take the responsibility in configuring and
- initializing exporters. This is error-prone (e.g they may not set up the
- correct credentials\monitored resources), and users may be reluctant to
- “pollute” their code with OpenTelemetry.
-
-To resolve the issues above, you can run OpenTelemetry Collector as an Agent.
-The Agent runs as a daemon in the VM/container and can be deployed independent
-of Library. Once Agent is deployed and running, it should be able to retrieve
-traces/metrics/logs from Library, export them to other backends. We MAY also
-give Agent the ability to push configurations (e.g sampling probability) to
-Library. For those languages that cannot do stats aggregation in process, they
-should also be able to send raw measurements and have Agent do the aggregation.
-
-
-![agent-architecture](images/design-collector-agent.png)
-
-For developers/maintainers of other libraries: Agent can also
-accept traces/metrics/logs from other tracing/monitoring libraries, such as
-Zipkin, Prometheus, etc. This is done by adding specific receivers. See
-[Receivers](#receivers) for details.
-
-## Running as a Gateway
-
-The OpenTelemetry Collector can run as a Gateway instance and receives spans
-and metrics exported by one or more Agents or Libraries, or by
-tasks/agents that emit in one of the supported protocols. The Collector is
-configured to send data to the configured exporter(s). The following figure
-summarizes the deployment architecture:
-
-
-![OpenTelemetry Collector Architecture](images/design-collector-service.png "OpenTelemetry Collector Architecture")
-
-The OpenTelemetry Collector can also be deployed in other configurations, such
-as receiving data from other agents or clients in one of the formats supported
-by its receivers.
diff --git a/docs/ga-roadmap.md b/docs/ga-roadmap.md
index 2f204ac9f74..2dc40d0645f 100644
--- a/docs/ga-roadmap.md
+++ b/docs/ga-roadmap.md
@@ -1,167 +1 @@
-# Collector GA Roadmap
-
-This document defines the roadmap followed by the OpenTelemetry Collector,
-along with tentative dates and requirements for GA (stability).
-
-In this document, the term “OpenTelemetry Collector packages" refers to all the golang
-modules and packages that are part of the “OpenTelemetry Collector” ecosystem which
-include the [core](https://github.com/open-telemetry/opentelemetry-collector) and
-[contrib](https://github.com/open-telemetry/opentelemetry-collector-contrib).
-
-In this document, the terms "OpenTelemetry Collector" and "Collector" both specifically
-refer to the entire OpenTelemetry Collector ecosystem’s including core and contrib.
-These terms do not refer to the specification or the Client libraries in this document.
-
-## Current Status
-
-The OpenTelemetry Collector ecosystem right now has a lot of packages that are in different
-stages of stability (experimental, alpha, beta, etc.). All these packages have different
-public APIs/Interfaces (e.g. code API, configuration, etc.).
-
-A significant amount of legacy code was inherited from the Collector's ancestor
-[OpenCensus Service](https://github.com/census-instrumentation/opencensus-service), since then
-the Collector changed the internal data model and other significant changes were made.
-
-Trying to mark the entire ecosystem GA, at the same moment, will be a significant effort and
-will take a significant amount of time.
-
-## Proposal
-
-This document proposes a GA Roadmap based on multiple phases, where different parts of the
-collector will be released as stable at different moments of time.
-
-At this moment we are completely defining only the first two phases of the process, and the
-next phases will be defined at a later stage once the Collector maintainers will have
-better understanding of the process and implications.
-
-The primary focus is on the tracing parts. When other signal's data models (proto definition)
-will be marked as stable, the amount of work necessary to stabilize their APIs will be minimal:
-`pdata` is auto-generated so all changes that we do for trace will apply to all of them,
-`consumer` is minimal interface, `component` as well.
-
-Metrics components such as (`receiver/prometheus`, `exporter/prometheusremotewrite`) are
-explicitly left out of this roadmap document because metrics data model is not complete.
-When that work finishes, we can add them to the Phase 3, or later.
-
-### Phase 1
-
-**Key Results:** At the end of this phase the Collector’s core API will be marked as Stable.
-
-At the end of this phase we want to achieve core APIs stability. This will allow developers
-to implement custom components and extend the collector will be marked as stable.
-The complete list of the packages/modules will be finalized during the first action item of
-this phase, but the tentative list is:
-
-* `consumer`
- * Official internal data model `pdata`.
- * Interfaces and utils to build a Consumer for (trace, metrics, logs).
-* `config`
- * Core `config` including service definition, component definition will be stabilized.
- * To be determined which config helpers will be marked as stable (e.g. configgrpc, etc.).
-* `component`
- * Interfaces and utils to build a Collector component (receiver, processor, exporter, extension).
-* `obsreport`
- * Focus on the public API of this package. It is out of scope to ensure stability for the
- metrics emitted (focus in phase 2).
-* `service`
- * Public API to construct a OpenTelemetry Collector Service.
-
-**Action Items:**
-
-* Create a new milestone for this phase, create issues for all the other action items and add
-them to the milestone.
-* Agreement on all packages/modules that will be marked as stable during this phase.
-* Write a version doc as per [version and stability document](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md).
- * Previously it was discussed that for the Collector it is fine to release stable golang modules
- that contain APIs marked as experimental.
- * Define status schema (experimental/stable), what are they applicable to every module.
-* Investigate if splitting into smaller, more granular, modules is possible.
- * Define the modules schema, try to not break everyone.
- See [here](https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository).
- * Investigate how can we release multiple golang modules from the same repo, without asking
- people that consume them to use a replace statement. See problem in contrib.
- * Investigate how to release test-only utils.
-* Review all public APIs and godocs for modules that we want to release in this phase.
- * Fix all critical issues, and remove unnecessary (“When in doubt leave it out”) public APIs.
- * Remove all already deprecated code from the stable modules.
-* Transition to opentelemetry-go trace library from opencensus?
-* Investigate if any config helper needs to be released as stable, if any do the review of
-the public API, godoc and configuration.
-* Investigate tools that check for API compatibility for go modules, enable them for modules
-that we mark as stable.
-
-### Phase 2
-
-**Key Results:** At the end of this phase the Collector’s end-to-end support for OTLP traces
-only be marked as GA.
-
-At the end of this phase we want to ensure that the Collector can be run in production, it can receive
-OTLP trace traffic and emit OTLP trace traffic. The complete list of the packages/modules will be
-finalized during the first part of this phase, but the tentative list is:
-
-* `receiver`
- * `receiverhelper` - without scraper utils in this phase.
- * `otlp`
-* `processor`
- * `processorhelper`
- * `batch`
- * `memory_limiter`
-* `exporter`
- * `exporterhelper`
- * `otlp`
- * `otlphttp`
-* `extension`
- * `extensionhelper`
- * `healthcheck`
-* `obsreport`
- * Stabilize the observability metrics (user public metrics).
-
-**Action Items:**
-
-* Create a new milestone for this phase, create issues for all the other action items and add them
-to the milestone.
-* Agreement on all packages/modules that will be marked as stable during this phase.
-* Review all public APIs and godocs for modules that we want to release in this phase.
- * Fix all critical issues, and remove unnecessary (“When in doubt leave it out”) public APIs.
- * Remove all already deprecated code from the stable modules.
-* Review all public configuration for all the modules, fix issues.
-* Setup a proper loadtest environment and continuously publish results.
-* Ensure correctness tests produce the expected results, improve until confident that a binary
-that passes them is good to be shipped.
-* Enable security checks on every PR (currently some are ignored like `codeql`).
-
-### Phase 3
-
-**Key Results:** At the end of this phase all Collector’s core components (receivers,
-processors, exporters, extensions) for traces only will be marked as GA.
-
-At the end of this phase we want to ensure that the Collector can be run in production, it can receive the
-trace traffic and emit OTLP trace traffic. The complete list of the packages/modules will be finalized
-during the first part of this phase, but the tentative list is:
-
-* `receiver`
- * `jaeger`
- * `opencensus`
- * `zipkin`
-* `processor`
- * `spantransformer` - there are good reasons to merge `attributes` and `span`.
- * `resource`
- * `filter` - we will consider offering a filter processor for all telemetry signals not just for metrics
-* `exporter`
- * `jaeger`
- * `opencensus`
- * `zipkin`
-* `extension`
- * `pprof`
- * `zpages`
-
-TODO: Add action items list.
-
-### Phase N
-
-TODO: Add more phases if/when necessary.
-
-## Alternatives
-
-One alternative proposal is to try to GA all packages at the same time. This proposal was rejected
-because of the complexity and size of the ecosystem that may force the GA process to take too much time.
+# Collector v1 Roadmap
diff --git a/docs/images/design-collector-agent.png b/docs/images/design-collector-agent.png
deleted file mode 100644
index 7f50eb66fa6..00000000000
Binary files a/docs/images/design-collector-agent.png and /dev/null differ
diff --git a/docs/images/design-collector-service.png b/docs/images/design-collector-service.png
deleted file mode 100644
index 83f75e950f8..00000000000
Binary files a/docs/images/design-collector-service.png and /dev/null differ
diff --git a/docs/images/design-exporters.png b/docs/images/design-exporters.png
deleted file mode 100644
index d19d41d36d3..00000000000
Binary files a/docs/images/design-exporters.png and /dev/null differ
diff --git a/docs/images/design-pipelines.png b/docs/images/design-pipelines.png
deleted file mode 100644
index 1b58d7fc0d9..00000000000
Binary files a/docs/images/design-pipelines.png and /dev/null differ
diff --git a/docs/images/design-processors.png b/docs/images/design-processors.png
deleted file mode 100644
index 8026ada37b6..00000000000
Binary files a/docs/images/design-processors.png and /dev/null differ
diff --git a/docs/images/design-receivers.png b/docs/images/design-receivers.png
deleted file mode 100644
index ca1f647bb69..00000000000
Binary files a/docs/images/design-receivers.png and /dev/null differ
diff --git a/docs/images/opentelemetry-service-deployment-models.png b/docs/images/opentelemetry-service-deployment-models.png
deleted file mode 100644
index b977c0de015..00000000000
Binary files a/docs/images/opentelemetry-service-deployment-models.png and /dev/null differ
diff --git a/docs/images/zpages-example.png b/docs/images/zpages-example.png
deleted file mode 100644
index 168004dd6fc..00000000000
Binary files a/docs/images/zpages-example.png and /dev/null differ
diff --git a/docs/platform-support.md b/docs/platform-support.md
index df6cdd37abd..7112bea89b5 100644
--- a/docs/platform-support.md
+++ b/docs/platform-support.md
@@ -56,16 +56,16 @@ Tier 2 platforms are currently:
Tier 3 platforms are _guaranteed to build_. Precompiled binaries are made available as part of the release process and as result of a cross compile build on Linux amd64 but the binaries are not tested at all. Any build failure delays the release of the binaries for the respective platform but not the collector distribution for all other platforms. Defects are addressed based on community contributions. Core developers might provide guidance or code reviews, but direct fixes may be limited.
Tier 3 platforms are currently:
-| Platform | Owner(s) |
-|---------------|-------------------------------------------------------------------------------------------------------------|
-| darwin/amd64 | [@h0cheung](https://github.com/h0cheung) |
-| darwin/arm64 | [@MovieStoreGuy](https://github.com/MovieStoreGuy) |
-| linux/arm64 | [@atoulme](https://github.com/atoulme) |
-| linux/386 | [@astencel-sumo](https://github.com/astencel-sumo) |
-| linux/arm | [@Wal8800](https://github.com/Wal8800), [@atoulme](https://github.com/atoulme) |
-| linux/ppc64le | |
-| linux/s390x | [@bwalk-at-ibm](https://github.com/bwalk-at-ibm), [@rrschulze](https://github.com/rrschulze) |
-| windows/386 | [@pjanotti](https://github.com/pjanotti) |
+| Platform | Owner(s) |
+|---------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| darwin/amd64 | [@h0cheung](https://github.com/h0cheung) |
+| darwin/arm64 | [@MovieStoreGuy](https://github.com/MovieStoreGuy) |
+| linux/arm64 | [@atoulme](https://github.com/atoulme) |
+| linux/386 | [@astencel-sumo](https://github.com/astencel-sumo) |
+| linux/arm | [@Wal8800](https://github.com/Wal8800), [@atoulme](https://github.com/atoulme) |
+| linux/ppc64le | [@IBM-Currency-Helper](https://github.com/IBM-Currency-Helper), [@adilhusain-s](https://github.com/adilhusain-s), [@seth-priya](https://github.com/seth-priya) |
+| linux/s390x | [@bwalk-at-ibm](https://github.com/bwalk-at-ibm), [@rrschulze](https://github.com/rrschulze) |
+| windows/386 | [@pjanotti](https://github.com/pjanotti) |
The proposed additional platform aix/ppc64 ([#19195](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/19195)) will be included into Tier 3 once it's added to the OpenTelemetry Collector as platform.
diff --git a/docs/release.md b/docs/release.md
index 5fb12339a35..4da847d352a 100644
--- a/docs/release.md
+++ b/docs/release.md
@@ -25,7 +25,8 @@ It is possible that a core approver isn't a contrib approver. In that case, the
## Releasing opentelemetry-collector
-1. Update Contrib to use the latest in development version of Core. Run `make update-otel` in Contrib root directory and if it results in any changes submit a draft PR to Contrib. Ensure the CI passes before proceeding. This is to ensure that the latest core does not break contrib in any way. We’ll update it once more to the final release number later.
+1. Update Contrib to use the latest in development version of Core by running `make update-otel` in Contrib root directory. This is to ensure that the latest core does not break contrib in any way. If it results in any changes, submit a PR to Contrib.
+ - 🛑 **Do not move forward until this PR is merged.**
2. Determine the version number that will be assigned to the release. Usually, we increment the minor version number and set the patch number to 0. In this document, we are using `v0.85.0` as the version to be released, following `v0.84.0`.
Check if stable modules have any changes since the last release by running `make check-changes PREVIOUS_VERSION=v1.0.0 MODSET=stable`. If there are no changes, there is no need to release new version for stable modules.
@@ -155,12 +156,12 @@ Once a module is ready to be released under the `1.x` version scheme, file a PR
## Release schedule
-| Date | Version | Release manager |
-|------------|---------|-----------------|
-| 2024-01-22 | v0.93.0 | @bogdandrutu |
-| 2024-02-05 | v0.94.0 | @Aneurysm9 |
-| 2024-02-19 | v0.95.0 | @jpkrohling |
-| 2024-03-04 | v0.96.0 | @mx-psi |
-| 2024-03-18 | v0.97.0 | @djaglowski |
-| 2024-04-01 | v0.98.0 | @dmitryax |
-| 2024-04-15 | v0.99.0 | @codeboten |
+| Date | Version | Release manager |
+|------------|----------|-----------------|
+| 2024-03-25 | v0.97.0 | @djaglowski |
+| 2024-04-08 | v0.98.0 | @dmitryax |
+| 2024-04-22 | v0.99.0 | @codeboten |
+| 2024-05-06 | v0.100.0 | @bogdandrutu |
+| 2024-05-20 | v0.101.0 | @Aneurysm9 |
+| 2024-06-03 | v0.102.0 | @jpkrohling |
+| 2024-06-17 | v0.103.0 | @mx-psi |
diff --git a/docs/rfcs/README.md b/docs/rfcs/README.md
new file mode 100644
index 00000000000..7d15f803bc4
--- /dev/null
+++ b/docs/rfcs/README.md
@@ -0,0 +1,10 @@
+# Collector RFCs
+
+This folder contains accepted design documents for the Collector.
+Proposals here imply changes only on the OpenTelemetry Collector and not on other parts of OpenTelemetry; if you have a cross-cutting proposal, file an [OTEP][1] instead.
+
+Accepted RFCs:
+
+- [OpenTelemetry Collector Processor Exploration](./processing.md)
+
+[1]: https://github.com/open-telemetry/oteps
diff --git a/docs/processing.md b/docs/rfcs/processing.md
similarity index 99%
rename from docs/processing.md
rename to docs/rfcs/processing.md
index 63e5e21b705..331fa16c617 100644
--- a/docs/processing.md
+++ b/docs/rfcs/processing.md
@@ -57,7 +57,7 @@ expectations.
- Create new metrics based on information in spans, for example to create a duration metric that is not implemented in the SDK yet
- Apply arithmetic between multiple incoming metrics to produce an output one, for example divide an `amount` and a `capacity` to create a `utilization` metric
-The processors implementing this use case are `metricsgenerationprocessor`, `spanmetricsprocessor`.
+The components implementing this use case are `metricsgenerationprocessor` and the former `spanmetricsprocessor` (now `spanmetricsconnector`).
### Grouping
diff --git a/docs/security-best-practices.md b/docs/security-best-practices.md
index f68fafe9a73..8c57d09ebc9 100644
--- a/docs/security-best-practices.md
+++ b/docs/security-best-practices.md
@@ -150,6 +150,9 @@ For more information, see [CWE-1327](https://cwe.mitre.org/data/definitions/1327
To change the default endpoint to be `localhost`-bound in all components, enable the `component.UseLocalHostAsDefaultHost` feature gate. This feature gate will be enabled by default in the Collector in a future release.
+
+If `localhost` resolves to a different IP due to your DNS settings then explicitly use the loopback IP instead: `127.0.0.1` for IPv4 or `::1` for IPv6. In IPv6 setups, ensure your system supports both IPv4 and IPv6 loopback addresses to avoid issues.
+
## Processors
Processors sit between receivers and exporters. They are responsible for
@@ -171,7 +174,7 @@ scrub sensitive data before exporting.
In addition, processors offer safeguards around resource utilization. The
`batch` and especially `memory_limiter` processor help ensure that the
-Collector is resource efficient and does not out of memory when overloaded. At
+Collector is resource efficient and does not run out of memory when overloaded. At
least these two processors SHOULD be enabled on every defined pipeline.
> For more information on recommended processors and order, see
@@ -218,4 +221,4 @@ Extensions may also be used to run subprocesses. This can be useful when
collection mechanisms that cannot natively be run by the Collector (e.g.
FluentBit). Subprocesses expose a completely separate attack vector that would
depend on the subprocess itself. In general, care should be taken before
-running any subprocesses alongside the Collector.
+running any subprocesses alongside the Collector.
\ No newline at end of file
diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md
index 21caec042fc..df9c995c507 100644
--- a/docs/troubleshooting.md
+++ b/docs/troubleshooting.md
@@ -38,6 +38,22 @@ service:
A Grafana dashboard for these metrics can be found
[here](https://grafana.com/grafana/dashboards/15983-opentelemetry-collector/).
+You can enhance metrics telemetry level using `level` field. The following is a list of all possible values and their explanations.
+
+- "none" indicates that no telemetry data should be collected;
+- "basic" is the recommended and covers the basics of the service telemetry.
+- "normal" adds some other indicators on top of basic.
+- "detailed" adds dimensions and views to the previous levels.
+
+For example:
+```yaml
+service:
+ telemetry:
+ metrics:
+ level: detailed
+ address: ":8888"
+```
+
Also note that a Collector can be configured to scrape its own metrics and send
it through configured pipelines. For example:
@@ -64,6 +80,22 @@ service:
exporters: [debug]
```
+### Traces
+
+OpenTelemetry Collector has an ability to send it's own traces using OTLP exporter. You can send the traces to OTLP server running on the same OpenTelemetry Collector, so it goes through configured pipelines. For example:
+
+```yaml
+service:
+ telemetry:
+ traces:
+ processors:
+ batch:
+ exporter:
+ otlp:
+ protocol: grpc/protobuf
+ endpoint: ${MY_POD_IP}:4317
+```
+
### zPages
The
diff --git a/examples/k8s/otel-config.yaml b/examples/k8s/otel-config.yaml
index c03b1a47bc4..791af80fc55 100644
--- a/examples/k8s/otel-config.yaml
+++ b/examples/k8s/otel-config.yaml
@@ -65,7 +65,7 @@ spec:
- command:
- "/otelcol"
- "--config=/conf/otel-agent-config.yaml"
- image: otel/opentelemetry-collector:0.93.0
+ image: otel/opentelemetry-collector:0.94.0
name: otel-agent
resources:
limits:
@@ -183,7 +183,7 @@ spec:
- command:
- "/otelcol"
- "--config=/conf/otel-collector-config.yaml"
- image: otel/opentelemetry-collector:0.93.0
+ image: otel/opentelemetry-collector:0.94.0
name: otel-collector
resources:
limits:
diff --git a/exporter/debugexporter/generated_component_test.go b/exporter/debugexporter/generated_component_test.go
new file mode 100644
index 00000000000..34ca9eaedce
--- /dev/null
+++ b/exporter/debugexporter/generated_component_test.go
@@ -0,0 +1,143 @@
+// Code generated by mdatagen. DO NOT EDIT.
+
+package debugexporter
+
+import (
+ "context"
+ "testing"
+ "time"
+
+ "github.com/stretchr/testify/require"
+
+ "go.opentelemetry.io/collector/component"
+ "go.opentelemetry.io/collector/component/componenttest"
+ "go.opentelemetry.io/collector/confmap/confmaptest"
+ "go.opentelemetry.io/collector/exporter"
+ "go.opentelemetry.io/collector/exporter/exportertest"
+ "go.opentelemetry.io/collector/pdata/pcommon"
+ "go.opentelemetry.io/collector/pdata/plog"
+ "go.opentelemetry.io/collector/pdata/pmetric"
+ "go.opentelemetry.io/collector/pdata/ptrace"
+)
+
+func TestComponentLifecycle(t *testing.T) {
+ factory := NewFactory()
+
+ tests := []struct {
+ name string
+ createFn func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error)
+ }{
+
+ {
+ name: "logs",
+ createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) {
+ return factory.CreateLogsExporter(ctx, set, cfg)
+ },
+ },
+
+ {
+ name: "metrics",
+ createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) {
+ return factory.CreateMetricsExporter(ctx, set, cfg)
+ },
+ },
+
+ {
+ name: "traces",
+ createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) {
+ return factory.CreateTracesExporter(ctx, set, cfg)
+ },
+ },
+ }
+
+ cm, err := confmaptest.LoadConf("metadata.yaml")
+ require.NoError(t, err)
+ cfg := factory.CreateDefaultConfig()
+ sub, err := cm.Sub("tests::config")
+ require.NoError(t, err)
+ require.NoError(t, component.UnmarshalConfig(sub, cfg))
+
+ for _, test := range tests {
+ t.Run(test.name+"-shutdown", func(t *testing.T) {
+ c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg)
+ require.NoError(t, err)
+ err = c.Shutdown(context.Background())
+ require.NoError(t, err)
+ })
+ t.Run(test.name+"-lifecycle", func(t *testing.T) {
+ c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg)
+ require.NoError(t, err)
+ host := componenttest.NewNopHost()
+ err = c.Start(context.Background(), host)
+ require.NoError(t, err)
+ require.NotPanics(t, func() {
+ switch test.name {
+ case "logs":
+ e, ok := c.(exporter.Logs)
+ require.True(t, ok)
+ logs := generateLifecycleTestLogs()
+ if !e.Capabilities().MutatesData {
+ logs.MarkReadOnly()
+ }
+ err = e.ConsumeLogs(context.Background(), logs)
+ case "metrics":
+ e, ok := c.(exporter.Metrics)
+ require.True(t, ok)
+ metrics := generateLifecycleTestMetrics()
+ if !e.Capabilities().MutatesData {
+ metrics.MarkReadOnly()
+ }
+ err = e.ConsumeMetrics(context.Background(), metrics)
+ case "traces":
+ e, ok := c.(exporter.Traces)
+ require.True(t, ok)
+ traces := generateLifecycleTestTraces()
+ if !e.Capabilities().MutatesData {
+ traces.MarkReadOnly()
+ }
+ err = e.ConsumeTraces(context.Background(), traces)
+ }
+ })
+
+ require.NoError(t, err)
+
+ err = c.Shutdown(context.Background())
+ require.NoError(t, err)
+ })
+ }
+}
+
+func generateLifecycleTestLogs() plog.Logs {
+ logs := plog.NewLogs()
+ rl := logs.ResourceLogs().AppendEmpty()
+ rl.Resource().Attributes().PutStr("resource", "R1")
+ l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty()
+ l.Body().SetStr("test log message")
+ l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now()))
+ return logs
+}
+
+func generateLifecycleTestMetrics() pmetric.Metrics {
+ metrics := pmetric.NewMetrics()
+ rm := metrics.ResourceMetrics().AppendEmpty()
+ rm.Resource().Attributes().PutStr("resource", "R1")
+ m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty()
+ m.SetName("test_metric")
+ dp := m.SetEmptyGauge().DataPoints().AppendEmpty()
+ dp.Attributes().PutStr("test_attr", "value_1")
+ dp.SetIntValue(123)
+ dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now()))
+ return metrics
+}
+
+func generateLifecycleTestTraces() ptrace.Traces {
+ traces := ptrace.NewTraces()
+ rs := traces.ResourceSpans().AppendEmpty()
+ rs.Resource().Attributes().PutStr("resource", "R1")
+ span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty()
+ span.Attributes().PutStr("test_attr", "value_1")
+ span.SetName("test_span")
+ span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second)))
+ span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now()))
+ return traces
+}
diff --git a/exporter/debugexporter/go.mod b/exporter/debugexporter/go.mod
index 7cd0a13fc22..434ac1d962c 100644
--- a/exporter/debugexporter/go.mod
+++ b/exporter/debugexporter/go.mod
@@ -1,59 +1,60 @@
module go.opentelemetry.io/collector/exporter/debugexporter
-go 1.20
+go 1.21
require (
- github.com/stretchr/testify v1.8.4
- go.opentelemetry.io/collector/component v0.93.0
- go.opentelemetry.io/collector/config/configtelemetry v0.93.0
- go.opentelemetry.io/collector/confmap v0.93.0
- go.opentelemetry.io/collector/exporter v0.93.0
- go.opentelemetry.io/otel/metric v1.22.0
- go.opentelemetry.io/otel/trace v1.22.0
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector/component v0.97.0
+ go.opentelemetry.io/collector/config/configtelemetry v0.97.0
+ go.opentelemetry.io/collector/confmap v0.97.0
+ go.opentelemetry.io/collector/exporter v0.97.0
+ go.opentelemetry.io/collector/pdata v1.4.0
+ go.opentelemetry.io/otel/metric v1.24.0
+ go.opentelemetry.io/otel/trace v1.24.0
go.uber.org/goleak v1.3.0
)
require (
github.com/beorn7/perks v1.0.1 // indirect
- github.com/cenkalti/backoff/v4 v4.2.1 // indirect
+ github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
+ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
+ github.com/google/uuid 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/knadh/koanf/v2 v2.1.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
- github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
- github.com/prometheus/client_golang v1.18.0 // indirect
- github.com/prometheus/client_model v0.5.0 // indirect
- github.com/prometheus/common v0.46.0 // indirect
+ github.com/prometheus/client_golang v1.19.0 // indirect
+ github.com/prometheus/client_model v0.6.0 // indirect
+ github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
- go.opentelemetry.io/collector v0.93.0 // indirect
- go.opentelemetry.io/collector/config/configretry v0.93.0 // indirect
- go.opentelemetry.io/collector/consumer v0.93.0 // indirect
- go.opentelemetry.io/collector/extension v0.93.0 // indirect
- go.opentelemetry.io/collector/pdata v1.0.1 // indirect
- go.opentelemetry.io/collector/receiver v0.93.0 // indirect
- go.opentelemetry.io/otel v1.22.0 // indirect
- go.opentelemetry.io/otel/exporters/prometheus v0.45.0 // indirect
- go.opentelemetry.io/otel/sdk v1.22.0 // indirect
- go.opentelemetry.io/otel/sdk/metric v1.22.0 // indirect
+ go.opentelemetry.io/collector v0.97.0 // indirect
+ go.opentelemetry.io/collector/config/configretry v0.97.0 // indirect
+ go.opentelemetry.io/collector/consumer v0.97.0 // indirect
+ go.opentelemetry.io/collector/extension v0.97.0 // indirect
+ go.opentelemetry.io/collector/receiver v0.97.0 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/exporters/prometheus v0.46.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk/metric v1.24.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
- go.uber.org/zap v1.26.0 // indirect
- golang.org/x/net v0.20.0 // indirect
- golang.org/x/sys v0.16.0 // indirect
+ go.uber.org/zap v1.27.0 // indirect
+ golang.org/x/net v0.23.0 // indirect
+ golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
- google.golang.org/grpc v1.61.0 // indirect
- google.golang.org/protobuf v1.32.0 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
+ google.golang.org/grpc v1.62.1 // indirect
+ google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/exporter/debugexporter/go.sum b/exporter/debugexporter/go.sum
index 8a046f9cc16..daf2741d99d 100644
--- a/exporter/debugexporter/go.sum
+++ b/exporter/debugexporter/go.sum
@@ -1,7 +1,7 @@
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/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
+github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/cespare/xxhash/v2 v2.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=
@@ -12,6 +12,8 @@ github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
@@ -19,7 +21,10 @@ 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.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
+github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
+github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
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=
@@ -28,14 +33,14 @@ github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NI
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/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -45,39 +50,40 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=
-github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA=
-github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
-github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
-github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y=
-github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ=
+github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU=
+github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k=
+github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=
+github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8=
+github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=
+github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
+github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
-github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y=
-go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0 h1:BeIK2KGho0oCWa7LxEGSqfDZbs7Fpv/Viz+FS4P8CXE=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0/go.mod h1:UVJZPLnfDSvHj+eJuZE+E1GjIBD267mEMfAAHJdghWg=
-go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg=
-go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY=
-go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw=
-go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc=
-go.opentelemetry.io/otel/sdk/metric v1.22.0 h1:ARrRetm1HCVxq0cbnaZQlfwODYJHo3gFL8Z3tSmHBcI=
-go.opentelemetry.io/otel/sdk/metric v1.22.0/go.mod h1:KjQGeMIDlBNEOo6HvjhxIec1p/69/kULDcp4gr0oLQQ=
-go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0=
-go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0 h1:I8WIFXR351FoLJYuloU4EgXbtNX2URfU/85pUPheIEQ=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0/go.mod h1:ztwVUHe5DTR/1v7PeuGRnU5Bbd4QKYwApWmuutKsJSs=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/sdk/metric v1.24.0 h1:yyMQrPzF+k88/DbH7o4FMAs80puqd+9osbiBrJrz/w8=
+go.opentelemetry.io/otel/sdk/metric v1.24.0/go.mod h1:I6Y5FjH6rvEnTTAYQz3Mmv2kl6Ek5IIrmwTLqMrrOE0=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
-go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
-go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -87,16 +93,16 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
-golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
+golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
+golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
-golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
+golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
@@ -109,15 +115,16 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA=
-google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
-google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s=
+google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=
+google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
-google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/exporter/debugexporter/internal/metadata/generated_status.go b/exporter/debugexporter/internal/metadata/generated_status.go
index 53acecdba3c..17813d2f8a6 100644
--- a/exporter/debugexporter/internal/metadata/generated_status.go
+++ b/exporter/debugexporter/internal/metadata/generated_status.go
@@ -20,9 +20,9 @@ const (
)
func Meter(settings component.TelemetrySettings) metric.Meter {
- return settings.MeterProvider.Meter("otelcol/debug")
+ return settings.MeterProvider.Meter("go.opentelemetry.io/collector/exporter/debugexporter")
}
func Tracer(settings component.TelemetrySettings) trace.Tracer {
- return settings.TracerProvider.Tracer("otelcol/debug")
+ return settings.TracerProvider.Tracer("go.opentelemetry.io/collector/exporter/debugexporter")
}
diff --git a/exporter/exporterbatcher/batch_func.go b/exporter/exporterbatcher/batch_func.go
new file mode 100644
index 00000000000..0298276ba7b
--- /dev/null
+++ b/exporter/exporterbatcher/batch_func.go
@@ -0,0 +1,24 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package exporterbatcher // import "go.opentelemetry.io/collector/exporter/exporterbatcher"
+
+import "context"
+
+// BatchMergeFunc is a function that merges two requests into a single request.
+// Do not mutate the requests passed to the function if error can be returned after mutation or if the exporter is
+// marked as not mutable.
+// Experimental: This API is at the early stage of development and may change without backward compatibility
+// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
+type BatchMergeFunc[T any] func(context.Context, T, T) (T, error)
+
+// BatchMergeSplitFunc is a function that merge and/or splits one or two requests into multiple requests based on the
+// configured limit provided in MaxSizeConfig.
+// All the returned requests MUST have a number of items that does not exceed the maximum number of items.
+// Size of the last returned request MUST be less or equal than the size of any other returned request.
+// The original request MUST not be mutated if error is returned after mutation or if the exporter is
+// marked as not mutable. The length of the returned slice MUST not be 0. The optionalReq argument can be nil,
+// make sure to check it before using.
+// Experimental: This API is at the early stage of development and may change without backward compatibility
+// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
+type BatchMergeSplitFunc[T any] func(ctx context.Context, cfg MaxSizeConfig, optionalReq T, req T) ([]T, error)
diff --git a/exporter/exporterbatcher/config.go b/exporter/exporterbatcher/config.go
new file mode 100644
index 00000000000..239dc2dd4fe
--- /dev/null
+++ b/exporter/exporterbatcher/config.go
@@ -0,0 +1,70 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package exporterbatcher // import "go.opentelemetry.io/collector/exporter/exporterbatcher"
+
+import (
+ "errors"
+ "time"
+)
+
+// Config defines a configuration for batching requests based on a timeout and a minimum number of items.
+// MaxSizeItems defines batch splitting functionality if it's more than zero.
+// Experimental: This API is at the early stage of development and may change without backward compatibility
+// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
+type Config struct {
+ // Enabled indicates whether to not enqueue batches before sending to the consumerSender.
+ Enabled bool `mapstructure:"enabled"`
+
+ // FlushTimeout sets the time after which a batch will be sent regardless of its size.
+ FlushTimeout time.Duration `mapstructure:"flush_timeout"`
+
+ MinSizeConfig `mapstructure:",squash"`
+ MaxSizeConfig `mapstructure:",squash"`
+}
+
+// MinSizeConfig defines the configuration for the minimum number of items in a batch.
+// Experimental: This API is at the early stage of development and may change without backward compatibility
+// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
+type MinSizeConfig struct {
+ // MinSizeItems is the number of items (spans, data points or log records for OTLP) at which the batch should be
+ // sent regardless of the timeout. There is no guarantee that the batch size always greater than this value.
+ // This option requires the Request to implement RequestItemsCounter interface. Otherwise, it will be ignored.
+ MinSizeItems int `mapstructure:"min_size_items"`
+}
+
+// MaxSizeConfig defines the configuration for the maximum number of items in a batch.
+// Experimental: This API is at the early stage of development and may change without backward compatibility
+// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
+type MaxSizeConfig struct {
+ // MaxSizeItems is the maximum number of the batch items, i.e. spans, data points or log records for OTLP.
+ // If the batch size exceeds this value, it will be broken up into smaller batches if possible.
+ // Setting this value to zero disables the maximum size limit.
+ MaxSizeItems int `mapstructure:"max_size_items"`
+}
+
+func (c Config) Validate() error {
+ if c.MinSizeItems < 0 {
+ return errors.New("min_size_items must be greater than or equal to zero")
+ }
+ if c.MaxSizeItems < 0 {
+ return errors.New("max_size_items must be greater than or equal to zero")
+ }
+ if c.MaxSizeItems != 0 && c.MaxSizeItems < c.MinSizeItems {
+ return errors.New("max_size_items must be greater than or equal to min_size_items")
+ }
+ if c.FlushTimeout <= 0 {
+ return errors.New("timeout must be greater than zero")
+ }
+ return nil
+}
+
+func NewDefaultConfig() Config {
+ return Config{
+ Enabled: true,
+ FlushTimeout: 200 * time.Millisecond,
+ MinSizeConfig: MinSizeConfig{
+ MinSizeItems: 8192,
+ },
+ }
+}
diff --git a/exporter/exporterbatcher/config_test.go b/exporter/exporterbatcher/config_test.go
new file mode 100644
index 00000000000..337f83ce318
--- /dev/null
+++ b/exporter/exporterbatcher/config_test.go
@@ -0,0 +1,30 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package exporterbatcher
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+)
+
+func TestConfig_Validate(t *testing.T) {
+ cfg := NewDefaultConfig()
+ assert.NoError(t, cfg.Validate())
+
+ cfg.MinSizeItems = -1
+ assert.EqualError(t, cfg.Validate(), "min_size_items must be greater than or equal to zero")
+
+ cfg = NewDefaultConfig()
+ cfg.FlushTimeout = 0
+ assert.EqualError(t, cfg.Validate(), "timeout must be greater than zero")
+
+ cfg.MaxSizeItems = -1
+ assert.EqualError(t, cfg.Validate(), "max_size_items must be greater than or equal to zero")
+
+ cfg = NewDefaultConfig()
+ cfg.MaxSizeItems = 20000
+ cfg.MinSizeItems = 20001
+ assert.EqualError(t, cfg.Validate(), "max_size_items must be greater than or equal to min_size_items")
+}
diff --git a/exporter/exporterhelper/README.md b/exporter/exporterhelper/README.md
index 627205d65c7..e32c948c924 100644
--- a/exporter/exporterhelper/README.md
+++ b/exporter/exporterhelper/README.md
@@ -12,7 +12,7 @@ The following configuration options can be modified:
- `enabled` (default = true)
- `initial_interval` (default = 5s): Time to wait after the first failure before retrying; ignored if `enabled` is `false`
- `max_interval` (default = 30s): Is the upper bound on backoff; ignored if `enabled` is `false`
- - `max_elapsed_time` (default = 300s): Is the maximum amount of time spent trying to send a batch; ignored if `enabled` is `false`
+ - `max_elapsed_time` (default = 300s): Is the maximum amount of time spent trying to send a batch; ignored if `enabled` is `false`. If set to 0, the retries are never stopped.
- `sending_queue`
- `enabled` (default = true)
- `num_consumers` (default = 10): Number of consumers that dequeue batches; ignored if `enabled` is `false`
@@ -31,10 +31,6 @@ valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
### Persistent Queue
-**Status: [alpha]**
-
-> :warning: The capability is under development. To use it, a storage extension needs to be set up.
-
To use the persistent queue, the following setting needs to be set:
- `sending_queue`
@@ -44,7 +40,7 @@ To use the persistent queue, the following setting needs to be set:
The maximum number of batches stored to disk can be controlled using `sending_queue.queue_size` parameter (which,
similarly as for in-memory buffering, defaults to 1000 batches).
-When persistent queue is enabled, the batches are being buffered using the provided storage extension - [filestorage] is a popular and safe choice. If the collector instance is killed while having some items in the persistent queue, on restart the items will be be picked and the exporting is continued.
+When persistent queue is enabled, the batches are being buffered using the provided storage extension - [filestorage] is a popular and safe choice. If the collector instance is killed while having some items in the persistent queue, on restart the items will be picked and the exporting is continued.
```
┌─Consumer #1─┐
@@ -66,19 +62,19 @@ When persistent queue is enabled, the batches are being buffered using the provi
│ │ │ │ │ │ │ 3 │ ├───► (in progress)
write read └─────┬─────┘ ├───►│ └───┘ │
index index │ │ │ │
- ▲ │ │ └─────────────┘
- │ │ │
- │ currently │ ┌─Consumer #4─┐
- │ dispatched │ │ ┌───┐ │ Temporary
- │ └───►│ │ 4 │ ├───► failure
- │ │ └───┘ │ │
- │ │ │ │
- │ └─────────────┘ │
- │ ▲ │
- │ └── Retry ───────┤
- │ │
- │ │
- └────────────────────────────────────── Requeuing ◄────── Retry limit exceeded ───┘
+ │ │ └─────────────┘
+ │ │
+ currently │ ┌─Consumer #4─┐
+ dispatched │ │ ┌───┐ │ Temporary
+ └───►│ │ 4 │ ├───► failure
+ │ └───┘ │ │
+ │ │ │
+ └─────────────┘ │
+ ▲ │
+ └── Retry ───────┤
+ │
+ │
+ X ◄────── Retry limit exceeded ───┘
```
Example:
diff --git a/exporter/exporterhelper/batch_sender.go b/exporter/exporterhelper/batch_sender.go
new file mode 100644
index 00000000000..da2ba88c057
--- /dev/null
+++ b/exporter/exporterhelper/batch_sender.go
@@ -0,0 +1,223 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package exporterhelper // import "go.opentelemetry.io/collector/exporter/exporterhelper"
+
+import (
+ "context"
+ "sync"
+ "sync/atomic"
+ "time"
+
+ "go.uber.org/zap"
+
+ "go.opentelemetry.io/collector/component"
+ "go.opentelemetry.io/collector/exporter"
+ "go.opentelemetry.io/collector/exporter/exporterbatcher"
+)
+
+// batchSender is a component that places requests into batches before passing them to the downstream senders.
+// Batches are sent out with any of the following conditions:
+// - batch size reaches cfg.SendBatchSize
+// - cfg.Timeout is elapsed since the timestamp when the previous batch was sent out.
+// - concurrencyLimit is reached.
+type batchSender struct {
+ baseRequestSender
+ cfg exporterbatcher.Config
+ mergeFunc exporterbatcher.BatchMergeFunc[Request]
+ mergeSplitFunc exporterbatcher.BatchMergeSplitFunc[Request]
+
+ // concurrencyLimit is the maximum number of goroutines that can be created by the batcher.
+ // If this number is reached and all the goroutines are busy, the batch will be sent right away.
+ // Populated from the number of queue consumers if queue is enabled.
+ concurrencyLimit uint64
+ activeRequests atomic.Uint64
+
+ resetTimerCh chan struct{}
+
+ mu sync.Mutex
+ activeBatch *batch
+
+ logger *zap.Logger
+
+ shutdownCh chan struct{}
+ stopped *atomic.Bool
+}
+
+// newBatchSender returns a new batch consumer component.
+func newBatchSender(cfg exporterbatcher.Config, set exporter.CreateSettings,
+ mf exporterbatcher.BatchMergeFunc[Request], msf exporterbatcher.BatchMergeSplitFunc[Request]) *batchSender {
+ bs := &batchSender{
+ activeBatch: newEmptyBatch(),
+ cfg: cfg,
+ logger: set.Logger,
+ mergeFunc: mf,
+ mergeSplitFunc: msf,
+ shutdownCh: make(chan struct{}),
+ stopped: &atomic.Bool{},
+ resetTimerCh: make(chan struct{}),
+ }
+ return bs
+}
+
+func (bs *batchSender) Start(_ context.Context, _ component.Host) error {
+ timer := time.NewTimer(bs.cfg.FlushTimeout)
+ go func() {
+ for {
+ select {
+ case <-bs.shutdownCh:
+ bs.mu.Lock()
+ if bs.activeBatch.request != nil {
+ bs.exportActiveBatch()
+ }
+ bs.mu.Unlock()
+ if !timer.Stop() {
+ <-timer.C
+ }
+ return
+ case <-timer.C:
+ bs.mu.Lock()
+ if bs.activeBatch.request != nil {
+ bs.exportActiveBatch()
+ }
+ bs.mu.Unlock()
+ timer.Reset(bs.cfg.FlushTimeout)
+ case <-bs.resetTimerCh:
+ if !timer.Stop() {
+ <-timer.C
+ }
+ timer.Reset(bs.cfg.FlushTimeout)
+ }
+ }
+ }()
+
+ return nil
+}
+
+type batch struct {
+ ctx context.Context
+ request Request
+ done chan struct{}
+ err error
+}
+
+func newEmptyBatch() *batch {
+ return &batch{
+ ctx: context.Background(),
+ done: make(chan struct{}),
+ }
+}
+
+// exportActiveBatch exports the active batch asynchronously and replaces it with a new one.
+// Caller must hold the lock.
+func (bs *batchSender) exportActiveBatch() {
+ go func(b *batch) {
+ b.err = b.request.Export(b.ctx)
+ close(b.done)
+ }(bs.activeBatch)
+ bs.activeBatch = newEmptyBatch()
+}
+
+// isActiveBatchReady returns true if the active batch is ready to be exported.
+// The batch is ready if it has reached the minimum size or the concurrency limit is reached.
+// Caller must hold the lock.
+func (bs *batchSender) isActiveBatchReady() bool {
+ return bs.activeBatch.request.ItemsCount() >= bs.cfg.MinSizeItems ||
+ (bs.concurrencyLimit > 0 && bs.activeRequests.Load() >= bs.concurrencyLimit)
+}
+
+func (bs *batchSender) send(ctx context.Context, req Request) error {
+ // Stopped batch sender should act as pass-through to allow the queue to be drained.
+ if bs.stopped.Load() {
+ return bs.nextSender.send(ctx, req)
+ }
+
+ if bs.cfg.MaxSizeItems > 0 {
+ return bs.sendMergeSplitBatch(ctx, req)
+ }
+ return bs.sendMergeBatch(ctx, req)
+}
+
+// sendMergeSplitBatch sends the request to the batch which may be split into multiple requests.
+func (bs *batchSender) sendMergeSplitBatch(ctx context.Context, req Request) error {
+ bs.mu.Lock()
+ bs.activeRequests.Add(1)
+ defer bs.activeRequests.Add(^uint64(0))
+
+ reqs, err := bs.mergeSplitFunc(ctx, bs.cfg.MaxSizeConfig, bs.activeBatch.request, req)
+ if err != nil || len(reqs) == 0 {
+ bs.mu.Unlock()
+ return err
+ }
+ if len(reqs) == 1 || bs.activeBatch.request != nil {
+ bs.updateActiveBatch(ctx, reqs[0])
+ batch := bs.activeBatch
+ if bs.isActiveBatchReady() || len(reqs) > 1 {
+ bs.exportActiveBatch()
+ bs.resetTimerCh <- struct{}{}
+ }
+ bs.mu.Unlock()
+ <-batch.done
+ if batch.err != nil {
+ return batch.err
+ }
+ reqs = reqs[1:]
+ } else {
+ bs.mu.Unlock()
+ }
+
+ // Intentionally do not put the last request in the active batch to not block it.
+ // TODO: Consider including the partial request in the error to avoid double publishing.
+ for _, r := range reqs {
+ if err := r.Export(ctx); err != nil {
+ return err
+ }
+ }
+ return nil
+}
+
+// sendMergeBatch sends the request to the batch and waits for the batch to be exported.
+func (bs *batchSender) sendMergeBatch(ctx context.Context, req Request) error {
+ bs.mu.Lock()
+ bs.activeRequests.Add(1)
+ defer bs.activeRequests.Add(^uint64(0))
+
+ if bs.activeBatch.request != nil {
+ var err error
+ req, err = bs.mergeFunc(ctx, bs.activeBatch.request, req)
+ if err != nil {
+ bs.mu.Unlock()
+ return err
+ }
+ }
+ bs.updateActiveBatch(ctx, req)
+ batch := bs.activeBatch
+ if bs.isActiveBatchReady() {
+ bs.exportActiveBatch()
+ bs.resetTimerCh <- struct{}{}
+ }
+ bs.mu.Unlock()
+ <-batch.done
+ return batch.err
+}
+
+// updateActiveBatch update the active batch to the new merged request and context.
+// The context is only set once and is not updated after the first call.
+// Merging the context would be complex and require an additional goroutine to handle the context cancellation.
+// We take the approach of using the context from the first request since it's likely to have the shortest timeout.
+func (bs *batchSender) updateActiveBatch(ctx context.Context, req Request) {
+ if bs.activeBatch.request == nil {
+ bs.activeBatch.ctx = ctx
+ }
+ bs.activeBatch.request = req
+}
+
+func (bs *batchSender) Shutdown(context.Context) error {
+ bs.stopped.Store(true)
+ close(bs.shutdownCh)
+ // Wait for the active requests to finish.
+ for bs.activeRequests.Load() > 0 {
+ time.Sleep(10 * time.Millisecond)
+ }
+ return nil
+}
diff --git a/exporter/exporterhelper/batch_sender_test.go b/exporter/exporterhelper/batch_sender_test.go
new file mode 100644
index 00000000000..5ea63c7d820
--- /dev/null
+++ b/exporter/exporterhelper/batch_sender_test.go
@@ -0,0 +1,448 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package exporterhelper // import "go.opentelemetry.io/collector/exporter/exporterhelper"
+
+import (
+ "context"
+ "errors"
+ "fmt"
+ "sync"
+ "testing"
+ "time"
+
+ "github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
+
+ "go.opentelemetry.io/collector/component/componenttest"
+ "go.opentelemetry.io/collector/exporter/exporterbatcher"
+ "go.opentelemetry.io/collector/exporter/exporterqueue"
+)
+
+func TestBatchSender_Merge(t *testing.T) {
+ cfg := exporterbatcher.NewDefaultConfig()
+ cfg.MinSizeItems = 10
+ cfg.FlushTimeout = 100 * time.Millisecond
+
+ tests := []struct {
+ name string
+ batcherOption Option
+ }{
+ {
+ name: "split_disabled",
+ batcherOption: WithBatcher(cfg, WithRequestBatchFuncs(fakeBatchMergeFunc, fakeBatchMergeSplitFunc)),
+ },
+ {
+ name: "split_high_limit",
+ batcherOption: func() Option {
+ c := cfg
+ c.MaxSizeItems = 1000
+ return WithBatcher(c, WithRequestBatchFuncs(fakeBatchMergeFunc, fakeBatchMergeSplitFunc))
+ }(),
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ be := queueBatchExporter(t, tt.batcherOption)
+
+ require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
+ t.Cleanup(func() {
+ require.NoError(t, be.Shutdown(context.Background()))
+ })
+
+ sink := newFakeRequestSink()
+
+ require.NoError(t, be.send(context.Background(), &fakeRequest{items: 8, sink: sink}))
+ require.NoError(t, be.send(context.Background(), &fakeRequest{items: 3, sink: sink}))
+
+ // the first two requests should be merged into one and sent by reaching the minimum items size
+ assert.Eventually(t, func() bool {
+ return sink.requestsCount.Load() == 1 && sink.itemsCount.Load() == 11
+ }, 50*time.Millisecond, 10*time.Millisecond)
+
+ require.NoError(t, be.send(context.Background(), &fakeRequest{items: 3, sink: sink}))
+ require.NoError(t, be.send(context.Background(), &fakeRequest{items: 1, sink: sink}))
+
+ // the third and fifth requests should be sent by reaching the timeout
+ // the fourth request should be ignored because of the merge error.
+ time.Sleep(50 * time.Millisecond)
+
+ // should be ignored because of the merge error.
+ require.NoError(t, be.send(context.Background(), &fakeRequest{items: 3, sink: sink,
+ mergeErr: errors.New("merge error")}))
+
+ assert.Equal(t, uint64(1), sink.requestsCount.Load())
+ assert.Eventually(t, func() bool {
+ return sink.requestsCount.Load() == 2 && sink.itemsCount.Load() == 15
+ }, 100*time.Millisecond, 10*time.Millisecond)
+ })
+ }
+}
+
+func TestBatchSender_BatchExportError(t *testing.T) {
+ cfg := exporterbatcher.NewDefaultConfig()
+ cfg.MinSizeItems = 10
+ tests := []struct {
+ name string
+ batcherOption Option
+ expectedRequests uint64
+ expectedItems uint64
+ }{
+ {
+ name: "merge_only",
+ batcherOption: WithBatcher(cfg, WithRequestBatchFuncs(fakeBatchMergeFunc, fakeBatchMergeSplitFunc)),
+ },
+ {
+ name: "merge_without_split_triggered",
+ batcherOption: func() Option {
+ c := cfg
+ c.MaxSizeItems = 200
+ return WithBatcher(c, WithRequestBatchFuncs(fakeBatchMergeFunc, fakeBatchMergeSplitFunc))
+ }(),
+ },
+ {
+ name: "merge_with_split_triggered",
+ batcherOption: func() Option {
+ c := cfg
+ c.MaxSizeItems = 20
+ return WithBatcher(c, WithRequestBatchFuncs(fakeBatchMergeFunc, fakeBatchMergeSplitFunc))
+ }(),
+ expectedRequests: 1,
+ expectedItems: 20,
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ be := queueBatchExporter(t, tt.batcherOption)
+
+ require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
+ t.Cleanup(func() {
+ require.NoError(t, be.Shutdown(context.Background()))
+ })
+
+ sink := newFakeRequestSink()
+
+ require.NoError(t, be.send(context.Background(), &fakeRequest{items: 4, sink: sink}))
+ require.NoError(t, be.send(context.Background(), &fakeRequest{items: 4, sink: sink}))
+
+ // the first two requests should be blocked by the batchSender.
+ time.Sleep(50 * time.Millisecond)
+ assert.Equal(t, uint64(0), sink.requestsCount.Load())
+
+ // the third request should trigger the export and cause an error.
+ errReq := &fakeRequest{items: 20, exportErr: errors.New("transient error"), sink: sink}
+ require.NoError(t, be.send(context.Background(), errReq))
+
+ // the batch should be dropped since the queue doesn't have requeuing enabled.
+ assert.Eventually(t, func() bool {
+ return sink.requestsCount.Load() == tt.expectedRequests &&
+ sink.itemsCount.Load() == tt.expectedItems &&
+ be.batchSender.(*batchSender).activeRequests.Load() == uint64(0) &&
+ be.queueSender.(*queueSender).queue.Size() == 0
+ }, 100*time.Millisecond, 10*time.Millisecond)
+ })
+ }
+}
+
+func TestBatchSender_MergeOrSplit(t *testing.T) {
+ cfg := exporterbatcher.NewDefaultConfig()
+ cfg.MinSizeItems = 5
+ cfg.MaxSizeItems = 10
+ cfg.FlushTimeout = 100 * time.Millisecond
+ be := queueBatchExporter(t, WithBatcher(cfg, WithRequestBatchFuncs(fakeBatchMergeFunc, fakeBatchMergeSplitFunc)))
+
+ require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
+ t.Cleanup(func() {
+ require.NoError(t, be.Shutdown(context.Background()))
+ })
+
+ sink := newFakeRequestSink()
+
+ // should be sent right away by reaching the minimum items size.
+ require.NoError(t, be.send(context.Background(), &fakeRequest{items: 8, sink: sink}))
+ assert.Eventually(t, func() bool {
+ return sink.requestsCount.Load() == 1 && sink.itemsCount.Load() == 8
+ }, 50*time.Millisecond, 10*time.Millisecond)
+
+ // big request should be broken down into two requests, both are sent right away.
+ require.NoError(t, be.send(context.Background(), &fakeRequest{items: 17, sink: sink}))
+
+ assert.Eventually(t, func() bool {
+ return sink.requestsCount.Load() == 3 && sink.itemsCount.Load() == 25
+ }, 50*time.Millisecond, 10*time.Millisecond)
+
+ // request that cannot be split should be dropped.
+ require.NoError(t, be.send(context.Background(), &fakeRequest{items: 11, sink: sink,
+ mergeErr: errors.New("split error")}))
+
+ // big request should be broken down into two requests, both are sent right away.
+ require.NoError(t, be.send(context.Background(), &fakeRequest{items: 13, sink: sink}))
+
+ assert.Eventually(t, func() bool {
+ return sink.requestsCount.Load() == 5 && sink.itemsCount.Load() == 38
+ }, 50*time.Millisecond, 10*time.Millisecond)
+
+ fmt.Println("TestBatchSender_MergeOrSplit")
+}
+
+func TestBatchSender_Shutdown(t *testing.T) {
+ batchCfg := exporterbatcher.NewDefaultConfig()
+ batchCfg.MinSizeItems = 10
+ be := queueBatchExporter(t, WithBatcher(batchCfg, WithRequestBatchFuncs(fakeBatchMergeFunc, fakeBatchMergeSplitFunc)))
+
+ require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
+
+ sink := newFakeRequestSink()
+ require.NoError(t, be.send(context.Background(), &fakeRequest{items: 3, sink: sink}))
+
+ // To make the request reached the batchSender before shutdown.
+ time.Sleep(50 * time.Millisecond)
+
+ require.NoError(t, be.Shutdown(context.Background()))
+
+ // shutdown should force sending the batch
+ assert.Equal(t, uint64(1), sink.requestsCount.Load())
+ assert.Equal(t, uint64(3), sink.itemsCount.Load())
+}
+
+func TestBatchSender_Disabled(t *testing.T) {
+ cfg := exporterbatcher.NewDefaultConfig()
+ cfg.Enabled = false
+ cfg.MaxSizeItems = 10
+ be, err := newBaseExporter(defaultSettings, defaultType, newNoopObsrepSender,
+ WithBatcher(cfg, WithRequestBatchFuncs(fakeBatchMergeFunc, fakeBatchMergeSplitFunc)))
+ require.NotNil(t, be)
+ require.NoError(t, err)
+
+ require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
+ t.Cleanup(func() {
+ require.NoError(t, be.Shutdown(context.Background()))
+ })
+
+ sink := newFakeRequestSink()
+ // should be sent right away because batching is disabled.
+ require.NoError(t, be.send(context.Background(), &fakeRequest{items: 8, sink: sink}))
+ assert.Equal(t, uint64(1), sink.requestsCount.Load())
+ assert.Equal(t, uint64(8), sink.itemsCount.Load())
+}
+
+func TestBatchSender_InvalidMergeSplitFunc(t *testing.T) {
+ invalidMergeSplitFunc := func(_ context.Context, _ exporterbatcher.MaxSizeConfig, _ Request, req2 Request) ([]Request,
+ error) {
+ // reply with invalid 0 length slice if req2 is more than 20 items
+ if req2.(*fakeRequest).items > 20 {
+ return []Request{}, nil
+ }
+ // otherwise reply with a single request.
+ return []Request{req2}, nil
+ }
+ cfg := exporterbatcher.NewDefaultConfig()
+ cfg.FlushTimeout = 50 * time.Millisecond
+ cfg.MaxSizeItems = 20
+ be := queueBatchExporter(t, WithBatcher(cfg, WithRequestBatchFuncs(fakeBatchMergeFunc, invalidMergeSplitFunc)))
+
+ require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
+ t.Cleanup(func() {
+ require.NoError(t, be.Shutdown(context.Background()))
+ })
+
+ sink := newFakeRequestSink()
+ // first request should be ignored due to invalid merge/split function.
+ require.NoError(t, be.send(context.Background(), &fakeRequest{items: 30, sink: sink}))
+ // second request should be sent after reaching the timeout.
+ require.NoError(t, be.send(context.Background(), &fakeRequest{items: 15, sink: sink}))
+ assert.Eventually(t, func() bool {
+ return sink.requestsCount.Load() == 1 && sink.itemsCount.Load() == 15
+ }, 100*time.Millisecond, 10*time.Millisecond)
+}
+
+func TestBatchSender_PostShutdown(t *testing.T) {
+ be, err := newBaseExporter(defaultSettings, defaultType, newNoopObsrepSender,
+ WithBatcher(exporterbatcher.NewDefaultConfig(), WithRequestBatchFuncs(fakeBatchMergeFunc,
+ fakeBatchMergeSplitFunc)))
+ require.NotNil(t, be)
+ require.NoError(t, err)
+ assert.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
+ assert.NoError(t, be.Shutdown(context.Background()))
+
+ // Closed batch sender should act as a pass-through to not block queue draining.
+ sink := newFakeRequestSink()
+ require.NoError(t, be.send(context.Background(), &fakeRequest{items: 8, sink: sink}))
+ assert.Equal(t, uint64(1), sink.requestsCount.Load())
+ assert.Equal(t, uint64(8), sink.itemsCount.Load())
+}
+
+func TestBatchSender_ConcurrencyLimitReached(t *testing.T) {
+ qCfg := exporterqueue.NewDefaultConfig()
+ qCfg.NumConsumers = 2
+ be, err := newBaseExporter(defaultSettings, defaultType, newNoopObsrepSender,
+ WithBatcher(exporterbatcher.NewDefaultConfig(), WithRequestBatchFuncs(fakeBatchMergeFunc, fakeBatchMergeSplitFunc)),
+ WithRequestQueue(qCfg, exporterqueue.NewMemoryQueueFactory[Request]()))
+ require.NotNil(t, be)
+ require.NoError(t, err)
+ assert.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
+ t.Cleanup(func() {
+ assert.NoError(t, be.Shutdown(context.Background()))
+ })
+
+ sink := newFakeRequestSink()
+ assert.NoError(t, be.send(context.Background(), &fakeRequest{items: 8, sink: sink}))
+
+ // the second request should be sent by reaching max concurrency limit.
+ assert.NoError(t, be.send(context.Background(), &fakeRequest{items: 8, sink: sink}))
+
+ assert.Eventually(t, func() bool {
+ return sink.requestsCount.Load() == 1 && sink.itemsCount.Load() == 16
+ }, 100*time.Millisecond, 10*time.Millisecond)
+}
+
+func TestBatchSender_BatchBlocking(t *testing.T) {
+ bCfg := exporterbatcher.NewDefaultConfig()
+ bCfg.MinSizeItems = 3
+ be, err := newBaseExporter(defaultSettings, defaultType, newNoopObsrepSender,
+ WithBatcher(bCfg, WithRequestBatchFuncs(fakeBatchMergeFunc, fakeBatchMergeSplitFunc)))
+ require.NotNil(t, be)
+ require.NoError(t, err)
+ require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
+
+ sink := newFakeRequestSink()
+
+ // send 6 blocking requests
+ wg := sync.WaitGroup{}
+ for i := 0; i < 6; i++ {
+ wg.Add(1)
+ go func() {
+ assert.NoError(t, be.send(context.Background(), &fakeRequest{items: 1, sink: sink, delay: 10 * time.Millisecond}))
+ wg.Done()
+ }()
+ }
+ wg.Wait()
+
+ // should be sent in two batches since the batch size is 3
+ assert.Equal(t, uint64(2), sink.requestsCount.Load())
+ assert.Equal(t, uint64(6), sink.itemsCount.Load())
+
+ require.NoError(t, be.Shutdown(context.Background()))
+}
+
+// Validate that the batch is cancelled once the first request in the request is cancelled
+func TestBatchSender_BatchCancelled(t *testing.T) {
+ bCfg := exporterbatcher.NewDefaultConfig()
+ bCfg.MinSizeItems = 2
+ be, err := newBaseExporter(defaultSettings, defaultType, newNoopObsrepSender,
+ WithBatcher(bCfg, WithRequestBatchFuncs(fakeBatchMergeFunc, fakeBatchMergeSplitFunc)))
+ require.NotNil(t, be)
+ require.NoError(t, err)
+ require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
+
+ sink := newFakeRequestSink()
+
+ // send 2 blocking requests
+ wg := sync.WaitGroup{}
+ ctx, cancel := context.WithCancel(context.Background())
+ wg.Add(1)
+ go func() {
+ assert.ErrorIs(t, be.send(ctx, &fakeRequest{items: 1, sink: sink, delay: 100 * time.Millisecond}), context.Canceled)
+ wg.Done()
+ }()
+ wg.Add(1)
+ go func() {
+ time.Sleep(20 * time.Millisecond) // ensure this call is the second
+ assert.ErrorIs(t, be.send(context.Background(), &fakeRequest{items: 1, sink: sink, delay: 100 * time.Millisecond}), context.Canceled)
+ wg.Done()
+ }()
+ cancel() // canceling the first request should cancel the whole batch
+ wg.Wait()
+
+ // nothing should be delivered
+ assert.Equal(t, uint64(0), sink.requestsCount.Load())
+ assert.Equal(t, uint64(0), sink.itemsCount.Load())
+
+ require.NoError(t, be.Shutdown(context.Background()))
+}
+
+func TestBatchSender_DrainActiveRequests(t *testing.T) {
+ bCfg := exporterbatcher.NewDefaultConfig()
+ bCfg.MinSizeItems = 2
+ be, err := newBaseExporter(defaultSettings, defaultType, newNoopObsrepSender,
+ WithBatcher(bCfg, WithRequestBatchFuncs(fakeBatchMergeFunc, fakeBatchMergeSplitFunc)))
+ require.NotNil(t, be)
+ require.NoError(t, err)
+ require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
+
+ sink := newFakeRequestSink()
+
+ // send 3 blocking requests with a timeout
+ go func() {
+ assert.NoError(t, be.send(context.Background(), &fakeRequest{items: 1, sink: sink, delay: 40 * time.Millisecond}))
+ }()
+ go func() {
+ assert.NoError(t, be.send(context.Background(), &fakeRequest{items: 1, sink: sink, delay: 40 * time.Millisecond}))
+ }()
+ go func() {
+ assert.NoError(t, be.send(context.Background(), &fakeRequest{items: 1, sink: sink, delay: 40 * time.Millisecond}))
+ }()
+
+ // give time for the first two requests to be batched
+ time.Sleep(20 * time.Millisecond)
+
+ // Shutdown should force the active batch to be dispatched and wait for all batches to be delivered.
+ // It should take 120 milliseconds to complete.
+ require.NoError(t, be.Shutdown(context.Background()))
+
+ assert.Equal(t, uint64(2), sink.requestsCount.Load())
+ assert.Equal(t, uint64(3), sink.itemsCount.Load())
+}
+
+func TestBatchSender_WithBatcherOption(t *testing.T) {
+ tests := []struct {
+ name string
+ opts []Option
+ expectedErr bool
+ }{
+ {
+ name: "no_funcs_set",
+ opts: []Option{WithBatcher(exporterbatcher.NewDefaultConfig())},
+ expectedErr: true,
+ },
+ {
+ name: "funcs_set_internally",
+ opts: []Option{withBatchFuncs(fakeBatchMergeFunc, fakeBatchMergeSplitFunc), WithBatcher(exporterbatcher.NewDefaultConfig())},
+ expectedErr: false,
+ },
+ {
+ name: "funcs_set_twice",
+ opts: []Option{
+ withBatchFuncs(fakeBatchMergeFunc, fakeBatchMergeSplitFunc),
+ WithBatcher(exporterbatcher.NewDefaultConfig(), WithRequestBatchFuncs(fakeBatchMergeFunc,
+ fakeBatchMergeSplitFunc)),
+ },
+ expectedErr: true,
+ },
+ {
+ name: "nil_funcs",
+ opts: []Option{WithBatcher(exporterbatcher.NewDefaultConfig(), WithRequestBatchFuncs(nil, nil))},
+ expectedErr: true,
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ be, err := newBaseExporter(defaultSettings, defaultType, newNoopObsrepSender, tt.opts...)
+ if tt.expectedErr {
+ assert.Nil(t, be)
+ assert.Error(t, err)
+ } else {
+ assert.NotNil(t, be)
+ assert.NoError(t, err)
+ }
+ })
+ }
+}
+
+func queueBatchExporter(t *testing.T, batchOption Option) *baseExporter {
+ be, err := newBaseExporter(defaultSettings, defaultType, newNoopObsrepSender, batchOption,
+ WithRequestQueue(exporterqueue.NewDefaultConfig(), exporterqueue.NewMemoryQueueFactory[Request]()))
+ require.NotNil(t, be)
+ require.NoError(t, err)
+ return be
+}
diff --git a/exporter/exporterhelper/common.go b/exporter/exporterhelper/common.go
index b5e7aa39a33..267656b4051 100644
--- a/exporter/exporterhelper/common.go
+++ b/exporter/exporterhelper/common.go
@@ -5,6 +5,7 @@ package exporterhelper // import "go.opentelemetry.io/collector/exporter/exporte
import (
"context"
+ "fmt"
"go.uber.org/multierr"
"go.uber.org/zap"
@@ -13,6 +14,8 @@ import (
"go.opentelemetry.io/collector/config/configretry"
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/exporter"
+ "go.opentelemetry.io/collector/exporter/exporterbatcher"
+ "go.opentelemetry.io/collector/exporter/exporterqueue"
)
// requestSender is an abstraction of a sender for a request independent of the type of the data (traces, metrics, logs).
@@ -41,41 +44,45 @@ func (b *baseRequestSender) setNextSender(nextSender requestSender) {
type obsrepSenderFactory func(obsrep *ObsReport) requestSender
// Option apply changes to baseExporter.
-type Option func(*baseExporter)
+type Option func(*baseExporter) error
// WithStart overrides the default Start function for an exporter.
// The default start function does nothing and always returns nil.
func WithStart(start component.StartFunc) Option {
- return func(o *baseExporter) {
+ return func(o *baseExporter) error {
o.StartFunc = start
+ return nil
}
}
// WithShutdown overrides the default Shutdown function for an exporter.
// The default shutdown function does nothing and always returns nil.
func WithShutdown(shutdown component.ShutdownFunc) Option {
- return func(o *baseExporter) {
+ return func(o *baseExporter) error {
o.ShutdownFunc = shutdown
+ return nil
}
}
// WithTimeout overrides the default TimeoutSettings for an exporter.
// The default TimeoutSettings is 5 seconds.
func WithTimeout(timeoutSettings TimeoutSettings) Option {
- return func(o *baseExporter) {
+ return func(o *baseExporter) error {
o.timeoutSender.cfg = timeoutSettings
+ return nil
}
}
// WithRetry overrides the default configretry.BackOffConfig for an exporter.
// The default configretry.BackOffConfig is to disable retries.
func WithRetry(config configretry.BackOffConfig) Option {
- return func(o *baseExporter) {
+ return func(o *baseExporter) error {
if !config.Enabled {
o.exportFailureMessage += " Try enabling retry_on_failure config option to retry on retryable errors."
- return
+ return nil
}
o.retrySender = newRetrySender(config, o.set)
+ return nil
}
}
@@ -83,19 +90,50 @@ func WithRetry(config configretry.BackOffConfig) Option {
// The default QueueSettings is to disable queueing.
// This option cannot be used with the new exporter helpers New[Traces|Metrics|Logs]RequestExporter.
func WithQueue(config QueueSettings) Option {
- return func(o *baseExporter) {
- if o.requestExporter {
- panic("queueing is not available for the new request exporters yet")
+ return func(o *baseExporter) error {
+ if o.marshaler == nil || o.unmarshaler == nil {
+ return fmt.Errorf("WithQueue option is not available for the new request exporters, use WithRequestQueue instead")
}
if !config.Enabled {
o.exportFailureMessage += " Try enabling sending_queue to survive temporary failures."
- return
+ return nil
}
- consumeErrHandler := func(err error, req Request) {
- o.set.Logger.Error("Exporting failed. Dropping data."+o.exportFailureMessage,
- zap.Error(err), zap.Int("dropped_items", req.ItemsCount()))
+ qf := exporterqueue.NewPersistentQueueFactory[Request](config.StorageID, exporterqueue.PersistentQueueSettings[Request]{
+ Marshaler: o.marshaler,
+ Unmarshaler: o.unmarshaler,
+ })
+ q := qf(context.Background(), exporterqueue.Settings{
+ DataType: o.signal,
+ ExporterSettings: o.set,
+ }, exporterqueue.Config{
+ Enabled: config.Enabled,
+ NumConsumers: config.NumConsumers,
+ QueueSize: config.QueueSize,
+ })
+ o.queueSender = newQueueSender(q, o.set, config.NumConsumers, o.exportFailureMessage)
+ return nil
+ }
+}
+
+// WithRequestQueue enables queueing for an exporter.
+// This option should be used with the new exporter helpers New[Traces|Metrics|Logs]RequestExporter.
+// Experimental: This API is at the early stage of development and may change without backward compatibility
+// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
+func WithRequestQueue(cfg exporterqueue.Config, queueFactory exporterqueue.Factory[Request]) Option {
+ return func(o *baseExporter) error {
+ if o.marshaler != nil || o.unmarshaler != nil {
+ return fmt.Errorf("WithRequestQueue option must be used with the new request exporters only, use WithQueue instead")
+ }
+ if !cfg.Enabled {
+ o.exportFailureMessage += " Try enabling sending_queue to survive temporary failures."
+ return nil
}
- o.queueSender = newQueueSender(config, o.set, o.signal, o.marshaler, o.unmarshaler, consumeErrHandler)
+ set := exporterqueue.Settings{
+ DataType: o.signal,
+ ExporterSettings: o.set,
+ }
+ o.queueSender = newQueueSender(queueFactory(context.Background(), set, cfg), o.set, cfg.NumConsumers, o.exportFailureMessage)
+ return nil
}
}
@@ -103,8 +141,76 @@ func WithQueue(config QueueSettings) Option {
// The default is non-mutable data.
// TODO: Verify if we can change the default to be mutable as we do for processors.
func WithCapabilities(capabilities consumer.Capabilities) Option {
- return func(o *baseExporter) {
+ return func(o *baseExporter) error {
o.consumerOptions = append(o.consumerOptions, consumer.WithCapabilities(capabilities))
+ return nil
+ }
+}
+
+// BatcherOption apply changes to batcher sender.
+type BatcherOption func(*batchSender) error
+
+// WithRequestBatchFuncs sets the functions for merging and splitting batches for an exporter built for custom request types.
+func WithRequestBatchFuncs(mf exporterbatcher.BatchMergeFunc[Request], msf exporterbatcher.BatchMergeSplitFunc[Request]) BatcherOption {
+ return func(bs *batchSender) error {
+ if mf == nil || msf == nil {
+ return fmt.Errorf("WithRequestBatchFuncs must be provided with non-nil functions")
+ }
+ if bs.mergeFunc != nil || bs.mergeSplitFunc != nil {
+ return fmt.Errorf("WithRequestBatchFuncs can only be used once with request-based exporters")
+ }
+ bs.mergeFunc = mf
+ bs.mergeSplitFunc = msf
+ return nil
+ }
+}
+
+// WithBatcher enables batching for an exporter based on custom request types.
+// For now, it can be used only with the New[Traces|Metrics|Logs]RequestExporter exporter helpers and
+// WithRequestBatchFuncs provided.
+// This API is at the early stage of development and may change without backward compatibility
+// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
+func WithBatcher(cfg exporterbatcher.Config, opts ...BatcherOption) Option {
+ return func(o *baseExporter) error {
+ bs := newBatchSender(cfg, o.set, o.batchMergeFunc, o.batchMergeSplitfunc)
+ for _, opt := range opts {
+ if err := opt(bs); err != nil {
+ return err
+ }
+ }
+ if bs.mergeFunc == nil || bs.mergeSplitFunc == nil {
+ return fmt.Errorf("WithRequestBatchFuncs must be provided for the batcher applied to the request-based exporters")
+ }
+ o.batchSender = bs
+ return nil
+ }
+}
+
+// withMarshaler is used to set the request marshaler for the new exporter helper.
+// It must be provided as the first option when creating a new exporter helper.
+func withMarshaler(marshaler exporterqueue.Marshaler[Request]) Option {
+ return func(o *baseExporter) error {
+ o.marshaler = marshaler
+ return nil
+ }
+}
+
+// withUnmarshaler is used to set the request unmarshaler for the new exporter helper.
+// It must be provided as the first option when creating a new exporter helper.
+func withUnmarshaler(unmarshaler exporterqueue.Unmarshaler[Request]) Option {
+ return func(o *baseExporter) error {
+ o.unmarshaler = unmarshaler
+ return nil
+ }
+}
+
+// withBatchFuncs is used to set the functions for merging and splitting batches for OLTP-based exporters.
+// It must be provided as the first option when creating a new exporter helper.
+func withBatchFuncs(mf exporterbatcher.BatchMergeFunc[Request], msf exporterbatcher.BatchMergeSplitFunc[Request]) Option {
+ return func(o *baseExporter) error {
+ o.batchMergeFunc = mf
+ o.batchMergeSplitfunc = msf
+ return nil
}
}
@@ -113,10 +219,13 @@ type baseExporter struct {
component.StartFunc
component.ShutdownFunc
- requestExporter bool
- marshaler RequestMarshaler
- unmarshaler RequestUnmarshaler
- signal component.DataType
+ signal component.DataType
+
+ batchMergeFunc exporterbatcher.BatchMergeFunc[Request]
+ batchMergeSplitfunc exporterbatcher.BatchMergeSplitFunc[Request]
+
+ marshaler exporterqueue.Marshaler[Request]
+ unmarshaler exporterqueue.Unmarshaler[Request]
set exporter.CreateSettings
obsrep *ObsReport
@@ -127,6 +236,7 @@ type baseExporter struct {
// Chain of senders that the exporter helper applies before passing the data to the actual exporter.
// The data is handled by each sender in the respective order starting from the queueSender.
// Most of the senders are optional, and initialized with a no-op path-through sender.
+ batchSender requestSender
queueSender requestSender
obsrepSender requestSender
retrySender requestSender
@@ -135,21 +245,16 @@ type baseExporter struct {
consumerOptions []consumer.Option
}
-// TODO: requestExporter, marshaler, and unmarshaler arguments can be removed when the old exporter helpers will be updated to call the new ones.
-func newBaseExporter(set exporter.CreateSettings, signal component.DataType, requestExporter bool, marshaler RequestMarshaler,
- unmarshaler RequestUnmarshaler, osf obsrepSenderFactory, options ...Option) (*baseExporter, error) {
-
+func newBaseExporter(set exporter.CreateSettings, signal component.DataType, osf obsrepSenderFactory, options ...Option) (*baseExporter, error) {
obsReport, err := NewObsReport(ObsReportSettings{ExporterID: set.ID, ExporterCreateSettings: set})
if err != nil {
return nil, err
}
be := &baseExporter{
- requestExporter: requestExporter,
- marshaler: marshaler,
- unmarshaler: unmarshaler,
- signal: signal,
+ signal: signal,
+ batchSender: &baseRequestSender{},
queueSender: &baseRequestSender{},
obsrepSender: osf(obsReport),
retrySender: &baseRequestSender{},
@@ -160,10 +265,23 @@ func newBaseExporter(set exporter.CreateSettings, signal component.DataType, req
}
for _, op := range options {
- op(be)
+ err = multierr.Append(err, op(be))
}
+ if err != nil {
+ return nil, err
+ }
+
be.connectSenders()
+ if bs, ok := be.batchSender.(*batchSender); ok {
+ // If queue sender is enabled assign to the batch sender the same number of workers.
+ if qs, ok := be.queueSender.(*queueSender); ok {
+ bs.concurrencyLimit = uint64(qs.numConsumers)
+ }
+ // Batcher sender mutates the data.
+ be.consumerOptions = append(be.consumerOptions, consumer.WithCapabilities(consumer.Capabilities{MutatesData: true}))
+ }
+
return be, nil
}
@@ -179,7 +297,8 @@ func (be *baseExporter) send(ctx context.Context, req Request) error {
// connectSenders connects the senders in the predefined order.
func (be *baseExporter) connectSenders() {
- be.queueSender.setNextSender(be.obsrepSender)
+ be.queueSender.setNextSender(be.batchSender)
+ be.batchSender.setNextSender(be.obsrepSender)
be.obsrepSender.setNextSender(be.retrySender)
be.retrySender.setNextSender(be.timeoutSender)
}
@@ -190,7 +309,12 @@ func (be *baseExporter) Start(ctx context.Context, host component.Host) error {
return err
}
- // If no error then start the queueSender.
+ // If no error then start the batchSender.
+ if err := be.batchSender.Start(ctx, host); err != nil {
+ return err
+ }
+
+ // Last start the queueSender.
return be.queueSender.Start(ctx, host)
}
@@ -198,6 +322,8 @@ func (be *baseExporter) Shutdown(ctx context.Context) error {
return multierr.Combine(
// First shutdown the retry sender, so the queue sender can flush the queue without retries.
be.retrySender.Shutdown(ctx),
+ // Then shutdown the batch sender
+ be.batchSender.Shutdown(ctx),
// Then shutdown the queue sender.
be.queueSender.Shutdown(ctx),
// Last shutdown the wrapped exporter itself.
diff --git a/exporter/exporterhelper/common_test.go b/exporter/exporterhelper/common_test.go
index 5ed2c5a1dc2..e134affeaaa 100644
--- a/exporter/exporterhelper/common_test.go
+++ b/exporter/exporterhelper/common_test.go
@@ -18,6 +18,7 @@ import (
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/config/configretry"
"go.opentelemetry.io/collector/exporter"
+ "go.opentelemetry.io/collector/exporter/exporterqueue"
"go.opentelemetry.io/collector/exporter/exportertest"
)
@@ -31,16 +32,12 @@ var (
}()
)
-func newNoopObsrepSender(_ *ObsReport) requestSender {
+func newNoopObsrepSender(*ObsReport) requestSender {
return &baseRequestSender{}
}
func TestBaseExporter(t *testing.T) {
- be, err := newBaseExporter(defaultSettings, defaultType, false, nil, nil, newNoopObsrepSender)
- require.NoError(t, err)
- require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
- require.NoError(t, be.Shutdown(context.Background()))
- be, err = newBaseExporter(defaultSettings, defaultType, true, nil, nil, newNoopObsrepSender)
+ be, err := newBaseExporter(defaultSettings, defaultType, newNoopObsrepSender)
require.NoError(t, err)
require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
require.NoError(t, be.Shutdown(context.Background()))
@@ -49,9 +46,9 @@ func TestBaseExporter(t *testing.T) {
func TestBaseExporterWithOptions(t *testing.T) {
want := errors.New("my error")
be, err := newBaseExporter(
- defaultSettings, defaultType, false, nil, nil, newNoopObsrepSender,
- WithStart(func(ctx context.Context, host component.Host) error { return want }),
- WithShutdown(func(ctx context.Context) error { return want }),
+ defaultSettings, defaultType, newNoopObsrepSender,
+ WithStart(func(context.Context, component.Host) error { return want }),
+ WithShutdown(func(context.Context) error { return want }),
WithTimeout(NewDefaultTimeoutSettings()),
)
require.NoError(t, err)
@@ -68,15 +65,21 @@ func checkStatus(t *testing.T, sd sdktrace.ReadOnlySpan, err error) {
}
}
-func TestQueueRetryOptionsWithRequestExporter(t *testing.T) {
- bs, err := newBaseExporter(exportertest.NewNopCreateSettings(), defaultType, true, nil, nil, newNoopObsrepSender,
+func TestQueueOptionsWithRequestExporter(t *testing.T) {
+ bs, err := newBaseExporter(exportertest.NewNopCreateSettings(), defaultType, newNoopObsrepSender,
WithRetry(configretry.NewDefaultBackOffConfig()))
require.Nil(t, err)
- require.True(t, bs.requestExporter)
- require.Panics(t, func() {
- _, _ = newBaseExporter(exportertest.NewNopCreateSettings(), defaultType, true, nil, nil, newNoopObsrepSender,
- WithRetry(configretry.NewDefaultBackOffConfig()), WithQueue(NewDefaultQueueSettings()))
- })
+ require.Nil(t, bs.marshaler)
+ require.Nil(t, bs.unmarshaler)
+ _, err = newBaseExporter(exportertest.NewNopCreateSettings(), defaultType, newNoopObsrepSender,
+ WithRetry(configretry.NewDefaultBackOffConfig()), WithQueue(NewDefaultQueueSettings()))
+ require.Error(t, err)
+
+ _, err = newBaseExporter(exportertest.NewNopCreateSettings(), defaultType, newNoopObsrepSender,
+ withMarshaler(mockRequestMarshaler), withUnmarshaler(mockRequestUnmarshaler(&mockRequest{})),
+ WithRetry(configretry.NewDefaultBackOffConfig()),
+ WithRequestQueue(exporterqueue.NewDefaultConfig(), exporterqueue.NewMemoryQueueFactory[Request]()))
+ require.Error(t, err)
}
func TestBaseExporterLogging(t *testing.T) {
@@ -85,9 +88,8 @@ func TestBaseExporterLogging(t *testing.T) {
set.Logger = zap.New(logger)
rCfg := configretry.NewDefaultBackOffConfig()
rCfg.Enabled = false
- bs, err := newBaseExporter(set, defaultType, true, nil, nil, newNoopObsrepSender, WithRetry(rCfg))
+ bs, err := newBaseExporter(set, defaultType, newNoopObsrepSender, WithRetry(rCfg))
require.Nil(t, err)
- require.True(t, bs.requestExporter)
sendErr := bs.send(context.Background(), newErrorRequest())
require.Error(t, sendErr)
diff --git a/exporter/exporterhelper/logs.go b/exporter/exporterhelper/logs.go
index f08bf0e6da6..2706ec7fe92 100644
--- a/exporter/exporterhelper/logs.go
+++ b/exporter/exporterhelper/logs.go
@@ -13,7 +13,8 @@ import (
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/consumer/consumererror"
"go.opentelemetry.io/collector/exporter"
- "go.opentelemetry.io/collector/exporter/exporterhelper/internal"
+ "go.opentelemetry.io/collector/exporter/exporterqueue"
+ "go.opentelemetry.io/collector/exporter/internal/queue"
"go.opentelemetry.io/collector/pdata/plog"
)
@@ -32,7 +33,7 @@ func newLogsRequest(ld plog.Logs, pusher consumer.ConsumeLogsFunc) Request {
}
}
-func newLogsRequestUnmarshalerFunc(pusher consumer.ConsumeLogsFunc) RequestUnmarshaler {
+func newLogsRequestUnmarshalerFunc(pusher consumer.ConsumeLogsFunc) exporterqueue.Unmarshaler[Request] {
return func(bytes []byte) (Request, error) {
logs, err := logsUnmarshaler.UnmarshalLogs(bytes)
if err != nil {
@@ -69,7 +70,7 @@ type logsExporter struct {
// NewLogsExporter creates an exporter.Logs that records observability metrics and wraps every request with a Span.
func NewLogsExporter(
- _ context.Context,
+ ctx context.Context,
set exporter.CreateSettings,
cfg component.Config,
pusher consumer.ConsumeLogsFunc,
@@ -78,43 +79,30 @@ func NewLogsExporter(
if cfg == nil {
return nil, errNilConfig
}
-
- if set.Logger == nil {
- return nil, errNilLogger
- }
-
if pusher == nil {
return nil, errNilPushLogsData
}
-
- be, err := newBaseExporter(set, component.DataTypeLogs, false, logsRequestMarshaler,
- newLogsRequestUnmarshalerFunc(pusher), newLogsExporterWithObservability, options...)
- if err != nil {
- return nil, err
+ logsOpts := []Option{
+ withMarshaler(logsRequestMarshaler), withUnmarshaler(newLogsRequestUnmarshalerFunc(pusher)),
+ withBatchFuncs(mergeLogs, mergeSplitLogs),
}
-
- lc, err := consumer.NewLogs(func(ctx context.Context, ld plog.Logs) error {
- req := newLogsRequest(ld, pusher)
- serr := be.send(ctx, req)
- if errors.Is(serr, internal.ErrQueueIsFull) {
- be.obsrep.recordEnqueueFailure(ctx, component.DataTypeLogs, int64(req.ItemsCount()))
- }
- return serr
- }, be.consumerOptions...)
-
- return &logsExporter{
- baseExporter: be,
- Logs: lc,
- }, err
+ return NewLogsRequestExporter(ctx, set, requestFromLogs(pusher), append(logsOpts, options...)...)
}
// RequestFromLogsFunc converts plog.Logs data into a user-defined request.
-// This API is at the early stage of development and may change without backward compatibility
+// Experimental: This API is at the early stage of development and may change without backward compatibility
// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
type RequestFromLogsFunc func(context.Context, plog.Logs) (Request, error)
+// requestFromLogs returns a RequestFromLogsFunc that converts plog.Logs into a Request.
+func requestFromLogs(pusher consumer.ConsumeLogsFunc) RequestFromLogsFunc {
+ return func(_ context.Context, ld plog.Logs) (Request, error) {
+ return newLogsRequest(ld, pusher), nil
+ }
+}
+
// NewLogsRequestExporter creates new logs exporter based on custom LogsConverter and RequestSender.
-// This API is at the early stage of development and may change without backward compatibility
+// Experimental: This API is at the early stage of development and may change without backward compatibility
// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
func NewLogsRequestExporter(
_ context.Context,
@@ -130,7 +118,7 @@ func NewLogsRequestExporter(
return nil, errNilLogsConverter
}
- be, err := newBaseExporter(set, component.DataTypeLogs, true, nil, nil, newLogsExporterWithObservability, options...)
+ be, err := newBaseExporter(set, component.DataTypeLogs, newLogsExporterWithObservability, options...)
if err != nil {
return nil, err
}
@@ -144,7 +132,7 @@ func NewLogsRequestExporter(
return consumererror.NewPermanent(cErr)
}
sErr := be.send(ctx, req)
- if errors.Is(sErr, internal.ErrQueueIsFull) {
+ if errors.Is(sErr, queue.ErrQueueIsFull) {
be.obsrep.recordEnqueueFailure(ctx, component.DataTypeLogs, int64(req.ItemsCount()))
}
return sErr
diff --git a/exporter/exporterhelper/logs_batch.go b/exporter/exporterhelper/logs_batch.go
new file mode 100644
index 00000000000..296538bc0e0
--- /dev/null
+++ b/exporter/exporterhelper/logs_batch.go
@@ -0,0 +1,137 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package exporterhelper // import "go.opentelemetry.io/collector/exporter/exporterhelper"
+
+import (
+ "context"
+ "errors"
+
+ "go.opentelemetry.io/collector/exporter/exporterbatcher"
+ "go.opentelemetry.io/collector/pdata/plog"
+)
+
+// mergeLogs merges two logs requests into one.
+func mergeLogs(_ context.Context, r1 Request, r2 Request) (Request, error) {
+ lr1, ok1 := r1.(*logsRequest)
+ lr2, ok2 := r2.(*logsRequest)
+ if !ok1 || !ok2 {
+ return nil, errors.New("invalid input type")
+ }
+ lr2.ld.ResourceLogs().MoveAndAppendTo(lr1.ld.ResourceLogs())
+ return lr1, nil
+}
+
+// mergeSplitLogs splits and/or merges the logs into multiple requests based on the MaxSizeConfig.
+func mergeSplitLogs(_ context.Context, cfg exporterbatcher.MaxSizeConfig, r1 Request, r2 Request) ([]Request, error) {
+ var (
+ res []Request
+ destReq *logsRequest
+ capacityLeft = cfg.MaxSizeItems
+ )
+ for _, req := range []Request{r1, r2} {
+ if req == nil {
+ continue
+ }
+ srcReq, ok := req.(*logsRequest)
+ if !ok {
+ return nil, errors.New("invalid input type")
+ }
+ if srcReq.ld.LogRecordCount() <= capacityLeft {
+ if destReq == nil {
+ destReq = srcReq
+ } else {
+ srcReq.ld.ResourceLogs().MoveAndAppendTo(destReq.ld.ResourceLogs())
+ }
+ capacityLeft -= destReq.ld.LogRecordCount()
+ continue
+ }
+
+ for {
+ extractedLogs := extractLogs(srcReq.ld, capacityLeft)
+ if extractedLogs.LogRecordCount() == 0 {
+ break
+ }
+ capacityLeft -= extractedLogs.LogRecordCount()
+ if destReq == nil {
+ destReq = &logsRequest{ld: extractedLogs, pusher: srcReq.pusher}
+ } else {
+ extractedLogs.ResourceLogs().MoveAndAppendTo(destReq.ld.ResourceLogs())
+ }
+ // Create new batch once capacity is reached.
+ if capacityLeft == 0 {
+ res = append(res, destReq)
+ destReq = nil
+ capacityLeft = cfg.MaxSizeItems
+ }
+ }
+ }
+
+ if destReq != nil {
+ res = append(res, destReq)
+ }
+ return res, nil
+}
+
+// extractLogs extracts logs from the input logs and returns a new logs with the specified number of log records.
+func extractLogs(srcLogs plog.Logs, count int) plog.Logs {
+ destLogs := plog.NewLogs()
+ srcLogs.ResourceLogs().RemoveIf(func(srcRL plog.ResourceLogs) bool {
+ if count == 0 {
+ return false
+ }
+ needToExtract := resourceLogsCount(srcRL) > count
+ if needToExtract {
+ srcRL = extractResourceLogs(srcRL, count)
+ }
+ count -= resourceLogsCount(srcRL)
+ srcRL.MoveTo(destLogs.ResourceLogs().AppendEmpty())
+ return !needToExtract
+ })
+ return destLogs
+}
+
+// extractResourceLogs extracts resource logs and returns a new resource logs with the specified number of log records.
+func extractResourceLogs(srcRL plog.ResourceLogs, count int) plog.ResourceLogs {
+ destRL := plog.NewResourceLogs()
+ destRL.SetSchemaUrl(srcRL.SchemaUrl())
+ srcRL.Resource().CopyTo(destRL.Resource())
+ srcRL.ScopeLogs().RemoveIf(func(srcSL plog.ScopeLogs) bool {
+ if count == 0 {
+ return false
+ }
+ needToExtract := srcSL.LogRecords().Len() > count
+ if needToExtract {
+ srcSL = extractScopeLogs(srcSL, count)
+ }
+ count -= srcSL.LogRecords().Len()
+ srcSL.MoveTo(destRL.ScopeLogs().AppendEmpty())
+ return !needToExtract
+ })
+ return destRL
+}
+
+// extractScopeLogs extracts scope logs and returns a new scope logs with the specified number of log records.
+func extractScopeLogs(srcSL plog.ScopeLogs, count int) plog.ScopeLogs {
+ destSL := plog.NewScopeLogs()
+ destSL.SetSchemaUrl(srcSL.SchemaUrl())
+ srcSL.Scope().CopyTo(destSL.Scope())
+ srcSL.LogRecords().RemoveIf(func(srcLR plog.LogRecord) bool {
+ if count == 0 {
+ return false
+ }
+ srcLR.MoveTo(destSL.LogRecords().AppendEmpty())
+ count--
+ return true
+ })
+ return destSL
+}
+
+// resourceLogsCount calculates the total number of log records in the plog.ResourceLogs.
+func resourceLogsCount(rl plog.ResourceLogs) int {
+ count := 0
+ for k := 0; k < rl.ScopeLogs().Len(); k++ {
+ count += rl.ScopeLogs().At(k).LogRecords().Len()
+ }
+ return count
+}
diff --git a/exporter/exporterhelper/logs_batch_test.go b/exporter/exporterhelper/logs_batch_test.go
new file mode 100644
index 00000000000..701d1794a85
--- /dev/null
+++ b/exporter/exporterhelper/logs_batch_test.go
@@ -0,0 +1,159 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package exporterhelper
+
+import (
+ "context"
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+
+ "go.opentelemetry.io/collector/exporter/exporterbatcher"
+ "go.opentelemetry.io/collector/internal/testdata"
+ "go.opentelemetry.io/collector/pdata/plog"
+)
+
+func TestMergeLogs(t *testing.T) {
+ lr1 := &logsRequest{ld: testdata.GenerateLogs(2)}
+ lr2 := &logsRequest{ld: testdata.GenerateLogs(3)}
+ res, err := mergeLogs(context.Background(), lr1, lr2)
+ assert.Nil(t, err)
+ assert.Equal(t, 5, res.(*logsRequest).ld.LogRecordCount())
+}
+
+func TestMergeLogsInvalidInput(t *testing.T) {
+ lr1 := &tracesRequest{td: testdata.GenerateTraces(2)}
+ lr2 := &logsRequest{ld: testdata.GenerateLogs(3)}
+ _, err := mergeLogs(context.Background(), lr1, lr2)
+ assert.Error(t, err)
+}
+
+func TestMergeSplitLogs(t *testing.T) {
+ tests := []struct {
+ name string
+ cfg exporterbatcher.MaxSizeConfig
+ lr1 Request
+ lr2 Request
+ expected []*logsRequest
+ }{
+ {
+ name: "both_requests_empty",
+ cfg: exporterbatcher.MaxSizeConfig{MaxSizeItems: 10},
+ lr1: &logsRequest{ld: plog.NewLogs()},
+ lr2: &logsRequest{ld: plog.NewLogs()},
+ expected: []*logsRequest{{ld: plog.NewLogs()}},
+ },
+ {
+ name: "both_requests_nil",
+ cfg: exporterbatcher.MaxSizeConfig{MaxSizeItems: 10},
+ lr1: nil,
+ lr2: nil,
+ expected: []*logsRequest{},
+ },
+ {
+ name: "first_request_empty",
+ cfg: exporterbatcher.MaxSizeConfig{MaxSizeItems: 10},
+ lr1: &logsRequest{ld: plog.NewLogs()},
+ lr2: &logsRequest{ld: testdata.GenerateLogs(5)},
+ expected: []*logsRequest{{ld: testdata.GenerateLogs(5)}},
+ },
+ {
+ name: "first_requests_nil",
+ cfg: exporterbatcher.MaxSizeConfig{MaxSizeItems: 10},
+ lr1: nil,
+ lr2: &logsRequest{ld: testdata.GenerateLogs(5)},
+ expected: []*logsRequest{{ld: testdata.GenerateLogs(5)}},
+ },
+ {
+ name: "first_nil_second_empty",
+ cfg: exporterbatcher.MaxSizeConfig{MaxSizeItems: 10},
+ lr1: nil,
+ lr2: &logsRequest{ld: plog.NewLogs()},
+ expected: []*logsRequest{{ld: plog.NewLogs()}},
+ },
+ {
+ name: "merge_only",
+ cfg: exporterbatcher.MaxSizeConfig{MaxSizeItems: 10},
+ lr1: &logsRequest{ld: testdata.GenerateLogs(4)},
+ lr2: &logsRequest{ld: testdata.GenerateLogs(6)},
+ expected: []*logsRequest{{ld: func() plog.Logs {
+ logs := testdata.GenerateLogs(4)
+ testdata.GenerateLogs(6).ResourceLogs().MoveAndAppendTo(logs.ResourceLogs())
+ return logs
+ }()}},
+ },
+ {
+ name: "split_only",
+ cfg: exporterbatcher.MaxSizeConfig{MaxSizeItems: 4},
+ lr1: nil,
+ lr2: &logsRequest{ld: testdata.GenerateLogs(10)},
+ expected: []*logsRequest{
+ {ld: testdata.GenerateLogs(4)},
+ {ld: testdata.GenerateLogs(4)},
+ {ld: testdata.GenerateLogs(2)},
+ },
+ },
+ {
+ name: "merge_and_split",
+ cfg: exporterbatcher.MaxSizeConfig{MaxSizeItems: 10},
+ lr1: &logsRequest{ld: testdata.GenerateLogs(8)},
+ lr2: &logsRequest{ld: testdata.GenerateLogs(20)},
+ expected: []*logsRequest{
+ {ld: func() plog.Logs {
+ logs := testdata.GenerateLogs(8)
+ testdata.GenerateLogs(2).ResourceLogs().MoveAndAppendTo(logs.ResourceLogs())
+ return logs
+ }()},
+ {ld: testdata.GenerateLogs(10)},
+ {ld: testdata.GenerateLogs(8)},
+ },
+ },
+ {
+ name: "scope_logs_split",
+ cfg: exporterbatcher.MaxSizeConfig{MaxSizeItems: 4},
+ lr1: &logsRequest{ld: func() plog.Logs {
+ ld := testdata.GenerateLogs(4)
+ ld.ResourceLogs().At(0).ScopeLogs().AppendEmpty().LogRecords().AppendEmpty().Body().SetStr("extra log")
+ return ld
+ }()},
+ lr2: &logsRequest{ld: testdata.GenerateLogs(2)},
+ expected: []*logsRequest{
+ {ld: testdata.GenerateLogs(4)},
+ {ld: func() plog.Logs {
+ ld := testdata.GenerateLogs(0)
+ ld.ResourceLogs().At(0).ScopeLogs().At(0).LogRecords().AppendEmpty().Body().SetStr("extra log")
+ testdata.GenerateLogs(2).ResourceLogs().MoveAndAppendTo(ld.ResourceLogs())
+ return ld
+ }()},
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ res, err := mergeSplitLogs(context.Background(), tt.cfg, tt.lr1, tt.lr2)
+ assert.Nil(t, err)
+ assert.Equal(t, len(tt.expected), len(res))
+ for i, r := range res {
+ assert.Equal(t, tt.expected[i], r.(*logsRequest))
+ }
+ })
+
+ }
+}
+
+func TestMergeSplitLogsInvalidInput(t *testing.T) {
+ r1 := &tracesRequest{td: testdata.GenerateTraces(2)}
+ r2 := &logsRequest{ld: testdata.GenerateLogs(3)}
+ _, err := mergeSplitLogs(context.Background(), exporterbatcher.MaxSizeConfig{}, r1, r2)
+ assert.Error(t, err)
+}
+
+func TestExtractLogs(t *testing.T) {
+ for i := 0; i < 10; i++ {
+ ld := testdata.GenerateLogs(10)
+ extractedLogs := extractLogs(ld, i)
+ assert.Equal(t, i, extractedLogs.LogRecordCount())
+ assert.Equal(t, 10-i, ld.LogRecordCount())
+ }
+}
diff --git a/exporter/exporterhelper/logs_test.go b/exporter/exporterhelper/logs_test.go
index 5349f767398..e42af577b2c 100644
--- a/exporter/exporterhelper/logs_test.go
+++ b/exporter/exporterhelper/logs_test.go
@@ -25,8 +25,8 @@ import (
"go.opentelemetry.io/collector/consumer/consumererror"
"go.opentelemetry.io/collector/consumer/consumertest"
"go.opentelemetry.io/collector/exporter"
- "go.opentelemetry.io/collector/exporter/exporterhelper/internal"
"go.opentelemetry.io/collector/exporter/exportertest"
+ "go.opentelemetry.io/collector/exporter/internal/queue"
"go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics"
"go.opentelemetry.io/collector/internal/testdata"
"go.opentelemetry.io/collector/pdata/plog"
@@ -167,7 +167,7 @@ func TestLogsExporter_WithPersistentQueue(t *testing.T) {
require.NoError(t, err)
host := &mockHost{ext: map[component.ID]component.Component{
- storageID: internal.NewMockStorageExtension(nil),
+ storageID: queue.NewMockStorageExtension(nil),
}}
require.NoError(t, te.Start(context.Background(), host))
t.Cleanup(func() { require.NoError(t, te.Shutdown(context.Background())) })
@@ -360,7 +360,7 @@ func TestLogsRequestExporter_WithShutdown_ReturnError(t *testing.T) {
}
func newPushLogsData(retError error) consumer.ConsumeLogsFunc {
- return func(ctx context.Context, td plog.Logs) error {
+ return func(_ context.Context, _ plog.Logs) error {
return retError
}
}
diff --git a/exporter/exporterhelper/metrics.go b/exporter/exporterhelper/metrics.go
index 7360d548962..83db18229dd 100644
--- a/exporter/exporterhelper/metrics.go
+++ b/exporter/exporterhelper/metrics.go
@@ -13,7 +13,8 @@ import (
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/consumer/consumererror"
"go.opentelemetry.io/collector/exporter"
- "go.opentelemetry.io/collector/exporter/exporterhelper/internal"
+ "go.opentelemetry.io/collector/exporter/exporterqueue"
+ "go.opentelemetry.io/collector/exporter/internal/queue"
"go.opentelemetry.io/collector/pdata/pmetric"
)
@@ -32,7 +33,7 @@ func newMetricsRequest(md pmetric.Metrics, pusher consumer.ConsumeMetricsFunc) R
}
}
-func newMetricsRequestUnmarshalerFunc(pusher consumer.ConsumeMetricsFunc) RequestUnmarshaler {
+func newMetricsRequestUnmarshalerFunc(pusher consumer.ConsumeMetricsFunc) exporterqueue.Unmarshaler[Request] {
return func(bytes []byte) (Request, error) {
metrics, err := metricsUnmarshaler.UnmarshalMetrics(bytes)
if err != nil {
@@ -69,7 +70,7 @@ type metricsExporter struct {
// NewMetricsExporter creates an exporter.Metrics that records observability metrics and wraps every request with a Span.
func NewMetricsExporter(
- _ context.Context,
+ ctx context.Context,
set exporter.CreateSettings,
cfg component.Config,
pusher consumer.ConsumeMetricsFunc,
@@ -78,43 +79,30 @@ func NewMetricsExporter(
if cfg == nil {
return nil, errNilConfig
}
-
- if set.Logger == nil {
- return nil, errNilLogger
- }
-
if pusher == nil {
return nil, errNilPushMetricsData
}
-
- be, err := newBaseExporter(set, component.DataTypeMetrics, false, metricsRequestMarshaler,
- newMetricsRequestUnmarshalerFunc(pusher), newMetricsSenderWithObservability, options...)
- if err != nil {
- return nil, err
+ metricsOpts := []Option{
+ withMarshaler(metricsRequestMarshaler), withUnmarshaler(newMetricsRequestUnmarshalerFunc(pusher)),
+ withBatchFuncs(mergeMetrics, mergeSplitMetrics),
}
-
- mc, err := consumer.NewMetrics(func(ctx context.Context, md pmetric.Metrics) error {
- req := newMetricsRequest(md, pusher)
- serr := be.send(ctx, req)
- if errors.Is(serr, internal.ErrQueueIsFull) {
- be.obsrep.recordEnqueueFailure(ctx, component.DataTypeMetrics, int64(req.ItemsCount()))
- }
- return serr
- }, be.consumerOptions...)
-
- return &metricsExporter{
- baseExporter: be,
- Metrics: mc,
- }, err
+ return NewMetricsRequestExporter(ctx, set, requestFromMetrics(pusher), append(metricsOpts, options...)...)
}
// RequestFromMetricsFunc converts pdata.Metrics into a user-defined request.
-// This API is at the early stage of development and may change without backward compatibility
+// Experimental: This API is at the early stage of development and may change without backward compatibility
// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
type RequestFromMetricsFunc func(context.Context, pmetric.Metrics) (Request, error)
+// requestFromMetrics returns a RequestFromMetricsFunc that converts pdata.Metrics into a Request.
+func requestFromMetrics(pusher consumer.ConsumeMetricsFunc) RequestFromMetricsFunc {
+ return func(_ context.Context, md pmetric.Metrics) (Request, error) {
+ return newMetricsRequest(md, pusher), nil
+ }
+}
+
// NewMetricsRequestExporter creates a new metrics exporter based on a custom MetricsConverter and RequestSender.
-// This API is at the early stage of development and may change without backward compatibility
+// Experimental: This API is at the early stage of development and may change without backward compatibility
// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
func NewMetricsRequestExporter(
_ context.Context,
@@ -130,7 +118,7 @@ func NewMetricsRequestExporter(
return nil, errNilMetricsConverter
}
- be, err := newBaseExporter(set, component.DataTypeMetrics, true, nil, nil, newMetricsSenderWithObservability, options...)
+ be, err := newBaseExporter(set, component.DataTypeMetrics, newMetricsSenderWithObservability, options...)
if err != nil {
return nil, err
}
@@ -144,7 +132,7 @@ func NewMetricsRequestExporter(
return consumererror.NewPermanent(cErr)
}
sErr := be.send(ctx, req)
- if errors.Is(sErr, internal.ErrQueueIsFull) {
+ if errors.Is(sErr, queue.ErrQueueIsFull) {
be.obsrep.recordEnqueueFailure(ctx, component.DataTypeMetrics, int64(req.ItemsCount()))
}
return sErr
diff --git a/exporter/exporterhelper/metrics_batch.go b/exporter/exporterhelper/metrics_batch.go
new file mode 100644
index 00000000000..1a6448c8496
--- /dev/null
+++ b/exporter/exporterhelper/metrics_batch.go
@@ -0,0 +1,236 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package exporterhelper // import "go.opentelemetry.io/collector/exporter/exporterhelper"
+
+import (
+ "context"
+ "errors"
+
+ "go.opentelemetry.io/collector/exporter/exporterbatcher"
+ "go.opentelemetry.io/collector/pdata/pmetric"
+)
+
+// mergeMetrics merges two metrics requests into one.
+func mergeMetrics(_ context.Context, r1 Request, r2 Request) (Request, error) {
+ mr1, ok1 := r1.(*metricsRequest)
+ mr2, ok2 := r2.(*metricsRequest)
+ if !ok1 || !ok2 {
+ return nil, errors.New("invalid input type")
+ }
+ mr2.md.ResourceMetrics().MoveAndAppendTo(mr1.md.ResourceMetrics())
+ return mr1, nil
+}
+
+// mergeSplitMetrics splits and/or merges the metrics into multiple requests based on the MaxSizeConfig.
+func mergeSplitMetrics(_ context.Context, cfg exporterbatcher.MaxSizeConfig, r1 Request, r2 Request) ([]Request, error) {
+ var (
+ res []Request
+ destReq *metricsRequest
+ capacityLeft = cfg.MaxSizeItems
+ )
+ for _, req := range []Request{r1, r2} {
+ if req == nil {
+ continue
+ }
+ srcReq, ok := req.(*metricsRequest)
+ if !ok {
+ return nil, errors.New("invalid input type")
+ }
+ if srcReq.md.DataPointCount() <= capacityLeft {
+ if destReq == nil {
+ destReq = srcReq
+ } else {
+ srcReq.md.ResourceMetrics().MoveAndAppendTo(destReq.md.ResourceMetrics())
+ }
+ capacityLeft -= destReq.md.DataPointCount()
+ continue
+ }
+
+ for {
+ extractedMetrics := extractMetrics(srcReq.md, capacityLeft)
+ if extractedMetrics.DataPointCount() == 0 {
+ break
+ }
+ capacityLeft -= extractedMetrics.DataPointCount()
+ if destReq == nil {
+ destReq = &metricsRequest{md: extractedMetrics, pusher: srcReq.pusher}
+ } else {
+ extractedMetrics.ResourceMetrics().MoveAndAppendTo(destReq.md.ResourceMetrics())
+ }
+ // Create new batch once capacity is reached.
+ if capacityLeft == 0 {
+ res = append(res, destReq)
+ destReq = nil
+ capacityLeft = cfg.MaxSizeItems
+ }
+ }
+ }
+
+ if destReq != nil {
+ res = append(res, destReq)
+ }
+
+ return res, nil
+}
+
+// extractMetrics extracts metrics from srcMetrics until count of data points is reached.
+func extractMetrics(srcMetrics pmetric.Metrics, count int) pmetric.Metrics {
+ destMetrics := pmetric.NewMetrics()
+ srcMetrics.ResourceMetrics().RemoveIf(func(srcRM pmetric.ResourceMetrics) bool {
+ if count == 0 {
+ return false
+ }
+ needToExtract := resourceDataPointsCount(srcRM) > count
+ if needToExtract {
+ srcRM = extractResourceMetrics(srcRM, count)
+ }
+ count -= resourceDataPointsCount(srcRM)
+ srcRM.MoveTo(destMetrics.ResourceMetrics().AppendEmpty())
+ return !needToExtract
+ })
+ return destMetrics
+}
+
+// extractResourceMetrics extracts resource metrics and returns a new resource metrics with the specified number of data points.
+func extractResourceMetrics(srcRM pmetric.ResourceMetrics, count int) pmetric.ResourceMetrics {
+ destRM := pmetric.NewResourceMetrics()
+ destRM.SetSchemaUrl(srcRM.SchemaUrl())
+ srcRM.Resource().CopyTo(destRM.Resource())
+ srcRM.ScopeMetrics().RemoveIf(func(srcSM pmetric.ScopeMetrics) bool {
+ if count == 0 {
+ return false
+ }
+ needToExtract := scopeDataPointsCount(srcSM) > count
+ if needToExtract {
+ srcSM = extractScopeMetrics(srcSM, count)
+ }
+ count -= scopeDataPointsCount(srcSM)
+ srcSM.MoveTo(destRM.ScopeMetrics().AppendEmpty())
+ return !needToExtract
+ })
+ return destRM
+}
+
+// extractScopeMetrics extracts scope metrics and returns a new scope metrics with the specified number of data points.
+func extractScopeMetrics(srcSM pmetric.ScopeMetrics, count int) pmetric.ScopeMetrics {
+ destSM := pmetric.NewScopeMetrics()
+ destSM.SetSchemaUrl(srcSM.SchemaUrl())
+ srcSM.Scope().CopyTo(destSM.Scope())
+ srcSM.Metrics().RemoveIf(func(srcMetric pmetric.Metric) bool {
+ if count == 0 {
+ return false
+ }
+ needToExtract := metricDataPointCount(srcMetric) > count
+ if needToExtract {
+ srcMetric = extractMetricDataPoints(srcMetric, count)
+ }
+ count -= metricDataPointCount(srcMetric)
+ srcMetric.MoveTo(destSM.Metrics().AppendEmpty())
+ return !needToExtract
+ })
+ return destSM
+}
+
+func extractMetricDataPoints(srcMetric pmetric.Metric, count int) pmetric.Metric {
+ destMetric := pmetric.NewMetric()
+ switch srcMetric.Type() {
+ case pmetric.MetricTypeGauge:
+ extractGaugeDataPoints(srcMetric.Gauge(), count, destMetric.SetEmptyGauge())
+ case pmetric.MetricTypeSum:
+ extractSumDataPoints(srcMetric.Sum(), count, destMetric.SetEmptySum())
+ case pmetric.MetricTypeHistogram:
+ extractHistogramDataPoints(srcMetric.Histogram(), count, destMetric.SetEmptyHistogram())
+ case pmetric.MetricTypeExponentialHistogram:
+ extractExponentialHistogramDataPoints(srcMetric.ExponentialHistogram(), count,
+ destMetric.SetEmptyExponentialHistogram())
+ case pmetric.MetricTypeSummary:
+ extractSummaryDataPoints(srcMetric.Summary(), count, destMetric.SetEmptySummary())
+ }
+ return destMetric
+}
+
+func extractGaugeDataPoints(srcGauge pmetric.Gauge, count int, destGauge pmetric.Gauge) {
+ srcGauge.DataPoints().RemoveIf(func(srcDP pmetric.NumberDataPoint) bool {
+ if count == 0 {
+ return false
+ }
+ srcDP.MoveTo(destGauge.DataPoints().AppendEmpty())
+ count--
+ return true
+ })
+}
+
+func extractSumDataPoints(srcSum pmetric.Sum, count int, destSum pmetric.Sum) {
+ srcSum.DataPoints().RemoveIf(func(srcDP pmetric.NumberDataPoint) bool {
+ if count == 0 {
+ return false
+ }
+ srcDP.MoveTo(destSum.DataPoints().AppendEmpty())
+ count--
+ return true
+ })
+}
+
+func extractHistogramDataPoints(srcHistogram pmetric.Histogram, count int, destHistogram pmetric.Histogram) {
+ srcHistogram.DataPoints().RemoveIf(func(srcDP pmetric.HistogramDataPoint) bool {
+ if count == 0 {
+ return false
+ }
+ srcDP.MoveTo(destHistogram.DataPoints().AppendEmpty())
+ count--
+ return true
+ })
+}
+
+func extractExponentialHistogramDataPoints(srcExponentialHistogram pmetric.ExponentialHistogram, count int, destExponentialHistogram pmetric.ExponentialHistogram) {
+ srcExponentialHistogram.DataPoints().RemoveIf(func(srcDP pmetric.ExponentialHistogramDataPoint) bool {
+ if count == 0 {
+ return false
+ }
+ srcDP.MoveTo(destExponentialHistogram.DataPoints().AppendEmpty())
+ count--
+ return true
+ })
+}
+
+func extractSummaryDataPoints(srcSummary pmetric.Summary, count int, destSummary pmetric.Summary) {
+ srcSummary.DataPoints().RemoveIf(func(srcDP pmetric.SummaryDataPoint) bool {
+ if count == 0 {
+ return false
+ }
+ srcDP.MoveTo(destSummary.DataPoints().AppendEmpty())
+ count--
+ return true
+ })
+}
+
+func resourceDataPointsCount(rm pmetric.ResourceMetrics) (count int) {
+ for i := 0; i < rm.ScopeMetrics().Len(); i++ {
+ count += scopeDataPointsCount(rm.ScopeMetrics().At(i))
+ }
+ return count
+}
+
+func scopeDataPointsCount(sm pmetric.ScopeMetrics) (count int) {
+ for i := 0; i < sm.Metrics().Len(); i++ {
+ count += metricDataPointCount(sm.Metrics().At(i))
+ }
+ return count
+}
+
+func metricDataPointCount(m pmetric.Metric) int {
+ switch m.Type() {
+ case pmetric.MetricTypeGauge:
+ return m.Gauge().DataPoints().Len()
+ case pmetric.MetricTypeSum:
+ return m.Sum().DataPoints().Len()
+ case pmetric.MetricTypeHistogram:
+ return m.Histogram().DataPoints().Len()
+ case pmetric.MetricTypeExponentialHistogram:
+ return m.ExponentialHistogram().DataPoints().Len()
+ case pmetric.MetricTypeSummary:
+ return m.Summary().DataPoints().Len()
+ }
+ return 0
+}
diff --git a/exporter/exporterhelper/metrics_batch_test.go b/exporter/exporterhelper/metrics_batch_test.go
new file mode 100644
index 00000000000..704ed409a87
--- /dev/null
+++ b/exporter/exporterhelper/metrics_batch_test.go
@@ -0,0 +1,166 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package exporterhelper
+
+import (
+ "context"
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+
+ "go.opentelemetry.io/collector/exporter/exporterbatcher"
+ "go.opentelemetry.io/collector/internal/testdata"
+ "go.opentelemetry.io/collector/pdata/pmetric"
+)
+
+func TestMergeMetrics(t *testing.T) {
+ mr1 := &metricsRequest{md: testdata.GenerateMetrics(2)}
+ mr2 := &metricsRequest{md: testdata.GenerateMetrics(3)}
+ res, err := mergeMetrics(context.Background(), mr1, mr2)
+ assert.Nil(t, err)
+ assert.Equal(t, 5, res.(*metricsRequest).md.MetricCount())
+}
+
+func TestMergeMetricsInvalidInput(t *testing.T) {
+ mr1 := &tracesRequest{td: testdata.GenerateTraces(2)}
+ mr2 := &metricsRequest{md: testdata.GenerateMetrics(3)}
+ _, err := mergeMetrics(context.Background(), mr1, mr2)
+ assert.Error(t, err)
+}
+
+func TestMergeSplitMetrics(t *testing.T) {
+ tests := []struct {
+ name string
+ cfg exporterbatcher.MaxSizeConfig
+ mr1 Request
+ mr2 Request
+ expected []*metricsRequest
+ }{
+ {
+ name: "both_requests_empty",
+ cfg: exporterbatcher.MaxSizeConfig{MaxSizeItems: 10},
+ mr1: &metricsRequest{md: pmetric.NewMetrics()},
+ mr2: &metricsRequest{md: pmetric.NewMetrics()},
+ expected: []*metricsRequest{{md: pmetric.NewMetrics()}},
+ },
+ {
+ name: "both_requests_nil",
+ cfg: exporterbatcher.MaxSizeConfig{MaxSizeItems: 10},
+ mr1: nil,
+ mr2: nil,
+ expected: []*metricsRequest{},
+ },
+ {
+ name: "first_request_empty",
+ cfg: exporterbatcher.MaxSizeConfig{MaxSizeItems: 10},
+ mr1: &metricsRequest{md: pmetric.NewMetrics()},
+ mr2: &metricsRequest{md: testdata.GenerateMetrics(5)},
+ expected: []*metricsRequest{{md: testdata.GenerateMetrics(5)}},
+ },
+ {
+ name: "first_requests_nil",
+ cfg: exporterbatcher.MaxSizeConfig{MaxSizeItems: 10},
+ mr1: nil,
+ mr2: &metricsRequest{md: testdata.GenerateMetrics(5)},
+ expected: []*metricsRequest{{md: testdata.GenerateMetrics(5)}},
+ },
+ {
+ name: "first_nil_second_empty",
+ cfg: exporterbatcher.MaxSizeConfig{MaxSizeItems: 10},
+ mr1: nil,
+ mr2: &metricsRequest{md: pmetric.NewMetrics()},
+ expected: []*metricsRequest{{md: pmetric.NewMetrics()}},
+ },
+ {
+ name: "merge_only",
+ cfg: exporterbatcher.MaxSizeConfig{MaxSizeItems: 60},
+ mr1: &metricsRequest{md: testdata.GenerateMetrics(10)},
+ mr2: &metricsRequest{md: testdata.GenerateMetrics(14)},
+ expected: []*metricsRequest{{md: func() pmetric.Metrics {
+ metrics := testdata.GenerateMetrics(10)
+ testdata.GenerateMetrics(14).ResourceMetrics().MoveAndAppendTo(metrics.ResourceMetrics())
+ return metrics
+ }()}},
+ },
+ {
+ name: "split_only",
+ cfg: exporterbatcher.MaxSizeConfig{MaxSizeItems: 14},
+ mr1: nil,
+ mr2: &metricsRequest{md: testdata.GenerateMetrics(15)}, // 15 metrics, 30 data points
+ expected: []*metricsRequest{
+ {md: testdata.GenerateMetrics(7)}, // 7 metrics, 14 data points
+ {md: testdata.GenerateMetrics(7)}, // 7 metrics, 14 data points
+ {md: testdata.GenerateMetrics(1)}, // 1 metric, 2 data points
+ },
+ },
+ {
+ name: "split_and_merge",
+ cfg: exporterbatcher.MaxSizeConfig{MaxSizeItems: 28},
+ mr1: &metricsRequest{md: testdata.GenerateMetrics(7)}, // 7 metrics, 14 data points
+ mr2: &metricsRequest{md: testdata.GenerateMetrics(25)}, // 25 metrics, 50 data points
+ expected: []*metricsRequest{
+ {md: func() pmetric.Metrics {
+ metrics := testdata.GenerateMetrics(7)
+ testdata.GenerateMetrics(7).ResourceMetrics().MoveAndAppendTo(metrics.ResourceMetrics())
+ return metrics
+ }()},
+ {md: testdata.GenerateMetrics(14)}, // 14 metrics, 28 data points
+ {md: testdata.GenerateMetrics(4)}, // 4 metrics, 8 data points
+ },
+ },
+ {
+ name: "scope_metrics_split",
+ cfg: exporterbatcher.MaxSizeConfig{MaxSizeItems: 8},
+ mr1: &metricsRequest{md: func() pmetric.Metrics {
+ md := testdata.GenerateMetrics(4)
+ extraScopeMetrics := md.ResourceMetrics().At(0).ScopeMetrics().AppendEmpty()
+ testdata.GenerateMetrics(4).ResourceMetrics().At(0).ScopeMetrics().At(0).MoveTo(extraScopeMetrics)
+ extraScopeMetrics.Scope().SetName("extra scope")
+ return md
+ }()},
+ mr2: nil,
+ expected: []*metricsRequest{
+ {md: testdata.GenerateMetrics(4)},
+ {md: func() pmetric.Metrics {
+ md := testdata.GenerateMetrics(4)
+ md.ResourceMetrics().At(0).ScopeMetrics().At(0).Scope().SetName("extra scope")
+ return md
+ }()},
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ res, err := mergeSplitMetrics(context.Background(), tt.cfg, tt.mr1, tt.mr2)
+ assert.Nil(t, err)
+ assert.Equal(t, len(tt.expected), len(res))
+ for i := range res {
+ assert.Equal(t, tt.expected[i], res[i].(*metricsRequest))
+ }
+ })
+ }
+}
+
+func TestMergeSplitMetricsInvalidInput(t *testing.T) {
+ r1 := &tracesRequest{td: testdata.GenerateTraces(2)}
+ r2 := &metricsRequest{md: testdata.GenerateMetrics(3)}
+ _, err := mergeSplitMetrics(context.Background(), exporterbatcher.MaxSizeConfig{MaxSizeItems: 10}, r1, r2)
+ assert.Error(t, err)
+}
+
+func TestExtractMetrics(t *testing.T) {
+ for i := 0; i < 20; i++ {
+ md := testdata.GenerateMetrics(10)
+ extractedMetrics := extractMetrics(md, i)
+ assert.Equal(t, i, extractedMetrics.DataPointCount())
+ assert.Equal(t, 20-i, md.DataPointCount())
+ }
+}
+
+func TestExtractMetricsInvalidMetric(t *testing.T) {
+ md := testdata.GenerateMetricsMetricTypeInvalid()
+ extractedMetrics := extractMetrics(md, 10)
+ assert.Equal(t, testdata.GenerateMetricsMetricTypeInvalid(), extractedMetrics)
+ assert.Equal(t, 0, md.ResourceMetrics().Len())
+}
diff --git a/exporter/exporterhelper/metrics_test.go b/exporter/exporterhelper/metrics_test.go
index 65125b4469c..ddbefeb71f2 100644
--- a/exporter/exporterhelper/metrics_test.go
+++ b/exporter/exporterhelper/metrics_test.go
@@ -25,8 +25,8 @@ import (
"go.opentelemetry.io/collector/consumer/consumererror"
"go.opentelemetry.io/collector/consumer/consumertest"
"go.opentelemetry.io/collector/exporter"
- "go.opentelemetry.io/collector/exporter/exporterhelper/internal"
"go.opentelemetry.io/collector/exporter/exportertest"
+ "go.opentelemetry.io/collector/exporter/internal/queue"
"go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics"
"go.opentelemetry.io/collector/internal/testdata"
"go.opentelemetry.io/collector/pdata/pmetric"
@@ -168,7 +168,7 @@ func TestMetricsExporter_WithPersistentQueue(t *testing.T) {
require.NoError(t, err)
host := &mockHost{ext: map[component.ID]component.Component{
- storageID: internal.NewMockStorageExtension(nil),
+ storageID: queue.NewMockStorageExtension(nil),
}}
require.NoError(t, te.Start(context.Background(), host))
t.Cleanup(func() { require.NoError(t, te.Shutdown(context.Background())) })
@@ -366,7 +366,7 @@ func TestMetricsRequestExporter_WithShutdown_ReturnError(t *testing.T) {
}
func newPushMetricsData(retError error) consumer.ConsumeMetricsFunc {
- return func(ctx context.Context, td pmetric.Metrics) error {
+ return func(_ context.Context, _ pmetric.Metrics) error {
return retError
}
}
diff --git a/exporter/exporterhelper/obsexporter.go b/exporter/exporterhelper/obsexporter.go
index f42c0195f49..ed490144242 100644
--- a/exporter/exporterhelper/obsexporter.go
+++ b/exporter/exporterhelper/obsexporter.go
@@ -20,7 +20,7 @@ import (
)
const (
- exporterScope = obsmetrics.Scope + obsmetrics.NameSep + obsmetrics.ExporterKey
+ exporterScope = obsmetrics.Scope + obsmetrics.SpanNameSep + obsmetrics.ExporterKey
)
// ObsReport is a helper to add observability to an exporter.
@@ -78,55 +78,55 @@ func (or *ObsReport) createOtelMetrics(cfg ObsReportSettings) error {
var errors, err error
or.sentSpans, err = meter.Int64Counter(
- obsmetrics.ExporterPrefix+obsmetrics.SentSpansKey,
+ obsmetrics.ExporterMetricPrefix+obsmetrics.SentSpansKey,
metric.WithDescription("Number of spans successfully sent to destination."),
metric.WithUnit("1"))
errors = multierr.Append(errors, err)
or.failedToSendSpans, err = meter.Int64Counter(
- obsmetrics.ExporterPrefix+obsmetrics.FailedToSendSpansKey,
+ obsmetrics.ExporterMetricPrefix+obsmetrics.FailedToSendSpansKey,
metric.WithDescription("Number of spans in failed attempts to send to destination."),
metric.WithUnit("1"))
errors = multierr.Append(errors, err)
or.failedToEnqueueSpans, err = meter.Int64Counter(
- obsmetrics.ExporterPrefix+obsmetrics.FailedToEnqueueSpansKey,
+ obsmetrics.ExporterMetricPrefix+obsmetrics.FailedToEnqueueSpansKey,
metric.WithDescription("Number of spans failed to be added to the sending queue."),
metric.WithUnit("1"))
errors = multierr.Append(errors, err)
or.sentMetricPoints, err = meter.Int64Counter(
- obsmetrics.ExporterPrefix+obsmetrics.SentMetricPointsKey,
+ obsmetrics.ExporterMetricPrefix+obsmetrics.SentMetricPointsKey,
metric.WithDescription("Number of metric points successfully sent to destination."),
metric.WithUnit("1"))
errors = multierr.Append(errors, err)
or.failedToSendMetricPoints, err = meter.Int64Counter(
- obsmetrics.ExporterPrefix+obsmetrics.FailedToSendMetricPointsKey,
+ obsmetrics.ExporterMetricPrefix+obsmetrics.FailedToSendMetricPointsKey,
metric.WithDescription("Number of metric points in failed attempts to send to destination."),
metric.WithUnit("1"))
errors = multierr.Append(errors, err)
or.failedToEnqueueMetricPoints, err = meter.Int64Counter(
- obsmetrics.ExporterPrefix+obsmetrics.FailedToEnqueueMetricPointsKey,
+ obsmetrics.ExporterMetricPrefix+obsmetrics.FailedToEnqueueMetricPointsKey,
metric.WithDescription("Number of metric points failed to be added to the sending queue."),
metric.WithUnit("1"))
errors = multierr.Append(errors, err)
or.sentLogRecords, err = meter.Int64Counter(
- obsmetrics.ExporterPrefix+obsmetrics.SentLogRecordsKey,
+ obsmetrics.ExporterMetricPrefix+obsmetrics.SentLogRecordsKey,
metric.WithDescription("Number of log record successfully sent to destination."),
metric.WithUnit("1"))
errors = multierr.Append(errors, err)
or.failedToSendLogRecords, err = meter.Int64Counter(
- obsmetrics.ExporterPrefix+obsmetrics.FailedToSendLogRecordsKey,
+ obsmetrics.ExporterMetricPrefix+obsmetrics.FailedToSendLogRecordsKey,
metric.WithDescription("Number of log records in failed attempts to send to destination."),
metric.WithUnit("1"))
errors = multierr.Append(errors, err)
or.failedToEnqueueLogRecords, err = meter.Int64Counter(
- obsmetrics.ExporterPrefix+obsmetrics.FailedToEnqueueLogRecordsKey,
+ obsmetrics.ExporterMetricPrefix+obsmetrics.FailedToEnqueueLogRecordsKey,
metric.WithDescription("Number of log records failed to be added to the sending queue."),
metric.WithUnit("1"))
errors = multierr.Append(errors, err)
diff --git a/exporter/exporterhelper/queue_sender.go b/exporter/exporterhelper/queue_sender.go
index 0f7a84fad29..3e539d7f9a0 100644
--- a/exporter/exporterhelper/queue_sender.go
+++ b/exporter/exporterhelper/queue_sender.go
@@ -16,7 +16,8 @@ import (
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/exporter"
- "go.opentelemetry.io/collector/exporter/exporterhelper/internal"
+ "go.opentelemetry.io/collector/exporter/exporterqueue"
+ "go.opentelemetry.io/collector/exporter/internal/queue"
"go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics"
)
@@ -30,7 +31,9 @@ var (
type QueueSettings struct {
// Enabled indicates whether to not enqueue batches before sending to the consumerSender.
Enabled bool `mapstructure:"enabled"`
- // NumConsumers is the number of consumers from the queue.
+ // NumConsumers is the number of consumers from the queue. Defaults to 10.
+ // If batching is enabled, a combined batch cannot contain more requests than the number of consumers.
+ // So it's recommended to set higher number of consumers if batching is enabled.
NumConsumers int `mapstructure:"num_consumers"`
// QueueSize is the maximum number of batches allowed in queue at a given time.
QueueSize int `mapstructure:"queue_size"`
@@ -71,41 +74,23 @@ func (qCfg *QueueSettings) Validate() error {
type queueSender struct {
baseRequestSender
fullName string
- queue internal.Queue[Request]
+ queue exporterqueue.Queue[Request]
+ numConsumers int
traceAttribute attribute.KeyValue
logger *zap.Logger
meter otelmetric.Meter
- consumers *internal.QueueConsumers[Request]
+ consumers *queue.Consumers[Request]
metricCapacity otelmetric.Int64ObservableGauge
metricSize otelmetric.Int64ObservableGauge
}
-func newQueueSender(config QueueSettings, set exporter.CreateSettings, signal component.DataType,
- marshaler RequestMarshaler, unmarshaler RequestUnmarshaler, consumeErrHandler func(error, Request)) *queueSender {
-
- isPersistent := config.StorageID != nil
- var queue internal.Queue[Request]
- queueSizer := &internal.RequestSizer[Request]{}
- if isPersistent {
- queue = internal.NewPersistentQueue[Request](internal.PersistentQueueSettings[Request]{
- Sizer: queueSizer,
- Capacity: config.QueueSize,
- DataType: signal,
- StorageID: *config.StorageID,
- Marshaler: marshaler,
- Unmarshaler: unmarshaler,
- ExporterSettings: set,
- })
- } else {
- queue = internal.NewBoundedMemoryQueue[Request](internal.MemoryQueueSettings[Request]{
- Sizer: queueSizer,
- Capacity: config.QueueSize,
- })
- }
+func newQueueSender(q exporterqueue.Queue[Request], set exporter.CreateSettings, numConsumers int,
+ exportFailureMessage string) *queueSender {
qs := &queueSender{
fullName: set.ID.String(),
- queue: queue,
+ queue: q,
+ numConsumers: numConsumers,
traceAttribute: attribute.String(obsmetrics.ExporterKey, set.ID.String()),
logger: set.TelemetrySettings.Logger,
meter: set.TelemetrySettings.MeterProvider.Meter(scopeName),
@@ -113,11 +98,12 @@ func newQueueSender(config QueueSettings, set exporter.CreateSettings, signal co
consumeFunc := func(ctx context.Context, req Request) error {
err := qs.nextSender.send(ctx, req)
if err != nil {
- consumeErrHandler(err, req)
+ set.Logger.Error("Exporting failed. Dropping data."+exportFailureMessage,
+ zap.Error(err), zap.Int("dropped_items", req.ItemsCount()))
}
return err
}
- qs.consumers = internal.NewQueueConsumers(queue, config.NumConsumers, consumeFunc)
+ qs.consumers = queue.NewQueueConsumers[Request](q, numConsumers, consumeFunc)
return qs
}
diff --git a/exporter/exporterhelper/queue_sender_test.go b/exporter/exporterhelper/queue_sender_test.go
index 58da1190e9a..a2616152ea6 100644
--- a/exporter/exporterhelper/queue_sender_test.go
+++ b/exporter/exporterhelper/queue_sender_test.go
@@ -18,15 +18,18 @@ import (
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/config/configretry"
"go.opentelemetry.io/collector/exporter"
- "go.opentelemetry.io/collector/exporter/exporterhelper/internal"
+ "go.opentelemetry.io/collector/exporter/exporterqueue"
"go.opentelemetry.io/collector/exporter/exportertest"
+ "go.opentelemetry.io/collector/exporter/internal/queue"
)
func TestQueuedRetry_StopWhileWaiting(t *testing.T) {
qCfg := NewDefaultQueueSettings()
qCfg.NumConsumers = 1
rCfg := configretry.NewDefaultBackOffConfig()
- be, err := newBaseExporter(defaultSettings, defaultType, false, nil, nil, newObservabilityConsumerSender, WithRetry(rCfg), WithQueue(qCfg))
+ be, err := newBaseExporter(defaultSettings, defaultType, newObservabilityConsumerSender,
+ withMarshaler(mockRequestMarshaler), withUnmarshaler(mockRequestUnmarshaler(&mockRequest{})),
+ WithRetry(rCfg), WithQueue(qCfg))
require.NoError(t, err)
ocs := be.obsrepSender.(*observabilityConsumerSender)
require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
@@ -58,7 +61,9 @@ func TestQueuedRetry_DoNotPreserveCancellation(t *testing.T) {
qCfg := NewDefaultQueueSettings()
qCfg.NumConsumers = 1
rCfg := configretry.NewDefaultBackOffConfig()
- be, err := newBaseExporter(defaultSettings, defaultType, false, nil, nil, newObservabilityConsumerSender, WithRetry(rCfg), WithQueue(qCfg))
+ be, err := newBaseExporter(defaultSettings, defaultType, newObservabilityConsumerSender,
+ withMarshaler(mockRequestMarshaler), withUnmarshaler(mockRequestUnmarshaler(&mockRequest{})),
+ WithRetry(rCfg), WithQueue(qCfg))
require.NoError(t, err)
ocs := be.obsrepSender.(*observabilityConsumerSender)
require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
@@ -88,7 +93,9 @@ func TestQueuedRetry_RejectOnFull(t *testing.T) {
set := exportertest.NewNopCreateSettings()
logger, observed := observer.New(zap.ErrorLevel)
set.Logger = zap.New(logger)
- be, err := newBaseExporter(set, defaultType, false, nil, nil, newNoopObsrepSender, WithQueue(qCfg))
+ be, err := newBaseExporter(set, defaultType, newNoopObsrepSender,
+ withMarshaler(mockRequestMarshaler), withUnmarshaler(mockRequestUnmarshaler(&mockRequest{})),
+ WithQueue(qCfg))
require.NoError(t, err)
require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
t.Cleanup(func() {
@@ -101,41 +108,98 @@ func TestQueuedRetry_RejectOnFull(t *testing.T) {
}
func TestQueuedRetryHappyPath(t *testing.T) {
- tt, err := componenttest.SetupTelemetry(defaultID)
- require.NoError(t, err)
- t.Cleanup(func() { require.NoError(t, tt.Shutdown(context.Background())) })
-
- qCfg := NewDefaultQueueSettings()
- rCfg := configretry.NewDefaultBackOffConfig()
- set := exporter.CreateSettings{ID: defaultID, TelemetrySettings: tt.TelemetrySettings(), BuildInfo: component.NewDefaultBuildInfo()}
- be, err := newBaseExporter(set, defaultType, false, nil, nil, newObservabilityConsumerSender, WithRetry(rCfg), WithQueue(qCfg))
- require.NoError(t, err)
- ocs := be.obsrepSender.(*observabilityConsumerSender)
- require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
- t.Cleanup(func() {
- assert.NoError(t, be.Shutdown(context.Background()))
- })
-
- wantRequests := 10
- reqs := make([]*mockRequest, 0, 10)
- for i := 0; i < wantRequests; i++ {
- ocs.run(func() {
- req := newMockRequest(2, nil)
- reqs = append(reqs, req)
- require.NoError(t, be.send(context.Background(), req))
- })
+ tests := []struct {
+ name string
+ queueOptions []Option
+ }{
+ {
+ name: "WithQueue",
+ queueOptions: []Option{
+ withMarshaler(mockRequestMarshaler),
+ withUnmarshaler(mockRequestUnmarshaler(&mockRequest{})),
+ WithQueue(QueueSettings{
+ Enabled: true,
+ QueueSize: 10,
+ NumConsumers: 1,
+ }),
+ WithRetry(configretry.NewDefaultBackOffConfig()),
+ },
+ },
+ {
+ name: "WithRequestQueue/MemoryQueueFactory",
+ queueOptions: []Option{
+ WithRequestQueue(exporterqueue.Config{
+ Enabled: true,
+ QueueSize: 10,
+ NumConsumers: 1,
+ }, exporterqueue.NewMemoryQueueFactory[Request]()),
+ WithRetry(configretry.NewDefaultBackOffConfig()),
+ },
+ },
+ {
+ name: "WithRequestQueue/PersistentQueueFactory",
+ queueOptions: []Option{
+ WithRequestQueue(exporterqueue.Config{
+ Enabled: true,
+ QueueSize: 10,
+ NumConsumers: 1,
+ }, exporterqueue.NewPersistentQueueFactory[Request](nil, exporterqueue.PersistentQueueSettings[Request]{})),
+ WithRetry(configretry.NewDefaultBackOffConfig()),
+ },
+ },
+ {
+ name: "WithRequestQueue/PersistentQueueFactory/RequestsLimit",
+ queueOptions: []Option{
+ WithRequestQueue(exporterqueue.Config{
+ Enabled: true,
+ QueueSize: 10,
+ NumConsumers: 1,
+ }, exporterqueue.NewPersistentQueueFactory[Request](nil, exporterqueue.PersistentQueueSettings[Request]{})),
+ WithRetry(configretry.NewDefaultBackOffConfig()),
+ },
+ },
}
-
- // Wait until all batches received
- ocs.awaitAsyncProcessing()
-
- require.Len(t, reqs, wantRequests)
- for _, req := range reqs {
- req.checkNumRequests(t, 1)
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ tel, err := componenttest.SetupTelemetry(defaultID)
+ require.NoError(t, err)
+ t.Cleanup(func() { require.NoError(t, tel.Shutdown(context.Background())) })
+
+ set := exporter.CreateSettings{ID: defaultID, TelemetrySettings: tel.TelemetrySettings(), BuildInfo: component.NewDefaultBuildInfo()}
+ be, err := newBaseExporter(set, defaultType, newObservabilityConsumerSender, tt.queueOptions...)
+ require.NoError(t, err)
+ ocs := be.obsrepSender.(*observabilityConsumerSender)
+
+ wantRequests := 10
+ reqs := make([]*mockRequest, 0, 10)
+ for i := 0; i < wantRequests; i++ {
+ ocs.run(func() {
+ req := newMockRequest(2, nil)
+ reqs = append(reqs, req)
+ require.NoError(t, be.send(context.Background(), req))
+ })
+ }
+
+ // expect queue to be full
+ require.Error(t, be.send(context.Background(), newMockRequest(2, nil)))
+
+ require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
+ t.Cleanup(func() {
+ assert.NoError(t, be.Shutdown(context.Background()))
+ })
+
+ // Wait until all batches received
+ ocs.awaitAsyncProcessing()
+
+ require.Len(t, reqs, wantRequests)
+ for _, req := range reqs {
+ req.checkNumRequests(t, 1)
+ }
+
+ ocs.checkSendItemsCount(t, 2*wantRequests)
+ ocs.checkDroppedItemsCount(t, 0)
+ })
}
-
- ocs.checkSendItemsCount(t, 2*wantRequests)
- ocs.checkDroppedItemsCount(t, 0)
}
func TestQueuedRetry_QueueMetricsReported(t *testing.T) {
tt, err := componenttest.SetupTelemetry(defaultID)
@@ -145,7 +209,9 @@ func TestQueuedRetry_QueueMetricsReported(t *testing.T) {
qCfg.NumConsumers = 0 // to make every request go straight to the queue
rCfg := configretry.NewDefaultBackOffConfig()
set := exporter.CreateSettings{ID: defaultID, TelemetrySettings: tt.TelemetrySettings(), BuildInfo: component.NewDefaultBuildInfo()}
- be, err := newBaseExporter(set, defaultType, false, nil, nil, newObservabilityConsumerSender, WithRetry(rCfg), WithQueue(qCfg))
+ be, err := newBaseExporter(set, defaultType, newObservabilityConsumerSender,
+ withMarshaler(mockRequestMarshaler), withUnmarshaler(mockRequestUnmarshaler(&mockRequest{})),
+ WithRetry(rCfg), WithQueue(qCfg))
require.NoError(t, err)
require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
@@ -193,34 +259,65 @@ func TestQueueSettings_Validate(t *testing.T) {
}
func TestQueueRetryWithDisabledQueue(t *testing.T) {
- qs := NewDefaultQueueSettings()
- qs.Enabled = false
- set := exportertest.NewNopCreateSettings()
- logger, observed := observer.New(zap.ErrorLevel)
- set.Logger = zap.New(logger)
- be, err := newBaseExporter(set, component.DataTypeLogs, false, nil, nil, newObservabilityConsumerSender,
- WithQueue(qs))
- require.NoError(t, err)
- require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
- ocs := be.obsrepSender.(*observabilityConsumerSender)
- mockR := newMockRequest(2, errors.New("some error"))
- ocs.run(func() {
- require.Error(t, be.send(context.Background(), mockR))
- })
- assert.Len(t, observed.All(), 1)
- assert.Equal(t, "Exporting failed. Rejecting data. Try enabling sending_queue to survive temporary failures.", observed.All()[0].Message)
- ocs.awaitAsyncProcessing()
- mockR.checkNumRequests(t, 1)
- ocs.checkSendItemsCount(t, 0)
- ocs.checkDroppedItemsCount(t, 2)
- require.NoError(t, be.Shutdown(context.Background()))
+ tests := []struct {
+ name string
+ queueOptions []Option
+ }{
+ {
+ name: "WithQueue",
+ queueOptions: []Option{
+ withMarshaler(mockRequestMarshaler),
+ withUnmarshaler(mockRequestUnmarshaler(&mockRequest{})),
+ func() Option {
+ qs := NewDefaultQueueSettings()
+ qs.Enabled = false
+ return WithQueue(qs)
+ }(),
+ },
+ },
+ {
+ name: "WithRequestQueue",
+ queueOptions: []Option{
+ func() Option {
+ qs := exporterqueue.NewDefaultConfig()
+ qs.Enabled = false
+ return WithRequestQueue(qs, exporterqueue.NewMemoryQueueFactory[Request]())
+ }(),
+ },
+ },
+ }
+
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ set := exportertest.NewNopCreateSettings()
+ logger, observed := observer.New(zap.ErrorLevel)
+ set.Logger = zap.New(logger)
+ be, err := newBaseExporter(set, component.DataTypeLogs, newObservabilityConsumerSender, tt.queueOptions...)
+ require.NoError(t, err)
+ require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
+ ocs := be.obsrepSender.(*observabilityConsumerSender)
+ mockR := newMockRequest(2, errors.New("some error"))
+ ocs.run(func() {
+ require.Error(t, be.send(context.Background(), mockR))
+ })
+ assert.Len(t, observed.All(), 1)
+ assert.Equal(t, "Exporting failed. Rejecting data. Try enabling sending_queue to survive temporary failures.", observed.All()[0].Message)
+ ocs.awaitAsyncProcessing()
+ mockR.checkNumRequests(t, 1)
+ ocs.checkSendItemsCount(t, 0)
+ ocs.checkDroppedItemsCount(t, 2)
+ require.NoError(t, be.Shutdown(context.Background()))
+ })
+ }
+
}
func TestQueueFailedRequestDropped(t *testing.T) {
set := exportertest.NewNopCreateSettings()
logger, observed := observer.New(zap.ErrorLevel)
set.Logger = zap.New(logger)
- be, err := newBaseExporter(set, component.DataTypeLogs, false, nil, nil, newNoopObsrepSender, WithQueue(NewDefaultQueueSettings()))
+ be, err := newBaseExporter(set, component.DataTypeLogs, newNoopObsrepSender,
+ WithRequestQueue(exporterqueue.NewDefaultConfig(), exporterqueue.NewMemoryQueueFactory[Request]()))
require.NoError(t, err)
require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
mockR := newMockRequest(2, errors.New("some error"))
@@ -241,11 +338,13 @@ func TestQueuedRetryPersistenceEnabled(t *testing.T) {
qCfg.StorageID = &storageID // enable persistence
rCfg := configretry.NewDefaultBackOffConfig()
set := exporter.CreateSettings{ID: defaultID, TelemetrySettings: tt.TelemetrySettings(), BuildInfo: component.NewDefaultBuildInfo()}
- be, err := newBaseExporter(set, defaultType, false, nil, nil, newObservabilityConsumerSender, WithRetry(rCfg), WithQueue(qCfg))
+ be, err := newBaseExporter(set, defaultType, newObservabilityConsumerSender,
+ withMarshaler(mockRequestMarshaler), withUnmarshaler(mockRequestUnmarshaler(&mockRequest{})),
+ WithRetry(rCfg), WithQueue(qCfg))
require.NoError(t, err)
var extensions = map[component.ID]component.Component{
- storageID: internal.NewMockStorageExtension(nil),
+ storageID: queue.NewMockStorageExtension(nil),
}
host := &mockHost{ext: extensions}
@@ -265,11 +364,12 @@ func TestQueuedRetryPersistenceEnabledStorageError(t *testing.T) {
qCfg.StorageID = &storageID // enable persistence
rCfg := configretry.NewDefaultBackOffConfig()
set := exporter.CreateSettings{ID: defaultID, TelemetrySettings: tt.TelemetrySettings(), BuildInfo: component.NewDefaultBuildInfo()}
- be, err := newBaseExporter(set, defaultType, false, mockRequestMarshaler, mockRequestUnmarshaler(&mockRequest{}), newObservabilityConsumerSender, WithRetry(rCfg), WithQueue(qCfg))
+ be, err := newBaseExporter(set, defaultType, newObservabilityConsumerSender, withMarshaler(mockRequestMarshaler),
+ withUnmarshaler(mockRequestUnmarshaler(&mockRequest{})), WithRetry(rCfg), WithQueue(qCfg))
require.NoError(t, err)
var extensions = map[component.ID]component.Component{
- storageID: internal.NewMockStorageExtension(storageError),
+ storageID: queue.NewMockStorageExtension(storageError),
}
host := &mockHost{ext: extensions}
@@ -288,12 +388,12 @@ func TestQueuedRetryPersistentEnabled_NoDataLossOnShutdown(t *testing.T) {
rCfg.MaxElapsedTime = 0 // retry infinitely so shutdown can be triggered
mockReq := newErrorRequest()
- be, err := newBaseExporter(defaultSettings, defaultType, false, mockRequestMarshaler, mockRequestUnmarshaler(mockReq),
- newNoopObsrepSender, WithRetry(rCfg), WithQueue(qCfg))
+ be, err := newBaseExporter(defaultSettings, defaultType, newNoopObsrepSender, withMarshaler(mockRequestMarshaler),
+ withUnmarshaler(mockRequestUnmarshaler(mockReq)), WithRetry(rCfg), WithQueue(qCfg))
require.NoError(t, err)
var extensions = map[component.ID]component.Component{
- storageID: internal.NewMockStorageExtension(nil),
+ storageID: queue.NewMockStorageExtension(nil),
}
host := &mockHost{ext: extensions}
@@ -312,8 +412,8 @@ func TestQueuedRetryPersistentEnabled_NoDataLossOnShutdown(t *testing.T) {
// start the exporter again replacing the preserved mockRequest in the unmarshaler with a new one that doesn't fail.
replacedReq := newMockRequest(1, nil)
- be, err = newBaseExporter(defaultSettings, defaultType, false, mockRequestMarshaler, mockRequestUnmarshaler(replacedReq),
- newNoopObsrepSender, WithRetry(rCfg), WithQueue(qCfg))
+ be, err = newBaseExporter(defaultSettings, defaultType, newNoopObsrepSender, withMarshaler(mockRequestMarshaler),
+ withUnmarshaler(mockRequestUnmarshaler(replacedReq)), WithRetry(rCfg), WithQueue(qCfg))
require.NoError(t, err)
require.NoError(t, be.Start(context.Background(), host))
t.Cleanup(func() { require.NoError(t, be.Shutdown(context.Background())) })
@@ -323,7 +423,8 @@ func TestQueuedRetryPersistentEnabled_NoDataLossOnShutdown(t *testing.T) {
}
func TestQueueSenderNoStartShutdown(t *testing.T) {
- qs := newQueueSender(NewDefaultQueueSettings(), exportertest.NewNopCreateSettings(), defaultType, nil, nil, nil)
+ queue := queue.NewBoundedMemoryQueue[Request](queue.MemoryQueueSettings[Request]{})
+ qs := newQueueSender(queue, exportertest.NewNopCreateSettings(), 1, "")
assert.NoError(t, qs.Shutdown(context.Background()))
}
diff --git a/exporter/exporterhelper/request.go b/exporter/exporterhelper/request.go
index c29da3a10a3..91d190f50a2 100644
--- a/exporter/exporterhelper/request.go
+++ b/exporter/exporterhelper/request.go
@@ -8,7 +8,7 @@ import (
)
// Request represents a single request that can be sent to an external endpoint.
-// This API is at the early stage of development and may change without backward compatibility
+// Experimental: This API is at the early stage of development and may change without backward compatibility
// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
type Request interface {
// Export exports the request to an external endpoint.
@@ -23,7 +23,7 @@ type Request interface {
// temporary failures. For example, if some items failed to process and can be retried, this interface allows to
// return a new Request that contains the items left to be sent. Otherwise, the original Request should be returned.
// If not implemented, the original Request will be returned assuming the error is applied to the whole Request.
-// This API is at the early stage of development and may change without backward compatibility
+// Experimental: This API is at the early stage of development and may change without backward compatibility
// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
type RequestErrorHandler interface {
Request
@@ -33,13 +33,11 @@ type RequestErrorHandler interface {
}
// RequestMarshaler is a function that can marshal a Request into bytes.
-// This API is at the early stage of development and may change without backward compatibility
-// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
+// Deprecated: [v0.94.0] Use exporterqueue.Marshaler[Request] instead.
type RequestMarshaler func(req Request) ([]byte, error)
// RequestUnmarshaler is a function that can unmarshal bytes into a Request.
-// This API is at the early stage of development and may change without backward compatibility
-// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
+// Deprecated: [v0.94.0] Use exporterqueue.Unmarshaler[Request] instead.
type RequestUnmarshaler func(data []byte) (Request, error)
// extractPartialRequest returns a new Request that may contain the items left to be sent
diff --git a/exporter/exporterhelper/request_test.go b/exporter/exporterhelper/request_test.go
index 593ee175319..fe373c67e12 100644
--- a/exporter/exporterhelper/request_test.go
+++ b/exporter/exporterhelper/request_test.go
@@ -5,25 +5,117 @@ package exporterhelper
import (
"context"
+ "sync/atomic"
+ "time"
+ "go.opentelemetry.io/collector/exporter/exporterbatcher"
"go.opentelemetry.io/collector/pdata/plog"
"go.opentelemetry.io/collector/pdata/pmetric"
"go.opentelemetry.io/collector/pdata/ptrace"
)
+type fakeRequestSink struct {
+ requestsCount *atomic.Uint64
+ itemsCount *atomic.Uint64
+}
+
+func newFakeRequestSink() *fakeRequestSink {
+ return &fakeRequestSink{
+ requestsCount: &atomic.Uint64{},
+ itemsCount: &atomic.Uint64{},
+ }
+}
+
type fakeRequest struct {
- items int
- err error
+ items int
+ exportErr error
+ mergeErr error
+ delay time.Duration
+ sink *fakeRequestSink
}
-func (r fakeRequest) Export(_ context.Context) error {
- return r.err
+func (r *fakeRequest) Export(ctx context.Context) error {
+ select {
+ case <-ctx.Done():
+ return ctx.Err()
+ case <-time.After(r.delay):
+ }
+ if r.exportErr != nil {
+ return r.exportErr
+ }
+ if r.sink != nil {
+ r.sink.requestsCount.Add(1)
+ r.sink.itemsCount.Add(uint64(r.items))
+ }
+ return nil
}
-func (r fakeRequest) ItemsCount() int {
+func (r *fakeRequest) ItemsCount() int {
return r.items
}
+func fakeBatchMergeFunc(_ context.Context, r1 Request, r2 Request) (Request, error) {
+ if r1 == nil {
+ return r2, nil
+ }
+ fr1 := r1.(*fakeRequest)
+ fr2 := r2.(*fakeRequest)
+ if fr2.mergeErr != nil {
+ return nil, fr2.mergeErr
+ }
+ return &fakeRequest{
+ items: fr1.items + fr2.items,
+ sink: fr1.sink,
+ exportErr: fr2.exportErr,
+ delay: fr1.delay + fr2.delay,
+ }, nil
+}
+
+func fakeBatchMergeSplitFunc(ctx context.Context, cfg exporterbatcher.MaxSizeConfig, r1 Request, r2 Request) ([]Request, error) {
+ maxItems := cfg.MaxSizeItems
+ if maxItems == 0 {
+ r, err := fakeBatchMergeFunc(ctx, r1, r2)
+ return []Request{r}, err
+ }
+
+ if r2.(*fakeRequest).mergeErr != nil {
+ return nil, r2.(*fakeRequest).mergeErr
+ }
+
+ fr2 := r2.(*fakeRequest)
+ fr2 = &fakeRequest{items: fr2.items, sink: fr2.sink, exportErr: fr2.exportErr, delay: fr2.delay}
+ var res []Request
+
+ // fill fr1 to maxItems if it's not nil
+ if r1 != nil {
+ fr1 := r1.(*fakeRequest)
+ fr1 = &fakeRequest{items: fr1.items, sink: fr1.sink, exportErr: fr1.exportErr, delay: fr1.delay}
+ if fr2.items <= maxItems-fr1.items {
+ fr1.items += fr2.items
+ if fr2.exportErr != nil {
+ fr1.exportErr = fr2.exportErr
+ }
+ return []Request{fr1}, nil
+ }
+ // if split is needed, we don't propagate exportErr from fr2 to fr1 to test more cases
+ fr2.items -= maxItems - fr1.items
+ fr1.items = maxItems
+ res = append(res, fr1)
+ }
+
+ // split fr2 to maxItems
+ for {
+ if fr2.items <= maxItems {
+ res = append(res, &fakeRequest{items: fr2.items, sink: fr2.sink, exportErr: fr2.exportErr, delay: fr2.delay})
+ break
+ }
+ res = append(res, &fakeRequest{items: maxItems, sink: fr2.sink, exportErr: fr2.exportErr, delay: fr2.delay})
+ fr2.items -= maxItems
+ }
+
+ return res, nil
+}
+
type fakeRequestConverter struct {
metricsError error
tracesError error
@@ -32,13 +124,13 @@ type fakeRequestConverter struct {
}
func (frc *fakeRequestConverter) requestFromMetricsFunc(_ context.Context, md pmetric.Metrics) (Request, error) {
- return fakeRequest{items: md.DataPointCount(), err: frc.requestError}, frc.metricsError
+ return &fakeRequest{items: md.DataPointCount(), exportErr: frc.requestError}, frc.metricsError
}
func (frc *fakeRequestConverter) requestFromTracesFunc(_ context.Context, md ptrace.Traces) (Request, error) {
- return fakeRequest{items: md.SpanCount(), err: frc.requestError}, frc.tracesError
+ return &fakeRequest{items: md.SpanCount(), exportErr: frc.requestError}, frc.tracesError
}
func (frc *fakeRequestConverter) requestFromLogsFunc(_ context.Context, md plog.Logs) (Request, error) {
- return fakeRequest{items: md.LogRecordCount(), err: frc.requestError}, frc.logsError
+ return &fakeRequest{items: md.LogRecordCount(), exportErr: frc.requestError}, frc.logsError
}
diff --git a/exporter/exporterhelper/retry_sender.go b/exporter/exporterhelper/retry_sender.go
index 1bf24157898..6e8a36f9ef4 100644
--- a/exporter/exporterhelper/retry_sender.go
+++ b/exporter/exporterhelper/retry_sender.go
@@ -17,7 +17,7 @@ import (
"go.opentelemetry.io/collector/config/configretry"
"go.opentelemetry.io/collector/consumer/consumererror"
"go.opentelemetry.io/collector/exporter"
- "go.opentelemetry.io/collector/exporter/exporterhelper/internal"
+ "go.opentelemetry.io/collector/exporter/internal/experr"
"go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics"
)
@@ -127,7 +127,7 @@ func (rs *retrySender) send(ctx context.Context, req Request) error {
case <-ctx.Done():
return fmt.Errorf("request is cancelled or timed out %w", err)
case <-rs.stopCh:
- return internal.NewShutdownErr(err)
+ return experr.NewShutdownErr(err)
case <-time.After(backoffDelay):
}
}
diff --git a/exporter/exporterhelper/retry_sender_test.go b/exporter/exporterhelper/retry_sender_test.go
index b26c465e1dc..96b4904f372 100644
--- a/exporter/exporterhelper/retry_sender_test.go
+++ b/exporter/exporterhelper/retry_sender_test.go
@@ -20,17 +20,18 @@ import (
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/config/configretry"
"go.opentelemetry.io/collector/consumer/consumererror"
+ "go.opentelemetry.io/collector/exporter/exporterqueue"
"go.opentelemetry.io/collector/exporter/exportertest"
"go.opentelemetry.io/collector/internal/testdata"
)
-func mockRequestUnmarshaler(mr Request) RequestUnmarshaler {
- return func(bytes []byte) (Request, error) {
+func mockRequestUnmarshaler(mr Request) exporterqueue.Unmarshaler[Request] {
+ return func([]byte) (Request, error) {
return mr, nil
}
}
-func mockRequestMarshaler(_ Request) ([]byte, error) {
+func mockRequestMarshaler(Request) ([]byte, error) {
return []byte("mockRequest"), nil
}
@@ -38,7 +39,8 @@ func TestQueuedRetry_DropOnPermanentError(t *testing.T) {
qCfg := NewDefaultQueueSettings()
rCfg := configretry.NewDefaultBackOffConfig()
mockR := newMockRequest(2, consumererror.NewPermanent(errors.New("bad data")))
- be, err := newBaseExporter(defaultSettings, defaultType, false, nil, nil, newObservabilityConsumerSender, WithRetry(rCfg), WithQueue(qCfg))
+ be, err := newBaseExporter(defaultSettings, defaultType, newObservabilityConsumerSender,
+ withMarshaler(mockRequestMarshaler), withUnmarshaler(mockRequestUnmarshaler(mockR)), WithRetry(rCfg), WithQueue(qCfg))
require.NoError(t, err)
ocs := be.obsrepSender.(*observabilityConsumerSender)
require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
@@ -61,9 +63,9 @@ func TestQueuedRetry_DropOnNoRetry(t *testing.T) {
qCfg := NewDefaultQueueSettings()
rCfg := configretry.NewDefaultBackOffConfig()
rCfg.Enabled = false
- be, err := newBaseExporter(defaultSettings, defaultType, false, mockRequestMarshaler,
- mockRequestUnmarshaler(newMockRequest(2, errors.New("transient error"))),
- newObservabilityConsumerSender, WithRetry(rCfg), WithQueue(qCfg))
+ be, err := newBaseExporter(defaultSettings, defaultType, newObservabilityConsumerSender, withMarshaler(mockRequestMarshaler),
+ withUnmarshaler(mockRequestUnmarshaler(newMockRequest(2, errors.New("transient error")))),
+ WithQueue(qCfg), WithRetry(rCfg))
require.NoError(t, err)
ocs := be.obsrepSender.(*observabilityConsumerSender)
require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
@@ -88,7 +90,9 @@ func TestQueuedRetry_OnError(t *testing.T) {
qCfg.NumConsumers = 1
rCfg := configretry.NewDefaultBackOffConfig()
rCfg.InitialInterval = 0
- be, err := newBaseExporter(defaultSettings, defaultType, false, nil, nil, newObservabilityConsumerSender, WithRetry(rCfg), WithQueue(qCfg))
+ be, err := newBaseExporter(defaultSettings, defaultType, newObservabilityConsumerSender,
+ withMarshaler(mockRequestMarshaler), withUnmarshaler(mockRequestUnmarshaler(&mockRequest{})),
+ WithRetry(rCfg), WithQueue(qCfg))
require.NoError(t, err)
require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
t.Cleanup(func() {
@@ -116,7 +120,9 @@ func TestQueuedRetry_MaxElapsedTime(t *testing.T) {
rCfg := configretry.NewDefaultBackOffConfig()
rCfg.InitialInterval = time.Millisecond
rCfg.MaxElapsedTime = 100 * time.Millisecond
- be, err := newBaseExporter(defaultSettings, defaultType, false, nil, nil, newObservabilityConsumerSender, WithRetry(rCfg), WithQueue(qCfg))
+ be, err := newBaseExporter(defaultSettings, defaultType, newObservabilityConsumerSender,
+ withMarshaler(mockRequestMarshaler), withUnmarshaler(mockRequestUnmarshaler(&mockRequest{})),
+ WithRetry(rCfg), WithQueue(qCfg))
require.NoError(t, err)
ocs := be.obsrepSender.(*observabilityConsumerSender)
require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
@@ -162,7 +168,9 @@ func TestQueuedRetry_ThrottleError(t *testing.T) {
qCfg.NumConsumers = 1
rCfg := configretry.NewDefaultBackOffConfig()
rCfg.InitialInterval = 10 * time.Millisecond
- be, err := newBaseExporter(defaultSettings, defaultType, false, nil, nil, newObservabilityConsumerSender, WithRetry(rCfg), WithQueue(qCfg))
+ be, err := newBaseExporter(defaultSettings, defaultType, newObservabilityConsumerSender,
+ withMarshaler(mockRequestMarshaler), withUnmarshaler(mockRequestUnmarshaler(&mockRequest{})),
+ WithRetry(rCfg), WithQueue(qCfg))
require.NoError(t, err)
ocs := be.obsrepSender.(*observabilityConsumerSender)
require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
@@ -194,7 +202,9 @@ func TestQueuedRetry_RetryOnError(t *testing.T) {
qCfg.QueueSize = 1
rCfg := configretry.NewDefaultBackOffConfig()
rCfg.InitialInterval = 0
- be, err := newBaseExporter(defaultSettings, defaultType, false, nil, nil, newObservabilityConsumerSender, WithRetry(rCfg), WithQueue(qCfg))
+ be, err := newBaseExporter(defaultSettings, defaultType, newObservabilityConsumerSender,
+ withMarshaler(mockRequestMarshaler), withUnmarshaler(mockRequestUnmarshaler(&mockRequest{})),
+ WithRetry(rCfg), WithQueue(qCfg))
require.NoError(t, err)
ocs := be.obsrepSender.(*observabilityConsumerSender)
require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
@@ -219,7 +229,7 @@ func TestQueuedRetry_RetryOnError(t *testing.T) {
func TestQueueRetryWithNoQueue(t *testing.T) {
rCfg := configretry.NewDefaultBackOffConfig()
rCfg.MaxElapsedTime = time.Nanosecond // fail fast
- be, err := newBaseExporter(exportertest.NewNopCreateSettings(), component.DataTypeLogs, false, nil, nil, newObservabilityConsumerSender, WithRetry(rCfg))
+ be, err := newBaseExporter(exportertest.NewNopCreateSettings(), component.DataTypeLogs, newObservabilityConsumerSender, WithRetry(rCfg))
require.NoError(t, err)
require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
ocs := be.obsrepSender.(*observabilityConsumerSender)
@@ -240,7 +250,7 @@ func TestQueueRetryWithDisabledRetires(t *testing.T) {
set := exportertest.NewNopCreateSettings()
logger, observed := observer.New(zap.ErrorLevel)
set.Logger = zap.New(logger)
- be, err := newBaseExporter(set, component.DataTypeLogs, false, nil, nil, newObservabilityConsumerSender, WithRetry(rCfg))
+ be, err := newBaseExporter(set, component.DataTypeLogs, newObservabilityConsumerSender, WithRetry(rCfg))
require.NoError(t, err)
require.NoError(t, be.Start(context.Background(), componenttest.NewNopHost()))
ocs := be.obsrepSender.(*observabilityConsumerSender)
@@ -260,7 +270,7 @@ func TestQueueRetryWithDisabledRetires(t *testing.T) {
type mockErrorRequest struct{}
-func (mer *mockErrorRequest) Export(_ context.Context) error {
+func (mer *mockErrorRequest) Export(context.Context) error {
return errors.New("transient error")
}
@@ -329,7 +339,7 @@ type observabilityConsumerSender struct {
droppedItemsCount *atomic.Int64
}
-func newObservabilityConsumerSender(_ *ObsReport) requestSender {
+func newObservabilityConsumerSender(*ObsReport) requestSender {
return &observabilityConsumerSender{
waitGroup: new(sync.WaitGroup),
droppedItemsCount: &atomic.Int64{},
diff --git a/exporter/exporterhelper/traces.go b/exporter/exporterhelper/traces.go
index 53c6533cc2d..6f5f39f3de5 100644
--- a/exporter/exporterhelper/traces.go
+++ b/exporter/exporterhelper/traces.go
@@ -13,7 +13,8 @@ import (
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/consumer/consumererror"
"go.opentelemetry.io/collector/exporter"
- "go.opentelemetry.io/collector/exporter/exporterhelper/internal"
+ "go.opentelemetry.io/collector/exporter/exporterqueue"
+ "go.opentelemetry.io/collector/exporter/internal/queue"
"go.opentelemetry.io/collector/pdata/ptrace"
)
@@ -32,7 +33,7 @@ func newTracesRequest(td ptrace.Traces, pusher consumer.ConsumeTracesFunc) Reque
}
}
-func newTraceRequestUnmarshalerFunc(pusher consumer.ConsumeTracesFunc) RequestUnmarshaler {
+func newTraceRequestUnmarshalerFunc(pusher consumer.ConsumeTracesFunc) exporterqueue.Unmarshaler[Request] {
return func(bytes []byte) (Request, error) {
traces, err := tracesUnmarshaler.UnmarshalTraces(bytes)
if err != nil {
@@ -69,7 +70,7 @@ type traceExporter struct {
// NewTracesExporter creates an exporter.Traces that records observability metrics and wraps every request with a Span.
func NewTracesExporter(
- _ context.Context,
+ ctx context.Context,
set exporter.CreateSettings,
cfg component.Config,
pusher consumer.ConsumeTracesFunc,
@@ -78,43 +79,30 @@ func NewTracesExporter(
if cfg == nil {
return nil, errNilConfig
}
-
- if set.Logger == nil {
- return nil, errNilLogger
- }
-
if pusher == nil {
return nil, errNilPushTraceData
}
-
- be, err := newBaseExporter(set, component.DataTypeTraces, false, tracesRequestMarshaler,
- newTraceRequestUnmarshalerFunc(pusher), newTracesExporterWithObservability, options...)
- if err != nil {
- return nil, err
+ tracesOpts := []Option{
+ withMarshaler(tracesRequestMarshaler), withUnmarshaler(newTraceRequestUnmarshalerFunc(pusher)),
+ withBatchFuncs(mergeTraces, mergeSplitTraces),
}
-
- tc, err := consumer.NewTraces(func(ctx context.Context, td ptrace.Traces) error {
- req := newTracesRequest(td, pusher)
- serr := be.send(ctx, req)
- if errors.Is(serr, internal.ErrQueueIsFull) {
- be.obsrep.recordEnqueueFailure(ctx, component.DataTypeTraces, int64(req.ItemsCount()))
- }
- return serr
- }, be.consumerOptions...)
-
- return &traceExporter{
- baseExporter: be,
- Traces: tc,
- }, err
+ return NewTracesRequestExporter(ctx, set, requestFromTraces(pusher), append(tracesOpts, options...)...)
}
// RequestFromTracesFunc converts ptrace.Traces into a user-defined Request.
-// This API is at the early stage of development and may change without backward compatibility
+// Experimental: This API is at the early stage of development and may change without backward compatibility
// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
type RequestFromTracesFunc func(context.Context, ptrace.Traces) (Request, error)
+// requestFromTraces returns a RequestFromTracesFunc that converts ptrace.Traces into a Request.
+func requestFromTraces(pusher consumer.ConsumeTracesFunc) RequestFromTracesFunc {
+ return func(_ context.Context, traces ptrace.Traces) (Request, error) {
+ return newTracesRequest(traces, pusher), nil
+ }
+}
+
// NewTracesRequestExporter creates a new traces exporter based on a custom TracesConverter and RequestSender.
-// This API is at the early stage of development and may change without backward compatibility
+// Experimental: This API is at the early stage of development and may change without backward compatibility
// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
func NewTracesRequestExporter(
_ context.Context,
@@ -130,7 +118,7 @@ func NewTracesRequestExporter(
return nil, errNilTracesConverter
}
- be, err := newBaseExporter(set, component.DataTypeTraces, true, nil, nil, newTracesExporterWithObservability, options...)
+ be, err := newBaseExporter(set, component.DataTypeTraces, newTracesExporterWithObservability, options...)
if err != nil {
return nil, err
}
@@ -144,7 +132,7 @@ func NewTracesRequestExporter(
return consumererror.NewPermanent(cErr)
}
sErr := be.send(ctx, req)
- if errors.Is(sErr, internal.ErrQueueIsFull) {
+ if errors.Is(sErr, queue.ErrQueueIsFull) {
be.obsrep.recordEnqueueFailure(ctx, component.DataTypeTraces, int64(req.ItemsCount()))
}
return sErr
diff --git a/exporter/exporterhelper/traces_batch.go b/exporter/exporterhelper/traces_batch.go
new file mode 100644
index 00000000000..1bdada95b7b
--- /dev/null
+++ b/exporter/exporterhelper/traces_batch.go
@@ -0,0 +1,139 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package exporterhelper // import "go.opentelemetry.io/collector/exporter/exporterhelper"
+
+import (
+ "context"
+ "errors"
+
+ "go.opentelemetry.io/collector/exporter/exporterbatcher"
+ "go.opentelemetry.io/collector/pdata/ptrace"
+)
+
+// mergeTraces merges two traces requests into one.
+func mergeTraces(_ context.Context, r1 Request, r2 Request) (Request, error) {
+ tr1, ok1 := r1.(*tracesRequest)
+ tr2, ok2 := r2.(*tracesRequest)
+ if !ok1 || !ok2 {
+ return nil, errors.New("invalid input type")
+ }
+ tr2.td.ResourceSpans().MoveAndAppendTo(tr1.td.ResourceSpans())
+ return tr1, nil
+}
+
+// mergeSplitTraces splits and/or merges the traces into multiple requests based on the MaxSizeConfig.
+func mergeSplitTraces(_ context.Context, cfg exporterbatcher.MaxSizeConfig, r1 Request, r2 Request) ([]Request, error) {
+ var (
+ res []Request
+ destReq *tracesRequest
+ capacityLeft = cfg.MaxSizeItems
+ )
+ for _, req := range []Request{r1, r2} {
+ if req == nil {
+ continue
+ }
+ srcReq, ok := req.(*tracesRequest)
+ if !ok {
+ return nil, errors.New("invalid input type")
+ }
+ if srcReq.td.SpanCount() <= capacityLeft {
+ if destReq == nil {
+ destReq = srcReq
+ } else {
+ srcReq.td.ResourceSpans().MoveAndAppendTo(destReq.td.ResourceSpans())
+ }
+ capacityLeft -= destReq.td.SpanCount()
+ continue
+ }
+
+ for {
+ extractedTraces := extractTraces(srcReq.td, capacityLeft)
+ if extractedTraces.SpanCount() == 0 {
+ break
+ }
+ capacityLeft -= extractedTraces.SpanCount()
+ if destReq == nil {
+ destReq = &tracesRequest{td: extractedTraces, pusher: srcReq.pusher}
+ } else {
+ extractedTraces.ResourceSpans().MoveAndAppendTo(destReq.td.ResourceSpans())
+ }
+ // Create new batch once capacity is reached.
+ if capacityLeft == 0 {
+ res = append(res, destReq)
+ destReq = nil
+ capacityLeft = cfg.MaxSizeItems
+ }
+ }
+ }
+
+ if destReq != nil {
+ res = append(res, destReq)
+ }
+ return res, nil
+}
+
+// extractTraces extracts a new traces with a maximum number of spans.
+func extractTraces(srcTraces ptrace.Traces, count int) ptrace.Traces {
+ destTraces := ptrace.NewTraces()
+ srcTraces.ResourceSpans().RemoveIf(func(srcRS ptrace.ResourceSpans) bool {
+ if count == 0 {
+ return false
+ }
+ needToExtract := resourceTracesCount(srcRS) > count
+ if needToExtract {
+ srcRS = extractResourceSpans(srcRS, count)
+ }
+ count -= resourceTracesCount(srcRS)
+ srcRS.MoveTo(destTraces.ResourceSpans().AppendEmpty())
+ return !needToExtract
+ })
+ return destTraces
+}
+
+// extractResourceSpans extracts spans and returns a new resource spans with the specified number of spans.
+func extractResourceSpans(srcRS ptrace.ResourceSpans, count int) ptrace.ResourceSpans {
+ destRS := ptrace.NewResourceSpans()
+ destRS.SetSchemaUrl(srcRS.SchemaUrl())
+ srcRS.Resource().CopyTo(destRS.Resource())
+ srcRS.ScopeSpans().RemoveIf(func(srcSS ptrace.ScopeSpans) bool {
+ if count == 0 {
+ return false
+ }
+ needToExtract := srcSS.Spans().Len() > count
+ if needToExtract {
+ srcSS = extractScopeSpans(srcSS, count)
+ }
+ count -= srcSS.Spans().Len()
+ srcSS.MoveTo(destRS.ScopeSpans().AppendEmpty())
+ return !needToExtract
+ })
+ srcRS.Resource().CopyTo(destRS.Resource())
+ return destRS
+}
+
+// extractScopeSpans extracts spans and returns a new scope spans with the specified number of spans.
+func extractScopeSpans(srcSS ptrace.ScopeSpans, count int) ptrace.ScopeSpans {
+ destSS := ptrace.NewScopeSpans()
+ destSS.SetSchemaUrl(srcSS.SchemaUrl())
+ srcSS.Scope().CopyTo(destSS.Scope())
+ srcSS.Spans().RemoveIf(func(srcSpan ptrace.Span) bool {
+ if count == 0 {
+ return false
+ }
+ srcSpan.MoveTo(destSS.Spans().AppendEmpty())
+ count--
+ return true
+ })
+ return destSS
+}
+
+// resourceTracesCount calculates the total number of spans in the pdata.ResourceSpans.
+func resourceTracesCount(rs ptrace.ResourceSpans) int {
+ count := 0
+ rs.ScopeSpans().RemoveIf(func(ss ptrace.ScopeSpans) bool {
+ count += ss.Spans().Len()
+ return false
+ })
+ return count
+}
diff --git a/exporter/exporterhelper/traces_batch_test.go b/exporter/exporterhelper/traces_batch_test.go
new file mode 100644
index 00000000000..9e89bb6c6e8
--- /dev/null
+++ b/exporter/exporterhelper/traces_batch_test.go
@@ -0,0 +1,159 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package exporterhelper
+
+import (
+ "context"
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+
+ "go.opentelemetry.io/collector/exporter/exporterbatcher"
+ "go.opentelemetry.io/collector/internal/testdata"
+ "go.opentelemetry.io/collector/pdata/ptrace"
+)
+
+func TestMergeTraces(t *testing.T) {
+ tr1 := &tracesRequest{td: testdata.GenerateTraces(2)}
+ tr2 := &tracesRequest{td: testdata.GenerateTraces(3)}
+ res, err := mergeTraces(context.Background(), tr1, tr2)
+ assert.Nil(t, err)
+ assert.Equal(t, 5, res.(*tracesRequest).td.SpanCount())
+}
+
+func TestMergeTracesInvalidInput(t *testing.T) {
+ tr1 := &logsRequest{ld: testdata.GenerateLogs(2)}
+ tr2 := &tracesRequest{td: testdata.GenerateTraces(3)}
+ _, err := mergeTraces(context.Background(), tr1, tr2)
+ assert.Error(t, err)
+}
+
+func TestMergeSplitTraces(t *testing.T) {
+ tests := []struct {
+ name string
+ cfg exporterbatcher.MaxSizeConfig
+ tr1 Request
+ tr2 Request
+ expected []*tracesRequest
+ }{
+ {
+ name: "both_requests_empty",
+ cfg: exporterbatcher.MaxSizeConfig{MaxSizeItems: 10},
+ tr1: &tracesRequest{td: ptrace.NewTraces()},
+ tr2: &tracesRequest{td: ptrace.NewTraces()},
+ expected: []*tracesRequest{{td: ptrace.NewTraces()}},
+ },
+ {
+ name: "both_requests_nil",
+ cfg: exporterbatcher.MaxSizeConfig{MaxSizeItems: 10},
+ tr1: nil,
+ tr2: nil,
+ expected: []*tracesRequest{},
+ },
+ {
+ name: "first_request_empty",
+ cfg: exporterbatcher.MaxSizeConfig{MaxSizeItems: 10},
+ tr1: &tracesRequest{td: ptrace.NewTraces()},
+ tr2: &tracesRequest{td: testdata.GenerateTraces(5)},
+ expected: []*tracesRequest{{td: testdata.GenerateTraces(5)}},
+ },
+ {
+ name: "second_request_empty",
+ cfg: exporterbatcher.MaxSizeConfig{MaxSizeItems: 10},
+ tr1: &tracesRequest{td: testdata.GenerateTraces(5)},
+ tr2: &tracesRequest{td: ptrace.NewTraces()},
+ expected: []*tracesRequest{{td: testdata.GenerateTraces(5)}},
+ },
+ {
+ name: "first_nil_second_empty",
+ cfg: exporterbatcher.MaxSizeConfig{MaxSizeItems: 10},
+ tr1: nil,
+ tr2: &tracesRequest{td: ptrace.NewTraces()},
+ expected: []*tracesRequest{{td: ptrace.NewTraces()}},
+ },
+ {
+ name: "merge_only",
+ cfg: exporterbatcher.MaxSizeConfig{MaxSizeItems: 10},
+ tr1: &tracesRequest{td: testdata.GenerateTraces(5)},
+ tr2: &tracesRequest{td: testdata.GenerateTraces(5)},
+ expected: []*tracesRequest{{td: func() ptrace.Traces {
+ td := testdata.GenerateTraces(5)
+ testdata.GenerateTraces(5).ResourceSpans().MoveAndAppendTo(td.ResourceSpans())
+ return td
+ }()}},
+ },
+ {
+ name: "split_only",
+ cfg: exporterbatcher.MaxSizeConfig{MaxSizeItems: 4},
+ tr1: nil,
+ tr2: &tracesRequest{td: testdata.GenerateTraces(10)},
+ expected: []*tracesRequest{
+ {td: testdata.GenerateTraces(4)},
+ {td: testdata.GenerateTraces(4)},
+ {td: testdata.GenerateTraces(2)},
+ },
+ },
+ {
+ name: "split_and_merge",
+ cfg: exporterbatcher.MaxSizeConfig{MaxSizeItems: 10},
+ tr1: &tracesRequest{td: testdata.GenerateTraces(4)},
+ tr2: &tracesRequest{td: testdata.GenerateTraces(20)},
+ expected: []*tracesRequest{
+ {td: func() ptrace.Traces {
+ td := testdata.GenerateTraces(4)
+ testdata.GenerateTraces(6).ResourceSpans().MoveAndAppendTo(td.ResourceSpans())
+ return td
+ }()},
+ {td: testdata.GenerateTraces(10)},
+ {td: testdata.GenerateTraces(4)},
+ },
+ },
+ {
+ name: "scope_spans_split",
+ cfg: exporterbatcher.MaxSizeConfig{MaxSizeItems: 10},
+ tr1: &tracesRequest{td: func() ptrace.Traces {
+ td := testdata.GenerateTraces(10)
+ extraScopeTraces := testdata.GenerateTraces(5)
+ extraScopeTraces.ResourceSpans().At(0).ScopeSpans().At(0).Scope().SetName("extra scope")
+ extraScopeTraces.ResourceSpans().MoveAndAppendTo(td.ResourceSpans())
+ return td
+ }()},
+ tr2: nil,
+ expected: []*tracesRequest{
+ {td: testdata.GenerateTraces(10)},
+ {td: func() ptrace.Traces {
+ td := testdata.GenerateTraces(5)
+ td.ResourceSpans().At(0).ScopeSpans().At(0).Scope().SetName("extra scope")
+ return td
+ }()},
+ },
+ },
+ }
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ res, err := mergeSplitTraces(context.Background(), tt.cfg, tt.tr1, tt.tr2)
+ assert.Nil(t, err)
+ assert.Equal(t, len(tt.expected), len(res))
+ for i := range res {
+ assert.Equal(t, tt.expected[i], res[i].(*tracesRequest))
+ }
+ })
+ }
+}
+
+func TestMergeSplitTracesInvalidInput(t *testing.T) {
+ r1 := &tracesRequest{td: testdata.GenerateTraces(2)}
+ r2 := &metricsRequest{md: testdata.GenerateMetrics(3)}
+ _, err := mergeSplitTraces(context.Background(), exporterbatcher.MaxSizeConfig{MaxSizeItems: 10}, r1, r2)
+ assert.Error(t, err)
+}
+
+func TestExtractTraces(t *testing.T) {
+ for i := 0; i < 10; i++ {
+ td := testdata.GenerateTraces(10)
+ extractedTraces := extractTraces(td, i)
+ assert.Equal(t, i, extractedTraces.SpanCount())
+ assert.Equal(t, 10-i, td.SpanCount())
+ }
+}
diff --git a/exporter/exporterhelper/traces_test.go b/exporter/exporterhelper/traces_test.go
index be5a45ac30d..0c8bec25f5f 100644
--- a/exporter/exporterhelper/traces_test.go
+++ b/exporter/exporterhelper/traces_test.go
@@ -25,8 +25,8 @@ import (
"go.opentelemetry.io/collector/consumer/consumererror"
"go.opentelemetry.io/collector/consumer/consumertest"
"go.opentelemetry.io/collector/exporter"
- "go.opentelemetry.io/collector/exporter/exporterhelper/internal"
"go.opentelemetry.io/collector/exporter/exportertest"
+ "go.opentelemetry.io/collector/exporter/internal/queue"
"go.opentelemetry.io/collector/internal/obsreportconfig/obsmetrics"
"go.opentelemetry.io/collector/internal/testdata"
"go.opentelemetry.io/collector/pdata/ptrace"
@@ -165,7 +165,7 @@ func TestTracesExporter_WithPersistentQueue(t *testing.T) {
require.NoError(t, err)
host := &mockHost{ext: map[component.ID]component.Component{
- storageID: internal.NewMockStorageExtension(nil),
+ storageID: queue.NewMockStorageExtension(nil),
}}
require.NoError(t, te.Start(context.Background(), host))
t.Cleanup(func() { require.NoError(t, te.Shutdown(context.Background())) })
@@ -367,7 +367,7 @@ func TestTracesRequestExporter_WithShutdown_ReturnError(t *testing.T) {
}
func newTraceDataPusher(retError error) consumer.ConsumeTracesFunc {
- return func(ctx context.Context, td ptrace.Traces) error {
+ return func(context.Context, ptrace.Traces) error {
return retError
}
}
diff --git a/exporter/exporterqueue/config.go b/exporter/exporterqueue/config.go
new file mode 100644
index 00000000000..fcc0e0e57b1
--- /dev/null
+++ b/exporter/exporterqueue/config.go
@@ -0,0 +1,61 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package exporterqueue // import "go.opentelemetry.io/collector/exporter/exporterqueue"
+
+import (
+ "errors"
+
+ "go.opentelemetry.io/collector/component"
+)
+
+// Config defines configuration for queueing requests before exporting.
+// It's supposed to be used with the new exporter helpers New[Traces|Metrics|Logs]RequestExporter.
+// Experimental: This API is at the early stage of development and may change without backward compatibility
+// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
+type Config struct {
+ // Enabled indicates whether to not enqueue batches before exporting.
+ Enabled bool `mapstructure:"enabled"`
+ // NumConsumers is the number of consumers from the queue.
+ NumConsumers int `mapstructure:"num_consumers"`
+ // QueueSize is the maximum number of requests allowed in queue at any given time.
+ QueueSize int `mapstructure:"queue_size"`
+}
+
+// NewDefaultConfig returns the default Config.
+// Experimental: This API is at the early stage of development and may change without backward compatibility
+// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
+func NewDefaultConfig() Config {
+ return Config{
+ Enabled: true,
+ NumConsumers: 10,
+ QueueSize: 1_000,
+ }
+}
+
+// Validate checks if the QueueSettings configuration is valid
+func (qCfg *Config) Validate() error {
+ if !qCfg.Enabled {
+ return nil
+ }
+ if qCfg.NumConsumers <= 0 {
+ return errors.New("number of consumers must be positive")
+ }
+ if qCfg.QueueSize <= 0 {
+ return errors.New("queue size must be positive")
+ }
+ return nil
+}
+
+// PersistentQueueConfig defines configuration for queueing requests in a persistent storage.
+// The struct is provided to be added in the exporter configuration as one struct under the "sending_queue" key.
+// The exporter helper Go interface requires the fields to be provided separately to WithRequestQueue and
+// NewPersistentQueueFactory.
+// Experimental: This API is at the early stage of development and may change without backward compatibility
+// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
+type PersistentQueueConfig struct {
+ Config `mapstructure:",squash"`
+ // StorageID if not empty, enables the persistent storage and uses the component specified
+ // as a storage extension for the persistent queue
+ StorageID *component.ID `mapstructure:"storage"`
+}
diff --git a/exporter/exporterqueue/config_test.go b/exporter/exporterqueue/config_test.go
new file mode 100644
index 00000000000..c1b43ba5f8e
--- /dev/null
+++ b/exporter/exporterqueue/config_test.go
@@ -0,0 +1,26 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package exporterqueue
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+)
+
+func TestQueueConfig_Validate(t *testing.T) {
+ qCfg := NewDefaultConfig()
+ assert.NoError(t, qCfg.Validate())
+
+ qCfg.NumConsumers = 0
+ assert.EqualError(t, qCfg.Validate(), "number of consumers must be positive")
+
+ qCfg = NewDefaultConfig()
+ qCfg.QueueSize = 0
+ assert.EqualError(t, qCfg.Validate(), "queue size must be positive")
+
+ // Confirm Validate doesn't return error with invalid config when feature is disabled
+ qCfg.Enabled = false
+ assert.NoError(t, qCfg.Validate())
+}
diff --git a/exporter/exporterqueue/queue.go b/exporter/exporterqueue/queue.go
new file mode 100644
index 00000000000..d96bbd1455a
--- /dev/null
+++ b/exporter/exporterqueue/queue.go
@@ -0,0 +1,96 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package exporterqueue // import "go.opentelemetry.io/collector/exporter/exporterqueue"
+
+import (
+ "context"
+
+ "go.opentelemetry.io/collector/component"
+ "go.opentelemetry.io/collector/exporter"
+ "go.opentelemetry.io/collector/exporter/internal/queue"
+)
+
+// Queue defines a producer-consumer exchange which can be backed by e.g. the memory-based ring buffer queue
+// (boundedMemoryQueue) or via a disk-based queue (persistentQueue)
+// Experimental: This API is at the early stage of development and may change without backward compatibility
+// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
+type Queue[T any] queue.Queue[T]
+
+// Settings defines settings for creating a queue.
+type Settings struct {
+ DataType component.DataType
+ ExporterSettings exporter.CreateSettings
+}
+
+// Marshaler is a function that can marshal a request into bytes.
+// Experimental: This API is at the early stage of development and may change without backward compatibility
+// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
+type Marshaler[T any] func(T) ([]byte, error)
+
+// Unmarshaler is a function that can unmarshal bytes into a request.
+// Experimental: This API is at the early stage of development and may change without backward compatibility
+// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
+type Unmarshaler[T any] func([]byte) (T, error)
+
+// Factory is a function that creates a new queue.
+// Experimental: This API is at the early stage of development and may change without backward compatibility
+// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
+type Factory[T any] func(context.Context, Settings, Config) Queue[T]
+
+// NewMemoryQueueFactory returns a factory to create a new memory queue.
+// Experimental: This API is at the early stage of development and may change without backward compatibility
+// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
+func NewMemoryQueueFactory[T itemsCounter]() Factory[T] {
+ return func(_ context.Context, _ Settings, cfg Config) Queue[T] {
+ return queue.NewBoundedMemoryQueue[T](queue.MemoryQueueSettings[T]{
+ Sizer: sizerFromConfig[T](cfg),
+ Capacity: capacityFromConfig(cfg),
+ })
+ }
+}
+
+// PersistentQueueSettings defines developer settings for the persistent queue factory.
+// Experimental: This API is at the early stage of development and may change without backward compatibility
+// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
+type PersistentQueueSettings[T any] struct {
+ // Marshaler is used to serialize queue elements before storing them in the persistent storage.
+ Marshaler Marshaler[T]
+ // Unmarshaler is used to deserialize requests after reading them from the persistent storage.
+ Unmarshaler Unmarshaler[T]
+}
+
+// NewPersistentQueueFactory returns a factory to create a new persistent queue.
+// If cfg.StorageID is nil then it falls back to memory queue.
+// Experimental: This API is at the early stage of development and may change without backward compatibility
+// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
+func NewPersistentQueueFactory[T itemsCounter](storageID *component.ID, factorySettings PersistentQueueSettings[T]) Factory[T] {
+ if storageID == nil {
+ return NewMemoryQueueFactory[T]()
+ }
+ return func(_ context.Context, set Settings, cfg Config) Queue[T] {
+ return queue.NewPersistentQueue[T](queue.PersistentQueueSettings[T]{
+ Sizer: sizerFromConfig[T](cfg),
+ Capacity: capacityFromConfig(cfg),
+ DataType: set.DataType,
+ StorageID: *storageID,
+ Marshaler: factorySettings.Marshaler,
+ Unmarshaler: factorySettings.Unmarshaler,
+ ExporterSettings: set.ExporterSettings,
+ })
+ }
+}
+
+type itemsCounter interface {
+ ItemsCount() int
+}
+
+func sizerFromConfig[T itemsCounter](Config) queue.Sizer[T] {
+ // TODO: Handle other ways to measure the queue size once they are added.
+ return &queue.RequestSizer[T]{}
+}
+
+func capacityFromConfig(cfg Config) int {
+ // TODO: Handle other ways to measure the queue size once they are added.
+ return cfg.QueueSize
+}
diff --git a/exporter/exportertest/contract_checker.go b/exporter/exportertest/contract_checker.go
index 55694bf632e..7b3f55c1902 100644
--- a/exporter/exportertest/contract_checker.go
+++ b/exporter/exportertest/contract_checker.go
@@ -141,7 +141,7 @@ func checkMetrics(t *testing.T, params CheckConsumeContractParams, mockReceiver
fmt.Printf("Number of permanent errors: %d\n", reqCounter.error.permanent)
fmt.Printf("Number of non-permanent errors: %d\n", reqCounter.error.nonpermanent)
- assert.EventuallyWithT(t, func(c *assert.CollectT) {
+ assert.EventuallyWithT(t, func(*assert.CollectT) {
checkIfTestPassed(t, params.NumberOfTestElements, *reqCounter)
}, 2*time.Second, 100*time.Millisecond)
}
@@ -181,7 +181,7 @@ func checkTraces(t *testing.T, params CheckConsumeContractParams, mockReceiver c
fmt.Printf("Number of permanent errors: %d\n", reqCounter.error.permanent)
fmt.Printf("Number of non-permanent errors: %d\n", reqCounter.error.nonpermanent)
- assert.EventuallyWithT(t, func(c *assert.CollectT) {
+ assert.EventuallyWithT(t, func(*assert.CollectT) {
checkIfTestPassed(t, params.NumberOfTestElements, *reqCounter)
}, 2*time.Second, 100*time.Millisecond)
}
@@ -220,7 +220,7 @@ func checkLogs(t *testing.T, params CheckConsumeContractParams, mockReceiver com
fmt.Printf("Number of permanent errors: %d\n", reqCounter.error.permanent)
fmt.Printf("Number of non-permanent errors: %d\n", reqCounter.error.nonpermanent)
- assert.EventuallyWithT(t, func(c *assert.CollectT) {
+ assert.EventuallyWithT(t, func(*assert.CollectT) {
checkIfTestPassed(t, params.NumberOfTestElements, *reqCounter)
}, 2*time.Second, 100*time.Millisecond)
}
diff --git a/exporter/exportertest/nop_exporter.go b/exporter/exportertest/nop_exporter.go
index e7e9f350331..6589d867bec 100644
--- a/exporter/exportertest/nop_exporter.go
+++ b/exporter/exportertest/nop_exporter.go
@@ -6,6 +6,8 @@ package exportertest // import "go.opentelemetry.io/collector/exporter/exportert
import (
"context"
+ "github.com/google/uuid"
+
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/consumer/consumertest"
@@ -17,7 +19,7 @@ var nopType = component.MustNewType("nop")
// NewNopCreateSettings returns a new nop settings for Create*Exporter functions.
func NewNopCreateSettings() exporter.CreateSettings {
return exporter.CreateSettings{
- ID: component.NewID(nopType),
+ ID: component.NewIDWithName(nopType, uuid.NewString()),
TelemetrySettings: componenttest.NewNopTelemetrySettings(),
BuildInfo: component.NewDefaultBuildInfo(),
}
diff --git a/exporter/go.mod b/exporter/go.mod
index cc985606343..f17085c3d1e 100644
--- a/exporter/go.mod
+++ b/exporter/go.mod
@@ -1,27 +1,28 @@
module go.opentelemetry.io/collector/exporter
-go 1.20
+go 1.21
require (
- github.com/cenkalti/backoff/v4 v4.2.1
- github.com/stretchr/testify v1.8.4
- go.opentelemetry.io/collector v0.93.0
- go.opentelemetry.io/collector/component v0.93.0
- go.opentelemetry.io/collector/config/configretry v0.93.0
- go.opentelemetry.io/collector/config/configtelemetry v0.93.0
- go.opentelemetry.io/collector/consumer v0.93.0
- go.opentelemetry.io/collector/extension v0.93.0
- go.opentelemetry.io/collector/pdata v1.0.1
- go.opentelemetry.io/collector/receiver v0.93.0
- go.opentelemetry.io/otel v1.22.0
- go.opentelemetry.io/otel/metric v1.22.0
- go.opentelemetry.io/otel/sdk v1.22.0
- go.opentelemetry.io/otel/trace v1.22.0
+ github.com/cenkalti/backoff/v4 v4.3.0
+ github.com/google/uuid v1.6.0
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector v0.97.0
+ go.opentelemetry.io/collector/component v0.97.0
+ go.opentelemetry.io/collector/config/configretry v0.97.0
+ go.opentelemetry.io/collector/config/configtelemetry v0.97.0
+ go.opentelemetry.io/collector/consumer v0.97.0
+ go.opentelemetry.io/collector/extension v0.97.0
+ go.opentelemetry.io/collector/pdata v1.4.0
+ go.opentelemetry.io/collector/receiver v0.97.0
+ go.opentelemetry.io/otel v1.24.0
+ go.opentelemetry.io/otel/metric v1.24.0
+ go.opentelemetry.io/otel/sdk v1.24.0
+ go.opentelemetry.io/otel/trace v1.24.0
go.uber.org/goleak v1.3.0
go.uber.org/multierr v1.11.0
- go.uber.org/zap v1.26.0
- golang.org/x/sys v0.16.0
- google.golang.org/grpc v1.61.0
+ go.uber.org/zap v1.27.0
+ golang.org/x/sys v0.18.0
+ google.golang.org/grpc v1.62.1
)
require (
@@ -30,29 +31,29 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
+ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
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/knadh/koanf/v2 v2.1.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
- github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
- github.com/prometheus/client_golang v1.18.0 // indirect
- github.com/prometheus/client_model v0.5.0 // indirect
- github.com/prometheus/common v0.46.0 // indirect
+ github.com/prometheus/client_golang v1.19.0 // indirect
+ github.com/prometheus/client_model v0.6.0 // indirect
+ github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
- go.opentelemetry.io/collector/confmap v0.93.0 // indirect
- go.opentelemetry.io/otel/exporters/prometheus v0.45.0 // indirect
- go.opentelemetry.io/otel/sdk/metric v1.22.0 // indirect
- golang.org/x/net v0.20.0 // indirect
+ go.opentelemetry.io/collector/confmap v0.97.0 // indirect
+ go.opentelemetry.io/otel/exporters/prometheus v0.46.0 // indirect
+ go.opentelemetry.io/otel/sdk/metric v1.24.0 // indirect
+ golang.org/x/net v0.23.0 // indirect
golang.org/x/text v0.14.0 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
- google.golang.org/protobuf v1.32.0 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
+ google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/exporter/go.sum b/exporter/go.sum
index 8a046f9cc16..daf2741d99d 100644
--- a/exporter/go.sum
+++ b/exporter/go.sum
@@ -1,7 +1,7 @@
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/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
+github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/cespare/xxhash/v2 v2.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=
@@ -12,6 +12,8 @@ github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
@@ -19,7 +21,10 @@ 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.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
+github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
+github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
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=
@@ -28,14 +33,14 @@ github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NI
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/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -45,39 +50,40 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=
-github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA=
-github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
-github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
-github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y=
-github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ=
+github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU=
+github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k=
+github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=
+github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8=
+github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=
+github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
+github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
-github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y=
-go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0 h1:BeIK2KGho0oCWa7LxEGSqfDZbs7Fpv/Viz+FS4P8CXE=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0/go.mod h1:UVJZPLnfDSvHj+eJuZE+E1GjIBD267mEMfAAHJdghWg=
-go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg=
-go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY=
-go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw=
-go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc=
-go.opentelemetry.io/otel/sdk/metric v1.22.0 h1:ARrRetm1HCVxq0cbnaZQlfwODYJHo3gFL8Z3tSmHBcI=
-go.opentelemetry.io/otel/sdk/metric v1.22.0/go.mod h1:KjQGeMIDlBNEOo6HvjhxIec1p/69/kULDcp4gr0oLQQ=
-go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0=
-go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0 h1:I8WIFXR351FoLJYuloU4EgXbtNX2URfU/85pUPheIEQ=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0/go.mod h1:ztwVUHe5DTR/1v7PeuGRnU5Bbd4QKYwApWmuutKsJSs=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/sdk/metric v1.24.0 h1:yyMQrPzF+k88/DbH7o4FMAs80puqd+9osbiBrJrz/w8=
+go.opentelemetry.io/otel/sdk/metric v1.24.0/go.mod h1:I6Y5FjH6rvEnTTAYQz3Mmv2kl6Ek5IIrmwTLqMrrOE0=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
-go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
-go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -87,16 +93,16 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
-golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
+golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
+golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
-golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
+golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
@@ -109,15 +115,16 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA=
-google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
-google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s=
+google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=
+google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
-google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/exporter/exporterhelper/internal/err.go b/exporter/internal/experr/err.go
similarity index 63%
rename from exporter/exporterhelper/internal/err.go
rename to exporter/internal/experr/err.go
index c93bd92f556..6bff64b162d 100644
--- a/exporter/exporterhelper/internal/err.go
+++ b/exporter/internal/experr/err.go
@@ -1,7 +1,9 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
-package internal // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal"
+package experr // import "go.opentelemetry.io/collector/exporter/internal/experr"
+
+import "errors"
type shutdownErr struct {
err error
@@ -18,3 +20,8 @@ func (s shutdownErr) Error() string {
func (s shutdownErr) Unwrap() error {
return s.err
}
+
+func IsShutdownErr(err error) bool {
+ var sdErr shutdownErr
+ return errors.As(err, &sdErr)
+}
diff --git a/exporter/internal/experr/err_test.go b/exporter/internal/experr/err_test.go
new file mode 100644
index 00000000000..ac0580025e5
--- /dev/null
+++ b/exporter/internal/experr/err_test.go
@@ -0,0 +1,24 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package experr
+
+import (
+ "errors"
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
+)
+
+func TestNewShutdownErr(t *testing.T) {
+ err := NewShutdownErr(errors.New("some error"))
+ assert.Equal(t, "interrupted due to shutdown: some error", err.Error())
+}
+
+func TestIsShutdownErr(t *testing.T) {
+ err := errors.New("testError")
+ require.False(t, IsShutdownErr(err))
+ err = NewShutdownErr(err)
+ require.True(t, IsShutdownErr(err))
+}
diff --git a/exporter/exporterhelper/internal/bounded_memory_queue.go b/exporter/internal/queue/bounded_memory_queue.go
similarity index 96%
rename from exporter/exporterhelper/internal/bounded_memory_queue.go
rename to exporter/internal/queue/bounded_memory_queue.go
index 85435d2aa61..9f85e8496bf 100644
--- a/exporter/exporterhelper/internal/bounded_memory_queue.go
+++ b/exporter/internal/queue/bounded_memory_queue.go
@@ -3,7 +3,7 @@
// Copyright (c) 2017 Uber Technologies, Inc.
// SPDX-License-Identifier: Apache-2.0
-package internal // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal"
+package queue // import "go.opentelemetry.io/collector/exporter/internal/queue"
import (
"context"
diff --git a/exporter/exporterhelper/internal/bounded_memory_queue_test.go b/exporter/internal/queue/bounded_memory_queue_test.go
similarity index 91%
rename from exporter/exporterhelper/internal/bounded_memory_queue_test.go
rename to exporter/internal/queue/bounded_memory_queue_test.go
index a26d32120cd..d861893eda9 100644
--- a/exporter/exporterhelper/internal/bounded_memory_queue_test.go
+++ b/exporter/internal/queue/bounded_memory_queue_test.go
@@ -3,7 +3,7 @@
// Copyright (c) 2017 Uber Technologies, Inc.
// SPDX-License-Identifier: Apache-2.0
-package internal
+package queue
import (
"context"
@@ -26,7 +26,7 @@ func TestBoundedQueue(t *testing.T) {
assert.NoError(t, q.Offer(context.Background(), "a"))
numConsumed := 0
- assert.True(t, q.Consume(func(ctx context.Context, item string) error {
+ assert.True(t, q.Consume(func(_ context.Context, item string) error {
assert.Equal(t, "a", item)
numConsumed++
return nil
@@ -42,7 +42,7 @@ func TestBoundedQueue(t *testing.T) {
assert.ErrorIs(t, q.Offer(context.Background(), "c"), ErrQueueIsFull)
assert.Equal(t, 1, q.Size())
- assert.True(t, q.Consume(func(ctx context.Context, item string) error {
+ assert.True(t, q.Consume(func(_ context.Context, item string) error {
assert.Equal(t, "b", item)
numConsumed++
return nil
@@ -51,7 +51,7 @@ func TestBoundedQueue(t *testing.T) {
for _, toAddItem := range []string{"d", "e", "f"} {
assert.NoError(t, q.Offer(context.Background(), toAddItem))
- assert.True(t, q.Consume(func(ctx context.Context, item string) error {
+ assert.True(t, q.Consume(func(_ context.Context, item string) error {
assert.Equal(t, toAddItem, item)
numConsumed++
return nil
@@ -59,7 +59,7 @@ func TestBoundedQueue(t *testing.T) {
}
assert.Equal(t, 5, numConsumed)
assert.NoError(t, q.Shutdown(context.Background()))
- assert.False(t, q.Consume(func(ctx context.Context, item string) error {
+ assert.False(t, q.Consume(func(_ context.Context, item string) error {
panic(item)
}))
}
@@ -82,7 +82,7 @@ func TestShutdownWhileNotEmpty(t *testing.T) {
assert.Equal(t, 10, q.Size())
numConsumed := 0
for i := 0; i < 10; i++ {
- assert.True(t, q.Consume(func(ctx context.Context, item string) error {
+ assert.True(t, q.Consume(func(_ context.Context, item string) error {
assert.Equal(t, strconv.FormatInt(int64(i), 10), item)
numConsumed++
return nil
@@ -91,7 +91,7 @@ func TestShutdownWhileNotEmpty(t *testing.T) {
assert.Equal(t, 10, numConsumed)
assert.Equal(t, 0, q.Size())
- assert.False(t, q.Consume(func(ctx context.Context, item string) error {
+ assert.False(t, q.Consume(func(_ context.Context, item string) error {
panic(item)
}))
}
diff --git a/exporter/exporterhelper/internal/consumers.go b/exporter/internal/queue/consumers.go
similarity index 73%
rename from exporter/exporterhelper/internal/consumers.go
rename to exporter/internal/queue/consumers.go
index 88b729ebfed..7c57fea9620 100644
--- a/exporter/exporterhelper/internal/consumers.go
+++ b/exporter/internal/queue/consumers.go
@@ -1,7 +1,7 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
-package internal // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal"
+package queue // import "go.opentelemetry.io/collector/exporter/internal/queue"
import (
"context"
@@ -10,15 +10,15 @@ import (
"go.opentelemetry.io/collector/component"
)
-type QueueConsumers[T any] struct {
+type Consumers[T any] struct {
queue Queue[T]
numConsumers int
consumeFunc func(context.Context, T) error
stopWG sync.WaitGroup
}
-func NewQueueConsumers[T any](q Queue[T], numConsumers int, consumeFunc func(context.Context, T) error) *QueueConsumers[T] {
- return &QueueConsumers[T]{
+func NewQueueConsumers[T any](q Queue[T], numConsumers int, consumeFunc func(context.Context, T) error) *Consumers[T] {
+ return &Consumers[T]{
queue: q,
numConsumers: numConsumers,
consumeFunc: consumeFunc,
@@ -27,7 +27,7 @@ func NewQueueConsumers[T any](q Queue[T], numConsumers int, consumeFunc func(con
}
// Start ensures that queue and all consumers are started.
-func (qc *QueueConsumers[T]) Start(ctx context.Context, host component.Host) error {
+func (qc *Consumers[T]) Start(ctx context.Context, host component.Host) error {
if err := qc.queue.Start(ctx, host); err != nil {
return err
}
@@ -52,7 +52,7 @@ func (qc *QueueConsumers[T]) Start(ctx context.Context, host component.Host) err
}
// Shutdown ensures that queue and all consumers are stopped.
-func (qc *QueueConsumers[T]) Shutdown(ctx context.Context) error {
+func (qc *Consumers[T]) Shutdown(ctx context.Context) error {
if err := qc.queue.Shutdown(ctx); err != nil {
return err
}
diff --git a/exporter/exporterhelper/internal/mock_storage.go b/exporter/internal/queue/mock_storage.go
similarity index 91%
rename from exporter/exporterhelper/internal/mock_storage.go
rename to exporter/internal/queue/mock_storage.go
index 507e1e6946e..6ef9810529b 100644
--- a/exporter/exporterhelper/internal/mock_storage.go
+++ b/exporter/internal/queue/mock_storage.go
@@ -1,7 +1,7 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
-package internal // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal"
+package queue // import "go.opentelemetry.io/collector/exporter/internal/queue"
import (
"context"
@@ -22,7 +22,7 @@ type mockStorageExtension struct {
getClientError error
}
-func (m *mockStorageExtension) GetClient(_ context.Context, _ component.Kind, _ component.ID, _ string) (storage.Client, error) {
+func (m *mockStorageExtension) GetClient(context.Context, component.Kind, component.ID, string) (storage.Client, error) {
if m.getClientError != nil {
return nil, m.getClientError
}
@@ -52,7 +52,7 @@ func (m *mockStorageClient) Delete(ctx context.Context, s string) error {
return m.Batch(ctx, storage.DeleteOperation(s))
}
-func (m *mockStorageClient) Close(_ context.Context) error {
+func (m *mockStorageClient) Close(context.Context) error {
m.closed.Store(true)
return nil
}
@@ -120,7 +120,7 @@ func (m *fakeBoundedStorageClient) Delete(ctx context.Context, key string) error
return m.Batch(ctx, storage.DeleteOperation(key))
}
-func (m *fakeBoundedStorageClient) Close(_ context.Context) error {
+func (m *fakeBoundedStorageClient) Close(context.Context) error {
return nil
}
@@ -221,11 +221,11 @@ func (m *fakeStorageClientWithErrors) Delete(ctx context.Context, key string) er
return m.Batch(ctx, storage.DeleteOperation(key))
}
-func (m *fakeStorageClientWithErrors) Close(_ context.Context) error {
+func (m *fakeStorageClientWithErrors) Close(context.Context) error {
return nil
}
-func (m *fakeStorageClientWithErrors) Batch(_ context.Context, _ ...storage.Operation) error {
+func (m *fakeStorageClientWithErrors) Batch(context.Context, ...storage.Operation) error {
m.mux.Lock()
defer m.mux.Unlock()
diff --git a/obsreport/obsreporttest/package_test.go b/exporter/internal/queue/package_test.go
similarity index 89%
rename from obsreport/obsreporttest/package_test.go
rename to exporter/internal/queue/package_test.go
index 97b3f7f9210..e73f51264a8 100644
--- a/obsreport/obsreporttest/package_test.go
+++ b/exporter/internal/queue/package_test.go
@@ -1,7 +1,7 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
-package obsreporttest
+package queue
import (
"testing"
diff --git a/exporter/exporterhelper/internal/persistent_queue.go b/exporter/internal/queue/persistent_queue.go
similarity index 98%
rename from exporter/exporterhelper/internal/persistent_queue.go
rename to exporter/internal/queue/persistent_queue.go
index 9f23ab6a98c..80a71f6bad7 100644
--- a/exporter/exporterhelper/internal/persistent_queue.go
+++ b/exporter/internal/queue/persistent_queue.go
@@ -1,7 +1,7 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
-package internal // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal"
+package queue // import "go.opentelemetry.io/collector/exporter/internal/queue"
import (
"context"
@@ -17,6 +17,7 @@ import (
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/exporter"
+ "go.opentelemetry.io/collector/exporter/internal/experr"
"go.opentelemetry.io/collector/extension/experimental/storage"
)
@@ -340,7 +341,7 @@ func (pq *persistentQueue[T]) getNextItem(ctx context.Context) (T, func(error),
// Back up the queue size to storage on every 10 reads. The stored value is used to recover the queue size
// in case if the collector is killed. The recovered queue size is allowed to be inaccurate.
- if (pq.writeIndex % 10) == 0 {
+ if (pq.readIndex % 10) == 0 {
if qsErr := pq.backupQueueSize(ctx); qsErr != nil {
pq.logger.Error("Error writing queue size to storage", zap.Error(err))
}
@@ -360,7 +361,7 @@ func (pq *persistentQueue[T]) getNextItem(ctx context.Context) (T, func(error),
pq.mu.Unlock()
}()
- if errors.As(consumeErr, &shutdownErr{}) {
+ if experr.IsShutdownErr(consumeErr) {
// The queue is shutting down, don't mark the item as dispatched, so it's picked up again after restart.
// TODO: Handle partially delivered requests by updating their values in the storage.
return
diff --git a/exporter/exporterhelper/internal/persistent_queue_test.go b/exporter/internal/queue/persistent_queue_test.go
similarity index 95%
rename from exporter/exporterhelper/internal/persistent_queue_test.go
rename to exporter/internal/queue/persistent_queue_test.go
index 8b74f9a5fac..2b525fa792f 100644
--- a/exporter/exporterhelper/internal/persistent_queue_test.go
+++ b/exporter/internal/queue/persistent_queue_test.go
@@ -1,7 +1,7 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
-package internal
+package queue
import (
"context"
@@ -18,6 +18,7 @@ import (
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/exporter/exportertest"
+ "go.opentelemetry.io/collector/exporter/internal/experr"
"go.opentelemetry.io/collector/extension/experimental/storage"
"go.opentelemetry.io/collector/extension/extensiontest"
"go.opentelemetry.io/collector/pdata/pcommon"
@@ -410,8 +411,8 @@ func TestPersistentQueue_CorruptedData(t *testing.T) {
require.NoError(t, err)
}
assert.Equal(t, 3, ps.Size())
- require.True(t, ps.Consume(func(ctx context.Context, traces tracesRequest) error {
- return NewShutdownErr(nil)
+ require.True(t, ps.Consume(func(context.Context, tracesRequest) error {
+ return experr.NewShutdownErr(nil)
}))
assert.Equal(t, 2, ps.Size())
@@ -483,7 +484,7 @@ func TestPersistentQueue_CurrentlyProcessedItems(t *testing.T) {
// We should be able to pull all remaining items now
for i := 0; i < 4; i++ {
- newPs.Consume(func(ctx context.Context, traces tracesRequest) error {
+ newPs.Consume(func(_ context.Context, traces tracesRequest) error {
assert.Equal(t, req, traces)
return nil
})
@@ -519,11 +520,11 @@ func TestPersistentQueueStartWithNonDispatched(t *testing.T) {
// get one item out, but don't mark it as processed
<-ps.putChan
- require.True(t, ps.Consume(func(ctx context.Context, traces tracesRequest) error {
+ require.True(t, ps.Consume(func(context.Context, tracesRequest) error {
// put one more item in
require.NoError(t, ps.Offer(context.Background(), req))
require.Equal(t, 5, ps.Size())
- return NewShutdownErr(nil)
+ return experr.NewShutdownErr(nil)
}))
assert.NoError(t, ps.Shutdown(context.Background()))
@@ -550,13 +551,13 @@ func TestPersistentQueue_PutCloseReadClose(t *testing.T) {
require.Equal(t, 2, newPs.Size())
// Let's read both of the elements we put
- newPs.Consume(func(ctx context.Context, traces tracesRequest) error {
+ newPs.Consume(func(_ context.Context, traces tracesRequest) error {
require.Equal(t, req, traces)
return nil
})
assert.Equal(t, 1, newPs.Size())
- newPs.Consume(func(ctx context.Context, traces tracesRequest) error {
+ newPs.Consume(func(_ context.Context, traces tracesRequest) error {
require.Equal(t, req, traces)
return nil
})
@@ -625,7 +626,7 @@ func TestItemIndexMarshaling(t *testing.T) {
}
for _, c := range cases {
- t.Run(fmt.Sprintf("#elements:%v", c.in), func(tt *testing.T) {
+ t.Run(fmt.Sprintf("#elements:%v", c.in), func(*testing.T) {
buf := itemIndexToBytes(c.in)
out, err := bytesToItemIndex(buf)
require.NoError(t, err)
@@ -654,7 +655,7 @@ func TestItemIndexArrayMarshaling(t *testing.T) {
}
for _, c := range cases {
- t.Run(fmt.Sprintf("#elements:%v", c.in), func(tt *testing.T) {
+ t.Run(fmt.Sprintf("#elements:%v", c.in), func(_ *testing.T) {
buf := itemIndexArrayToBytes(c.in)
out, err := bytesToItemIndexArray(buf)
require.NoError(t, err)
@@ -791,7 +792,7 @@ func TestPersistentQueue_ItemsCapacityUsageRestoredOnShutdown(t *testing.T) {
assert.ErrorIs(t, pq.Offer(context.Background(), newTracesRequest(5, 5)), ErrQueueIsFull)
assert.Equal(t, 100, pq.Size())
- assert.True(t, pq.Consume(func(ctx context.Context, traces tracesRequest) error {
+ assert.True(t, pq.Consume(func(_ context.Context, traces tracesRequest) error {
assert.Equal(t, 40, traces.traces.SpanCount())
return nil
}))
@@ -809,13 +810,13 @@ func TestPersistentQueue_ItemsCapacityUsageRestoredOnShutdown(t *testing.T) {
// Check the combined queue size.
assert.Equal(t, 70, newPQ.Size())
- assert.True(t, newPQ.Consume(func(ctx context.Context, traces tracesRequest) error {
+ assert.True(t, newPQ.Consume(func(_ context.Context, traces tracesRequest) error {
assert.Equal(t, 40, traces.traces.SpanCount())
return nil
}))
assert.Equal(t, 30, newPQ.Size())
- assert.True(t, newPQ.Consume(func(ctx context.Context, traces tracesRequest) error {
+ assert.True(t, newPQ.Consume(func(_ context.Context, traces tracesRequest) error {
assert.Equal(t, 20, traces.traces.SpanCount())
return nil
}))
@@ -836,7 +837,7 @@ func TestPersistentQueue_ItemsCapacityUsageIsNotPreserved(t *testing.T) {
assert.NoError(t, pq.Offer(context.Background(), newTracesRequest(5, 5)))
assert.Equal(t, 3, pq.Size())
- assert.True(t, pq.Consume(func(ctx context.Context, traces tracesRequest) error {
+ assert.True(t, pq.Consume(func(_ context.Context, traces tracesRequest) error {
assert.Equal(t, 40, traces.traces.SpanCount())
return nil
}))
@@ -855,19 +856,19 @@ func TestPersistentQueue_ItemsCapacityUsageIsNotPreserved(t *testing.T) {
assert.Equal(t, 10, newPQ.Size())
// Consuming old items should does not affect the size.
- assert.True(t, newPQ.Consume(func(ctx context.Context, traces tracesRequest) error {
+ assert.True(t, newPQ.Consume(func(_ context.Context, traces tracesRequest) error {
assert.Equal(t, 20, traces.traces.SpanCount())
return nil
}))
assert.Equal(t, 10, newPQ.Size())
- assert.True(t, newPQ.Consume(func(ctx context.Context, traces tracesRequest) error {
+ assert.True(t, newPQ.Consume(func(_ context.Context, traces tracesRequest) error {
assert.Equal(t, 25, traces.traces.SpanCount())
return nil
}))
assert.Equal(t, 10, newPQ.Size())
- assert.True(t, newPQ.Consume(func(ctx context.Context, traces tracesRequest) error {
+ assert.True(t, newPQ.Consume(func(_ context.Context, traces tracesRequest) error {
assert.Equal(t, 10, traces.traces.SpanCount())
return nil
}))
diff --git a/exporter/exporterhelper/internal/queue.go b/exporter/internal/queue/queue.go
similarity index 93%
rename from exporter/exporterhelper/internal/queue.go
rename to exporter/internal/queue/queue.go
index 8bd8879a940..0ae0703b05d 100644
--- a/exporter/exporterhelper/internal/queue.go
+++ b/exporter/internal/queue/queue.go
@@ -3,7 +3,7 @@
// Copyright (c) 2017 Uber Technologies, Inc.
// SPDX-License-Identifier: Apache-2.0
-package internal // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal"
+package queue // import "go.opentelemetry.io/collector/exporter/internal/queue"
import (
"context"
diff --git a/exporter/exporterhelper/internal/queue_capacity.go b/exporter/internal/queue/queue_capacity.go
similarity index 94%
rename from exporter/exporterhelper/internal/queue_capacity.go
rename to exporter/internal/queue/queue_capacity.go
index 0466de0d8b2..1995febcd63 100644
--- a/exporter/exporterhelper/internal/queue_capacity.go
+++ b/exporter/internal/queue/queue_capacity.go
@@ -1,7 +1,7 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
-package internal // import "go.opentelemetry.io/collector/exporter/exporterhelper/internal"
+package queue // import "go.opentelemetry.io/collector/exporter/internal/queue"
import (
"sync/atomic"
diff --git a/exporter/exporterhelper/internal/queue_capacity_test.go b/exporter/internal/queue/queue_capacity_test.go
similarity index 98%
rename from exporter/exporterhelper/internal/queue_capacity_test.go
rename to exporter/internal/queue/queue_capacity_test.go
index 7a3b3ad41f2..3dd6ad2b898 100644
--- a/exporter/exporterhelper/internal/queue_capacity_test.go
+++ b/exporter/internal/queue/queue_capacity_test.go
@@ -1,7 +1,7 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
-package internal
+package queue
import (
"testing"
diff --git a/exporter/loggingexporter/generated_component_test.go b/exporter/loggingexporter/generated_component_test.go
new file mode 100644
index 00000000000..2ea8edc933a
--- /dev/null
+++ b/exporter/loggingexporter/generated_component_test.go
@@ -0,0 +1,143 @@
+// Code generated by mdatagen. DO NOT EDIT.
+
+package loggingexporter
+
+import (
+ "context"
+ "testing"
+ "time"
+
+ "github.com/stretchr/testify/require"
+
+ "go.opentelemetry.io/collector/component"
+ "go.opentelemetry.io/collector/component/componenttest"
+ "go.opentelemetry.io/collector/confmap/confmaptest"
+ "go.opentelemetry.io/collector/exporter"
+ "go.opentelemetry.io/collector/exporter/exportertest"
+ "go.opentelemetry.io/collector/pdata/pcommon"
+ "go.opentelemetry.io/collector/pdata/plog"
+ "go.opentelemetry.io/collector/pdata/pmetric"
+ "go.opentelemetry.io/collector/pdata/ptrace"
+)
+
+func TestComponentLifecycle(t *testing.T) {
+ factory := NewFactory()
+
+ tests := []struct {
+ name string
+ createFn func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error)
+ }{
+
+ {
+ name: "logs",
+ createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) {
+ return factory.CreateLogsExporter(ctx, set, cfg)
+ },
+ },
+
+ {
+ name: "metrics",
+ createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) {
+ return factory.CreateMetricsExporter(ctx, set, cfg)
+ },
+ },
+
+ {
+ name: "traces",
+ createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) {
+ return factory.CreateTracesExporter(ctx, set, cfg)
+ },
+ },
+ }
+
+ cm, err := confmaptest.LoadConf("metadata.yaml")
+ require.NoError(t, err)
+ cfg := factory.CreateDefaultConfig()
+ sub, err := cm.Sub("tests::config")
+ require.NoError(t, err)
+ require.NoError(t, component.UnmarshalConfig(sub, cfg))
+
+ for _, test := range tests {
+ t.Run(test.name+"-shutdown", func(t *testing.T) {
+ c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg)
+ require.NoError(t, err)
+ err = c.Shutdown(context.Background())
+ require.NoError(t, err)
+ })
+ t.Run(test.name+"-lifecycle", func(t *testing.T) {
+ c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg)
+ require.NoError(t, err)
+ host := componenttest.NewNopHost()
+ err = c.Start(context.Background(), host)
+ require.NoError(t, err)
+ require.NotPanics(t, func() {
+ switch test.name {
+ case "logs":
+ e, ok := c.(exporter.Logs)
+ require.True(t, ok)
+ logs := generateLifecycleTestLogs()
+ if !e.Capabilities().MutatesData {
+ logs.MarkReadOnly()
+ }
+ err = e.ConsumeLogs(context.Background(), logs)
+ case "metrics":
+ e, ok := c.(exporter.Metrics)
+ require.True(t, ok)
+ metrics := generateLifecycleTestMetrics()
+ if !e.Capabilities().MutatesData {
+ metrics.MarkReadOnly()
+ }
+ err = e.ConsumeMetrics(context.Background(), metrics)
+ case "traces":
+ e, ok := c.(exporter.Traces)
+ require.True(t, ok)
+ traces := generateLifecycleTestTraces()
+ if !e.Capabilities().MutatesData {
+ traces.MarkReadOnly()
+ }
+ err = e.ConsumeTraces(context.Background(), traces)
+ }
+ })
+
+ require.NoError(t, err)
+
+ err = c.Shutdown(context.Background())
+ require.NoError(t, err)
+ })
+ }
+}
+
+func generateLifecycleTestLogs() plog.Logs {
+ logs := plog.NewLogs()
+ rl := logs.ResourceLogs().AppendEmpty()
+ rl.Resource().Attributes().PutStr("resource", "R1")
+ l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty()
+ l.Body().SetStr("test log message")
+ l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now()))
+ return logs
+}
+
+func generateLifecycleTestMetrics() pmetric.Metrics {
+ metrics := pmetric.NewMetrics()
+ rm := metrics.ResourceMetrics().AppendEmpty()
+ rm.Resource().Attributes().PutStr("resource", "R1")
+ m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty()
+ m.SetName("test_metric")
+ dp := m.SetEmptyGauge().DataPoints().AppendEmpty()
+ dp.Attributes().PutStr("test_attr", "value_1")
+ dp.SetIntValue(123)
+ dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now()))
+ return metrics
+}
+
+func generateLifecycleTestTraces() ptrace.Traces {
+ traces := ptrace.NewTraces()
+ rs := traces.ResourceSpans().AppendEmpty()
+ rs.Resource().Attributes().PutStr("resource", "R1")
+ span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty()
+ span.Attributes().PutStr("test_attr", "value_1")
+ span.SetName("test_span")
+ span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second)))
+ span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now()))
+ return traces
+}
diff --git a/exporter/loggingexporter/go.mod b/exporter/loggingexporter/go.mod
index afcd3a3dbff..d6248293eea 100644
--- a/exporter/loggingexporter/go.mod
+++ b/exporter/loggingexporter/go.mod
@@ -1,60 +1,61 @@
// Deprecated: loggingexporter is deprecated in favour of the debugexporter. It will be removed in September 2024.
module go.opentelemetry.io/collector/exporter/loggingexporter
-go 1.20
+go 1.21
require (
- github.com/stretchr/testify v1.8.4
- go.opentelemetry.io/collector/component v0.93.0
- go.opentelemetry.io/collector/config/configtelemetry v0.93.0
- go.opentelemetry.io/collector/confmap v0.93.0
- go.opentelemetry.io/collector/exporter v0.93.0
- go.opentelemetry.io/otel/metric v1.22.0
- go.opentelemetry.io/otel/trace v1.22.0
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector/component v0.97.0
+ go.opentelemetry.io/collector/config/configtelemetry v0.97.0
+ go.opentelemetry.io/collector/confmap v0.97.0
+ go.opentelemetry.io/collector/exporter v0.97.0
+ go.opentelemetry.io/collector/pdata v1.4.0
+ go.opentelemetry.io/otel/metric v1.24.0
+ go.opentelemetry.io/otel/trace v1.24.0
go.uber.org/goleak v1.3.0
- go.uber.org/zap v1.26.0
+ go.uber.org/zap v1.27.0
)
require (
github.com/beorn7/perks v1.0.1 // indirect
- github.com/cenkalti/backoff/v4 v4.2.1 // indirect
+ github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
+ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
+ github.com/google/uuid 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/knadh/koanf/v2 v2.1.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
- github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
- github.com/prometheus/client_golang v1.18.0 // indirect
- github.com/prometheus/client_model v0.5.0 // indirect
- github.com/prometheus/common v0.46.0 // indirect
+ github.com/prometheus/client_golang v1.19.0 // indirect
+ github.com/prometheus/client_model v0.6.0 // indirect
+ github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
- go.opentelemetry.io/collector v0.93.0 // indirect
- go.opentelemetry.io/collector/config/configretry v0.93.0 // indirect
- go.opentelemetry.io/collector/consumer v0.93.0 // indirect
- go.opentelemetry.io/collector/extension v0.93.0 // indirect
- go.opentelemetry.io/collector/pdata v1.0.1 // indirect
- go.opentelemetry.io/collector/receiver v0.93.0 // indirect
- go.opentelemetry.io/otel v1.22.0 // indirect
- go.opentelemetry.io/otel/exporters/prometheus v0.45.0 // indirect
- go.opentelemetry.io/otel/sdk v1.22.0 // indirect
- go.opentelemetry.io/otel/sdk/metric v1.22.0 // indirect
+ go.opentelemetry.io/collector v0.97.0 // indirect
+ go.opentelemetry.io/collector/config/configretry v0.97.0 // indirect
+ go.opentelemetry.io/collector/consumer v0.97.0 // indirect
+ go.opentelemetry.io/collector/extension v0.97.0 // indirect
+ go.opentelemetry.io/collector/receiver v0.97.0 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/exporters/prometheus v0.46.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk/metric v1.24.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
- golang.org/x/net v0.20.0 // indirect
- golang.org/x/sys v0.16.0 // indirect
+ golang.org/x/net v0.23.0 // indirect
+ golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
- google.golang.org/grpc v1.61.0 // indirect
- google.golang.org/protobuf v1.32.0 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
+ google.golang.org/grpc v1.62.1 // indirect
+ google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/exporter/loggingexporter/go.sum b/exporter/loggingexporter/go.sum
index 8a046f9cc16..daf2741d99d 100644
--- a/exporter/loggingexporter/go.sum
+++ b/exporter/loggingexporter/go.sum
@@ -1,7 +1,7 @@
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/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
+github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/cespare/xxhash/v2 v2.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=
@@ -12,6 +12,8 @@ github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
@@ -19,7 +21,10 @@ 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.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
+github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
+github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
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=
@@ -28,14 +33,14 @@ github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NI
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/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -45,39 +50,40 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=
-github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA=
-github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
-github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
-github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y=
-github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ=
+github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU=
+github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k=
+github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=
+github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8=
+github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=
+github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
+github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
-github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y=
-go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0 h1:BeIK2KGho0oCWa7LxEGSqfDZbs7Fpv/Viz+FS4P8CXE=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0/go.mod h1:UVJZPLnfDSvHj+eJuZE+E1GjIBD267mEMfAAHJdghWg=
-go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg=
-go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY=
-go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw=
-go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc=
-go.opentelemetry.io/otel/sdk/metric v1.22.0 h1:ARrRetm1HCVxq0cbnaZQlfwODYJHo3gFL8Z3tSmHBcI=
-go.opentelemetry.io/otel/sdk/metric v1.22.0/go.mod h1:KjQGeMIDlBNEOo6HvjhxIec1p/69/kULDcp4gr0oLQQ=
-go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0=
-go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0 h1:I8WIFXR351FoLJYuloU4EgXbtNX2URfU/85pUPheIEQ=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0/go.mod h1:ztwVUHe5DTR/1v7PeuGRnU5Bbd4QKYwApWmuutKsJSs=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/sdk/metric v1.24.0 h1:yyMQrPzF+k88/DbH7o4FMAs80puqd+9osbiBrJrz/w8=
+go.opentelemetry.io/otel/sdk/metric v1.24.0/go.mod h1:I6Y5FjH6rvEnTTAYQz3Mmv2kl6Ek5IIrmwTLqMrrOE0=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
-go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
-go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -87,16 +93,16 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
-golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
+golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
+golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
-golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
+golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
@@ -109,15 +115,16 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA=
-google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
-google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s=
+google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=
+google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
-google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/exporter/loggingexporter/internal/metadata/generated_status.go b/exporter/loggingexporter/internal/metadata/generated_status.go
index dc0bf4e123d..ceb4c2e3f3a 100644
--- a/exporter/loggingexporter/internal/metadata/generated_status.go
+++ b/exporter/loggingexporter/internal/metadata/generated_status.go
@@ -20,9 +20,9 @@ const (
)
func Meter(settings component.TelemetrySettings) metric.Meter {
- return settings.MeterProvider.Meter("otelcol/logging")
+ return settings.MeterProvider.Meter("go.opentelemetry.io/collector/exporter/loggingexporter")
}
func Tracer(settings component.TelemetrySettings) trace.Tracer {
- return settings.TracerProvider.Tracer("otelcol/logging")
+ return settings.TracerProvider.Tracer("go.opentelemetry.io/collector/exporter/loggingexporter")
}
diff --git a/exporter/nopexporter/Makefile b/exporter/nopexporter/Makefile
new file mode 100644
index 00000000000..ded7a36092d
--- /dev/null
+++ b/exporter/nopexporter/Makefile
@@ -0,0 +1 @@
+include ../../Makefile.Common
diff --git a/exporter/nopexporter/README.md b/exporter/nopexporter/README.md
new file mode 100644
index 00000000000..72ae23273c4
--- /dev/null
+++ b/exporter/nopexporter/README.md
@@ -0,0 +1,25 @@
+# No-op Exporter
+
+
+| Status | |
+| ------------- |-----------|
+| Stability | [development]: traces, metrics, logs |
+| Distributions | [] |
+| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aexporter%2Fnop%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aexporter%2Fnop) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aexporter%2Fnop%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aexporter%2Fnop) |
+
+[development]: https://github.com/open-telemetry/opentelemetry-collector#development
+
+
+Serves as a placeholder exporter in a pipeline. This can be useful if you want
+to e.g. start a Collector with only extensions enabled, or for testing Collector
+pipeline throughput without worrying about an exporter.
+
+## Getting Started
+
+All that is required to enable the No-op exporter is to include it in the
+exporter definitions. It takes no configuration.
+
+```yaml
+exporters:
+ nop:
+```
diff --git a/exporter/nopexporter/doc.go b/exporter/nopexporter/doc.go
new file mode 100644
index 00000000000..00261565191
--- /dev/null
+++ b/exporter/nopexporter/doc.go
@@ -0,0 +1,7 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+//go:generate mdatagen metadata.yaml
+
+// Package nopexporter serves as a placeholder exporter.
+package nopexporter // import "go.opentelemetry.io/collector/exporter/nopexporter"
diff --git a/exporter/nopexporter/generated_component_test.go b/exporter/nopexporter/generated_component_test.go
new file mode 100644
index 00000000000..4c1876140dc
--- /dev/null
+++ b/exporter/nopexporter/generated_component_test.go
@@ -0,0 +1,143 @@
+// Code generated by mdatagen. DO NOT EDIT.
+
+package nopexporter
+
+import (
+ "context"
+ "testing"
+ "time"
+
+ "github.com/stretchr/testify/require"
+
+ "go.opentelemetry.io/collector/component"
+ "go.opentelemetry.io/collector/component/componenttest"
+ "go.opentelemetry.io/collector/confmap/confmaptest"
+ "go.opentelemetry.io/collector/exporter"
+ "go.opentelemetry.io/collector/exporter/exportertest"
+ "go.opentelemetry.io/collector/pdata/pcommon"
+ "go.opentelemetry.io/collector/pdata/plog"
+ "go.opentelemetry.io/collector/pdata/pmetric"
+ "go.opentelemetry.io/collector/pdata/ptrace"
+)
+
+func TestComponentLifecycle(t *testing.T) {
+ factory := NewFactory()
+
+ tests := []struct {
+ name string
+ createFn func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error)
+ }{
+
+ {
+ name: "logs",
+ createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) {
+ return factory.CreateLogsExporter(ctx, set, cfg)
+ },
+ },
+
+ {
+ name: "metrics",
+ createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) {
+ return factory.CreateMetricsExporter(ctx, set, cfg)
+ },
+ },
+
+ {
+ name: "traces",
+ createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) {
+ return factory.CreateTracesExporter(ctx, set, cfg)
+ },
+ },
+ }
+
+ cm, err := confmaptest.LoadConf("metadata.yaml")
+ require.NoError(t, err)
+ cfg := factory.CreateDefaultConfig()
+ sub, err := cm.Sub("tests::config")
+ require.NoError(t, err)
+ require.NoError(t, component.UnmarshalConfig(sub, cfg))
+
+ for _, test := range tests {
+ t.Run(test.name+"-shutdown", func(t *testing.T) {
+ c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg)
+ require.NoError(t, err)
+ err = c.Shutdown(context.Background())
+ require.NoError(t, err)
+ })
+ t.Run(test.name+"-lifecycle", func(t *testing.T) {
+ c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg)
+ require.NoError(t, err)
+ host := componenttest.NewNopHost()
+ err = c.Start(context.Background(), host)
+ require.NoError(t, err)
+ require.NotPanics(t, func() {
+ switch test.name {
+ case "logs":
+ e, ok := c.(exporter.Logs)
+ require.True(t, ok)
+ logs := generateLifecycleTestLogs()
+ if !e.Capabilities().MutatesData {
+ logs.MarkReadOnly()
+ }
+ err = e.ConsumeLogs(context.Background(), logs)
+ case "metrics":
+ e, ok := c.(exporter.Metrics)
+ require.True(t, ok)
+ metrics := generateLifecycleTestMetrics()
+ if !e.Capabilities().MutatesData {
+ metrics.MarkReadOnly()
+ }
+ err = e.ConsumeMetrics(context.Background(), metrics)
+ case "traces":
+ e, ok := c.(exporter.Traces)
+ require.True(t, ok)
+ traces := generateLifecycleTestTraces()
+ if !e.Capabilities().MutatesData {
+ traces.MarkReadOnly()
+ }
+ err = e.ConsumeTraces(context.Background(), traces)
+ }
+ })
+
+ require.NoError(t, err)
+
+ err = c.Shutdown(context.Background())
+ require.NoError(t, err)
+ })
+ }
+}
+
+func generateLifecycleTestLogs() plog.Logs {
+ logs := plog.NewLogs()
+ rl := logs.ResourceLogs().AppendEmpty()
+ rl.Resource().Attributes().PutStr("resource", "R1")
+ l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty()
+ l.Body().SetStr("test log message")
+ l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now()))
+ return logs
+}
+
+func generateLifecycleTestMetrics() pmetric.Metrics {
+ metrics := pmetric.NewMetrics()
+ rm := metrics.ResourceMetrics().AppendEmpty()
+ rm.Resource().Attributes().PutStr("resource", "R1")
+ m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty()
+ m.SetName("test_metric")
+ dp := m.SetEmptyGauge().DataPoints().AppendEmpty()
+ dp.Attributes().PutStr("test_attr", "value_1")
+ dp.SetIntValue(123)
+ dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now()))
+ return metrics
+}
+
+func generateLifecycleTestTraces() ptrace.Traces {
+ traces := ptrace.NewTraces()
+ rs := traces.ResourceSpans().AppendEmpty()
+ rs.Resource().Attributes().PutStr("resource", "R1")
+ span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty()
+ span.Attributes().PutStr("test_attr", "value_1")
+ span.SetName("test_span")
+ span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second)))
+ span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now()))
+ return traces
+}
diff --git a/exporter/nopexporter/go.mod b/exporter/nopexporter/go.mod
new file mode 100644
index 00000000000..a860b9fbc29
--- /dev/null
+++ b/exporter/nopexporter/go.mod
@@ -0,0 +1,78 @@
+module go.opentelemetry.io/collector/exporter/nopexporter
+
+go 1.21
+
+toolchain go1.21.6
+
+require (
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector/component v0.97.0
+ go.opentelemetry.io/collector/confmap v0.97.0
+ go.opentelemetry.io/collector/consumer v0.97.0
+ go.opentelemetry.io/collector/exporter v0.97.0
+ go.opentelemetry.io/collector/pdata v1.4.0
+ go.opentelemetry.io/otel/metric v1.24.0
+ go.opentelemetry.io/otel/trace v1.24.0
+)
+
+require (
+ github.com/beorn7/perks v1.0.1 // indirect
+ github.com/cespare/xxhash/v2 v2.2.0 // indirect
+ github.com/davecgh/go-spew v1.1.1 // indirect
+ github.com/go-logr/logr v1.4.1 // indirect
+ github.com/go-logr/stdr v1.2.2 // indirect
+ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
+ github.com/gogo/protobuf v1.3.2 // indirect
+ github.com/golang/protobuf v1.5.3 // indirect
+ github.com/google/uuid 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.1.0 // indirect
+ github.com/mitchellh/copystructure v1.2.0 // indirect
+ github.com/mitchellh/reflectwalk v1.0.2 // indirect
+ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
+ github.com/modern-go/reflect2 v1.0.2 // indirect
+ github.com/pmezard/go-difflib v1.0.0 // indirect
+ github.com/prometheus/client_golang v1.19.0 // indirect
+ github.com/prometheus/client_model v0.6.0 // indirect
+ github.com/prometheus/common v0.48.0 // indirect
+ github.com/prometheus/procfs v0.12.0 // indirect
+ go.opentelemetry.io/collector/config/configtelemetry v0.97.0 // indirect
+ go.opentelemetry.io/collector/receiver v0.97.0 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/exporters/prometheus v0.46.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk/metric v1.24.0 // indirect
+ go.uber.org/multierr v1.11.0 // indirect
+ go.uber.org/zap v1.27.0 // indirect
+ golang.org/x/net v0.23.0 // indirect
+ golang.org/x/sys v0.18.0 // indirect
+ golang.org/x/text v0.14.0 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
+ google.golang.org/grpc v1.62.1 // indirect
+ google.golang.org/protobuf v1.33.0 // indirect
+ gopkg.in/yaml.v3 v3.0.1 // indirect
+)
+
+replace go.opentelemetry.io/collector/component => ../../component
+
+replace go.opentelemetry.io/collector/consumer => ../../consumer
+
+replace go.opentelemetry.io/collector/exporter => ../
+
+replace go.opentelemetry.io/collector/pdata => ../../pdata
+
+replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry
+
+replace go.opentelemetry.io/collector/receiver => ../../receiver
+
+replace go.opentelemetry.io/collector => ../..
+
+replace go.opentelemetry.io/collector/featuregate => ../../featuregate
+
+replace go.opentelemetry.io/collector/confmap => ../../confmap
+
+replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry
+
+replace go.opentelemetry.io/collector/extension => ../../extension
diff --git a/exporter/nopexporter/go.sum b/exporter/nopexporter/go.sum
new file mode 100644
index 00000000000..daf2741d99d
--- /dev/null
+++ b/exporter/nopexporter/go.sum
@@ -0,0 +1,130 @@
+github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
+github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
+github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
+github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
+github.com/cespare/xxhash/v2 v2.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=
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
+github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
+github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
+github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
+github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
+github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
+github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
+github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
+github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
+github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
+github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
+github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
+github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
+github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+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.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
+github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
+github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
+github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
+github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
+github.com/mitchellh/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.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU=
+github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k=
+github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=
+github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8=
+github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=
+github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=
+github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
+github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
+github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
+github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
+github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
+github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
+github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0 h1:I8WIFXR351FoLJYuloU4EgXbtNX2URfU/85pUPheIEQ=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0/go.mod h1:ztwVUHe5DTR/1v7PeuGRnU5Bbd4QKYwApWmuutKsJSs=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/sdk/metric v1.24.0 h1:yyMQrPzF+k88/DbH7o4FMAs80puqd+9osbiBrJrz/w8=
+go.opentelemetry.io/otel/sdk/metric v1.24.0/go.mod h1:I6Y5FjH6rvEnTTAYQz3Mmv2kl6Ek5IIrmwTLqMrrOE0=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
+go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
+go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
+go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
+go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
+golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
+golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
+golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
+golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
+golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
+golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
+golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s=
+google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=
+google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
+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.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
+gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/exporter/nopexporter/internal/metadata/generated_status.go b/exporter/nopexporter/internal/metadata/generated_status.go
new file mode 100644
index 00000000000..6c8429f744e
--- /dev/null
+++ b/exporter/nopexporter/internal/metadata/generated_status.go
@@ -0,0 +1,28 @@
+// Code generated by mdatagen. DO NOT EDIT.
+
+package metadata
+
+import (
+ "go.opentelemetry.io/otel/metric"
+ "go.opentelemetry.io/otel/trace"
+
+ "go.opentelemetry.io/collector/component"
+)
+
+var (
+ Type = component.MustNewType("nop")
+)
+
+const (
+ TracesStability = component.StabilityLevelDevelopment
+ MetricsStability = component.StabilityLevelDevelopment
+ LogsStability = component.StabilityLevelDevelopment
+)
+
+func Meter(settings component.TelemetrySettings) metric.Meter {
+ return settings.MeterProvider.Meter("go.opentelemetry.io/collector/exporter/nopexporter")
+}
+
+func Tracer(settings component.TelemetrySettings) trace.Tracer {
+ return settings.TracerProvider.Tracer("go.opentelemetry.io/collector/exporter/nopexporter")
+}
diff --git a/exporter/nopexporter/metadata.yaml b/exporter/nopexporter/metadata.yaml
new file mode 100644
index 00000000000..ca59864dabc
--- /dev/null
+++ b/exporter/nopexporter/metadata.yaml
@@ -0,0 +1,7 @@
+type: nop
+
+status:
+ class: exporter
+ stability:
+ development: [traces, metrics, logs]
+ distributions: []
diff --git a/exporter/nopexporter/nop_exporter.go b/exporter/nopexporter/nop_exporter.go
new file mode 100644
index 00000000000..16adf430cea
--- /dev/null
+++ b/exporter/nopexporter/nop_exporter.go
@@ -0,0 +1,46 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package nopexporter // import "go.opentelemetry.io/collector/exporter/nopexporter"
+
+import (
+ "context"
+
+ "go.opentelemetry.io/collector/component"
+ "go.opentelemetry.io/collector/consumer/consumertest"
+ "go.opentelemetry.io/collector/exporter"
+ "go.opentelemetry.io/collector/exporter/nopexporter/internal/metadata"
+)
+
+// NewFactory returns an exporter.Factory that constructs nop exporters.
+func NewFactory() exporter.Factory {
+ return exporter.NewFactory(
+ metadata.Type,
+ func() component.Config { return &struct{}{} },
+ exporter.WithTraces(createTracesExporter, metadata.TracesStability),
+ exporter.WithMetrics(createMetricsExporter, metadata.MetricsStability),
+ exporter.WithLogs(createLogsExporter, metadata.LogsStability),
+ )
+}
+
+func createTracesExporter(context.Context, exporter.CreateSettings, component.Config) (exporter.Traces, error) {
+ return nopInstance, nil
+}
+
+func createMetricsExporter(context.Context, exporter.CreateSettings, component.Config) (exporter.Metrics, error) {
+ return nopInstance, nil
+}
+
+func createLogsExporter(context.Context, exporter.CreateSettings, component.Config) (exporter.Logs, error) {
+ return nopInstance, nil
+}
+
+var nopInstance = &nopExporter{
+ Consumer: consumertest.NewNop(),
+}
+
+type nopExporter struct {
+ component.StartFunc
+ component.ShutdownFunc
+ consumertest.Consumer
+}
diff --git a/exporter/nopexporter/nop_exporter_test.go b/exporter/nopexporter/nop_exporter_test.go
new file mode 100644
index 00000000000..80baefc9631
--- /dev/null
+++ b/exporter/nopexporter/nop_exporter_test.go
@@ -0,0 +1,45 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+package nopexporter
+
+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/exporter/exportertest"
+ "go.opentelemetry.io/collector/pdata/plog"
+ "go.opentelemetry.io/collector/pdata/pmetric"
+ "go.opentelemetry.io/collector/pdata/ptrace"
+)
+
+func TestNewNopFactory(t *testing.T) {
+ factory := NewFactory()
+ require.NotNil(t, factory)
+ assert.Equal(t, component.MustNewType("nop"), factory.Type())
+ cfg := factory.CreateDefaultConfig()
+ assert.Equal(t, &struct{}{}, cfg)
+
+ traces, err := factory.CreateTracesExporter(context.Background(), exportertest.NewNopCreateSettings(), cfg)
+ require.NoError(t, err)
+ assert.NoError(t, traces.Start(context.Background(), componenttest.NewNopHost()))
+ assert.NoError(t, traces.ConsumeTraces(context.Background(), ptrace.NewTraces()))
+ assert.NoError(t, traces.Shutdown(context.Background()))
+
+ metrics, err := factory.CreateMetricsExporter(context.Background(), exportertest.NewNopCreateSettings(), cfg)
+ require.NoError(t, err)
+ assert.NoError(t, metrics.Start(context.Background(), componenttest.NewNopHost()))
+ assert.NoError(t, metrics.ConsumeMetrics(context.Background(), pmetric.NewMetrics()))
+ assert.NoError(t, metrics.Shutdown(context.Background()))
+
+ logs, err := factory.CreateLogsExporter(context.Background(), exportertest.NewNopCreateSettings(), cfg)
+ require.NoError(t, err)
+ assert.NoError(t, logs.Start(context.Background(), componenttest.NewNopHost()))
+ assert.NoError(t, logs.ConsumeLogs(context.Background(), plog.NewLogs()))
+ assert.NoError(t, logs.Shutdown(context.Background()))
+}
diff --git a/exporter/otlpexporter/config.go b/exporter/otlpexporter/config.go
index a657fa684c9..8b449fbbca3 100644
--- a/exporter/otlpexporter/config.go
+++ b/exporter/otlpexporter/config.go
@@ -4,6 +4,12 @@
package otlpexporter // import "go.opentelemetry.io/collector/exporter/otlpexporter"
import (
+ "errors"
+ "fmt"
+ "net"
+ "strconv"
+ "strings"
+
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/configgrpc"
"go.opentelemetry.io/collector/config/configretry"
@@ -19,4 +25,33 @@ type Config struct {
configgrpc.ClientConfig `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct.
}
+func (c *Config) Validate() error {
+ endpoint := c.sanitizedEndpoint()
+ if endpoint == "" {
+ return errors.New(`requires a non-empty "endpoint"`)
+ }
+
+ // Validate that the port is in the address
+ _, port, err := net.SplitHostPort(endpoint)
+ if err != nil {
+ return err
+ }
+ if _, err := strconv.Atoi(port); err != nil {
+ return fmt.Errorf(`invalid port "%s"`, port)
+ }
+
+ return nil
+}
+
+func (c *Config) sanitizedEndpoint() string {
+ switch {
+ case strings.HasPrefix(c.Endpoint, "http://"):
+ return strings.TrimPrefix(c.Endpoint, "http://")
+ case strings.HasPrefix(c.Endpoint, "https://"):
+ return strings.TrimPrefix(c.Endpoint, "https://")
+ default:
+ return c.Endpoint
+ }
+}
+
var _ component.Config = (*Config)(nil)
diff --git a/exporter/otlpexporter/config_test.go b/exporter/otlpexporter/config_test.go
index ae2fac324d8..e183ebc5ef2 100644
--- a/exporter/otlpexporter/config_test.go
+++ b/exporter/otlpexporter/config_test.go
@@ -61,8 +61,8 @@ func TestUnmarshalConfig(t *testing.T) {
},
Endpoint: "1.2.3.4:1234",
Compression: "gzip",
- TLSSetting: configtls.TLSClientSetting{
- TLSSetting: configtls.TLSSetting{
+ TLSSetting: configtls.ClientConfig{
+ Config: configtls.Config{
CAFile: "/var/lib/mycert.pem",
},
Insecure: false,
@@ -78,3 +78,55 @@ func TestUnmarshalConfig(t *testing.T) {
},
}, cfg)
}
+
+func TestUnmarshalInvalidConfig(t *testing.T) {
+ cm, err := confmaptest.LoadConf(filepath.Join("testdata", "invalid_configs.yaml"))
+ require.NoError(t, err)
+ factory := NewFactory()
+ for _, test := range []struct {
+ name string
+ errorMsg string
+ }{
+ {
+ name: "no_endpoint",
+ errorMsg: `requires a non-empty "endpoint"`,
+ },
+ {
+ name: "https_endpoint",
+ errorMsg: `requires a non-empty "endpoint"`,
+ },
+ {
+ name: "http_endpoint",
+ errorMsg: `requires a non-empty "endpoint"`,
+ },
+ {
+ name: "invalid_timeout",
+ errorMsg: `'timeout' must be non-negative`,
+ },
+ {
+ name: "invalid_retry",
+ errorMsg: `'randomization_factor' must be within [0, 1]`,
+ },
+ {
+ name: "invalid_tls",
+ errorMsg: `invalid TLS min_version: unsupported TLS version: "asd"`,
+ },
+ {
+ name: "missing_port",
+ errorMsg: `missing port in address`,
+ },
+ {
+ name: "invalid_port",
+ errorMsg: `invalid port "port"`,
+ },
+ } {
+ t.Run(test.name, func(t *testing.T) {
+ cfg := factory.CreateDefaultConfig()
+ sub, err := cm.Sub(test.name)
+ require.NoError(t, err)
+ assert.NoError(t, component.UnmarshalConfig(sub, cfg))
+ assert.ErrorContains(t, component.ValidateConfig(cfg), test.errorMsg)
+ })
+ }
+
+}
diff --git a/exporter/otlpexporter/factory.go b/exporter/otlpexporter/factory.go
index 3144cc4594b..8a72aab8cdc 100644
--- a/exporter/otlpexporter/factory.go
+++ b/exporter/otlpexporter/factory.go
@@ -36,7 +36,7 @@ func createDefaultConfig() component.Config {
ClientConfig: configgrpc.ClientConfig{
Headers: map[string]configopaque.String{},
// Default to gzip compression
- Compression: configcompression.Gzip,
+ Compression: configcompression.TypeGzip,
// We almost read 0 bytes, so no need to tune ReadBufferSize.
WriteBufferSize: 512 * 1024,
},
@@ -48,10 +48,7 @@ func createTracesExporter(
set exporter.CreateSettings,
cfg component.Config,
) (exporter.Traces, error) {
- oce, err := newExporter(cfg, set)
- if err != nil {
- return nil, err
- }
+ oce := newExporter(cfg, set)
oCfg := cfg.(*Config)
return exporterhelper.NewTracesExporter(ctx, set, cfg,
oce.pushTraces,
@@ -68,10 +65,7 @@ func createMetricsExporter(
set exporter.CreateSettings,
cfg component.Config,
) (exporter.Metrics, error) {
- oce, err := newExporter(cfg, set)
- if err != nil {
- return nil, err
- }
+ oce := newExporter(cfg, set)
oCfg := cfg.(*Config)
return exporterhelper.NewMetricsExporter(ctx, set, cfg,
oce.pushMetrics,
@@ -89,10 +83,7 @@ func createLogsExporter(
set exporter.CreateSettings,
cfg component.Config,
) (exporter.Logs, error) {
- oce, err := newExporter(cfg, set)
- if err != nil {
- return nil, err
- }
+ oce := newExporter(cfg, set)
oCfg := cfg.(*Config)
return exporterhelper.NewLogsExporter(ctx, set, cfg,
oce.pushLogs,
diff --git a/exporter/otlpexporter/factory_test.go b/exporter/otlpexporter/factory_test.go
index 311f4b838f0..d89c8fe2ead 100644
--- a/exporter/otlpexporter/factory_test.go
+++ b/exporter/otlpexporter/factory_test.go
@@ -33,7 +33,7 @@ func TestCreateDefaultConfig(t *testing.T) {
assert.Equal(t, ocfg.RetryConfig, configretry.NewDefaultBackOffConfig())
assert.Equal(t, ocfg.QueueConfig, exporterhelper.NewDefaultQueueSettings())
assert.Equal(t, ocfg.TimeoutSettings, exporterhelper.NewDefaultTimeoutSettings())
- assert.Equal(t, ocfg.Compression, configcompression.Gzip)
+ assert.Equal(t, ocfg.Compression, configcompression.TypeGzip)
}
func TestCreateMetricsExporter(t *testing.T) {
@@ -50,26 +50,16 @@ func TestCreateMetricsExporter(t *testing.T) {
func TestCreateTracesExporter(t *testing.T) {
endpoint := testutil.GetAvailableLocalAddress(t)
tests := []struct {
- name string
- config *Config
- mustFailOnCreate bool
- mustFailOnStart bool
+ name string
+ config *Config
+ mustFailOnStart bool
}{
- {
- name: "NoEndpoint",
- config: &Config{
- ClientConfig: configgrpc.ClientConfig{
- Endpoint: "",
- },
- },
- mustFailOnCreate: true,
- },
{
name: "UseSecure",
config: &Config{
ClientConfig: configgrpc.ClientConfig{
Endpoint: endpoint,
- TLSSetting: configtls.TLSClientSetting{
+ TLSSetting: configtls.ClientConfig{
Insecure: false,
},
},
@@ -102,7 +92,7 @@ func TestCreateTracesExporter(t *testing.T) {
config: &Config{
ClientConfig: configgrpc.ClientConfig{
Endpoint: endpoint,
- Compression: configcompression.Gzip,
+ Compression: configcompression.TypeGzip,
},
},
},
@@ -111,7 +101,7 @@ func TestCreateTracesExporter(t *testing.T) {
config: &Config{
ClientConfig: configgrpc.ClientConfig{
Endpoint: endpoint,
- Compression: configcompression.Snappy,
+ Compression: configcompression.TypeSnappy,
},
},
},
@@ -120,7 +110,7 @@ func TestCreateTracesExporter(t *testing.T) {
config: &Config{
ClientConfig: configgrpc.ClientConfig{
Endpoint: endpoint,
- Compression: configcompression.Zstd,
+ Compression: configcompression.TypeZstd,
},
},
},
@@ -149,8 +139,8 @@ func TestCreateTracesExporter(t *testing.T) {
config: &Config{
ClientConfig: configgrpc.ClientConfig{
Endpoint: endpoint,
- TLSSetting: configtls.TLSClientSetting{
- TLSSetting: configtls.TLSSetting{
+ TLSSetting: configtls.ClientConfig{
+ Config: configtls.Config{
CAFile: filepath.Join("testdata", "test_cert.pem"),
},
},
@@ -162,8 +152,8 @@ func TestCreateTracesExporter(t *testing.T) {
config: &Config{
ClientConfig: configgrpc.ClientConfig{
Endpoint: endpoint,
- TLSSetting: configtls.TLSClientSetting{
- TLSSetting: configtls.TLSSetting{
+ TLSSetting: configtls.ClientConfig{
+ Config: configtls.Config{
CAFile: "nosuchfile",
},
},
@@ -178,10 +168,6 @@ func TestCreateTracesExporter(t *testing.T) {
factory := NewFactory()
set := exportertest.NewNopCreateSettings()
consumer, err := factory.CreateTracesExporter(context.Background(), set, tt.config)
- if tt.mustFailOnCreate {
- assert.NotNil(t, err)
- return
- }
assert.NoError(t, err)
assert.NotNil(t, consumer)
err = consumer.Start(context.Background(), componenttest.NewNopHost())
diff --git a/exporter/otlpexporter/generated_component_test.go b/exporter/otlpexporter/generated_component_test.go
new file mode 100644
index 00000000000..cad24cfa855
--- /dev/null
+++ b/exporter/otlpexporter/generated_component_test.go
@@ -0,0 +1,143 @@
+// Code generated by mdatagen. DO NOT EDIT.
+
+package otlpexporter
+
+import (
+ "context"
+ "testing"
+ "time"
+
+ "github.com/stretchr/testify/require"
+
+ "go.opentelemetry.io/collector/component"
+ "go.opentelemetry.io/collector/component/componenttest"
+ "go.opentelemetry.io/collector/confmap/confmaptest"
+ "go.opentelemetry.io/collector/exporter"
+ "go.opentelemetry.io/collector/exporter/exportertest"
+ "go.opentelemetry.io/collector/pdata/pcommon"
+ "go.opentelemetry.io/collector/pdata/plog"
+ "go.opentelemetry.io/collector/pdata/pmetric"
+ "go.opentelemetry.io/collector/pdata/ptrace"
+)
+
+func TestComponentLifecycle(t *testing.T) {
+ factory := NewFactory()
+
+ tests := []struct {
+ name string
+ createFn func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error)
+ }{
+
+ {
+ name: "logs",
+ createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) {
+ return factory.CreateLogsExporter(ctx, set, cfg)
+ },
+ },
+
+ {
+ name: "metrics",
+ createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) {
+ return factory.CreateMetricsExporter(ctx, set, cfg)
+ },
+ },
+
+ {
+ name: "traces",
+ createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) {
+ return factory.CreateTracesExporter(ctx, set, cfg)
+ },
+ },
+ }
+
+ cm, err := confmaptest.LoadConf("metadata.yaml")
+ require.NoError(t, err)
+ cfg := factory.CreateDefaultConfig()
+ sub, err := cm.Sub("tests::config")
+ require.NoError(t, err)
+ require.NoError(t, component.UnmarshalConfig(sub, cfg))
+
+ for _, test := range tests {
+ t.Run(test.name+"-shutdown", func(t *testing.T) {
+ c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg)
+ require.NoError(t, err)
+ err = c.Shutdown(context.Background())
+ require.NoError(t, err)
+ })
+ t.Run(test.name+"-lifecycle", func(t *testing.T) {
+ c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg)
+ require.NoError(t, err)
+ host := componenttest.NewNopHost()
+ err = c.Start(context.Background(), host)
+ require.NoError(t, err)
+ require.NotPanics(t, func() {
+ switch test.name {
+ case "logs":
+ e, ok := c.(exporter.Logs)
+ require.True(t, ok)
+ logs := generateLifecycleTestLogs()
+ if !e.Capabilities().MutatesData {
+ logs.MarkReadOnly()
+ }
+ err = e.ConsumeLogs(context.Background(), logs)
+ case "metrics":
+ e, ok := c.(exporter.Metrics)
+ require.True(t, ok)
+ metrics := generateLifecycleTestMetrics()
+ if !e.Capabilities().MutatesData {
+ metrics.MarkReadOnly()
+ }
+ err = e.ConsumeMetrics(context.Background(), metrics)
+ case "traces":
+ e, ok := c.(exporter.Traces)
+ require.True(t, ok)
+ traces := generateLifecycleTestTraces()
+ if !e.Capabilities().MutatesData {
+ traces.MarkReadOnly()
+ }
+ err = e.ConsumeTraces(context.Background(), traces)
+ }
+ })
+
+ require.NoError(t, err)
+
+ err = c.Shutdown(context.Background())
+ require.NoError(t, err)
+ })
+ }
+}
+
+func generateLifecycleTestLogs() plog.Logs {
+ logs := plog.NewLogs()
+ rl := logs.ResourceLogs().AppendEmpty()
+ rl.Resource().Attributes().PutStr("resource", "R1")
+ l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty()
+ l.Body().SetStr("test log message")
+ l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now()))
+ return logs
+}
+
+func generateLifecycleTestMetrics() pmetric.Metrics {
+ metrics := pmetric.NewMetrics()
+ rm := metrics.ResourceMetrics().AppendEmpty()
+ rm.Resource().Attributes().PutStr("resource", "R1")
+ m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty()
+ m.SetName("test_metric")
+ dp := m.SetEmptyGauge().DataPoints().AppendEmpty()
+ dp.Attributes().PutStr("test_attr", "value_1")
+ dp.SetIntValue(123)
+ dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now()))
+ return metrics
+}
+
+func generateLifecycleTestTraces() ptrace.Traces {
+ traces := ptrace.NewTraces()
+ rs := traces.ResourceSpans().AppendEmpty()
+ rs.Resource().Attributes().PutStr("resource", "R1")
+ span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty()
+ span.Attributes().PutStr("test_attr", "value_1")
+ span.SetName("test_span")
+ span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second)))
+ span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now()))
+ return traces
+}
diff --git a/exporter/otlpexporter/go.mod b/exporter/otlpexporter/go.mod
index feff772ee31..b97f36c0001 100644
--- a/exporter/otlpexporter/go.mod
+++ b/exporter/otlpexporter/go.mod
@@ -1,82 +1,83 @@
module go.opentelemetry.io/collector/exporter/otlpexporter
-go 1.20
+go 1.21
require (
- github.com/stretchr/testify v1.8.4
- go.opentelemetry.io/collector v0.93.0
- go.opentelemetry.io/collector/component v0.93.0
- go.opentelemetry.io/collector/config/configauth v0.93.0
- go.opentelemetry.io/collector/config/configcompression v0.93.0
- go.opentelemetry.io/collector/config/configgrpc v0.93.0
- go.opentelemetry.io/collector/config/configopaque v0.93.0
- go.opentelemetry.io/collector/config/configretry v0.93.0
- go.opentelemetry.io/collector/config/configtls v0.93.0
- go.opentelemetry.io/collector/confmap v0.93.0
- go.opentelemetry.io/collector/consumer v0.93.0
- go.opentelemetry.io/collector/exporter v0.93.0
- go.opentelemetry.io/collector/pdata v1.0.1
- go.opentelemetry.io/otel/metric v1.22.0
- go.opentelemetry.io/otel/trace v1.22.0
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector v0.97.0
+ go.opentelemetry.io/collector/component v0.97.0
+ go.opentelemetry.io/collector/config/configauth v0.97.0
+ go.opentelemetry.io/collector/config/configcompression v1.4.0
+ go.opentelemetry.io/collector/config/configgrpc v0.97.0
+ go.opentelemetry.io/collector/config/configopaque v1.4.0
+ go.opentelemetry.io/collector/config/configretry v0.97.0
+ go.opentelemetry.io/collector/config/configtls v0.97.0
+ go.opentelemetry.io/collector/confmap v0.97.0
+ go.opentelemetry.io/collector/consumer v0.97.0
+ go.opentelemetry.io/collector/exporter v0.97.0
+ go.opentelemetry.io/collector/pdata v1.4.0
+ go.opentelemetry.io/otel/metric v1.24.0
+ go.opentelemetry.io/otel/trace v1.24.0
go.uber.org/goleak v1.3.0
- google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4
- google.golang.org/grpc v1.61.0
- google.golang.org/protobuf v1.32.0
+ go.uber.org/zap v1.27.0
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80
+ google.golang.org/grpc v1.62.1
+ google.golang.org/protobuf v1.33.0
)
require (
github.com/beorn7/perks v1.0.1 // indirect
- github.com/cenkalti/backoff/v4 v4.2.1 // indirect
+ github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
+ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
- github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
+ github.com/google/uuid v1.6.0 // indirect
+ github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.17.4 // indirect
github.com/knadh/koanf/maps v0.1.1 // indirect
github.com/knadh/koanf/providers/confmap v0.1.0 // indirect
- github.com/knadh/koanf/v2 v2.0.1 // indirect
+ github.com/knadh/koanf/v2 v2.1.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
- github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mostynb/go-grpc-compression v1.2.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
- github.com/prometheus/client_golang v1.18.0 // indirect
- github.com/prometheus/client_model v0.5.0 // indirect
- github.com/prometheus/common v0.46.0 // indirect
+ github.com/prometheus/client_golang v1.19.0 // indirect
+ github.com/prometheus/client_model v0.6.0 // indirect
+ github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
- go.opentelemetry.io/collector/config/confignet v0.93.0 // indirect
- go.opentelemetry.io/collector/config/configtelemetry v0.93.0 // indirect
- go.opentelemetry.io/collector/config/internal v0.93.0 // indirect
- go.opentelemetry.io/collector/extension v0.93.0 // indirect
- go.opentelemetry.io/collector/extension/auth v0.93.0 // indirect
- go.opentelemetry.io/collector/featuregate v1.0.1 // indirect
- go.opentelemetry.io/collector/receiver v0.93.0 // indirect
- go.opentelemetry.io/contrib/config v0.2.0 // indirect
- go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect
- go.opentelemetry.io/otel v1.22.0 // indirect
- go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0 // indirect
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0 // indirect
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0 // indirect
- go.opentelemetry.io/otel/exporters/prometheus v0.45.0 // indirect
- go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.22.0 // indirect
- go.opentelemetry.io/otel/sdk v1.22.0 // indirect
- go.opentelemetry.io/otel/sdk/metric v1.22.0 // indirect
- go.opentelemetry.io/proto/otlp v1.0.0 // indirect
+ go.opentelemetry.io/collector/config/confignet v0.97.0 // indirect
+ go.opentelemetry.io/collector/config/configtelemetry v0.97.0 // indirect
+ go.opentelemetry.io/collector/config/internal v0.97.0 // indirect
+ go.opentelemetry.io/collector/extension v0.97.0 // indirect
+ go.opentelemetry.io/collector/extension/auth v0.97.0 // indirect
+ go.opentelemetry.io/collector/featuregate v1.4.0 // indirect
+ go.opentelemetry.io/collector/receiver v0.97.0 // indirect
+ go.opentelemetry.io/contrib/config v0.4.0 // indirect
+ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 // indirect
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 // indirect
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 // indirect
+ go.opentelemetry.io/otel/exporters/prometheus v0.46.0 // indirect
+ go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk/metric v1.24.0 // indirect
+ go.opentelemetry.io/proto/otlp v1.1.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
- go.uber.org/zap v1.26.0 // indirect
- golang.org/x/net v0.20.0 // indirect
- golang.org/x/sys v0.16.0 // indirect
+ golang.org/x/net v0.23.0 // indirect
+ golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
- google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect
+ google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/exporter/otlpexporter/go.sum b/exporter/otlpexporter/go.sum
index 8ad3fea5a01..815993f3635 100644
--- a/exporter/otlpexporter/go.sum
+++ b/exporter/otlpexporter/go.sum
@@ -1,16 +1,12 @@
-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=
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/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
+github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
-github.com/cncf/xds/go v0.0.0-20231109132714-523115ebc101 h1:7To3pQ+pZo0i3dsWEbinPNFs5gPSBOsJtx3wTT94VBY=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
@@ -18,9 +14,10 @@ github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
-github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo=
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=
@@ -28,9 +25,12 @@ github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
-github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms=
-github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg=
+github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
+github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No=
+github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU=
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
@@ -43,14 +43,14 @@ github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NI
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/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -62,53 +62,54 @@ github.com/mostynb/go-grpc-compression v1.2.2 h1:XaDbnRvt2+1vgr0b/l0qh4mJAfIxE0b
github.com/mostynb/go-grpc-compression v1.2.2/go.mod h1:GOCr2KBxXcblCuczg3YdLQlcin1/NfyDA348ckuCH6w=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=
-github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA=
-github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
-github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
-github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y=
-github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ=
+github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU=
+github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k=
+github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=
+github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8=
+github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=
+github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
+github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
-github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-go.opentelemetry.io/contrib/config v0.2.0 h1:VRYXnoE2ug3QOtaKka4eV9OgHXMJ0q6ggFtx6s+Jvy0=
-go.opentelemetry.io/contrib/config v0.2.0/go.mod h1:iBfwdwpZBKsVXMOAWHyGS8//dcVNJORYnFm6VNqsOG8=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 h1:UNQQKPfTDe1J81ViolILjTKPr9WetKW6uei2hFgJmFs=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0/go.mod h1:r9vWsPS/3AQItv3OSlEJ/E4mbrhUbbw18meOjArPtKQ=
-go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y=
-go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0 h1:9M3+rhx7kZCIQQhQRYaZCdNu1V73tm4TvXs2ntl98C4=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0/go.mod h1:noq80iT8rrHP1SfybmPiRGc9dc5M8RPmGvtwo7Oo7tc=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0 h1:H2JFgRcGiyHg7H7bwcwaQJYrNFqCqrbTQ8K4p1OvDu8=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0/go.mod h1:WfCWp1bGoYK8MeULtI15MmQVczfR+bFkk0DF3h06QmQ=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0 h1:FyjCyI9jVEfqhUh2MoSkmolPjfh5fp2hnV0b0irxH4Q=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0/go.mod h1:hYwym2nDEeZfG/motx0p7L7J1N1vyzIThemQsb4g2qY=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0 h1:BeIK2KGho0oCWa7LxEGSqfDZbs7Fpv/Viz+FS4P8CXE=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0/go.mod h1:UVJZPLnfDSvHj+eJuZE+E1GjIBD267mEMfAAHJdghWg=
-go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.22.0 h1:zr8ymM5OWWjjiWRzwTfZ67c905+2TMHYp2lMJ52QTyM=
-go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.22.0/go.mod h1:sQs7FT2iLVJ+67vYngGJkPe1qr39IzaBzaj9IDNNY8k=
-go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg=
-go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY=
-go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw=
-go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc=
-go.opentelemetry.io/otel/sdk/metric v1.22.0 h1:ARrRetm1HCVxq0cbnaZQlfwODYJHo3gFL8Z3tSmHBcI=
-go.opentelemetry.io/otel/sdk/metric v1.22.0/go.mod h1:KjQGeMIDlBNEOo6HvjhxIec1p/69/kULDcp4gr0oLQQ=
-go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0=
-go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo=
-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.opentelemetry.io/contrib/config v0.4.0 h1:Xb+ncYOqseLroMuBesGNRgVQolXcXOhMj7EhGwJCdHs=
+go.opentelemetry.io/contrib/config v0.4.0/go.mod h1:drNk2xRqLWW4/amk6Uh1S+sDAJTc7bcEEN1GfJzj418=
+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 h1:4Pp6oUg3+e/6M4C0A/3kJ2VYa++dsWVTtGgLVj5xtHg=
+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0/go.mod h1:Mjt1i1INqiaoZOMGR1RIUJN+i3ChKoFRqzrRQhlkbs0=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 h1:t6wl9SPayj+c7lEIFgm4ooDBZVb01IhLB4InpomhRw8=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0/go.mod h1:iSDOcsnSA5INXzZtwaBPrKp/lWu/V14Dd+llD0oI2EA=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 h1:Mw5xcxMwlqoJd97vwPxA8isEaIoxsta9/Q51+TTJLGE=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0/go.mod h1:CQNu9bj7o7mC6U7+CA/schKEYakYXWr79ucDHTMGhCM=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 h1:Xw8U6u2f8DK2XAkGRFV7BBLENgnTGX9i4rQRxJf+/vs=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0/go.mod h1:6KW1Fm6R/s6Z3PGXwSJN2K4eT6wQB3vXX6CVnYX9NmM=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0 h1:I8WIFXR351FoLJYuloU4EgXbtNX2URfU/85pUPheIEQ=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0/go.mod h1:ztwVUHe5DTR/1v7PeuGRnU5Bbd4QKYwApWmuutKsJSs=
+go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.24.0 h1:s0PHtIkN+3xrbDOpt2M8OTG92cWqUESvzh2MxiR5xY8=
+go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.24.0/go.mod h1:hZlFbDbRt++MMPCCfSJfmhkGIWnX1h3XjkfxZUjLrIA=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/sdk/metric v1.24.0 h1:yyMQrPzF+k88/DbH7o4FMAs80puqd+9osbiBrJrz/w8=
+go.opentelemetry.io/otel/sdk/metric v1.24.0/go.mod h1:I6Y5FjH6rvEnTTAYQz3Mmv2kl6Ek5IIrmwTLqMrrOE0=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
+go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI=
+go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
-go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
-go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -118,17 +119,16 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
-golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
-golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ=
+golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
+golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
-golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
+golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
@@ -141,19 +141,20 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=
-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.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
-google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
+google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ=
+google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro=
+google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 h1:Lj5rbfG876hIAYFjqiJnPHfhXbv+nzTWfm04Fg/XSVU=
+google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s=
+google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=
+google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
-google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/exporter/otlpexporter/internal/metadata/generated_status.go b/exporter/otlpexporter/internal/metadata/generated_status.go
index f4222df7521..0f9aba1f217 100644
--- a/exporter/otlpexporter/internal/metadata/generated_status.go
+++ b/exporter/otlpexporter/internal/metadata/generated_status.go
@@ -20,9 +20,9 @@ const (
)
func Meter(settings component.TelemetrySettings) metric.Meter {
- return settings.MeterProvider.Meter("otelcol/otlp")
+ return settings.MeterProvider.Meter("go.opentelemetry.io/collector/exporter/otlpexporter")
}
func Tracer(settings component.TelemetrySettings) trace.Tracer {
- return settings.TracerProvider.Tracer("otelcol/otlp")
+ return settings.TracerProvider.Tracer("go.opentelemetry.io/collector/exporter/otlpexporter")
}
diff --git a/exporter/otlpexporter/metadata.yaml b/exporter/otlpexporter/metadata.yaml
index 820930b1dc5..f24e40e1f91 100644
--- a/exporter/otlpexporter/metadata.yaml
+++ b/exporter/otlpexporter/metadata.yaml
@@ -6,3 +6,7 @@ status:
stable: [traces, metrics]
beta: [logs]
distributions: [core, contrib]
+
+tests:
+ config:
+ endpoint: otelcol:4317
\ No newline at end of file
diff --git a/exporter/otlpexporter/otlp.go b/exporter/otlpexporter/otlp.go
index f300d5d6822..21864d7723a 100644
--- a/exporter/otlpexporter/otlp.go
+++ b/exporter/otlpexporter/otlp.go
@@ -5,11 +5,11 @@ package otlpexporter // import "go.opentelemetry.io/collector/exporter/otlpexpor
import (
"context"
- "errors"
"fmt"
"runtime"
"time"
+ "go.uber.org/zap"
"google.golang.org/genproto/googleapis/rpc/errdetails"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
@@ -46,19 +46,13 @@ type baseExporter struct {
userAgent string
}
-// Crete new exporter and start it. The exporter will begin connecting but
-// this function may return before the connection is established.
-func newExporter(cfg component.Config, set exporter.CreateSettings) (*baseExporter, error) {
+func newExporter(cfg component.Config, set exporter.CreateSettings) *baseExporter {
oCfg := cfg.(*Config)
- if oCfg.Endpoint == "" {
- return nil, errors.New("OTLP exporter config requires an Endpoint")
- }
-
userAgent := fmt.Sprintf("%s/%s (%s/%s)",
set.BuildInfo.Description, set.BuildInfo.Version, runtime.GOOS, runtime.GOARCH)
- return &baseExporter{config: oCfg, settings: set.TelemetrySettings, userAgent: userAgent}, nil
+ return &baseExporter{config: oCfg, settings: set.TelemetrySettings, userAgent: userAgent}
}
// start actually creates the gRPC connection. The client construction is deferred till this point as this
@@ -97,7 +91,10 @@ func (e *baseExporter) pushTraces(ctx context.Context, td ptrace.Traces) error {
}
partialSuccess := resp.PartialSuccess()
if !(partialSuccess.ErrorMessage() == "" && partialSuccess.RejectedSpans() == 0) {
- return consumererror.NewPermanent(fmt.Errorf("OTLP partial success: \"%s\" (%d rejected)", resp.PartialSuccess().ErrorMessage(), resp.PartialSuccess().RejectedSpans()))
+ e.settings.Logger.Warn("Partial success response",
+ zap.String("message", resp.PartialSuccess().ErrorMessage()),
+ zap.Int64("dropped_spans", resp.PartialSuccess().RejectedSpans()),
+ )
}
return nil
}
@@ -110,7 +107,10 @@ func (e *baseExporter) pushMetrics(ctx context.Context, md pmetric.Metrics) erro
}
partialSuccess := resp.PartialSuccess()
if !(partialSuccess.ErrorMessage() == "" && partialSuccess.RejectedDataPoints() == 0) {
- return consumererror.NewPermanent(fmt.Errorf("OTLP partial success: \"%s\" (%d rejected)", resp.PartialSuccess().ErrorMessage(), resp.PartialSuccess().RejectedDataPoints()))
+ e.settings.Logger.Warn("Partial success response",
+ zap.String("message", resp.PartialSuccess().ErrorMessage()),
+ zap.Int64("dropped_data_points", resp.PartialSuccess().RejectedDataPoints()),
+ )
}
return nil
}
@@ -123,7 +123,10 @@ func (e *baseExporter) pushLogs(ctx context.Context, ld plog.Logs) error {
}
partialSuccess := resp.PartialSuccess()
if !(partialSuccess.ErrorMessage() == "" && partialSuccess.RejectedLogRecords() == 0) {
- return consumererror.NewPermanent(fmt.Errorf("OTLP partial success: \"%s\" (%d rejected)", resp.PartialSuccess().ErrorMessage(), resp.PartialSuccess().RejectedLogRecords()))
+ e.settings.Logger.Warn("Partial success response",
+ zap.String("message", resp.PartialSuccess().ErrorMessage()),
+ zap.Int64("dropped_log_records", resp.PartialSuccess().RejectedLogRecords()),
+ )
}
return nil
}
diff --git a/exporter/otlpexporter/otlp_test.go b/exporter/otlpexporter/otlp_test.go
index c6753740e7f..d1c4f622bc0 100644
--- a/exporter/otlpexporter/otlp_test.go
+++ b/exporter/otlpexporter/otlp_test.go
@@ -15,6 +15,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+ "go.uber.org/zap"
+ "go.uber.org/zap/zaptest/observer"
"google.golang.org/genproto/googleapis/rpc/errdetails"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
@@ -237,7 +239,7 @@ func TestSendTraces(t *testing.T) {
cfg.QueueConfig.Enabled = false
cfg.ClientConfig = configgrpc.ClientConfig{
Endpoint: ln.Addr().String(),
- TLSSetting: configtls.TLSClientSetting{
+ TLSSetting: configtls.ClientConfig{
Insecure: true,
},
Headers: map[string]configopaque.String{
@@ -247,6 +249,11 @@ func TestSendTraces(t *testing.T) {
set := exportertest.NewNopCreateSettings()
set.BuildInfo.Description = "Collector"
set.BuildInfo.Version = "1.2.3test"
+
+ // For testing the "Partial success" warning.
+ logger, observed := observer.New(zap.DebugLevel)
+ set.TelemetrySettings.Logger = zap.New(logger)
+
exp, err := factory.CreateTracesExporter(context.Background(), set, cfg)
require.NoError(t, err)
require.NotNil(t, exp)
@@ -310,7 +317,9 @@ func TestSendTraces(t *testing.T) {
td = testdata.GenerateTraces(2)
err = exp.ConsumeTraces(context.Background(), td)
- assert.Error(t, err)
+ assert.NoError(t, err)
+ assert.Len(t, observed.FilterLevelExact(zap.WarnLevel).All(), 1)
+ assert.Contains(t, observed.FilterLevelExact(zap.WarnLevel).All()[0].Message, "Partial success")
}
func TestSendTracesWhenEndpointHasHttpScheme(t *testing.T) {
@@ -331,7 +340,7 @@ func TestSendTracesWhenEndpointHasHttpScheme(t *testing.T) {
useTLS: false,
scheme: "http://",
gRPCClientSettings: configgrpc.ClientConfig{
- TLSSetting: configtls.TLSClientSetting{
+ TLSSetting: configtls.ClientConfig{
Insecure: true,
},
},
@@ -402,7 +411,7 @@ func TestSendMetrics(t *testing.T) {
cfg.QueueConfig.Enabled = false
cfg.ClientConfig = configgrpc.ClientConfig{
Endpoint: ln.Addr().String(),
- TLSSetting: configtls.TLSClientSetting{
+ TLSSetting: configtls.ClientConfig{
Insecure: true,
},
Headers: map[string]configopaque.String{
@@ -412,6 +421,11 @@ func TestSendMetrics(t *testing.T) {
set := exportertest.NewNopCreateSettings()
set.BuildInfo.Description = "Collector"
set.BuildInfo.Version = "1.2.3test"
+
+ // For testing the "Partial success" warning.
+ logger, observed := observer.New(zap.DebugLevel)
+ set.TelemetrySettings.Logger = zap.New(logger)
+
exp, err := factory.CreateMetricsExporter(context.Background(), set, cfg)
require.NoError(t, err)
require.NotNil(t, exp)
@@ -484,7 +498,9 @@ func TestSendMetrics(t *testing.T) {
// Send two metrics.
md = testdata.GenerateMetrics(2)
- assert.Error(t, exp.ConsumeMetrics(context.Background(), md))
+ assert.NoError(t, exp.ConsumeMetrics(context.Background(), md))
+ assert.Len(t, observed.FilterLevelExact(zap.WarnLevel).All(), 1)
+ assert.Contains(t, observed.FilterLevelExact(zap.WarnLevel).All()[0].Message, "Partial success")
}
func TestSendTraceDataServerDownAndUp(t *testing.T) {
@@ -500,7 +516,7 @@ func TestSendTraceDataServerDownAndUp(t *testing.T) {
cfg.QueueConfig.Enabled = false
cfg.ClientConfig = configgrpc.ClientConfig{
Endpoint: ln.Addr().String(),
- TLSSetting: configtls.TLSClientSetting{
+ TLSSetting: configtls.ClientConfig{
Insecure: true,
},
// Need to wait for every request blocking until either request timeouts or succeed.
@@ -560,7 +576,7 @@ func TestSendTraceDataServerStartWhileRequest(t *testing.T) {
cfg := factory.CreateDefaultConfig().(*Config)
cfg.ClientConfig = configgrpc.ClientConfig{
Endpoint: ln.Addr().String(),
- TLSSetting: configtls.TLSClientSetting{
+ TLSSetting: configtls.ClientConfig{
Insecure: true,
},
}
@@ -611,7 +627,7 @@ func TestSendTracesOnResourceExhaustion(t *testing.T) {
cfg.RetryConfig.InitialInterval = 0
cfg.ClientConfig = configgrpc.ClientConfig{
Endpoint: ln.Addr().String(),
- TLSSetting: configtls.TLSClientSetting{
+ TLSSetting: configtls.ClientConfig{
Insecure: true,
},
}
@@ -692,13 +708,18 @@ func TestSendLogData(t *testing.T) {
cfg.QueueConfig.Enabled = false
cfg.ClientConfig = configgrpc.ClientConfig{
Endpoint: ln.Addr().String(),
- TLSSetting: configtls.TLSClientSetting{
+ TLSSetting: configtls.ClientConfig{
Insecure: true,
},
}
set := exportertest.NewNopCreateSettings()
set.BuildInfo.Description = "Collector"
set.BuildInfo.Version = "1.2.3test"
+
+ // For testing the "Partial success" warning.
+ logger, observed := observer.New(zap.DebugLevel)
+ set.TelemetrySettings.Logger = zap.New(logger)
+
exp, err := factory.CreateLogsExporter(context.Background(), set, cfg)
require.NoError(t, err)
require.NotNil(t, exp)
@@ -770,5 +791,7 @@ func TestSendLogData(t *testing.T) {
ld = testdata.GenerateLogs(2)
err = exp.ConsumeLogs(context.Background(), ld)
- assert.Error(t, err)
+ assert.NoError(t, err)
+ assert.Len(t, observed.FilterLevelExact(zap.WarnLevel).All(), 1)
+ assert.Contains(t, observed.FilterLevelExact(zap.WarnLevel).All()[0].Message, "Partial success")
}
diff --git a/exporter/otlpexporter/testdata/invalid_configs.yaml b/exporter/otlpexporter/testdata/invalid_configs.yaml
new file mode 100644
index 00000000000..69fd873be3f
--- /dev/null
+++ b/exporter/otlpexporter/testdata/invalid_configs.yaml
@@ -0,0 +1,103 @@
+no_endpoint:
+ 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: 1.3
+ max_interval: 60s
+ max_elapsed_time: 10m
+https_endpoint:
+ endpoint: https://
+http_endpoint:
+ endpoint: http://
+ 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: 1.3
+ max_interval: 60s
+ max_elapsed_time: 10m
+invalid_timeout:
+ endpoint: example.com:443
+ timeout: -5s
+ sending_queue:
+ enabled: true
+ num_consumers: 2
+ queue_size: 10
+ retry_on_failure:
+ enabled: true
+ initial_interval: 10s
+ randomization_factor: 0.7
+ multiplier: 1.3
+ max_interval: 60s
+ max_elapsed_time: 10m
+invalid_retry:
+ endpoint: example.com:443
+ timeout: 30s
+ sending_queue:
+ enabled: true
+ num_consumers: 2
+ queue_size: 10
+ retry_on_failure:
+ enabled: true
+ initial_interval: 10s
+ randomization_factor: -5
+ multiplier: 1.3
+ max_interval: 60s
+ max_elapsed_time: 10m
+invalid_tls:
+ tls:
+ min_version: asd
+ endpoint: example.com:443
+ 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: 1.3
+ max_interval: 60s
+ max_elapsed_time: 10m
+missing_port:
+ endpoint: example.com
+ 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: 1.3
+ max_interval: 60s
+ max_elapsed_time: 10m
+invalid_port:
+ endpoint: example.com:port
+ 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: 1.3
+ max_interval: 60s
+ max_elapsed_time: 10m
+
+
diff --git a/exporter/otlphttpexporter/README.md b/exporter/otlphttpexporter/README.md
index 75d6824af6c..fb15c0dab7a 100644
--- a/exporter/otlphttpexporter/README.md
+++ b/exporter/otlphttpexporter/README.md
@@ -37,6 +37,7 @@ The following settings can be optionally configured:
- `timeout` (default = 30s): HTTP request time limit. For details see https://golang.org/pkg/net/http/#Client
- `read_buffer_size` (default = 0): ReadBufferSize for HTTP client.
- `write_buffer_size` (default = 512 * 1024): WriteBufferSize for HTTP client.
+- `encoding` (default = proto): The encoding to use for the messages (valid options: `proto`, `json`)
Example:
@@ -55,5 +56,14 @@ exporters:
compression: none
```
+By default `proto` encoding is used, to change the content encoding of the message configure it as follows:
+
+```yaml
+exporters:
+ otlphttp:
+ ...
+ encoding: json
+```
+
The full list of settings exposed for this exporter are documented [here](./config.go)
with detailed sample configurations [here](./testdata/config.yaml).
diff --git a/exporter/otlphttpexporter/config.go b/exporter/otlphttpexporter/config.go
index c0918e0924e..ef59fc324a0 100644
--- a/exporter/otlphttpexporter/config.go
+++ b/exporter/otlphttpexporter/config.go
@@ -4,7 +4,9 @@
package otlphttpexporter // import "go.opentelemetry.io/collector/exporter/otlphttpexporter"
import (
+ "encoding"
"errors"
+ "fmt"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/confighttp"
@@ -12,6 +14,35 @@ import (
"go.opentelemetry.io/collector/exporter/exporterhelper"
)
+// EncodingType defines the type for content encoding
+type EncodingType string
+
+const (
+ EncodingProto EncodingType = "proto"
+ EncodingJSON EncodingType = "json"
+)
+
+var _ encoding.TextUnmarshaler = (*EncodingType)(nil)
+
+// UnmarshalText unmarshalls text to an EncodingType.
+func (e *EncodingType) UnmarshalText(text []byte) error {
+ if e == nil {
+ return errors.New("cannot unmarshal to a nil *EncodingType")
+ }
+
+ str := string(text)
+ switch str {
+ case string(EncodingProto):
+ *e = EncodingProto
+ case string(EncodingJSON):
+ *e = EncodingJSON
+ default:
+ return fmt.Errorf("invalid encoding type: %s", str)
+ }
+
+ return nil
+}
+
// Config defines configuration for OTLP/HTTP exporter.
type Config struct {
confighttp.ClientConfig `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct.
@@ -26,6 +57,9 @@ type Config struct {
// The URL to send logs to. If omitted the Endpoint + "/v1/logs" will be used.
LogsEndpoint string `mapstructure:"logs_endpoint"`
+
+ // The encoding to export telemetry (default: "proto")
+ Encoding EncodingType `mapstructure:"encoding"`
}
var _ component.Config = (*Config)(nil)
diff --git a/exporter/otlphttpexporter/config_test.go b/exporter/otlphttpexporter/config_test.go
index 76579f05d21..e158891dd75 100644
--- a/exporter/otlphttpexporter/config_test.go
+++ b/exporter/otlphttpexporter/config_test.go
@@ -51,6 +51,7 @@ func TestUnmarshalConfig(t *testing.T) {
NumConsumers: 2,
QueueSize: 10,
},
+ Encoding: EncodingProto,
ClientConfig: confighttp.ClientConfig{
Headers: map[string]configopaque.String{
"can you have a . here?": "F0000000-0000-0000-0000-000000000000",
@@ -58,8 +59,8 @@ func TestUnmarshalConfig(t *testing.T) {
"another": "somevalue",
},
Endpoint: "https://1.2.3.4:1234",
- TLSSetting: configtls.TLSClientSetting{
- TLSSetting: configtls.TLSSetting{
+ TLSSetting: configtls.ClientConfig{
+ Config: configtls.Config{
CAFile: "/var/lib/mycert.pem",
CertFile: "certfile",
KeyFile: "keyfile",
@@ -73,3 +74,57 @@ func TestUnmarshalConfig(t *testing.T) {
},
}, cfg)
}
+
+func TestUnmarshalConfigInvalidEncoding(t *testing.T) {
+ cm, err := confmaptest.LoadConf(filepath.Join("testdata", "bad_invalid_encoding.yaml"))
+ require.NoError(t, err)
+ factory := NewFactory()
+ cfg := factory.CreateDefaultConfig()
+ assert.Error(t, component.UnmarshalConfig(cm, cfg))
+}
+
+func TestUnmarshalEncoding(t *testing.T) {
+ tests := []struct {
+ name string
+ encodingBytes []byte
+ expected EncodingType
+ shouldError bool
+ }{
+ {
+ name: "UnmarshalEncodingProto",
+ encodingBytes: []byte("proto"),
+ expected: EncodingProto,
+ shouldError: false,
+ },
+ {
+ name: "UnmarshalEncodingJson",
+ encodingBytes: []byte("json"),
+ expected: EncodingJSON,
+ shouldError: false,
+ },
+ {
+ name: "UnmarshalEmptyEncoding",
+ encodingBytes: []byte(""),
+ shouldError: true,
+ },
+ {
+ name: "UnmarshalInvalidEncoding",
+ encodingBytes: []byte("invalid"),
+ shouldError: true,
+ },
+ }
+
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ var encoding EncodingType
+ err := encoding.UnmarshalText(tt.encodingBytes)
+
+ if tt.shouldError {
+ assert.Error(t, err)
+ } else {
+ assert.NoError(t, err)
+ assert.Equal(t, tt.expected, encoding)
+ }
+ })
+ }
+}
diff --git a/exporter/otlphttpexporter/factory.go b/exporter/otlphttpexporter/factory.go
index 6aeac2dcd93..9ebcc01fba1 100644
--- a/exporter/otlphttpexporter/factory.go
+++ b/exporter/otlphttpexporter/factory.go
@@ -36,12 +36,13 @@ func createDefaultConfig() component.Config {
return &Config{
RetryConfig: configretry.NewDefaultBackOffConfig(),
QueueConfig: exporterhelper.NewDefaultQueueSettings(),
+ Encoding: EncodingProto,
ClientConfig: confighttp.ClientConfig{
Endpoint: "",
Timeout: 30 * time.Second,
Headers: map[string]configopaque.String{},
// Default to gzip compression
- Compression: configcompression.Gzip,
+ Compression: configcompression.TypeGzip,
// We almost read 0 bytes, so no need to tune ReadBufferSize.
WriteBufferSize: 512 * 1024,
},
diff --git a/exporter/otlphttpexporter/factory_test.go b/exporter/otlphttpexporter/factory_test.go
index 89526ed5fb7..d81b0c7bd55 100644
--- a/exporter/otlphttpexporter/factory_test.go
+++ b/exporter/otlphttpexporter/factory_test.go
@@ -35,7 +35,8 @@ func TestCreateDefaultConfig(t *testing.T) {
assert.Equal(t, ocfg.RetryConfig.InitialInterval, 5*time.Second, "default retry InitialInterval")
assert.Equal(t, ocfg.RetryConfig.MaxInterval, 30*time.Second, "default retry MaxInterval")
assert.Equal(t, ocfg.QueueConfig.Enabled, true, "default sending queue is enabled")
- assert.Equal(t, ocfg.Compression, configcompression.Gzip)
+ assert.Equal(t, ocfg.Encoding, EncodingProto)
+ assert.Equal(t, ocfg.Compression, configcompression.TypeGzip)
}
func TestCreateMetricsExporter(t *testing.T) {
@@ -72,7 +73,7 @@ func TestCreateTracesExporter(t *testing.T) {
config: &Config{
ClientConfig: confighttp.ClientConfig{
Endpoint: endpoint,
- TLSSetting: configtls.TLSClientSetting{
+ TLSSetting: configtls.ClientConfig{
Insecure: false,
},
},
@@ -95,8 +96,8 @@ func TestCreateTracesExporter(t *testing.T) {
config: &Config{
ClientConfig: confighttp.ClientConfig{
Endpoint: endpoint,
- TLSSetting: configtls.TLSClientSetting{
- TLSSetting: configtls.TLSSetting{
+ TLSSetting: configtls.ClientConfig{
+ Config: configtls.Config{
CAFile: filepath.Join("testdata", "test_cert.pem"),
},
},
@@ -108,8 +109,8 @@ func TestCreateTracesExporter(t *testing.T) {
config: &Config{
ClientConfig: confighttp.ClientConfig{
Endpoint: endpoint,
- TLSSetting: configtls.TLSClientSetting{
- TLSSetting: configtls.TLSSetting{
+ TLSSetting: configtls.ClientConfig{
+ Config: configtls.Config{
CAFile: "nosuchfile",
},
},
@@ -132,7 +133,7 @@ func TestCreateTracesExporter(t *testing.T) {
config: &Config{
ClientConfig: confighttp.ClientConfig{
Endpoint: endpoint,
- Compression: configcompression.Gzip,
+ Compression: configcompression.TypeGzip,
},
},
},
@@ -141,7 +142,7 @@ func TestCreateTracesExporter(t *testing.T) {
config: &Config{
ClientConfig: confighttp.ClientConfig{
Endpoint: endpoint,
- Compression: configcompression.Snappy,
+ Compression: configcompression.TypeSnappy,
},
},
},
@@ -150,10 +151,24 @@ func TestCreateTracesExporter(t *testing.T) {
config: &Config{
ClientConfig: confighttp.ClientConfig{
Endpoint: endpoint,
- Compression: configcompression.Zstd,
+ Compression: configcompression.TypeZstd,
},
},
},
+ {
+ name: "ProtoEncoding",
+ config: &Config{
+ Encoding: EncodingProto,
+ ClientConfig: confighttp.ClientConfig{Endpoint: endpoint},
+ },
+ },
+ {
+ name: "JSONEncoding",
+ config: &Config{
+ Encoding: EncodingJSON,
+ ClientConfig: confighttp.ClientConfig{Endpoint: endpoint},
+ },
+ },
}
for _, tt := range tests {
diff --git a/exporter/otlphttpexporter/generated_component_test.go b/exporter/otlphttpexporter/generated_component_test.go
new file mode 100644
index 00000000000..3ed05244be2
--- /dev/null
+++ b/exporter/otlphttpexporter/generated_component_test.go
@@ -0,0 +1,143 @@
+// Code generated by mdatagen. DO NOT EDIT.
+
+package otlphttpexporter
+
+import (
+ "context"
+ "testing"
+ "time"
+
+ "github.com/stretchr/testify/require"
+
+ "go.opentelemetry.io/collector/component"
+ "go.opentelemetry.io/collector/component/componenttest"
+ "go.opentelemetry.io/collector/confmap/confmaptest"
+ "go.opentelemetry.io/collector/exporter"
+ "go.opentelemetry.io/collector/exporter/exportertest"
+ "go.opentelemetry.io/collector/pdata/pcommon"
+ "go.opentelemetry.io/collector/pdata/plog"
+ "go.opentelemetry.io/collector/pdata/pmetric"
+ "go.opentelemetry.io/collector/pdata/ptrace"
+)
+
+func TestComponentLifecycle(t *testing.T) {
+ factory := NewFactory()
+
+ tests := []struct {
+ name string
+ createFn func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error)
+ }{
+
+ {
+ name: "logs",
+ createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) {
+ return factory.CreateLogsExporter(ctx, set, cfg)
+ },
+ },
+
+ {
+ name: "metrics",
+ createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) {
+ return factory.CreateMetricsExporter(ctx, set, cfg)
+ },
+ },
+
+ {
+ name: "traces",
+ createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) {
+ return factory.CreateTracesExporter(ctx, set, cfg)
+ },
+ },
+ }
+
+ cm, err := confmaptest.LoadConf("metadata.yaml")
+ require.NoError(t, err)
+ cfg := factory.CreateDefaultConfig()
+ sub, err := cm.Sub("tests::config")
+ require.NoError(t, err)
+ require.NoError(t, component.UnmarshalConfig(sub, cfg))
+
+ for _, test := range tests {
+ t.Run(test.name+"-shutdown", func(t *testing.T) {
+ c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg)
+ require.NoError(t, err)
+ err = c.Shutdown(context.Background())
+ require.NoError(t, err)
+ })
+ t.Run(test.name+"-lifecycle", func(t *testing.T) {
+ c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg)
+ require.NoError(t, err)
+ host := componenttest.NewNopHost()
+ err = c.Start(context.Background(), host)
+ require.NoError(t, err)
+ require.NotPanics(t, func() {
+ switch test.name {
+ case "logs":
+ e, ok := c.(exporter.Logs)
+ require.True(t, ok)
+ logs := generateLifecycleTestLogs()
+ if !e.Capabilities().MutatesData {
+ logs.MarkReadOnly()
+ }
+ err = e.ConsumeLogs(context.Background(), logs)
+ case "metrics":
+ e, ok := c.(exporter.Metrics)
+ require.True(t, ok)
+ metrics := generateLifecycleTestMetrics()
+ if !e.Capabilities().MutatesData {
+ metrics.MarkReadOnly()
+ }
+ err = e.ConsumeMetrics(context.Background(), metrics)
+ case "traces":
+ e, ok := c.(exporter.Traces)
+ require.True(t, ok)
+ traces := generateLifecycleTestTraces()
+ if !e.Capabilities().MutatesData {
+ traces.MarkReadOnly()
+ }
+ err = e.ConsumeTraces(context.Background(), traces)
+ }
+ })
+
+ require.NoError(t, err)
+
+ err = c.Shutdown(context.Background())
+ require.NoError(t, err)
+ })
+ }
+}
+
+func generateLifecycleTestLogs() plog.Logs {
+ logs := plog.NewLogs()
+ rl := logs.ResourceLogs().AppendEmpty()
+ rl.Resource().Attributes().PutStr("resource", "R1")
+ l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty()
+ l.Body().SetStr("test log message")
+ l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now()))
+ return logs
+}
+
+func generateLifecycleTestMetrics() pmetric.Metrics {
+ metrics := pmetric.NewMetrics()
+ rm := metrics.ResourceMetrics().AppendEmpty()
+ rm.Resource().Attributes().PutStr("resource", "R1")
+ m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty()
+ m.SetName("test_metric")
+ dp := m.SetEmptyGauge().DataPoints().AppendEmpty()
+ dp.Attributes().PutStr("test_attr", "value_1")
+ dp.SetIntValue(123)
+ dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now()))
+ return metrics
+}
+
+func generateLifecycleTestTraces() ptrace.Traces {
+ traces := ptrace.NewTraces()
+ rs := traces.ResourceSpans().AppendEmpty()
+ rs.Resource().Attributes().PutStr("resource", "R1")
+ span := rs.ScopeSpans().AppendEmpty().Spans().AppendEmpty()
+ span.Attributes().PutStr("test_attr", "value_1")
+ span.SetName("test_span")
+ span.SetStartTimestamp(pcommon.NewTimestampFromTime(time.Now().Add(-1 * time.Second)))
+ span.SetEndTimestamp(pcommon.NewTimestampFromTime(time.Now()))
+ return traces
+}
diff --git a/exporter/otlphttpexporter/go.mod b/exporter/otlphttpexporter/go.mod
index e52b3425a0a..3fbfeb1e9ca 100644
--- a/exporter/otlphttpexporter/go.mod
+++ b/exporter/otlphttpexporter/go.mod
@@ -1,82 +1,83 @@
module go.opentelemetry.io/collector/exporter/otlphttpexporter
-go 1.20
+go 1.21
require (
- github.com/stretchr/testify v1.8.4
- go.opentelemetry.io/collector v0.93.0
- go.opentelemetry.io/collector/component v0.93.0
- go.opentelemetry.io/collector/config/configcompression v0.93.0
- go.opentelemetry.io/collector/config/confighttp v0.93.0
- go.opentelemetry.io/collector/config/configopaque v0.93.0
- go.opentelemetry.io/collector/config/configretry v0.93.0
- go.opentelemetry.io/collector/config/configtls v0.93.0
- go.opentelemetry.io/collector/confmap v0.93.0
- go.opentelemetry.io/collector/consumer v0.93.0
- go.opentelemetry.io/collector/exporter v0.93.0
- go.opentelemetry.io/collector/pdata v1.0.1
- go.opentelemetry.io/otel/metric v1.22.0
- go.opentelemetry.io/otel/trace v1.22.0
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector v0.97.0
+ go.opentelemetry.io/collector/component v0.97.0
+ go.opentelemetry.io/collector/config/configcompression v1.4.0
+ go.opentelemetry.io/collector/config/confighttp v0.97.0
+ go.opentelemetry.io/collector/config/configopaque v1.4.0
+ go.opentelemetry.io/collector/config/configretry v0.97.0
+ go.opentelemetry.io/collector/config/configtls v0.97.0
+ go.opentelemetry.io/collector/confmap v0.97.0
+ go.opentelemetry.io/collector/consumer v0.97.0
+ go.opentelemetry.io/collector/exporter v0.97.0
+ go.opentelemetry.io/collector/pdata v1.4.0
+ go.opentelemetry.io/otel/metric v1.24.0
+ go.opentelemetry.io/otel/trace v1.24.0
go.uber.org/goleak v1.3.0
- go.uber.org/zap v1.26.0
- google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4
- google.golang.org/grpc v1.61.0
- google.golang.org/protobuf v1.32.0
+ go.uber.org/zap v1.27.0
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80
+ google.golang.org/grpc v1.62.1
+ google.golang.org/protobuf v1.33.0
)
require (
github.com/beorn7/perks v1.0.1 // indirect
- github.com/cenkalti/backoff/v4 v4.2.1 // indirect
+ github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
+ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
- github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
+ github.com/google/uuid v1.6.0 // indirect
+ github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
- github.com/klauspost/compress v1.17.5 // indirect
+ github.com/klauspost/compress v1.17.7 // indirect
github.com/knadh/koanf/maps v0.1.1 // indirect
github.com/knadh/koanf/providers/confmap v0.1.0 // indirect
- github.com/knadh/koanf/v2 v2.0.1 // indirect
+ github.com/knadh/koanf/v2 v2.1.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
- github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
- github.com/prometheus/client_golang v1.18.0 // indirect
- github.com/prometheus/client_model v0.5.0 // indirect
- github.com/prometheus/common v0.46.0 // indirect
+ github.com/prometheus/client_golang v1.19.0 // indirect
+ github.com/prometheus/client_model v0.6.0 // indirect
+ github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/rs/cors v1.10.1 // indirect
- go.opentelemetry.io/collector/config/configauth v0.93.0 // indirect
- go.opentelemetry.io/collector/config/configtelemetry v0.93.0 // indirect
- go.opentelemetry.io/collector/config/internal v0.93.0 // indirect
- go.opentelemetry.io/collector/extension v0.93.0 // indirect
- go.opentelemetry.io/collector/extension/auth v0.93.0 // indirect
- go.opentelemetry.io/collector/featuregate v1.0.1 // indirect
- go.opentelemetry.io/collector/receiver v0.93.0 // indirect
- go.opentelemetry.io/contrib/config v0.2.0 // indirect
- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect
- go.opentelemetry.io/otel v1.22.0 // indirect
- go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0 // indirect
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0 // indirect
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0 // indirect
- go.opentelemetry.io/otel/exporters/prometheus v0.45.0 // indirect
- go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.22.0 // indirect
- go.opentelemetry.io/otel/sdk v1.22.0 // indirect
- go.opentelemetry.io/otel/sdk/metric v1.22.0 // indirect
- go.opentelemetry.io/proto/otlp v1.0.0 // indirect
+ go.opentelemetry.io/collector/config/configauth v0.97.0 // indirect
+ go.opentelemetry.io/collector/config/configtelemetry v0.97.0 // indirect
+ go.opentelemetry.io/collector/config/internal v0.97.0 // indirect
+ go.opentelemetry.io/collector/extension v0.97.0 // indirect
+ go.opentelemetry.io/collector/extension/auth v0.97.0 // indirect
+ go.opentelemetry.io/collector/featuregate v1.4.0 // indirect
+ go.opentelemetry.io/collector/receiver v0.97.0 // indirect
+ go.opentelemetry.io/contrib/config v0.4.0 // indirect
+ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 // indirect
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 // indirect
+ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 // indirect
+ go.opentelemetry.io/otel/exporters/prometheus v0.46.0 // indirect
+ go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk/metric v1.24.0 // indirect
+ go.opentelemetry.io/proto/otlp v1.1.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
- golang.org/x/net v0.20.0 // indirect
- golang.org/x/sys v0.16.0 // indirect
+ golang.org/x/net v0.23.0 // indirect
+ golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
- google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect
+ google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/exporter/otlphttpexporter/go.sum b/exporter/otlphttpexporter/go.sum
index 7aeadc7879c..48d843bdd87 100644
--- a/exporter/otlphttpexporter/go.sum
+++ b/exporter/otlphttpexporter/go.sum
@@ -1,7 +1,7 @@
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/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8=
+github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/cespare/xxhash/v2 v2.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=
@@ -16,9 +16,10 @@ github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
-github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo=
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=
@@ -26,29 +27,32 @@ github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
-github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms=
-github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg=
+github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
+github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No=
+github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU=
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
-github.com/klauspost/compress v1.17.5 h1:d4vBd+7CHydUqpFBgUEKkSdtSugf9YFmSkvUYPquI5E=
-github.com/klauspost/compress v1.17.5/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
+github.com/klauspost/compress v1.17.7 h1:ehO88t2UGzQK66LMdE8tibEd1ErmzZjNEqWkjLAKQQg=
+github.com/klauspost/compress v1.17.7/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
github.com/knadh/koanf/maps v0.1.1 h1:G5TjmUh2D7G2YWf5SQQqSiHRJEjaicvU0KpypqB3NIs=
github.com/knadh/koanf/maps v0.1.1/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI=
github.com/knadh/koanf/providers/confmap v0.1.0 h1:gOkxhHkemwG4LezxxN8DMOFopOPghxRVp7JbIvdvqzU=
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/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -58,55 +62,56 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=
-github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA=
-github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
-github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
-github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y=
-github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ=
+github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU=
+github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k=
+github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=
+github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8=
+github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=
+github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
+github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo=
github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-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/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-go.opentelemetry.io/contrib/config v0.2.0 h1:VRYXnoE2ug3QOtaKka4eV9OgHXMJ0q6ggFtx6s+Jvy0=
-go.opentelemetry.io/contrib/config v0.2.0/go.mod h1:iBfwdwpZBKsVXMOAWHyGS8//dcVNJORYnFm6VNqsOG8=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 h1:sv9kVfal0MK0wBMCOGr+HeJm9v803BkJxGrk2au7j08=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0/go.mod h1:SK2UL73Zy1quvRPonmOmRDiWk1KBV3LyIeeIxcEApWw=
-go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y=
-go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0 h1:9M3+rhx7kZCIQQhQRYaZCdNu1V73tm4TvXs2ntl98C4=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0/go.mod h1:noq80iT8rrHP1SfybmPiRGc9dc5M8RPmGvtwo7Oo7tc=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0 h1:H2JFgRcGiyHg7H7bwcwaQJYrNFqCqrbTQ8K4p1OvDu8=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0/go.mod h1:WfCWp1bGoYK8MeULtI15MmQVczfR+bFkk0DF3h06QmQ=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0 h1:FyjCyI9jVEfqhUh2MoSkmolPjfh5fp2hnV0b0irxH4Q=
-go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.22.0/go.mod h1:hYwym2nDEeZfG/motx0p7L7J1N1vyzIThemQsb4g2qY=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0 h1:BeIK2KGho0oCWa7LxEGSqfDZbs7Fpv/Viz+FS4P8CXE=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0/go.mod h1:UVJZPLnfDSvHj+eJuZE+E1GjIBD267mEMfAAHJdghWg=
-go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.22.0 h1:zr8ymM5OWWjjiWRzwTfZ67c905+2TMHYp2lMJ52QTyM=
-go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.22.0/go.mod h1:sQs7FT2iLVJ+67vYngGJkPe1qr39IzaBzaj9IDNNY8k=
-go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg=
-go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY=
-go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw=
-go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc=
-go.opentelemetry.io/otel/sdk/metric v1.22.0 h1:ARrRetm1HCVxq0cbnaZQlfwODYJHo3gFL8Z3tSmHBcI=
-go.opentelemetry.io/otel/sdk/metric v1.22.0/go.mod h1:KjQGeMIDlBNEOo6HvjhxIec1p/69/kULDcp4gr0oLQQ=
-go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0=
-go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo=
-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.opentelemetry.io/contrib/config v0.4.0 h1:Xb+ncYOqseLroMuBesGNRgVQolXcXOhMj7EhGwJCdHs=
+go.opentelemetry.io/contrib/config v0.4.0/go.mod h1:drNk2xRqLWW4/amk6Uh1S+sDAJTc7bcEEN1GfJzj418=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0 h1:t6wl9SPayj+c7lEIFgm4ooDBZVb01IhLB4InpomhRw8=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.24.0/go.mod h1:iSDOcsnSA5INXzZtwaBPrKp/lWu/V14Dd+llD0oI2EA=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0 h1:Mw5xcxMwlqoJd97vwPxA8isEaIoxsta9/Q51+TTJLGE=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0/go.mod h1:CQNu9bj7o7mC6U7+CA/schKEYakYXWr79ucDHTMGhCM=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 h1:Xw8U6u2f8DK2XAkGRFV7BBLENgnTGX9i4rQRxJf+/vs=
+go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0/go.mod h1:6KW1Fm6R/s6Z3PGXwSJN2K4eT6wQB3vXX6CVnYX9NmM=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0 h1:I8WIFXR351FoLJYuloU4EgXbtNX2URfU/85pUPheIEQ=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0/go.mod h1:ztwVUHe5DTR/1v7PeuGRnU5Bbd4QKYwApWmuutKsJSs=
+go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.24.0 h1:s0PHtIkN+3xrbDOpt2M8OTG92cWqUESvzh2MxiR5xY8=
+go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.24.0/go.mod h1:hZlFbDbRt++MMPCCfSJfmhkGIWnX1h3XjkfxZUjLrIA=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/sdk/metric v1.24.0 h1:yyMQrPzF+k88/DbH7o4FMAs80puqd+9osbiBrJrz/w8=
+go.opentelemetry.io/otel/sdk/metric v1.24.0/go.mod h1:I6Y5FjH6rvEnTTAYQz3Mmv2kl6Ek5IIrmwTLqMrrOE0=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
+go.opentelemetry.io/proto/otlp v1.1.0 h1:2Di21piLrCqJ3U3eXGCTPHE9R8Nh+0uglSnOyxikMeI=
+go.opentelemetry.io/proto/otlp v1.1.0/go.mod h1:GpBHCBWiqvVLDqmHZsoMM3C5ySeKTC7ej/RNTae6MdY=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
-go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
-go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -116,16 +121,16 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
-golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
+golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
+golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
-golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
+golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
@@ -138,18 +143,20 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/genproto 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.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
-google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
+google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ=
+google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro=
+google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 h1:Lj5rbfG876hIAYFjqiJnPHfhXbv+nzTWfm04Fg/XSVU=
+google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s=
+google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=
+google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
-google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/exporter/otlphttpexporter/internal/metadata/generated_status.go b/exporter/otlphttpexporter/internal/metadata/generated_status.go
index 8917eb822f7..dcc1443c384 100644
--- a/exporter/otlphttpexporter/internal/metadata/generated_status.go
+++ b/exporter/otlphttpexporter/internal/metadata/generated_status.go
@@ -20,9 +20,9 @@ const (
)
func Meter(settings component.TelemetrySettings) metric.Meter {
- return settings.MeterProvider.Meter("otelcol/otlphttp")
+ return settings.MeterProvider.Meter("go.opentelemetry.io/collector/exporter/otlphttpexporter")
}
func Tracer(settings component.TelemetrySettings) trace.Tracer {
- return settings.TracerProvider.Tracer("otelcol/otlphttp")
+ return settings.TracerProvider.Tracer("go.opentelemetry.io/collector/exporter/otlphttpexporter")
}
diff --git a/exporter/otlphttpexporter/metadata.yaml b/exporter/otlphttpexporter/metadata.yaml
index 14cae78d175..5e1c41d3243 100644
--- a/exporter/otlphttpexporter/metadata.yaml
+++ b/exporter/otlphttpexporter/metadata.yaml
@@ -6,3 +6,8 @@ status:
stable: [traces, metrics]
beta: [logs]
distributions: [core, contrib]
+
+tests:
+ config:
+ endpoint: "https://1.2.3.4:1234"
+
diff --git a/exporter/otlphttpexporter/otlp.go b/exporter/otlphttpexporter/otlp.go
index d2489366afc..8a8d428121b 100644
--- a/exporter/otlphttpexporter/otlp.go
+++ b/exporter/otlphttpexporter/otlp.go
@@ -48,6 +48,7 @@ const (
headerRetryAfter = "Retry-After"
maxHTTPResponseReadBytes = 64 * 1024
+ jsonContentType = "application/json"
protobufContentType = "application/x-protobuf"
)
@@ -87,31 +88,64 @@ func (e *baseExporter) start(_ context.Context, host component.Host) error {
func (e *baseExporter) pushTraces(ctx context.Context, td ptrace.Traces) error {
tr := ptraceotlp.NewExportRequestFromTraces(td)
- request, err := tr.MarshalProto()
+
+ var err error
+ var request []byte
+ switch e.config.Encoding {
+ case EncodingJSON:
+ request, err = tr.MarshalJSON()
+ case EncodingProto:
+ request, err = tr.MarshalProto()
+ default:
+ err = fmt.Errorf("invalid encoding: %s", e.config.Encoding)
+ }
+
if err != nil {
return consumererror.NewPermanent(err)
}
- return e.export(ctx, e.tracesURL, request, tracesPartialSuccessHandler)
+ return e.export(ctx, e.tracesURL, request, e.tracesPartialSuccessHandler)
}
func (e *baseExporter) pushMetrics(ctx context.Context, md pmetric.Metrics) error {
tr := pmetricotlp.NewExportRequestFromMetrics(md)
- request, err := tr.MarshalProto()
+
+ var err error
+ var request []byte
+ switch e.config.Encoding {
+ case EncodingJSON:
+ request, err = tr.MarshalJSON()
+ case EncodingProto:
+ request, err = tr.MarshalProto()
+ default:
+ err = fmt.Errorf("invalid encoding: %s", e.config.Encoding)
+ }
+
if err != nil {
return consumererror.NewPermanent(err)
}
- return e.export(ctx, e.metricsURL, request, metricsPartialSuccessHandler)
+ return e.export(ctx, e.metricsURL, request, e.metricsPartialSuccessHandler)
}
func (e *baseExporter) pushLogs(ctx context.Context, ld plog.Logs) error {
tr := plogotlp.NewExportRequestFromLogs(ld)
- request, err := tr.MarshalProto()
+
+ var err error
+ var request []byte
+ switch e.config.Encoding {
+ case EncodingJSON:
+ request, err = tr.MarshalJSON()
+ case EncodingProto:
+ request, err = tr.MarshalProto()
+ default:
+ err = fmt.Errorf("invalid encoding: %s", e.config.Encoding)
+ }
+
if err != nil {
return consumererror.NewPermanent(err)
}
- return e.export(ctx, e.logsURL, request, logsPartialSuccessHandler)
+ return e.export(ctx, e.logsURL, request, e.logsPartialSuccessHandler)
}
func (e *baseExporter) export(ctx context.Context, url string, request []byte, partialSuccessHandler partialSuccessHandler) error {
@@ -120,7 +154,16 @@ func (e *baseExporter) export(ctx context.Context, url string, request []byte, p
if err != nil {
return consumererror.NewPermanent(err)
}
- req.Header.Set("Content-Type", protobufContentType)
+
+ switch e.config.Encoding {
+ case EncodingJSON:
+ req.Header.Set("Content-Type", jsonContentType)
+ case EncodingProto:
+ req.Header.Set("Content-Type", protobufContentType)
+ default:
+ return fmt.Errorf("invalid encoding: %s", e.config.Encoding)
+ }
+
req.Header.Set("User-Agent", e.userAgent)
resp, err := e.client.Do(req)
@@ -231,7 +274,6 @@ func readResponseStatus(resp *http.Response) *status.Status {
// "Response body for all HTTP 4xx and HTTP 5xx responses MUST be a
// Protobuf-encoded Status message that describes the problem."
respBytes, err := readResponseBody(resp)
-
if err != nil {
return nil
}
@@ -249,7 +291,6 @@ func readResponseStatus(resp *http.Response) *status.Status {
func handlePartialSuccessResponse(resp *http.Response, partialSuccessHandler partialSuccessHandler) error {
bodyBytes, err := readResponseBody(resp)
-
if err != nil {
return err
}
@@ -259,50 +300,92 @@ func handlePartialSuccessResponse(resp *http.Response, partialSuccessHandler par
type partialSuccessHandler func(bytes []byte, contentType string) error
-func tracesPartialSuccessHandler(protoBytes []byte, contentType string) error {
- if contentType != protobufContentType {
+func (e *baseExporter) tracesPartialSuccessHandler(protoBytes []byte, contentType string) error {
+ if protoBytes == nil {
return nil
}
exportResponse := ptraceotlp.NewExportResponse()
- err := exportResponse.UnmarshalProto(protoBytes)
- if err != nil {
- return fmt.Errorf("error parsing protobuf response: %w", err)
+ switch contentType {
+ case protobufContentType:
+ err := exportResponse.UnmarshalProto(protoBytes)
+ if err != nil {
+ return fmt.Errorf("error parsing protobuf response: %w", err)
+ }
+ case jsonContentType:
+ err := exportResponse.UnmarshalJSON(protoBytes)
+ if err != nil {
+ return fmt.Errorf("error parsing json response: %w", err)
+ }
+ default:
+ return nil
}
+
partialSuccess := exportResponse.PartialSuccess()
if !(partialSuccess.ErrorMessage() == "" && partialSuccess.RejectedSpans() == 0) {
- return consumererror.NewPermanent(fmt.Errorf("OTLP partial success: %s (%d rejected)", partialSuccess.ErrorMessage(), partialSuccess.RejectedSpans()))
+ e.logger.Warn("Partial success response",
+ zap.String("message", exportResponse.PartialSuccess().ErrorMessage()),
+ zap.Int64("dropped_spans", exportResponse.PartialSuccess().RejectedSpans()),
+ )
}
return nil
}
-func metricsPartialSuccessHandler(protoBytes []byte, contentType string) error {
- if contentType != protobufContentType {
+func (e *baseExporter) metricsPartialSuccessHandler(protoBytes []byte, contentType string) error {
+ if protoBytes == nil {
return nil
}
exportResponse := pmetricotlp.NewExportResponse()
- err := exportResponse.UnmarshalProto(protoBytes)
- if err != nil {
- return fmt.Errorf("error parsing protobuf response: %w", err)
+ switch contentType {
+ case protobufContentType:
+ err := exportResponse.UnmarshalProto(protoBytes)
+ if err != nil {
+ return fmt.Errorf("error parsing protobuf response: %w", err)
+ }
+ case jsonContentType:
+ err := exportResponse.UnmarshalJSON(protoBytes)
+ if err != nil {
+ return fmt.Errorf("error parsing json response: %w", err)
+ }
+ default:
+ return nil
}
+
partialSuccess := exportResponse.PartialSuccess()
if !(partialSuccess.ErrorMessage() == "" && partialSuccess.RejectedDataPoints() == 0) {
- return consumererror.NewPermanent(fmt.Errorf("OTLP partial success: %s (%d rejected)", partialSuccess.ErrorMessage(), partialSuccess.RejectedDataPoints()))
+ e.logger.Warn("Partial success response",
+ zap.String("message", exportResponse.PartialSuccess().ErrorMessage()),
+ zap.Int64("dropped_data_points", exportResponse.PartialSuccess().RejectedDataPoints()),
+ )
}
return nil
}
-func logsPartialSuccessHandler(protoBytes []byte, contentType string) error {
- if contentType != protobufContentType {
+func (e *baseExporter) logsPartialSuccessHandler(protoBytes []byte, contentType string) error {
+ if protoBytes == nil {
return nil
}
exportResponse := plogotlp.NewExportResponse()
- err := exportResponse.UnmarshalProto(protoBytes)
- if err != nil {
- return fmt.Errorf("error parsing protobuf response: %w", err)
+ switch contentType {
+ case protobufContentType:
+ err := exportResponse.UnmarshalProto(protoBytes)
+ if err != nil {
+ return fmt.Errorf("error parsing protobuf response: %w", err)
+ }
+ case jsonContentType:
+ err := exportResponse.UnmarshalJSON(protoBytes)
+ if err != nil {
+ return fmt.Errorf("error parsing json response: %w", err)
+ }
+ default:
+ return nil
}
+
partialSuccess := exportResponse.PartialSuccess()
if !(partialSuccess.ErrorMessage() == "" && partialSuccess.RejectedLogRecords() == 0) {
- return consumererror.NewPermanent(fmt.Errorf("OTLP partial success: %s (%d rejected)", partialSuccess.ErrorMessage(), partialSuccess.RejectedLogRecords()))
+ e.logger.Warn("Partial success response",
+ zap.String("message", exportResponse.PartialSuccess().ErrorMessage()),
+ zap.Int64("dropped_log_records", exportResponse.PartialSuccess().RejectedLogRecords()),
+ )
}
return nil
}
diff --git a/exporter/otlphttpexporter/otlp_test.go b/exporter/otlphttpexporter/otlp_test.go
index 95ca2ce06af..470a4d872e2 100644
--- a/exporter/otlphttpexporter/otlp_test.go
+++ b/exporter/otlphttpexporter/otlp_test.go
@@ -17,6 +17,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+ "go.uber.org/zap"
+ "go.uber.org/zap/zaptest/observer"
codes "google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
@@ -35,6 +37,41 @@ import (
"go.opentelemetry.io/collector/pdata/ptrace/ptraceotlp"
)
+const tracesTelemetryType = "traces"
+const metricsTelemetryType = "metrics"
+const logsTelemetryType = "logs"
+
+type responseSerializer interface {
+ MarshalJSON() ([]byte, error)
+ MarshalProto() ([]byte, error)
+}
+
+type responseSerializerProvider = func() responseSerializer
+
+func provideTracesResponseSerializer() responseSerializer {
+ response := ptraceotlp.NewExportResponse()
+ partial := response.PartialSuccess()
+ partial.SetErrorMessage("hello")
+ partial.SetRejectedSpans(1)
+ return response
+}
+
+func provideMetricsResponseSerializer() responseSerializer {
+ response := pmetricotlp.NewExportResponse()
+ partial := response.PartialSuccess()
+ partial.SetErrorMessage("hello")
+ partial.SetRejectedDataPoints(1)
+ return response
+}
+
+func provideLogsResponseSerializer() responseSerializer {
+ response := plogotlp.NewExportResponse()
+ partial := response.PartialSuccess()
+ partial.SetErrorMessage("hello")
+ partial.SetRejectedLogRecords(1)
+ return response
+}
+
func TestErrorResponses(t *testing.T) {
errMsgPrefix := func(srv *httptest.Server) string {
return fmt.Sprintf("error exporting items, request to %s/v1/traces responded with HTTP Status Code ", srv.URL)
@@ -161,7 +198,7 @@ func TestErrorResponses(t *testing.T) {
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
- srv := createBackend("/v1/traces", func(writer http.ResponseWriter, request *http.Request) {
+ srv := createBackend("/v1/traces", func(writer http.ResponseWriter, _ *http.Request) {
for k, v := range test.headers {
writer.Header().Add(k, v)
}
@@ -176,6 +213,7 @@ func TestErrorResponses(t *testing.T) {
defer srv.Close()
cfg := &Config{
+ Encoding: EncodingProto,
TracesEndpoint: fmt.Sprintf("%s/v1/traces", srv.URL),
// Create without QueueSettings and RetryConfig so that ConsumeTraces
// returns the errors that we want to check immediately.
@@ -250,6 +288,7 @@ func TestUserAgent(t *testing.T) {
defer srv.Close()
cfg := &Config{
+ Encoding: EncodingProto,
TracesEndpoint: fmt.Sprintf("%s/v1/traces", srv.URL),
ClientConfig: confighttp.ClientConfig{
Headers: test.headers,
@@ -283,6 +322,7 @@ func TestUserAgent(t *testing.T) {
defer srv.Close()
cfg := &Config{
+ Encoding: EncodingProto,
MetricsEndpoint: fmt.Sprintf("%s/v1/metrics", srv.URL),
ClientConfig: confighttp.ClientConfig{
Headers: test.headers,
@@ -316,6 +356,7 @@ func TestUserAgent(t *testing.T) {
defer srv.Close()
cfg := &Config{
+ Encoding: EncodingProto,
LogsEndpoint: fmt.Sprintf("%s/v1/logs", srv.URL),
ClientConfig: confighttp.ClientConfig{
Headers: test.headers,
@@ -343,21 +384,25 @@ func TestUserAgent(t *testing.T) {
}
func TestPartialSuccessInvalidBody(t *testing.T) {
+ cfg := createDefaultConfig()
+ set := exportertest.NewNopCreateSettings()
+ exp, err := newExporter(cfg, set)
+ require.NoError(t, err)
invalidBodyCases := []struct {
telemetryType string
handler partialSuccessHandler
}{
{
telemetryType: "traces",
- handler: tracesPartialSuccessHandler,
+ handler: exp.tracesPartialSuccessHandler,
},
{
telemetryType: "metrics",
- handler: metricsPartialSuccessHandler,
+ handler: exp.metricsPartialSuccessHandler,
},
{
telemetryType: "logs",
- handler: logsPartialSuccessHandler,
+ handler: exp.logsPartialSuccessHandler,
},
}
for _, tt := range invalidBodyCases {
@@ -369,12 +414,13 @@ func TestPartialSuccessInvalidBody(t *testing.T) {
}
func TestPartialSuccessUnsupportedContentType(t *testing.T) {
+ cfg := createDefaultConfig()
+ set := exportertest.NewNopCreateSettings()
+ exp, err := newExporter(cfg, set)
+ require.NoError(t, err)
unsupportedContentTypeCases := []struct {
contentType string
}{
- {
- contentType: "application/json",
- },
{
contentType: "text/plain",
},
@@ -388,11 +434,11 @@ func TestPartialSuccessUnsupportedContentType(t *testing.T) {
var handler func(b []byte, contentType string) error
switch telemetryType {
case "logs":
- handler = logsPartialSuccessHandler
+ handler = exp.logsPartialSuccessHandler
case "metrics":
- handler = metricsPartialSuccessHandler
+ handler = exp.metricsPartialSuccessHandler
case "traces":
- handler = tracesPartialSuccessHandler
+ handler = exp.tracesPartialSuccessHandler
default:
panic(telemetryType)
}
@@ -409,7 +455,7 @@ func TestPartialSuccessUnsupportedContentType(t *testing.T) {
}
func TestPartialSuccess_logs(t *testing.T) {
- srv := createBackend("/v1/logs", func(writer http.ResponseWriter, request *http.Request) {
+ srv := createBackend("/v1/logs", func(writer http.ResponseWriter, _ *http.Request) {
response := plogotlp.NewExportResponse()
partial := response.PartialSuccess()
partial.SetErrorMessage("hello")
@@ -423,10 +469,16 @@ func TestPartialSuccess_logs(t *testing.T) {
defer srv.Close()
cfg := &Config{
+ Encoding: EncodingProto,
LogsEndpoint: fmt.Sprintf("%s/v1/logs", srv.URL),
ClientConfig: confighttp.ClientConfig{},
}
- exp, err := createLogsExporter(context.Background(), exportertest.NewNopCreateSettings(), cfg)
+ set := exportertest.NewNopCreateSettings()
+
+ logger, observed := observer.New(zap.DebugLevel)
+ set.TelemetrySettings.Logger = zap.New(logger)
+
+ exp, err := createLogsExporter(context.Background(), set, cfg)
require.NoError(t, err)
// start the exporter
@@ -439,88 +491,298 @@ func TestPartialSuccess_logs(t *testing.T) {
// generate data
logs := plog.NewLogs()
err = exp.ConsumeLogs(context.Background(), logs)
- require.Error(t, err)
+ require.NoError(t, err)
+ require.Len(t, observed.FilterLevelExact(zap.WarnLevel).All(), 1)
+ require.Contains(t, observed.FilterLevelExact(zap.WarnLevel).All()[0].Message, "Partial success")
}
func TestPartialResponse_missingHeaderButHasBody(t *testing.T) {
- response := ptraceotlp.NewExportResponse()
- partial := response.PartialSuccess()
- partial.SetErrorMessage("hello")
- partial.SetRejectedSpans(1)
- data, err := response.MarshalProto()
+ cfg := createDefaultConfig()
+ set := exportertest.NewNopCreateSettings()
+ exp, err := newExporter(cfg, set)
require.NoError(t, err)
- resp := &http.Response{
- // `-1` indicates a missing Content-Length header in the Go http standard library
- ContentLength: -1,
- Body: io.NopCloser(bytes.NewReader(data)),
- Header: map[string][]string{
- "Content-Type": {"application/x-protobuf"},
+
+ contentTypes := []struct {
+ contentType string
+ }{
+ {contentType: protobufContentType},
+ {contentType: jsonContentType},
+ }
+
+ telemetryTypes := []struct {
+ telemetryType string
+ handler partialSuccessHandler
+ serializer responseSerializerProvider
+ }{
+ {
+ telemetryType: tracesTelemetryType,
+ handler: exp.tracesPartialSuccessHandler,
+ serializer: provideTracesResponseSerializer,
+ },
+ {
+ telemetryType: metricsTelemetryType,
+ handler: exp.metricsPartialSuccessHandler,
+ serializer: provideMetricsResponseSerializer,
+ },
+ {
+ telemetryType: logsTelemetryType,
+ handler: exp.logsPartialSuccessHandler,
+ serializer: provideLogsResponseSerializer,
},
}
- err = handlePartialSuccessResponse(resp, tracesPartialSuccessHandler)
- assert.True(t, consumererror.IsPermanent(err))
+
+ for _, ct := range contentTypes {
+ for _, tt := range telemetryTypes {
+ t.Run(tt.telemetryType+" "+ct.contentType, func(t *testing.T) {
+ serializer := tt.serializer()
+
+ var data []byte
+ var err error
+
+ switch ct.contentType {
+ case jsonContentType:
+ data, err = serializer.MarshalJSON()
+ case protobufContentType:
+ data, err = serializer.MarshalProto()
+ default:
+ require.Fail(t, "unsupported content type: %s", ct.contentType)
+ }
+ require.NoError(t, err)
+
+ resp := &http.Response{
+ // `-1` indicates a missing Content-Length header in the Go http standard library
+ ContentLength: -1,
+ Body: io.NopCloser(bytes.NewReader(data)),
+ Header: map[string][]string{
+ "Content-Type": {ct.contentType},
+ },
+ }
+ err = handlePartialSuccessResponse(resp, tt.handler)
+ assert.NoError(t, err)
+ })
+ }
+ }
}
func TestPartialResponse_missingHeaderAndBody(t *testing.T) {
- resp := &http.Response{
- // `-1` indicates a missing Content-Length header in the Go http standard library
- ContentLength: -1,
- Body: io.NopCloser(bytes.NewReader([]byte{})),
- Header: map[string][]string{
- "Content-Type": {"application/x-protobuf"},
+ cfg := createDefaultConfig()
+ set := exportertest.NewNopCreateSettings()
+ exp, err := newExporter(cfg, set)
+ require.NoError(t, err)
+
+ contentTypes := []struct {
+ contentType string
+ }{
+ {contentType: protobufContentType},
+ {contentType: jsonContentType},
+ }
+
+ telemetryTypes := []struct {
+ telemetryType string
+ handler partialSuccessHandler
+ }{
+ {
+ telemetryType: tracesTelemetryType,
+ handler: exp.tracesPartialSuccessHandler,
+ },
+ {
+ telemetryType: metricsTelemetryType,
+ handler: exp.metricsPartialSuccessHandler,
+ },
+ {
+ telemetryType: logsTelemetryType,
+ handler: exp.logsPartialSuccessHandler,
},
}
- err := handlePartialSuccessResponse(resp, tracesPartialSuccessHandler)
- assert.Nil(t, err)
+
+ for _, ct := range contentTypes {
+ for _, tt := range telemetryTypes {
+ t.Run(tt.telemetryType+" "+ct.contentType, func(t *testing.T) {
+ resp := &http.Response{
+ // `-1` indicates a missing Content-Length header in the Go http standard library
+ ContentLength: -1,
+ Body: io.NopCloser(bytes.NewReader([]byte{})),
+ Header: map[string][]string{
+ "Content-Type": {ct.contentType},
+ },
+ }
+ err = handlePartialSuccessResponse(resp, tt.handler)
+ assert.Nil(t, err)
+ })
+ }
+ }
}
func TestPartialResponse_nonErrUnexpectedEOFError(t *testing.T) {
+ cfg := createDefaultConfig()
+ set := exportertest.NewNopCreateSettings()
+ exp, err := newExporter(cfg, set)
+ require.NoError(t, err)
+
resp := &http.Response{
// `-1` indicates a missing Content-Length header in the Go http standard library
ContentLength: -1,
Body: io.NopCloser(badReader{}),
}
- err := handlePartialSuccessResponse(resp, tracesPartialSuccessHandler)
+ err = handlePartialSuccessResponse(resp, exp.tracesPartialSuccessHandler)
assert.Error(t, err)
}
func TestPartialSuccess_shortContentLengthHeader(t *testing.T) {
- response := ptraceotlp.NewExportResponse()
- partial := response.PartialSuccess()
- partial.SetErrorMessage("hello")
- partial.SetRejectedSpans(1)
- data, err := response.MarshalProto()
+ cfg := createDefaultConfig()
+ set := exportertest.NewNopCreateSettings()
+ exp, err := newExporter(cfg, set)
require.NoError(t, err)
- resp := &http.Response{
- ContentLength: 3,
- Body: io.NopCloser(bytes.NewReader(data)),
- Header: map[string][]string{
- "Content-Type": {"application/x-protobuf"},
+
+ contentTypes := []struct {
+ contentType string
+ }{
+ {contentType: protobufContentType},
+ {contentType: jsonContentType},
+ }
+
+ telemetryTypes := []struct {
+ telemetryType string
+ handler partialSuccessHandler
+ serializer responseSerializerProvider
+ }{
+ {
+ telemetryType: tracesTelemetryType,
+ handler: exp.tracesPartialSuccessHandler,
+ serializer: provideTracesResponseSerializer,
+ },
+ {
+ telemetryType: metricsTelemetryType,
+ handler: exp.metricsPartialSuccessHandler,
+ serializer: provideMetricsResponseSerializer,
+ },
+ {
+ telemetryType: logsTelemetryType,
+ handler: exp.logsPartialSuccessHandler,
+ serializer: provideLogsResponseSerializer,
},
}
- err = handlePartialSuccessResponse(resp, tracesPartialSuccessHandler)
- assert.Error(t, err)
+
+ for _, ct := range contentTypes {
+ for _, tt := range telemetryTypes {
+ t.Run(tt.telemetryType+" "+ct.contentType, func(t *testing.T) {
+ serializer := tt.serializer()
+
+ var data []byte
+ var err error
+
+ switch ct.contentType {
+ case jsonContentType:
+ data, err = serializer.MarshalJSON()
+ case protobufContentType:
+ data, err = serializer.MarshalProto()
+ default:
+ require.Fail(t, "unsupported content type: %s", ct.contentType)
+ }
+ require.NoError(t, err)
+
+ resp := &http.Response{
+ ContentLength: 3,
+ Body: io.NopCloser(bytes.NewReader(data)),
+ Header: map[string][]string{
+ "Content-Type": {ct.contentType},
+ },
+ }
+ // For short content-length, a real error happens.
+ err = handlePartialSuccessResponse(resp, tt.handler)
+ assert.Error(t, err)
+ })
+ }
+ }
}
func TestPartialSuccess_longContentLengthHeader(t *testing.T) {
- response := ptraceotlp.NewExportResponse()
- partial := response.PartialSuccess()
- partial.SetErrorMessage("hello")
- partial.SetRejectedSpans(1)
- data, err := response.MarshalProto()
- require.NoError(t, err)
- resp := &http.Response{
- ContentLength: 4096,
- Body: io.NopCloser(bytes.NewReader(data)),
- Header: map[string][]string{
- "Content-Type": {"application/x-protobuf"},
+ contentTypes := []struct {
+ contentType string
+ }{
+ {contentType: protobufContentType},
+ {contentType: jsonContentType},
+ }
+
+ telemetryTypes := []struct {
+ telemetryType string
+ serializer responseSerializerProvider
+ }{
+ {
+ telemetryType: tracesTelemetryType,
+ serializer: provideTracesResponseSerializer,
+ },
+ {
+ telemetryType: metricsTelemetryType,
+ serializer: provideMetricsResponseSerializer,
+ },
+ {
+ telemetryType: logsTelemetryType,
+ serializer: provideLogsResponseSerializer,
},
}
- err = handlePartialSuccessResponse(resp, tracesPartialSuccessHandler)
- assert.Error(t, err)
+
+ for _, ct := range contentTypes {
+ for _, tt := range telemetryTypes {
+ t.Run(tt.telemetryType+" "+ct.contentType, func(t *testing.T) {
+ cfg := createDefaultConfig()
+ set := exportertest.NewNopCreateSettings()
+ logger, observed := observer.New(zap.DebugLevel)
+ set.TelemetrySettings.Logger = zap.New(logger)
+ exp, err := newExporter(cfg, set)
+ require.NoError(t, err)
+
+ serializer := tt.serializer()
+
+ var handler partialSuccessHandler
+
+ switch tt.telemetryType {
+ case tracesTelemetryType:
+ handler = exp.tracesPartialSuccessHandler
+ case metricsTelemetryType:
+ handler = exp.metricsPartialSuccessHandler
+ case logsTelemetryType:
+ handler = exp.logsPartialSuccessHandler
+ default:
+ require.Fail(t, "unsupported telemetry type: %s", ct.contentType)
+ }
+
+ var data []byte
+
+ switch ct.contentType {
+ case jsonContentType:
+ data, err = serializer.MarshalJSON()
+ case protobufContentType:
+ data, err = serializer.MarshalProto()
+ default:
+ require.Fail(t, "unsupported content type: %s", ct.contentType)
+ }
+ require.NoError(t, err)
+
+ resp := &http.Response{
+ ContentLength: 4096,
+ Body: io.NopCloser(bytes.NewReader(data)),
+ Header: map[string][]string{
+ "Content-Type": {ct.contentType},
+ },
+ }
+ // No real error happens for long content length, so the partial
+ // success is handled as success with a warning.
+ err = handlePartialSuccessResponse(resp, handler)
+ assert.NoError(t, err)
+ assert.Len(t, observed.FilterLevelExact(zap.WarnLevel).All(), 1)
+ assert.Contains(t, observed.FilterLevelExact(zap.WarnLevel).All()[0].Message, "Partial success")
+ })
+ }
+ }
}
func TestPartialSuccessInvalidResponseBody(t *testing.T) {
+ cfg := createDefaultConfig()
+ set := exportertest.NewNopCreateSettings()
+ exp, err := newExporter(cfg, set)
+ require.NoError(t, err)
+
resp := &http.Response{
Body: io.NopCloser(badReader{}),
ContentLength: 100,
@@ -528,12 +790,12 @@ func TestPartialSuccessInvalidResponseBody(t *testing.T) {
"Content-Type": {protobufContentType},
},
}
- err := handlePartialSuccessResponse(resp, tracesPartialSuccessHandler)
+ err = handlePartialSuccessResponse(resp, exp.tracesPartialSuccessHandler)
assert.Error(t, err)
}
func TestPartialSuccess_traces(t *testing.T) {
- srv := createBackend("/v1/traces", func(writer http.ResponseWriter, request *http.Request) {
+ srv := createBackend("/v1/traces", func(writer http.ResponseWriter, _ *http.Request) {
response := ptraceotlp.NewExportResponse()
partial := response.PartialSuccess()
partial.SetErrorMessage("hello")
@@ -547,10 +809,14 @@ func TestPartialSuccess_traces(t *testing.T) {
defer srv.Close()
cfg := &Config{
+ Encoding: EncodingProto,
TracesEndpoint: fmt.Sprintf("%s/v1/traces", srv.URL),
ClientConfig: confighttp.ClientConfig{},
}
- exp, err := createTracesExporter(context.Background(), exportertest.NewNopCreateSettings(), cfg)
+ set := exportertest.NewNopCreateSettings()
+ logger, observed := observer.New(zap.DebugLevel)
+ set.TelemetrySettings.Logger = zap.New(logger)
+ exp, err := createTracesExporter(context.Background(), set, cfg)
require.NoError(t, err)
// start the exporter
@@ -563,11 +829,13 @@ func TestPartialSuccess_traces(t *testing.T) {
// generate data
traces := ptrace.NewTraces()
err = exp.ConsumeTraces(context.Background(), traces)
- require.Error(t, err)
+ require.NoError(t, err)
+ require.Len(t, observed.FilterLevelExact(zap.WarnLevel).All(), 1)
+ require.Contains(t, observed.FilterLevelExact(zap.WarnLevel).All()[0].Message, "Partial success")
}
func TestPartialSuccess_metrics(t *testing.T) {
- srv := createBackend("/v1/metrics", func(writer http.ResponseWriter, request *http.Request) {
+ srv := createBackend("/v1/metrics", func(writer http.ResponseWriter, _ *http.Request) {
response := pmetricotlp.NewExportResponse()
partial := response.PartialSuccess()
partial.SetErrorMessage("hello")
@@ -581,10 +849,14 @@ func TestPartialSuccess_metrics(t *testing.T) {
defer srv.Close()
cfg := &Config{
+ Encoding: EncodingProto,
MetricsEndpoint: fmt.Sprintf("%s/v1/metrics", srv.URL),
ClientConfig: confighttp.ClientConfig{},
}
- exp, err := createMetricsExporter(context.Background(), exportertest.NewNopCreateSettings(), cfg)
+ set := exportertest.NewNopCreateSettings()
+ logger, observed := observer.New(zap.DebugLevel)
+ set.TelemetrySettings.Logger = zap.New(logger)
+ exp, err := createMetricsExporter(context.Background(), set, cfg)
require.NoError(t, err)
// start the exporter
@@ -597,7 +869,127 @@ func TestPartialSuccess_metrics(t *testing.T) {
// generate data
metrics := pmetric.NewMetrics()
err = exp.ConsumeMetrics(context.Background(), metrics)
- require.Error(t, err)
+ require.NoError(t, err)
+ require.Len(t, observed.FilterLevelExact(zap.WarnLevel).All(), 1)
+ require.Contains(t, observed.FilterLevelExact(zap.WarnLevel).All()[0].Message, "Partial success")
+}
+
+func TestEncoding(t *testing.T) {
+ set := exportertest.NewNopCreateSettings()
+ set.BuildInfo.Description = "Collector"
+ set.BuildInfo.Version = "1.2.3test"
+
+ tests := []struct {
+ name string
+ encoding EncodingType
+ expectedEncoding EncodingType
+ }{
+ {
+ name: "proto_encoding",
+ encoding: EncodingProto,
+ expectedEncoding: "application/x-protobuf",
+ },
+ {
+ name: "json_encoding",
+ encoding: EncodingJSON,
+ expectedEncoding: "application/json",
+ },
+ }
+
+ t.Run("traces", func(t *testing.T) {
+ for _, test := range tests {
+ t.Run(test.name, func(t *testing.T) {
+ srv := createBackend("/v1/traces", func(writer http.ResponseWriter, request *http.Request) {
+ assert.Contains(t, request.Header.Get("content-type"), test.expectedEncoding)
+ writer.WriteHeader(200)
+ })
+ defer srv.Close()
+
+ cfg := &Config{
+ TracesEndpoint: fmt.Sprintf("%s/v1/traces", srv.URL),
+ Encoding: test.encoding,
+ }
+ exp, err := createTracesExporter(context.Background(), set, cfg)
+ require.NoError(t, err)
+
+ // start the exporter
+ err = exp.Start(context.Background(), componenttest.NewNopHost())
+ require.NoError(t, err)
+ t.Cleanup(func() {
+ require.NoError(t, exp.Shutdown(context.Background()))
+ })
+
+ // generate data
+ traces := ptrace.NewTraces()
+ err = exp.ConsumeTraces(context.Background(), traces)
+ require.NoError(t, err)
+ })
+ }
+ })
+
+ t.Run("metrics", func(t *testing.T) {
+ for _, test := range tests {
+ t.Run(test.name, func(t *testing.T) {
+ srv := createBackend("/v1/metrics", func(writer http.ResponseWriter, request *http.Request) {
+ assert.Contains(t, request.Header.Get("content-type"), test.expectedEncoding)
+ writer.WriteHeader(200)
+ })
+ defer srv.Close()
+
+ cfg := &Config{
+ MetricsEndpoint: fmt.Sprintf("%s/v1/metrics", srv.URL),
+ Encoding: test.encoding,
+ }
+ exp, err := createMetricsExporter(context.Background(), set, cfg)
+ require.NoError(t, err)
+
+ // start the exporter
+ err = exp.Start(context.Background(), componenttest.NewNopHost())
+ require.NoError(t, err)
+ t.Cleanup(func() {
+ require.NoError(t, exp.Shutdown(context.Background()))
+ })
+
+ // generate data
+ metrics := pmetric.NewMetrics()
+ err = exp.ConsumeMetrics(context.Background(), metrics)
+ require.NoError(t, err)
+ })
+ }
+ })
+
+ t.Run("logs", func(t *testing.T) {
+ for _, test := range tests {
+ t.Run(test.name, func(t *testing.T) {
+ srv := createBackend("/v1/logs", func(writer http.ResponseWriter, request *http.Request) {
+ assert.Contains(t, request.Header.Get("content-type"), test.expectedEncoding)
+ writer.WriteHeader(200)
+ })
+ defer srv.Close()
+
+ cfg := &Config{
+ LogsEndpoint: fmt.Sprintf("%s/v1/logs", srv.URL),
+ Encoding: test.encoding,
+ }
+ exp, err := createLogsExporter(context.Background(), set, cfg)
+ require.NoError(t, err)
+
+ // start the exporter
+ err = exp.Start(context.Background(), componenttest.NewNopHost())
+ require.NoError(t, err)
+ t.Cleanup(func() {
+ require.NoError(t, exp.Shutdown(context.Background()))
+ })
+
+ // generate data
+ logs := plog.NewLogs()
+ err = exp.ConsumeLogs(context.Background(), logs)
+ require.NoError(t, err)
+
+ srv.Close()
+ })
+ }
+ })
}
func createBackend(endpoint string, handler func(writer http.ResponseWriter, request *http.Request)) *httptest.Server {
diff --git a/exporter/otlphttpexporter/testdata/bad_invalid_encoding.yaml b/exporter/otlphttpexporter/testdata/bad_invalid_encoding.yaml
new file mode 100644
index 00000000000..593aee269a5
--- /dev/null
+++ b/exporter/otlphttpexporter/testdata/bad_invalid_encoding.yaml
@@ -0,0 +1 @@
+encoding: invalid
diff --git a/extension/auth/authtest/mock_clientauth.go b/extension/auth/authtest/mock_clientauth.go
index b9c6b80e8b0..d28546fc4a0 100644
--- a/extension/auth/authtest/mock_clientauth.go
+++ b/extension/auth/authtest/mock_clientauth.go
@@ -27,18 +27,18 @@ type MockClient struct {
}
// Start for the MockClient does nothing
-func (m *MockClient) Start(_ context.Context, _ component.Host) error {
+func (m *MockClient) Start(context.Context, component.Host) error {
return nil
}
// Shutdown for the MockClient does nothing
-func (m *MockClient) Shutdown(_ context.Context) error {
+func (m *MockClient) Shutdown(context.Context) error {
return nil
}
// RoundTripper for the MockClient either returns error if the mock authenticator is forced to or
// returns the supplied resultRoundTripper.
-func (m *MockClient) RoundTripper(_ http.RoundTripper) (http.RoundTripper, error) {
+func (m *MockClient) RoundTripper(http.RoundTripper) (http.RoundTripper, error) {
if m.MustError {
return nil, errMockError
}
diff --git a/extension/auth/authtest/mock_clientauth_test.go b/extension/auth/authtest/mock_clientauth_test.go
index 5b0bd18d6b5..873d62e8384 100644
--- a/extension/auth/authtest/mock_clientauth_test.go
+++ b/extension/auth/authtest/mock_clientauth_test.go
@@ -28,7 +28,7 @@ func TestNilStartAndShutdown(t *testing.T) {
type customRoundTripper struct{}
-func (c *customRoundTripper) RoundTrip(_ *http.Request) (*http.Response, error) {
+func (c *customRoundTripper) RoundTrip(*http.Request) (*http.Response, error) {
return nil, nil
}
diff --git a/extension/auth/client.go b/extension/auth/client.go
index cf1bdb55fb8..d1855d8aece 100644
--- a/extension/auth/client.go
+++ b/extension/auth/client.go
@@ -25,7 +25,7 @@ type Client interface {
PerRPCCredentials() (credentials.PerRPCCredentials, error)
}
-// ClientOption represents the possible options for NewServerAuthenticator.
+// ClientOption represents the possible options for NewClient.
type ClientOption func(*defaultClient)
// ClientRoundTripperFunc specifies the function that returns a RoundTripper that can be used to authenticate HTTP requests.
diff --git a/extension/auth/client_test.go b/extension/auth/client_test.go
index ea643b2cc14..c3666c229b0 100644
--- a/extension/auth/client_test.go
+++ b/extension/auth/client_test.go
@@ -45,7 +45,7 @@ func TestClientDefaultValues(t *testing.T) {
func TestWithClientStart(t *testing.T) {
called := false
- e := NewClient(WithClientStart(func(c context.Context, h component.Host) error {
+ e := NewClient(WithClientStart(func(context.Context, component.Host) error {
called = true
return nil
}))
@@ -60,7 +60,7 @@ func TestWithClientStart(t *testing.T) {
func TestWithClientShutdown(t *testing.T) {
called := false
- e := NewClient(WithClientShutdown(func(c context.Context) error {
+ e := NewClient(WithClientShutdown(func(context.Context) error {
called = true
return nil
}))
diff --git a/extension/auth/go.mod b/extension/auth/go.mod
index 0a3ddd3c889..70e550636ab 100644
--- a/extension/auth/go.mod
+++ b/extension/auth/go.mod
@@ -1,13 +1,13 @@
module go.opentelemetry.io/collector/extension/auth
-go 1.20
+go 1.21
require (
- github.com/stretchr/testify v1.8.4
- go.opentelemetry.io/collector/component v0.93.0
- go.opentelemetry.io/collector/extension v0.93.0
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector/component v0.97.0
+ go.opentelemetry.io/collector/extension v0.97.0
go.uber.org/goleak v1.3.0
- google.golang.org/grpc v1.61.0
+ google.golang.org/grpc v1.62.1
)
require (
@@ -16,35 +16,35 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
+ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
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/knadh/koanf/v2 v2.1.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
- github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
- github.com/prometheus/client_golang v1.18.0 // indirect
- github.com/prometheus/client_model v0.5.0 // indirect
- github.com/prometheus/common v0.46.0 // indirect
+ github.com/prometheus/client_golang v1.19.0 // indirect
+ github.com/prometheus/client_model v0.6.0 // indirect
+ github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
- go.opentelemetry.io/collector/config/configtelemetry v0.93.0 // indirect
- go.opentelemetry.io/collector/confmap v0.93.0 // indirect
- go.opentelemetry.io/collector/pdata v1.0.1 // indirect
- go.opentelemetry.io/otel v1.22.0 // indirect
- go.opentelemetry.io/otel/exporters/prometheus v0.45.0 // indirect
- go.opentelemetry.io/otel/metric v1.22.0 // indirect
- go.opentelemetry.io/otel/sdk v1.22.0 // indirect
- go.opentelemetry.io/otel/sdk/metric v1.22.0 // indirect
- go.opentelemetry.io/otel/trace v1.22.0 // indirect
+ go.opentelemetry.io/collector/config/configtelemetry v0.97.0 // indirect
+ go.opentelemetry.io/collector/confmap v0.97.0 // indirect
+ go.opentelemetry.io/collector/pdata v1.4.0 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/exporters/prometheus v0.46.0 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
- go.uber.org/zap v1.26.0 // indirect
- golang.org/x/net v0.20.0 // indirect
- golang.org/x/sys v0.16.0 // indirect
+ go.uber.org/zap v1.27.0 // indirect
+ golang.org/x/net v0.23.0 // indirect
+ golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
- google.golang.org/protobuf v1.32.0 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
+ google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/extension/auth/go.sum b/extension/auth/go.sum
index 86549631f90..05709b8b26f 100644
--- a/extension/auth/go.sum
+++ b/extension/auth/go.sum
@@ -9,6 +9,8 @@ github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
@@ -16,55 +18,57 @@ 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.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/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/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=
-github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA=
-github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
-github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
-github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y=
-github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ=
+github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU=
+github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k=
+github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=
+github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8=
+github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=
+github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/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/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y=
-go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0 h1:BeIK2KGho0oCWa7LxEGSqfDZbs7Fpv/Viz+FS4P8CXE=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0/go.mod h1:UVJZPLnfDSvHj+eJuZE+E1GjIBD267mEMfAAHJdghWg=
-go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg=
-go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY=
-go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw=
-go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc=
-go.opentelemetry.io/otel/sdk/metric v1.22.0 h1:ARrRetm1HCVxq0cbnaZQlfwODYJHo3gFL8Z3tSmHBcI=
-go.opentelemetry.io/otel/sdk/metric v1.22.0/go.mod h1:KjQGeMIDlBNEOo6HvjhxIec1p/69/kULDcp4gr0oLQQ=
-go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0=
-go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0 h1:I8WIFXR351FoLJYuloU4EgXbtNX2URfU/85pUPheIEQ=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0/go.mod h1:ztwVUHe5DTR/1v7PeuGRnU5Bbd4QKYwApWmuutKsJSs=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/sdk/metric v1.24.0 h1:yyMQrPzF+k88/DbH7o4FMAs80puqd+9osbiBrJrz/w8=
+go.opentelemetry.io/otel/sdk/metric v1.24.0/go.mod h1:I6Y5FjH6rvEnTTAYQz3Mmv2kl6Ek5IIrmwTLqMrrOE0=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
-go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
-go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -74,16 +78,16 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
-golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
+golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
+golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
-golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
+golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
@@ -96,15 +100,16 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA=
-google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
-google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s=
+google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=
+google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
-google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/extension/auth/server_test.go b/extension/auth/server_test.go
index c99ee6042d1..9e1f7a5b973 100644
--- a/extension/auth/server_test.go
+++ b/extension/auth/server_test.go
@@ -39,7 +39,7 @@ func TestWithServerAuthenticateFunc(t *testing.T) {
// prepare
authCalled := false
e := NewServer(
- WithServerAuthenticate(func(ctx context.Context, headers map[string][]string) (context.Context, error) {
+ WithServerAuthenticate(func(ctx context.Context, _ map[string][]string) (context.Context, error) {
authCalled = true
return ctx, nil
}),
@@ -55,7 +55,7 @@ func TestWithServerAuthenticateFunc(t *testing.T) {
func TestWithServerStart(t *testing.T) {
called := false
- e := NewServer(WithServerStart(func(c context.Context, h component.Host) error {
+ e := NewServer(WithServerStart(func(context.Context, component.Host) error {
called = true
return nil
}))
@@ -70,7 +70,7 @@ func TestWithServerStart(t *testing.T) {
func TestWithServerShutdown(t *testing.T) {
called := false
- e := NewServer(WithServerShutdown(func(c context.Context) error {
+ e := NewServer(WithServerShutdown(func(context.Context) error {
called = true
return nil
}))
diff --git a/extension/ballastextension/generated_component_test.go b/extension/ballastextension/generated_component_test.go
new file mode 100644
index 00000000000..f43cef29af4
--- /dev/null
+++ b/extension/ballastextension/generated_component_test.go
@@ -0,0 +1,43 @@
+// Code generated by mdatagen. DO NOT EDIT.
+
+package ballastextension
+
+import (
+ "context"
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ "go.opentelemetry.io/collector/component"
+ "go.opentelemetry.io/collector/component/componenttest"
+ "go.opentelemetry.io/collector/confmap/confmaptest"
+ "go.opentelemetry.io/collector/extension/extensiontest"
+)
+
+func TestComponentLifecycle(t *testing.T) {
+ factory := NewFactory()
+
+ cm, err := confmaptest.LoadConf("metadata.yaml")
+ require.NoError(t, err)
+ cfg := factory.CreateDefaultConfig()
+ sub, err := cm.Sub("tests::config")
+ require.NoError(t, err)
+ require.NoError(t, component.UnmarshalConfig(sub, cfg))
+ t.Run("shutdown", func(t *testing.T) {
+ e, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg)
+ require.NoError(t, err)
+ err = e.Shutdown(context.Background())
+ require.NoError(t, err)
+ })
+ t.Run("lifecycle", func(t *testing.T) {
+ firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg)
+ require.NoError(t, err)
+ require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost()))
+ require.NoError(t, firstExt.Shutdown(context.Background()))
+
+ secondExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg)
+ require.NoError(t, err)
+ require.NoError(t, secondExt.Start(context.Background(), componenttest.NewNopHost()))
+ require.NoError(t, secondExt.Shutdown(context.Background()))
+ })
+}
diff --git a/extension/ballastextension/go.mod b/extension/ballastextension/go.mod
index 39f5aa3d982..e384177a69e 100644
--- a/extension/ballastextension/go.mod
+++ b/extension/ballastextension/go.mod
@@ -1,18 +1,18 @@
// Deprecated: Use the GOMEMLIMIT environment variable instead.
module go.opentelemetry.io/collector/extension/ballastextension
-go 1.20
+go 1.21
require (
- github.com/stretchr/testify v1.8.4
- go.opentelemetry.io/collector v0.93.0
- go.opentelemetry.io/collector/component v0.93.0
- go.opentelemetry.io/collector/confmap v0.93.0
- go.opentelemetry.io/collector/extension v0.93.0
- go.opentelemetry.io/otel/metric v1.22.0
- go.opentelemetry.io/otel/trace v1.22.0
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector v0.97.0
+ go.opentelemetry.io/collector/component v0.97.0
+ go.opentelemetry.io/collector/confmap v0.97.0
+ go.opentelemetry.io/collector/extension v0.97.0
+ go.opentelemetry.io/otel/metric v1.24.0
+ go.opentelemetry.io/otel/trace v1.24.0
go.uber.org/goleak v1.3.0
- go.uber.org/zap v1.26.0
+ go.uber.org/zap v1.27.0
)
require (
@@ -22,38 +22,39 @@ require (
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
+ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
+ github.com/google/uuid v1.6.0 // indirect
github.com/knadh/koanf/maps v0.1.1 // indirect
github.com/knadh/koanf/providers/confmap v0.1.0 // indirect
- github.com/knadh/koanf/v2 v2.0.1 // indirect
+ github.com/knadh/koanf/v2 v2.1.0 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
- github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
- github.com/prometheus/client_golang v1.18.0 // indirect
- github.com/prometheus/client_model v0.5.0 // indirect
- github.com/prometheus/common v0.46.0 // indirect
+ github.com/prometheus/client_golang v1.19.0 // indirect
+ github.com/prometheus/client_model v0.6.0 // indirect
+ github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
- github.com/shirou/gopsutil/v3 v3.23.12 // indirect
+ github.com/shirou/gopsutil/v3 v3.24.3 // 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/config/configtelemetry v0.93.0 // indirect
- go.opentelemetry.io/collector/pdata v1.0.1 // indirect
- go.opentelemetry.io/otel v1.22.0 // indirect
- go.opentelemetry.io/otel/exporters/prometheus v0.45.0 // indirect
- go.opentelemetry.io/otel/sdk v1.22.0 // indirect
- go.opentelemetry.io/otel/sdk/metric v1.22.0 // indirect
+ github.com/yusufpapurcu/wmi v1.2.4 // indirect
+ go.opentelemetry.io/collector/config/configtelemetry v0.97.0 // indirect
+ go.opentelemetry.io/collector/pdata v1.4.0 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/exporters/prometheus v0.46.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk/metric v1.24.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
- golang.org/x/net v0.20.0 // indirect
- golang.org/x/sys v0.16.0 // indirect
+ golang.org/x/net v0.23.0 // indirect
+ golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
- google.golang.org/grpc v1.61.0 // indirect
- google.golang.org/protobuf v1.32.0 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
+ google.golang.org/grpc v1.62.1 // indirect
+ google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/extension/ballastextension/go.sum b/extension/ballastextension/go.sum
index e698a4b84c2..4e005e6f0a7 100644
--- a/extension/ballastextension/go.sum
+++ b/extension/ballastextension/go.sum
@@ -12,6 +12,8 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
@@ -22,74 +24,79 @@ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
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/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
+github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/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/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4=
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw=
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
-github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=
-github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA=
-github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
-github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
-github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y=
-github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ=
+github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU=
+github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k=
+github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=
+github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8=
+github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=
+github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
-github.com/shirou/gopsutil/v3 v3.23.12 h1:z90NtUkp3bMtmICZKpC4+WaknU1eXtp5vtbQ11DgpE4=
-github.com/shirou/gopsutil/v3 v3.23.12/go.mod h1:1FrWgea594Jp7qmjHUUPlJDTPgcsb9mGnXDxavtikzM=
+github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
+github.com/shirou/gopsutil/v3 v3.24.3 h1:eoUGJSmdfLzJ3mxIhmOAhgKEKgQkeOwKpz1NbhVnuPE=
+github.com/shirou/gopsutil/v3 v3.24.3/go.mod h1:JpND7O217xa72ewWz9zN2eIIkPWsDN/3pl0H8Qt0uwg=
github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ=
github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
+github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
-github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU=
github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI=
github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk=
github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw=
-github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
-go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y=
-go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0 h1:BeIK2KGho0oCWa7LxEGSqfDZbs7Fpv/Viz+FS4P8CXE=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0/go.mod h1:UVJZPLnfDSvHj+eJuZE+E1GjIBD267mEMfAAHJdghWg=
-go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg=
-go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY=
-go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw=
-go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc=
-go.opentelemetry.io/otel/sdk/metric v1.22.0 h1:ARrRetm1HCVxq0cbnaZQlfwODYJHo3gFL8Z3tSmHBcI=
-go.opentelemetry.io/otel/sdk/metric v1.22.0/go.mod h1:KjQGeMIDlBNEOo6HvjhxIec1p/69/kULDcp4gr0oLQQ=
-go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0=
-go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo=
+github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
+github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0 h1:I8WIFXR351FoLJYuloU4EgXbtNX2URfU/85pUPheIEQ=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0/go.mod h1:ztwVUHe5DTR/1v7PeuGRnU5Bbd4QKYwApWmuutKsJSs=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/sdk/metric v1.24.0 h1:yyMQrPzF+k88/DbH7o4FMAs80puqd+9osbiBrJrz/w8=
+go.opentelemetry.io/otel/sdk/metric v1.24.0/go.mod h1:I6Y5FjH6rvEnTTAYQz3Mmv2kl6Ek5IIrmwTLqMrrOE0=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
-go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
-go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -99,8 +106,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
-golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
+golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
+golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
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=
@@ -111,9 +118,8 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
-golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
+golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
@@ -126,16 +132,17 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA=
-google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
-google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s=
+google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=
+google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
-google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/extension/ballastextension/internal/metadata/generated_status.go b/extension/ballastextension/internal/metadata/generated_status.go
index 02205c5623e..d431f8bfba6 100644
--- a/extension/ballastextension/internal/metadata/generated_status.go
+++ b/extension/ballastextension/internal/metadata/generated_status.go
@@ -18,9 +18,9 @@ const (
)
func Meter(settings component.TelemetrySettings) metric.Meter {
- return settings.MeterProvider.Meter("otelcol/ballast")
+ return settings.MeterProvider.Meter("go.opentelemetry.io/collector/extension/ballastextension")
}
func Tracer(settings component.TelemetrySettings) trace.Tracer {
- return settings.TracerProvider.Tracer("otelcol/ballast")
+ return settings.TracerProvider.Tracer("go.opentelemetry.io/collector/extension/ballastextension")
}
diff --git a/extension/ballastextension/memory_ballast.go b/extension/ballastextension/memory_ballast.go
index ba1b1749b6e..afbf6ec6d7d 100644
--- a/extension/ballastextension/memory_ballast.go
+++ b/extension/ballastextension/memory_ballast.go
@@ -21,7 +21,7 @@ type memoryBallast struct {
getTotalMem func() (uint64, error)
}
-func (m *memoryBallast) Start(_ context.Context, _ component.Host) error {
+func (m *memoryBallast) Start(context.Context, component.Host) error {
// absolute value supersedes percentage setting
if m.cfg.SizeMiB > 0 {
m.ballastSizeBytes = m.cfg.SizeMiB * megaBytes
@@ -43,7 +43,7 @@ func (m *memoryBallast) Start(_ context.Context, _ component.Host) error {
return nil
}
-func (m *memoryBallast) Shutdown(_ context.Context) error {
+func (m *memoryBallast) Shutdown(context.Context) error {
m.ballast = nil
return nil
}
diff --git a/extension/extension_test.go b/extension/extension_test.go
index af75db9feea..d3dbf80c8c3 100644
--- a/extension/extension_test.go
+++ b/extension/extension_test.go
@@ -28,7 +28,7 @@ func TestNewFactory(t *testing.T) {
factory := NewFactory(
testType,
func() component.Config { return &defaultCfg },
- func(ctx context.Context, settings CreateSettings, extension component.Config) (Extension, error) {
+ func(context.Context, CreateSettings, component.Config) (Extension, error) {
return nopExtensionInstance, nil
},
component.StabilityLevelDevelopment)
@@ -88,7 +88,7 @@ func TestBuilder(t *testing.T) {
NewFactory(
testType,
func() component.Config { return &defaultCfg },
- func(ctx context.Context, settings CreateSettings, extension component.Config) (Extension, error) {
+ func(_ context.Context, settings CreateSettings, _ component.Config) (Extension, error) {
return nopExtension{CreateSettings: settings}, nil
},
component.StabilityLevelDevelopment),
diff --git a/extension/extensiontest/nop_extension.go b/extension/extensiontest/nop_extension.go
index fcb9ab001f7..134eee042a7 100644
--- a/extension/extensiontest/nop_extension.go
+++ b/extension/extensiontest/nop_extension.go
@@ -6,6 +6,8 @@ package extensiontest // import "go.opentelemetry.io/collector/extension/extensi
import (
"context"
+ "github.com/google/uuid"
+
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/extension"
@@ -16,7 +18,7 @@ var nopType = component.MustNewType("nop")
// NewNopCreateSettings returns a new nop settings for extension.Factory Create* functions.
func NewNopCreateSettings() extension.CreateSettings {
return extension.CreateSettings{
- ID: component.NewID(nopType),
+ ID: component.NewIDWithName(nopType, uuid.NewString()),
TelemetrySettings: componenttest.NewNopTelemetrySettings(),
BuildInfo: component.NewDefaultBuildInfo(),
}
@@ -39,13 +41,13 @@ type nopConfig struct{}
var nopInstance = &nopExtension{}
-// nopExtension stores consumed traces and metrics for testing purposes.
+// nopExtension acts as an extension for testing purposes.
type nopExtension struct {
component.StartFunc
component.ShutdownFunc
}
-// NewNopBuilder returns a extension.Builder that constructs nop receivers.
+// NewNopBuilder returns a extension.Builder that constructs nop extension.
func NewNopBuilder() *extension.Builder {
nopFactory := NewNopFactory()
return extension.NewBuilder(
diff --git a/extension/go.mod b/extension/go.mod
index 3cb6a194ae2..d422c11b183 100644
--- a/extension/go.mod
+++ b/extension/go.mod
@@ -1,11 +1,12 @@
module go.opentelemetry.io/collector/extension
-go 1.20
+go 1.21
require (
- github.com/stretchr/testify v1.8.4
- go.opentelemetry.io/collector/component v0.93.0
- go.opentelemetry.io/collector/confmap v0.93.0
+ github.com/google/uuid v1.6.0
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector/component v0.97.0
+ go.opentelemetry.io/collector/confmap v0.97.0
go.uber.org/goleak v1.3.0
)
@@ -15,35 +16,35 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
+ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
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/knadh/koanf/v2 v2.1.0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
- github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
- github.com/prometheus/client_golang v1.18.0 // indirect
- github.com/prometheus/client_model v0.5.0 // indirect
- github.com/prometheus/common v0.46.0 // indirect
+ github.com/prometheus/client_golang v1.19.0 // indirect
+ github.com/prometheus/client_model v0.6.0 // indirect
+ github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
- go.opentelemetry.io/collector/config/configtelemetry v0.93.0 // indirect
- go.opentelemetry.io/collector/pdata v1.0.1 // indirect
- go.opentelemetry.io/otel v1.22.0 // indirect
- go.opentelemetry.io/otel/exporters/prometheus v0.45.0 // indirect
- go.opentelemetry.io/otel/metric v1.22.0 // indirect
- go.opentelemetry.io/otel/sdk v1.22.0 // indirect
- go.opentelemetry.io/otel/sdk/metric v1.22.0 // indirect
- go.opentelemetry.io/otel/trace v1.22.0 // indirect
+ go.opentelemetry.io/collector/config/configtelemetry v0.97.0 // indirect
+ go.opentelemetry.io/collector/pdata v1.4.0 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/exporters/prometheus v0.46.0 // indirect
+ go.opentelemetry.io/otel/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk/metric v1.24.0 // indirect
+ go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
- go.uber.org/zap v1.26.0 // indirect
- golang.org/x/net v0.20.0 // indirect
- golang.org/x/sys v0.16.0 // indirect
+ go.uber.org/zap v1.27.0 // indirect
+ golang.org/x/net v0.23.0 // indirect
+ golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
- google.golang.org/grpc v1.61.0 // indirect
- google.golang.org/protobuf v1.32.0 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
+ google.golang.org/grpc v1.62.1 // indirect
+ google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/extension/go.sum b/extension/go.sum
index 86549631f90..b615fd8d404 100644
--- a/extension/go.sum
+++ b/extension/go.sum
@@ -9,6 +9,8 @@ github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
@@ -16,55 +18,59 @@ 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.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
+github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
+github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/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/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=
-github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA=
-github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
-github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
-github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y=
-github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ=
+github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU=
+github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k=
+github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=
+github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8=
+github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=
+github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/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/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y=
-go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0 h1:BeIK2KGho0oCWa7LxEGSqfDZbs7Fpv/Viz+FS4P8CXE=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0/go.mod h1:UVJZPLnfDSvHj+eJuZE+E1GjIBD267mEMfAAHJdghWg=
-go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg=
-go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY=
-go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw=
-go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc=
-go.opentelemetry.io/otel/sdk/metric v1.22.0 h1:ARrRetm1HCVxq0cbnaZQlfwODYJHo3gFL8Z3tSmHBcI=
-go.opentelemetry.io/otel/sdk/metric v1.22.0/go.mod h1:KjQGeMIDlBNEOo6HvjhxIec1p/69/kULDcp4gr0oLQQ=
-go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0=
-go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0 h1:I8WIFXR351FoLJYuloU4EgXbtNX2URfU/85pUPheIEQ=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0/go.mod h1:ztwVUHe5DTR/1v7PeuGRnU5Bbd4QKYwApWmuutKsJSs=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/sdk/metric v1.24.0 h1:yyMQrPzF+k88/DbH7o4FMAs80puqd+9osbiBrJrz/w8=
+go.opentelemetry.io/otel/sdk/metric v1.24.0/go.mod h1:I6Y5FjH6rvEnTTAYQz3Mmv2kl6Ek5IIrmwTLqMrrOE0=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
-go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
-go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -74,16 +80,16 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
-golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
+golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
+golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
-golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
+golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
@@ -96,15 +102,16 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA=
-google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
-google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s=
+google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=
+google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
-google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/extension/memorylimiterextension/generated_component_test.go b/extension/memorylimiterextension/generated_component_test.go
new file mode 100644
index 00000000000..ef808e120ac
--- /dev/null
+++ b/extension/memorylimiterextension/generated_component_test.go
@@ -0,0 +1,37 @@
+// Code generated by mdatagen. DO NOT EDIT.
+
+package memorylimiterextension
+
+import (
+ "context"
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ "go.opentelemetry.io/collector/component"
+ "go.opentelemetry.io/collector/component/componenttest"
+ "go.opentelemetry.io/collector/confmap/confmaptest"
+ "go.opentelemetry.io/collector/extension/extensiontest"
+)
+
+func TestComponentLifecycle(t *testing.T) {
+ factory := NewFactory()
+
+ cm, err := confmaptest.LoadConf("metadata.yaml")
+ require.NoError(t, err)
+ cfg := factory.CreateDefaultConfig()
+ sub, err := cm.Sub("tests::config")
+ require.NoError(t, err)
+ require.NoError(t, component.UnmarshalConfig(sub, cfg))
+ t.Run("lifecycle", func(t *testing.T) {
+ firstExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg)
+ require.NoError(t, err)
+ require.NoError(t, firstExt.Start(context.Background(), componenttest.NewNopHost()))
+ require.NoError(t, firstExt.Shutdown(context.Background()))
+
+ secondExt, err := factory.CreateExtension(context.Background(), extensiontest.NewNopCreateSettings(), cfg)
+ require.NoError(t, err)
+ require.NoError(t, secondExt.Start(context.Background(), componenttest.NewNopHost()))
+ require.NoError(t, secondExt.Shutdown(context.Background()))
+ })
+}
diff --git a/extension/memorylimiterextension/go.mod b/extension/memorylimiterextension/go.mod
index 3c5f0740da6..6a7a9d37855 100644
--- a/extension/memorylimiterextension/go.mod
+++ b/extension/memorylimiterextension/go.mod
@@ -1,15 +1,16 @@
module go.opentelemetry.io/collector/extension/memorylimiterextension
-go 1.20
+go 1.21
require (
- github.com/stretchr/testify v1.8.4
- go.opentelemetry.io/collector v0.93.0
- go.opentelemetry.io/collector/component v0.93.0
- go.opentelemetry.io/collector/extension v0.93.0
- go.opentelemetry.io/otel/metric v1.22.0
- go.opentelemetry.io/otel/trace v1.22.0
- go.uber.org/zap v1.26.0
+ github.com/stretchr/testify v1.9.0
+ go.opentelemetry.io/collector v0.97.0
+ go.opentelemetry.io/collector/component v0.97.0
+ go.opentelemetry.io/collector/confmap v0.97.0
+ go.opentelemetry.io/collector/extension v0.97.0
+ go.opentelemetry.io/otel/metric v1.24.0
+ go.opentelemetry.io/otel/trace v1.24.0
+ go.uber.org/zap v1.27.0
)
require (
@@ -19,39 +20,39 @@ require (
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
+ github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
+ github.com/google/uuid v1.6.0 // indirect
github.com/knadh/koanf/maps v0.1.1 // indirect
github.com/knadh/koanf/providers/confmap v0.1.0 // indirect
- github.com/knadh/koanf/v2 v2.0.1 // indirect
+ github.com/knadh/koanf/v2 v2.1.0 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
- github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
- github.com/prometheus/client_golang v1.18.0 // indirect
- github.com/prometheus/client_model v0.5.0 // indirect
- github.com/prometheus/common v0.46.0 // indirect
+ github.com/prometheus/client_golang v1.19.0 // indirect
+ github.com/prometheus/client_model v0.6.0 // indirect
+ github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
- github.com/shirou/gopsutil/v3 v3.23.12 // indirect
+ github.com/shirou/gopsutil/v3 v3.24.3 // 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/config/configtelemetry v0.93.0 // indirect
- go.opentelemetry.io/collector/confmap v0.93.0 // indirect
- go.opentelemetry.io/collector/pdata v1.0.1 // indirect
- go.opentelemetry.io/otel v1.22.0 // indirect
- go.opentelemetry.io/otel/exporters/prometheus v0.45.0 // indirect
- go.opentelemetry.io/otel/sdk v1.22.0 // indirect
- go.opentelemetry.io/otel/sdk/metric v1.22.0 // indirect
+ github.com/yusufpapurcu/wmi v1.2.4 // indirect
+ go.opentelemetry.io/collector/config/configtelemetry v0.97.0 // indirect
+ go.opentelemetry.io/collector/pdata v1.4.0 // indirect
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ go.opentelemetry.io/otel/exporters/prometheus v0.46.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.24.0 // indirect
+ go.opentelemetry.io/otel/sdk/metric v1.24.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
- golang.org/x/net v0.20.0 // indirect
- golang.org/x/sys v0.16.0 // indirect
+ golang.org/x/net v0.23.0 // indirect
+ golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
- google.golang.org/grpc v1.61.0 // indirect
- google.golang.org/protobuf v1.32.0 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect
+ google.golang.org/grpc v1.62.1 // indirect
+ google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/extension/memorylimiterextension/go.sum b/extension/memorylimiterextension/go.sum
index 94b865dd9e1..4e005e6f0a7 100644
--- a/extension/memorylimiterextension/go.sum
+++ b/extension/memorylimiterextension/go.sum
@@ -12,6 +12,8 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c=
+github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
@@ -22,73 +24,79 @@ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
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/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
+github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/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/knadh/koanf/v2 v2.1.0 h1:eh4QmHHBuU8BybfIJ8mB8K8gsGCD/AUQTdwGq/GzId8=
+github.com/knadh/koanf/v2 v2.1.0/go.mod h1:4mnTRbZCK+ALuBXHZMjDfG9y714L7TykVnZkXbMU3Es=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4=
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I=
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE=
-github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw=
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
-github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk=
-github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA=
-github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
-github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
-github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y=
-github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ=
+github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU=
+github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k=
+github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos=
+github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8=
+github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSzKKE=
+github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
-github.com/shirou/gopsutil/v3 v3.23.12 h1:z90NtUkp3bMtmICZKpC4+WaknU1eXtp5vtbQ11DgpE4=
-github.com/shirou/gopsutil/v3 v3.23.12/go.mod h1:1FrWgea594Jp7qmjHUUPlJDTPgcsb9mGnXDxavtikzM=
+github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
+github.com/shirou/gopsutil/v3 v3.24.3 h1:eoUGJSmdfLzJ3mxIhmOAhgKEKgQkeOwKpz1NbhVnuPE=
+github.com/shirou/gopsutil/v3 v3.24.3/go.mod h1:JpND7O217xa72ewWz9zN2eIIkPWsDN/3pl0H8Qt0uwg=
github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ=
github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
+github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
-github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
+github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU=
github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI=
github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk=
github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
-github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw=
-github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
-go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y=
-go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0 h1:BeIK2KGho0oCWa7LxEGSqfDZbs7Fpv/Viz+FS4P8CXE=
-go.opentelemetry.io/otel/exporters/prometheus v0.45.0/go.mod h1:UVJZPLnfDSvHj+eJuZE+E1GjIBD267mEMfAAHJdghWg=
-go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg=
-go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY=
-go.opentelemetry.io/otel/sdk v1.22.0 h1:6coWHw9xw7EfClIC/+O31R8IY3/+EiRFHevmHafB2Gw=
-go.opentelemetry.io/otel/sdk v1.22.0/go.mod h1:iu7luyVGYovrRpe2fmj3CVKouQNdTOkxtLzPvPz1DOc=
-go.opentelemetry.io/otel/sdk/metric v1.22.0 h1:ARrRetm1HCVxq0cbnaZQlfwODYJHo3gFL8Z3tSmHBcI=
-go.opentelemetry.io/otel/sdk/metric v1.22.0/go.mod h1:KjQGeMIDlBNEOo6HvjhxIec1p/69/kULDcp4gr0oLQQ=
-go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0=
-go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo=
+github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
+github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0 h1:I8WIFXR351FoLJYuloU4EgXbtNX2URfU/85pUPheIEQ=
+go.opentelemetry.io/otel/exporters/prometheus v0.46.0/go.mod h1:ztwVUHe5DTR/1v7PeuGRnU5Bbd4QKYwApWmuutKsJSs=
+go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
+go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
+go.opentelemetry.io/otel/sdk v1.24.0 h1:YMPPDNymmQN3ZgczicBY3B6sf9n62Dlj9pWD3ucgoDw=
+go.opentelemetry.io/otel/sdk v1.24.0/go.mod h1:KVrIYw6tEubO9E96HQpcmpTKDVn9gdv35HoYiQWGDFg=
+go.opentelemetry.io/otel/sdk/metric v1.24.0 h1:yyMQrPzF+k88/DbH7o4FMAs80puqd+9osbiBrJrz/w8=
+go.opentelemetry.io/otel/sdk/metric v1.24.0/go.mod h1:I6Y5FjH6rvEnTTAYQz3Mmv2kl6Ek5IIrmwTLqMrrOE0=
+go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
+go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
+go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
-go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo=
-go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so=
+go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
+go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -98,8 +106,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
-golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
-golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY=
+golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
+golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
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=
@@ -110,9 +118,8 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
-golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
+golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
@@ -125,16 +132,17 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA=
-google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
-google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 h1:AjyfHzEPEFp/NpvfN5g+KDla3EMojjhRVZc1i7cj+oM=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80/go.mod h1:PAREbraiVEVGVdTZsVWjSbbTtSyGbAgIIvni8a8CD5s=
+google.golang.org/grpc v1.62.1 h1:B4n+nfKzOICUXMgyrNd19h/I9oH0L1pizfk1d4zSgTk=
+google.golang.org/grpc v1.62.1/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
-google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/extension/memorylimiterextension/internal/metadata/generated_status.go b/extension/memorylimiterextension/internal/metadata/generated_status.go
index c5131e1f7a7..6d4ad14b175 100644
--- a/extension/memorylimiterextension/internal/metadata/generated_status.go
+++ b/extension/memorylimiterextension/internal/metadata/generated_status.go
@@ -18,9 +18,9 @@ const (
)
func Meter(settings component.TelemetrySettings) metric.Meter {
- return settings.MeterProvider.Meter("otelcol/memorylimiter")
+ return settings.MeterProvider.Meter("go.opentelemetry.io/collector/extension/memorylimiterextension")
}
func Tracer(settings component.TelemetrySettings) trace.Tracer {
- return settings.TracerProvider.Tracer("otelcol/memorylimiter")
+ return settings.TracerProvider.Tracer("go.opentelemetry.io/collector/extension/memorylimiterextension")
}
diff --git a/extension/memorylimiterextension/metadata.yaml b/extension/memorylimiterextension/metadata.yaml
index 75f16b8f750..26cafc9b5ad 100644
--- a/extension/memorylimiterextension/metadata.yaml
+++ b/extension/memorylimiterextension/metadata.yaml
@@ -5,3 +5,11 @@ status:
stability:
development: [extension]
distributions: []
+
+tests:
+ config:
+ check_interval: 5s
+ limit_mib: 400
+ spike_limit_mib: 50
+ # TODO: https://github.com/open-telemetry/opentelemetry-collector/issues/9686
+ skip_shutdown: true
diff --git a/extension/zpagesextension/config.go b/extension/zpagesextension/config.go
index 090dbfd6e1a..6702491ad0d 100644
--- a/extension/zpagesextension/config.go
+++ b/extension/zpagesextension/config.go
@@ -15,7 +15,7 @@ type Config struct {
// TCPAddr is the address and port in which the zPages will be listening to.
// Use localhost: