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 2da796c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/otelcollector/otelcol-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

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

Check warning on line 57 in src/otelcollector/otelcol-config.yml

View workflow job for this annotation

GitHub Actions / yamllint

57:48 [comments] too few spaces before comment

Check warning on line 57 in src/otelcollector/otelcol-config.yml

View workflow job for this annotation

GitHub Actions / yamllint

57:49 [comments] missing starting space in comment

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

View workflow job for this annotation

GitHub Actions / yamllint

57:133 [trailing-spaces] trailing spaces
connectors:
spanmetrics:
Expand All @@ -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]
Expand Down

0 comments on commit 2da796c

Please sign in to comment.