Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sanitize paths for Prometheus #94

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

aulme
Copy link
Contributor

@aulme aulme commented Nov 13, 2024

No description provided.

@aulme aulme requested a review from ssundahlTTD November 13, 2024 10:40
@aulme
Copy link
Contributor Author

aulme commented Nov 13, 2024

There already was some path sanitization attempt in code, but it didn't work. Fixed it as close to the original spirit/idea as I could. Also added a sprinkling of comments since not everything is obvious.
In absence of unit testing setup, testing done locally. Paths known to Express stay in metrics but are sanitized. The /user/:id comes from a test route I've added locally. Paths that are not known to Express including any spam get mapped to "unmatched-url".
Production tests for both UID2 and EUID work as per readme.

Unfortunately, any static files served get mapped to "unmatched-url" too since Express doesn't know about them. With a little effort it's possible to implement proper handling for them, but it wasn't in the original implementation either.

image

@aulme aulme merged commit 37f277d into main Nov 14, 2024
3 checks passed
@aulme aulme deleted the aul-uid2-4448-sanitize-paths-for-metrics branch November 14, 2024 02:14
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.

2 participants