Apply memory limits
The following configuration example shows how you configure a Collector instance and its native memory limiter processor to guarantee memory allocation keeps within the specified parameters.
For optimal memory usage with your Collector instance, we recommend that you apply this configuration with all setups.
Prerequisites
- One of the following Collector distributions with the memory limiter processor:
- The Dynatrace Collector
- OpenTelemetry Core or Contrib
- A custom Builder version
- The Dynatrace API endpoint URL to which the data should be exported
- An API token with the relevant access scope (only required for SaaS and ActiveGate)
Demo configuration
receivers:otlp:protocols:grpc:endpoint: 0.0.0.0:4317http:endpoint: 0.0.0.0:4318processors:memory_limiter:check_interval: 1slimit_percentage: 70spike_limit_percentage: 30exporters:otlphttp:endpoint: ${env:DT_ENDPOINT}headers:Authorization: "Api-Token ${env:DT_API_TOKEN}"service:pipelines:traces:receivers: [otlp]processors: [memory_limiter]exporters: [otlphttp]metrics:receivers: [otlp]processors: [memory_limiter]exporters: [otlphttp]logs:receivers: [otlp]processors: [memory_limiter]exporters: [otlphttp]
Validate your settings to avoid any configuration issues.
Components
For our configuration, we configure the following components.
Receivers
Under receivers
, we specify the standard otlp
receiver as active receiver component for our Collector instance.
This is mainly for demonstration purposes. You can specify any other valid receiver here (for example, zipkin
).
Processors
Under processors
, we specify the memory_limiter
processor with the following parameters:
check_interval
configured to check the memory status every secondlimit_percentage
configured to allow a maximum memory allocation of 70 percentspike_limit_percentage
configured to allow a maximum spike memory usage of 20 percent
With this configuration, the Collector checks the memory allocation every second and starts to apply limits (for example, rejecting requests or forcing garbage collection) when the allocated memory exceeds 70 percent, with a temporary spike limit of 20 percent.
Exporters
Under exporters
, we specify the default otlphttp
exporter and configure it with our Dynatrace API URL and the required authentication token.
For this purpose, we set the following two environment variables and reference them in the configuration values for endpoint
and Authorization
.
DT_ENDPOINT
contains the base URL of the Dynatrace API endpoint (for example,https://{your-environment-id}.live.dynatrace.com/api/v2/otlp
)DT_API_TOKEN
contains the API token
Service pipelines
Under service
, we assemble our receiver and exporter objects into pipelines for traces, metrics, and logs and enable our memory limiter processor by referencing it under processors
for each respective pipeline.
Limits and limitations
Data is ingested using the OpenTelemetry protocol (OTLP) via the Dynatrace OTLP APIs and is subject to the API's limits and restrictions. For more information see: