From d59b0f351ff333920f56ab0a3c73aaf5b356992c Mon Sep 17 00:00:00 2001 From: endigma Date: Thu, 3 Jul 2025 12:29:27 +0100 Subject: [PATCH] Add documentation for experiment cardinality limit --- docs/router/configuration.mdx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/router/configuration.mdx b/docs/router/configuration.mdx index 9d6d9f1b..d20e2040 100644 --- a/docs/router/configuration.mdx +++ b/docs/router/configuration.mdx @@ -545,6 +545,18 @@ telemetry: ## Metrics +| Environment Variable | YAML | Required | Description | Default Value | +| ------------------------------------ | ---------------------------- | ---------------------- | ------------------------------------------------------------------------------------------------- | ------------- | +| METRICS_EXPERIMENT_CARDINALITY_LIMIT | experiment_cardinality_limit | | Sets a hard limit on the number of Metric Points that can be collected during a collection cycle. | 2000 | + + +The `experiment_cardinality_limit` option is experimental because it relies on experimental functionality in the OpenTelemetry SDK for Go. This feature helps prevent excessive memory usage by limiting the number of unique metric combinations (cardinality) that can be collected in a single collection cycle. + +See the specification for more information: https://opentelemetry.io/docs/specs/otel/metrics/sdk/#cardinality-limits + +This option may change or be removed in future versions as the OpenTelemetry SDK stabilizes this functionality. + + ### OTLP | Environment Variable | YAML | Required | Description | Default Value | @@ -572,6 +584,7 @@ telemetry: # See "https://cosmo-docs.wundergraph.com/router/metrics-and-monitoring" for more information telemetry: metrics: + experiment_cardinality_limit: 2000 otlp: enabled: true router_runtime: true @@ -2005,4 +2018,4 @@ cache_warmup: timeout: 30s source: path: "./cache-warmer/operations" -``` \ No newline at end of file +```