internal: implement path normalization w/ configurable rules
Strips query strings and URL fragmenets, prevents unbounded Prometheus metrics by normalizing paths like: - `/users/12345/profile -> /users/:id/profile` - `/page?utm_source=twitter -> /page` - `/a/../b -> /b` etc. Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I72f2fa2452f4666567143d052b5716476a6a6964
This commit is contained in:
parent
28abcf50e2
commit
0691e5ee34
4 changed files with 303 additions and 0 deletions
|
|
@ -37,6 +37,7 @@ type PathConfig struct {
|
|||
StripFragment bool `yaml:"strip_fragment"`
|
||||
CollapseNumericSegments bool `yaml:"collapse_numeric_segments"`
|
||||
MaxSegments int `yaml:"max_segments"`
|
||||
NormalizeTrailingSlash bool `yaml:"normalize_trailing_slash"`
|
||||
}
|
||||
|
||||
// Cardinality limits
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue