Skip to content

Commit

Permalink
Remove query params and product ID from span names (open-telemetry#1668)
Browse files Browse the repository at this point in the history
* Fixes open-telemetry#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

* fix lint errors

* update changelog

---------

Co-authored-by: Juliano Costa <[email protected]>
  • Loading branch information
joshleecreates and julianocosta89 committed Jul 16, 2024
1 parent 8e0275e commit 91c7df4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ the release.

## Unreleased

* [otel-col] strip high-cardinality segments of span names
([#1668](https://github.com/open-telemetry/opentelemetry-demo/pull/1668))
* [tests] run trace based tests concurrently
([#1659](https://github.com/open-telemetry/opentelemetry-demo/pull/1659))
* [accountingservice] increase memory to 120MB
Expand Down
10 changes: 9 additions & 1 deletion src/otelcollector/otelcol-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,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, "\\?.*", "")
- replace_match(name, "GET /api/products/*", "GET /api/products/{productId}")

connectors:
spanmetrics:
Expand All @@ -57,7 +65,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 91c7df4

Please sign in to comment.