Skip to content

Normalise trailing slashes for forPath and forUrl sampling rules#73

Merged
rubenvanassche merged 1 commit into
mainfrom
fix/sampling-trailing-slash-normalisation
May 19, 2026
Merged

Normalise trailing slashes for forPath and forUrl sampling rules#73
rubenvanassche merged 1 commit into
mainfrom
fix/sampling-trailing-slash-normalisation

Conversation

@rubenvanassche

Copy link
Copy Markdown
Member

Summary

  • A path filter for /foo would not trigger on an incoming /foo/ (or vice versa) because PatternMatcher anchors the regex.
  • forPath and forUrl rules now strip the trailing slash from both the pattern and the matched value before matching, so a single pattern handles both shapes. Root paths are preserved.
  • forRoute, forCommand, and forJob are untouched; they don't carry URL-style paths.

A path filter for /foo would not match an incoming /foo/ because
PatternMatcher anchors the regex. Strip the trailing slash from both
the pattern and the matched value for Path and Url rules so a single
pattern matches both shapes. Root paths are preserved.
@rubenvanassche rubenvanassche merged commit 58dda62 into main May 19, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant