From 3c8f509c9510769f5172d7c2cf22cc3315730210 Mon Sep 17 00:00:00 2001 From: Cyrille Le Clerc Date: Thu, 29 Jan 2026 13:46:06 +0100 Subject: [PATCH 1/9] Bump OTelCol to 0.144.0 and leverage set_semconv_span_name() for better http operation names --- .env | 2 +- src/otel-collector/otelcol-config.yml | 60 +++++++++++++++++++++++---- 2 files changed, 52 insertions(+), 10 deletions(-) diff --git a/.env b/.env index f67e6c489c..4f9e197189 100644 --- a/.env +++ b/.env @@ -9,7 +9,7 @@ OTEL_JAVA_AGENT_VERSION=2.23.0 OPENTELEMETRY_CPP_VERSION=1.24.0 # Dependent images -COLLECTOR_CONTRIB_IMAGE=ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.142.0 +COLLECTOR_CONTRIB_IMAGE=ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.144.0 FLAGD_IMAGE=ghcr.io/open-feature/flagd:v0.12.9 GRAFANA_IMAGE=grafana/grafana:12.3.1 JAEGERTRACING_IMAGE=jaegertracing/jaeger:2.12.0 diff --git a/src/otel-collector/otelcol-config.yml b/src/otel-collector/otelcol-config.yml index 709047404c..516dd21e86 100644 --- a/src/otel-collector/otelcol-config.yml +++ b/src/otel-collector/otelcol-config.yml @@ -121,13 +121,13 @@ receivers: enabled: true exporters: debug: - otlp: + otlp_grpc/jaeger: endpoint: "jaeger:4317" tls: insecure: true sending_queue: batch: - otlphttp/prometheus: + otlp_http/prometheus: endpoint: "http://prometheus:9090/api/v1/otlp" tls: insecure: true @@ -152,14 +152,56 @@ processors: spike_limit_percentage: 25 resourcedetection: detectors: [env, docker, system] - transform: + transform/sanitize_spans: error_mode: ignore trace_statements: - context: span statements: - # could be removed when https://github.com/vercel/next.js/pull/64852 is fixed upstream - - replace_pattern(name, "\\?.*", "") - - replace_match(name, "GET /api/products/*", "GET /api/products/{productId}") + # Sanitize spans to prevent span metrics cardinality explosion + # caused by non-compliant high cardinality span names: + # 1. Define missing http.route on key HTTP operations for meaningful operation names + # 2. Then normalize span names; http operation spans lacking http.route to operations "GET", "POST", etc. + + # Prevent span metrics cardinality explosion by: + # 1. Mapping critical operations to http.route for meaningful operation names + # 2. Normalizing span names (unmapped HTTP operations default to GET, POST, etc.) + + + # FRONTEND SERVICE + + # Workaround for Next.js high cardinality span name issue: https://github.com/vercel/next.js/issues/54694 + - set(span.attributes["http.route"], "/api/cart") where + span.kind == SPAN_KIND_SERVER and + resource.attributes["service.name"] == "frontend" and + span.attributes["http.route"] == nil and + IsMatch(span.attributes["http.target"], "\\/api\\/cart") # e.g. # /api/cart + + - set(span.attributes["http.route"], "/api/checkout") where + span.kind == SPAN_KIND_SERVER and + resource.attributes["service.name"] == "frontend" and + span.attributes["http.route"] == nil and + IsMatch(span.attributes["http.target"], "\\/api\\/checkout") # e.g. # /api/checkout + + - set(span.attributes["http.route"], "/api/products/{productId}") where + span.kind == SPAN_KIND_SERVER and + resource.attributes["service.name"] == "frontend" and + span.attributes["http.route"] == nil and + IsMatch(span.attributes["http.target"], "\\/api\\/products\\/.*") # e.g. /api/products/1YMWWN1N4O + + - set(span.attributes["http.route"], "/api/recommendations") where + span.kind == SPAN_KIND_SERVER and + resource.attributes["service.name"] == "frontend" and + span.attributes["http.route"] == nil and + IsMatch(span.attributes["http.target"], "\\/api\\/recommendations") # e.g. # /api/recommendations?productIds=... + + - set(span.attributes["http.route"], "/api/data") where + span.kind == SPAN_KIND_SERVER and + resource.attributes["service.name"] == "frontend" and + span.attributes["http.route"] == nil and + IsMatch(span.attributes["http.target"], "\\/api\\/data.*") # e.g. # " /api/data?contextKeys=telescopes" or /api/data/?contextKeys=cameras + + # SANITIZE ALL SPAN NAMES TO PREVENT CARDINALITY EXPLOSION + - set_semconv_span_name("1.37.0", "original_span_name") connectors: spanmetrics: @@ -168,12 +210,12 @@ service: pipelines: traces: receivers: [otlp] - processors: [resourcedetection, memory_limiter, transform] - exporters: [otlp, debug, spanmetrics] + processors: [resourcedetection, memory_limiter, transform/sanitize_spans] + exporters: [otlp_grpc/jaeger, debug, spanmetrics] metrics: receivers: [docker_stats, httpcheck/frontend-proxy, hostmetrics, nginx, otlp, postgresql, redis, spanmetrics] processors: [resourcedetection, memory_limiter] - exporters: [otlphttp/prometheus, debug] + exporters: [otlp_http/prometheus, debug] logs: receivers: [otlp] processors: [resourcedetection, memory_limiter] From f4a82a0f70bfefc4f5fc7aa11643975d2777c3a3 Mon Sep 17 00:00:00 2001 From: Cyrille Le Clerc Date: Thu, 29 Jan 2026 14:02:40 +0100 Subject: [PATCH 2/9] Bump OTelCol to 0.144.0 and leverage set_semconv_span_name() for better http operation names --- src/otel-collector/otelcol-config.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/otel-collector/otelcol-config.yml b/src/otel-collector/otelcol-config.yml index 516dd21e86..6ab0e4ae17 100644 --- a/src/otel-collector/otelcol-config.yml +++ b/src/otel-collector/otelcol-config.yml @@ -160,12 +160,7 @@ processors: # Sanitize spans to prevent span metrics cardinality explosion # caused by non-compliant high cardinality span names: # 1. Define missing http.route on key HTTP operations for meaningful operation names - # 2. Then normalize span names; http operation spans lacking http.route to operations "GET", "POST", etc. - - # Prevent span metrics cardinality explosion by: - # 1. Mapping critical operations to http.route for meaningful operation names - # 2. Normalizing span names (unmapped HTTP operations default to GET, POST, etc.) - + # 2. Then normalize span names; http server spans lacking http.route default to operations "GET", "POST", etc. # FRONTEND SERVICE From a8c2e4b9abf07dc06773a24e6508eb48b81695af Mon Sep 17 00:00:00 2001 From: Cyrille Le Clerc Date: Thu, 29 Jan 2026 14:12:23 +0100 Subject: [PATCH 3/9] changelog --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca1d9efc12..a29c1e7dad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,15 @@ the release. * [accounting] fix memory leak with dbcontext ([#2876](https://github.com/open-telemetry/opentelemetry-demo/pull/2876)) +* [chore] Bump OTel Collector to v0.144.0 and rename OTLP exporters + `otlp`--> `otlp_grpc` and `otlphttp` --> `otlp_http` + [#2942](https://github.com/open-telemetry/opentelemetry-demo/pull/2942) +* [collector] Use the [`set_semconv_span_name()`] + (https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/transformprocessor#set_semconv_span_name) + function to better handle the next.js + issue [High-cardinality HTTP span names #54694] + (https://github.com/vercel/next.js/issues/54694) + [#2942](https://github.com/open-telemetry/opentelemetry-demo/pull/2942) ## 2.2.0 From f5536635928bc6ee5bf6684d573e7ca7aa139b27 Mon Sep 17 00:00:00 2001 From: Cyrille Le Clerc Date: Thu, 29 Jan 2026 16:08:45 +0100 Subject: [PATCH 4/9] lint --- CHANGELOG.md | 6 +++--- src/otel-collector/otelcol-config.yml | 22 +++++++++++----------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a29c1e7dad..c7db9ebbfe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,13 +10,13 @@ the release. * [accounting] fix memory leak with dbcontext ([#2876](https://github.com/open-telemetry/opentelemetry-demo/pull/2876)) * [chore] Bump OTel Collector to v0.144.0 and rename OTLP exporters - `otlp`--> `otlp_grpc` and `otlphttp` --> `otlp_http` + `otlp`--> `otlp_grpc` and `otlphttp` --> `otlp_http` [#2942](https://github.com/open-telemetry/opentelemetry-demo/pull/2942) * [collector] Use the [`set_semconv_span_name()`] - (https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/transformprocessor#set_semconv_span_name) + (https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/transformprocessor#set_semconv_span_name) function to better handle the next.js issue [High-cardinality HTTP span names #54694] - (https://github.com/vercel/next.js/issues/54694) + (https://github.com/vercel/next.js/issues/54694) [#2942](https://github.com/open-telemetry/opentelemetry-demo/pull/2942) ## 2.2.0 diff --git a/src/otel-collector/otelcol-config.yml b/src/otel-collector/otelcol-config.yml index 6ab0e4ae17..480b58a612 100644 --- a/src/otel-collector/otelcol-config.yml +++ b/src/otel-collector/otelcol-config.yml @@ -158,42 +158,42 @@ processors: - context: span statements: # Sanitize spans to prevent span metrics cardinality explosion - # caused by non-compliant high cardinality span names: + # caused by non-compliant high cardinality span names: # 1. Define missing http.route on key HTTP operations for meaningful operation names # 2. Then normalize span names; http server spans lacking http.route default to operations "GET", "POST", etc. # FRONTEND SERVICE # Workaround for Next.js high cardinality span name issue: https://github.com/vercel/next.js/issues/54694 - - set(span.attributes["http.route"], "/api/cart") where + - set(span.attributes["http.route"], "/api/cart") where span.kind == SPAN_KIND_SERVER and resource.attributes["service.name"] == "frontend" and span.attributes["http.route"] == nil and - IsMatch(span.attributes["http.target"], "\\/api\\/cart") # e.g. # /api/cart + IsMatch(span.attributes["http.target"], "\\/api\\/cart") # e.g. # /api/cart - - set(span.attributes["http.route"], "/api/checkout") where + - set(span.attributes["http.route"], "/api/checkout") where span.kind == SPAN_KIND_SERVER and resource.attributes["service.name"] == "frontend" and span.attributes["http.route"] == nil and - IsMatch(span.attributes["http.target"], "\\/api\\/checkout") # e.g. # /api/checkout + IsMatch(span.attributes["http.target"], "\\/api\\/checkout") # e.g. # /api/checkout - - set(span.attributes["http.route"], "/api/products/{productId}") where + - set(span.attributes["http.route"], "/api/products/{productId}") where span.kind == SPAN_KIND_SERVER and resource.attributes["service.name"] == "frontend" and span.attributes["http.route"] == nil and - IsMatch(span.attributes["http.target"], "\\/api\\/products\\/.*") # e.g. /api/products/1YMWWN1N4O + IsMatch(span.attributes["http.target"], "\\/api\\/products\\/.*") # e.g. /api/products/1YMWWN1N4O - - set(span.attributes["http.route"], "/api/recommendations") where + - set(span.attributes["http.route"], "/api/recommendations") where span.kind == SPAN_KIND_SERVER and resource.attributes["service.name"] == "frontend" and span.attributes["http.route"] == nil and - IsMatch(span.attributes["http.target"], "\\/api\\/recommendations") # e.g. # /api/recommendations?productIds=... + IsMatch(span.attributes["http.target"], "\\/api\\/recommendations") # e.g. # /api/recommendations?productIds=... - - set(span.attributes["http.route"], "/api/data") where + - set(span.attributes["http.route"], "/api/data") where span.kind == SPAN_KIND_SERVER and resource.attributes["service.name"] == "frontend" and span.attributes["http.route"] == nil and - IsMatch(span.attributes["http.target"], "\\/api\\/data.*") # e.g. # " /api/data?contextKeys=telescopes" or /api/data/?contextKeys=cameras + IsMatch(span.attributes["http.target"], "\\/api\\/data.*") # e.g. # " /api/data?contextKeys=telescopes" or /api/data/?contextKeys=cameras # SANITIZE ALL SPAN NAMES TO PREVENT CARDINALITY EXPLOSION - set_semconv_span_name("1.37.0", "original_span_name") From aa6d365fe4312a268c87cf16906b8086751b51f8 Mon Sep 17 00:00:00 2001 From: Cyrille Le Clerc Date: Thu, 29 Jan 2026 16:12:53 +0100 Subject: [PATCH 5/9] lint --- CHANGELOG.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7db9ebbfe..896bcb92d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,11 +12,10 @@ the release. * [chore] Bump OTel Collector to v0.144.0 and rename OTLP exporters `otlp`--> `otlp_grpc` and `otlphttp` --> `otlp_http` [#2942](https://github.com/open-telemetry/opentelemetry-demo/pull/2942) -* [collector] Use the [`set_semconv_span_name()`] - (https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/transformprocessor#set_semconv_span_name) - function to better handle the next.js - issue [High-cardinality HTTP span names #54694] - (https://github.com/vercel/next.js/issues/54694) +* [collector] Use the + [`set_semconv_span_name()`](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/transformprocessor#set_semconv_span_name) + function to better handle the next.js issue + [High-cardinality HTTP span names #54694](https://github.com/vercel/next.js/issues/54694) [#2942](https://github.com/open-telemetry/opentelemetry-demo/pull/2942) ## 2.2.0 From 7e3ed1cbf9b8cd118ede0351b5ed256cd8636d3f Mon Sep 17 00:00:00 2001 From: Cyrille Le Clerc Date: Thu, 29 Jan 2026 16:15:02 +0100 Subject: [PATCH 6/9] lint --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 896bcb92d3..beac738c59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,9 +12,9 @@ the release. * [chore] Bump OTel Collector to v0.144.0 and rename OTLP exporters `otlp`--> `otlp_grpc` and `otlphttp` --> `otlp_http` [#2942](https://github.com/open-telemetry/opentelemetry-demo/pull/2942) -* [collector] Use the +* [collector] Use the [`set_semconv_span_name()`](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/transformprocessor#set_semconv_span_name) - function to better handle the next.js issue + function to better handle the next.js issue [High-cardinality HTTP span names #54694](https://github.com/vercel/next.js/issues/54694) [#2942](https://github.com/open-telemetry/opentelemetry-demo/pull/2942) From 4eef07898c7aa0f45243b0e18d53d79a3965882d Mon Sep 17 00:00:00 2001 From: Cyrille Le Clerc Date: Mon, 9 Feb 2026 16:29:06 +0100 Subject: [PATCH 7/9] Better changelog.md --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index beac738c59..055006acd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,8 +9,9 @@ the release. * [accounting] fix memory leak with dbcontext ([#2876](https://github.com/open-telemetry/opentelemetry-demo/pull/2876)) -* [chore] Bump OTel Collector to v0.144.0 and rename OTLP exporters - `otlp`--> `otlp_grpc` and `otlphttp` --> `otlp_http` +* [chore] Upgrade OTel Collector to v0.144.0 with :warning: breaking change: + OTLP exporters renamed from `otlp` to `otlp_grpc/jaeger` and from + `otlphttp/prometheus` to `otlp_http/prometheus` [#2942](https://github.com/open-telemetry/opentelemetry-demo/pull/2942) * [collector] Use the [`set_semconv_span_name()`](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/transformprocessor#set_semconv_span_name) From 404dda59009b6d84d7592719e8b30709731e41c4 Mon Sep 17 00:00:00 2001 From: Cyrille Le Clerc Date: Tue, 10 Feb 2026 14:09:24 +0100 Subject: [PATCH 8/9] Bump otelcol to 0.145. --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 4f9e197189..27d87a47f6 100644 --- a/.env +++ b/.env @@ -9,7 +9,7 @@ OTEL_JAVA_AGENT_VERSION=2.23.0 OPENTELEMETRY_CPP_VERSION=1.24.0 # Dependent images -COLLECTOR_CONTRIB_IMAGE=ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.144.0 +COLLECTOR_CONTRIB_IMAGE=ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:0.145.0 FLAGD_IMAGE=ghcr.io/open-feature/flagd:v0.12.9 GRAFANA_IMAGE=grafana/grafana:12.3.1 JAEGERTRACING_IMAGE=jaegertracing/jaeger:2.12.0 From e94dd60012993e760faf18bc4e60f7fef00560f7 Mon Sep 17 00:00:00 2001 From: Cyrille Le Clerc Date: Tue, 10 Feb 2026 14:11:15 +0100 Subject: [PATCH 9/9] Bump otelcol to 0.145. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 055006acd8..65dd9a8d6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ the release. * [accounting] fix memory leak with dbcontext ([#2876](https://github.com/open-telemetry/opentelemetry-demo/pull/2876)) -* [chore] Upgrade OTel Collector to v0.144.0 with :warning: breaking change: +* [chore] Upgrade OTel Collector to v0.145.0 with :warning: breaking change: OTLP exporters renamed from `otlp` to `otlp_grpc/jaeger` and from `otlphttp/prometheus` to `otlp_http/prometheus` [#2942](https://github.com/open-telemetry/opentelemetry-demo/pull/2942)