diff --git a/.chloggen/mx-psi_deprecate-memory-ballast.yaml b/.chloggen/mx-psi_deprecate-memory-ballast.yaml new file mode 100755 index 00000000000..f9d5e3c0876 --- /dev/null +++ b/.chloggen/mx-psi_deprecate-memory-ballast.yaml @@ -0,0 +1,26 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: deprecation + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: extension/ballast + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Deprecate `memory_ballast` extension. + +# One or more tracking issues or pull requests related to the change +issues: [8343] + +# (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 `GOMEMLIMIT` environment variable instead. + +# 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/confmap/provider/internal/configurablehttpprovider/testdata/otel-config.yaml b/confmap/provider/internal/configurablehttpprovider/testdata/otel-config.yaml index ba9fd20b40f..ac27ba4c851 100644 --- a/confmap/provider/internal/configurablehttpprovider/testdata/otel-config.yaml +++ b/confmap/provider/internal/configurablehttpprovider/testdata/otel-config.yaml @@ -1,6 +1,4 @@ extensions: - memory_ballast: - size_mib: 512 zpages: endpoint: 0.0.0.0:55679 @@ -34,4 +32,4 @@ service: processors: [memory_limiter, batch] exporters: [debug] - extensions: [memory_ballast, zpages] + extensions: [zpages] diff --git a/examples/k8s/otel-config.yaml b/examples/k8s/otel-config.yaml index f9e51a8d477..177a978fdd9 100644 --- a/examples/k8s/otel-config.yaml +++ b/examples/k8s/otel-config.yaml @@ -35,11 +35,8 @@ data: check_interval: 5s extensions: zpages: {} - memory_ballast: - # Memory Ballast size should be max 1/3 to 1/2 of memory. - size_mib: 165 service: - extensions: [zpages, memory_ballast] + extensions: [zpages] pipelines: traces: receivers: [otlp] @@ -87,6 +84,8 @@ spec: fieldRef: apiVersion: v1 fieldPath: status.podIP + - name: GOMEMLIMIT + value: 400MiB volumeMounts: - name: otel-agent-config-vol mountPath: /conf @@ -124,16 +123,13 @@ data: check_interval: 5s extensions: zpages: {} - memory_ballast: - # Memory Ballast size should be max 1/3 to 1/2 of memory. - size_mib: 683 exporters: otlp: endpoint: "http://someotlp.target.com:4317" # Replace with a real endpoint. tls: insecure: true service: - extensions: [zpages, memory_ballast] + extensions: [zpages] pipelines: traces/1: receivers: [otlp] @@ -209,6 +205,8 @@ spec: fieldRef: apiVersion: v1 fieldPath: status.podIP + - name: GOMEMLIMIT + value: 1600MiB volumeMounts: - name: otel-collector-config-vol mountPath: /conf diff --git a/examples/local/otel-config.yaml b/examples/local/otel-config.yaml index b7288029732..20cbf6973f5 100644 --- a/examples/local/otel-config.yaml +++ b/examples/local/otel-config.yaml @@ -1,6 +1,4 @@ extensions: - memory_ballast: - size_mib: 512 zpages: endpoint: localhost:55679 @@ -36,4 +34,4 @@ service: processors: [memory_limiter, batch] exporters: [debug] - extensions: [memory_ballast, zpages] + extensions: [zpages] diff --git a/extension/ballastextension/README.md b/extension/ballastextension/README.md index a67ab0bbbca..145ad464528 100644 --- a/extension/ballastextension/README.md +++ b/extension/ballastextension/README.md @@ -1,8 +1,16 @@ +> [!WARNING] +> The memory ballast extension is deprecated in favor of using the `GOMEMLIMIT` environment variable. +> This environment variable is available on any Collector built with Go 1.19 or higher. Official binary releases are built with Go 1.19 since v0.61.0. See [issue 8343](https://github.com/open-telemetry/opentelemetry-collector/issues/8343) for the deprecation timeline. +> +> To migrate to `GOMEMLIMIT`, set its value to 80% of the hard memory limit of your Collector. +> For example, if the Collector hard memory limit is 1GiB, set `GOMEMLIMIT` to `800MiB`. +> Check [the Go documentation](https://pkg.go.dev/runtime#hdr-Environment_Variables) for more information about `GOMEMLIMIT`'s syntax. + # Memory Ballast | Status | | | ------------------------ | ----------------- | -| Stability | [beta] | +| Stability | [deprecated] | | Distributions | [core], [contrib] | Memory Ballast extension enables applications to configure memory ballast for the process. For more details see: @@ -47,6 +55,6 @@ extensions: size_in_percentage: 20 ``` -[beta]: https://github.com/open-telemetry/opentelemetry-collector-contrib#beta +[deprecated]: https://github.com/open-telemetry/opentelemetry-collector-contrib#deprecated [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib [core]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol diff --git a/extension/ballastextension/factory.go b/extension/ballastextension/factory.go index 6609111dd80..353150249a5 100644 --- a/extension/ballastextension/factory.go +++ b/extension/ballastextension/factory.go @@ -21,7 +21,7 @@ var memHandler = iruntime.TotalMemory // NewFactory creates a factory for FluentBit extension. func NewFactory() extension.Factory { - return extension.NewFactory(typeStr, createDefaultConfig, createExtension, component.StabilityLevelBeta) + return extension.NewFactory(typeStr, createDefaultConfig, createExtension, component.StabilityLevelDeprecated) } func createDefaultConfig() component.Config { diff --git a/extension/ballastextension/go.mod b/extension/ballastextension/go.mod index bfb6192bdf3..a51dc33eea4 100644 --- a/extension/ballastextension/go.mod +++ b/extension/ballastextension/go.mod @@ -1,3 +1,4 @@ +// Deprecated: Use the GOMEMLIMIT environment variable instead. module go.opentelemetry.io/collector/extension/ballastextension go 1.20 diff --git a/service/README.md b/service/README.md index 58409c7f9b8..b954cd85aa4 100644 --- a/service/README.md +++ b/service/README.md @@ -142,7 +142,6 @@ exporters: - debug extensions: - zpages - - memory_ballast ``` ## How to validate configuration file and return all errors without running collector