From 2da796c81db2dcde628ed3715da4d6a46238f87a Mon Sep 17 00:00:00 2001 From: Joshua Lee Date: Sun, 14 Jul 2024 12:22:51 -0400 Subject: [PATCH] Fixes #1665 Query Params in Span Name - adds a transform processor - adds two rules for transforming span names: - Strip anything after a "?" - Replace productID with a token in "GET /api/products/{productID}" spans --- src/otelcollector/otelcol-config.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/otelcollector/otelcol-config.yml b/src/otelcollector/otelcol-config.yml index 8901737b5c..5e7d9925fa 100644 --- a/src/otelcollector/otelcol-config.yml +++ b/src/otelcollector/otelcol-config.yml @@ -47,6 +47,13 @@ exporters: processors: batch: + transform: + error_mode: ignore + trace_statements: + - context: span + statements: + - replace_pattern(name, "\\?.*", "") #could be removed when https://github.com/vercel/next.js/pull/64852 is fixed upstream + - replace_match(name, "GET /api/products/*", "GET /api/products/{productId}") connectors: spanmetrics: @@ -55,7 +62,7 @@ service: pipelines: traces: receivers: [otlp] - processors: [batch] + processors: [transform, batch] exporters: [otlp, debug, spanmetrics] metrics: receivers: [docker_stats, httpcheck/frontendproxy, otlp, prometheus, redis, spanmetrics]