Skip to content

Commit

Permalink
Fixes #1665 Query Params in Span Name
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
joshleecreates committed Jul 14, 2024
1 parent c417bdb commit cf519ec
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/otelcollector/otelcol-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ exporters:

processors:
batch:
transform:
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, "\\?.*", "")

Check failure on line 56 in src/otelcollector/otelcol-config.yml

View workflow job for this annotation

GitHub Actions / yamllint

56:20 [trailing-spaces] trailing spaces
- replace_match(name, "GET /api/products/*", "GET /api/products/{productId}")

connectors:
spanmetrics:
Expand All @@ -55,7 +63,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]
Expand Down

0 comments on commit cf519ec

Please sign in to comment.