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

feat(metrics): Add URL to metrics labels #875

Merged
merged 2 commits into from
Dec 28, 2024

Conversation

danlsgiga
Copy link
Contributor

Small feature addition.

Sometimes is useful to have the endpoint URL in metrics labels so we can include that as part of alert messages when these metrics are scraped via prometheus.

@danlsgiga
Copy link
Contributor Author

@TwiN any feedback on this PR?

Copy link

codecov bot commented Dec 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.01%. Comparing base (19713c2) to head (dda84ac).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #875      +/-   ##
==========================================
+ Coverage   76.00%   76.01%   +0.01%     
==========================================
  Files          73       73              
  Lines        6676     6679       +3     
==========================================
+ Hits         5074     5077       +3     
  Misses       1301     1301              
  Partials      301      301              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TwiN TwiN merged commit e88f47f into TwiN:master Dec 28, 2024
2 checks passed
@TwiN
Copy link
Owner

TwiN commented Dec 28, 2024

Thank you for the contribution!

TwiN added a commit that referenced this pull request Dec 28, 2024
TwiN added a commit that referenced this pull request Dec 28, 2024
Revert "feat(metrics): Add URL to metrics labels (#875)"

This reverts commit e88f47f.
@TwiN
Copy link
Owner

TwiN commented Dec 28, 2024

@danlsgiga I don't do this usually, but I had to revert the PR because I don't have the time to fix this right now.

After merging, I found out that the URL doesn't discard the query parameters, and that's an issue because unfortunately, many people pass tokens as query parameter (e.g. https://example.org/api/v1/example?token=123), which would make releasing this a security risk.

If you can make another PR that discards all query parameters (?token=123, in the example above), I could merge your feature.

@danlsgiga
Copy link
Contributor Author

Oh, I'm sorry @TwiN, I totally missed this message! I'll look into this and open a new PR! thanks!

@danlsgiga danlsgiga deleted the url-on-metrics-labels branch January 15, 2025 23:59
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.

3 participants