logger icon indicating copy to clipboard operation
logger copied to clipboard

feat: add option to omit query string from path matching and logging

Open mgabeler-lee-6rs opened this issue 7 months ago • 3 comments

Adds an option (default disabled for backwards compatibility) to change the handling of the path field to omit the query string.

When enabled:

  • The path is logged without the query string
  • The query string, if non-empty, is logged in a new query field
  • The path without the query string is used for matching in the the WithSkipPath, WithSkipPathRegexps, and WithPathLevel options

Why?

  • With structured log aggregators, being able to aggregate on the base path without highly variable query strings can be helpful
  • Overriding log levels by path is similarly likely to want to use the base path ignoring variable / user-submitted query strings

(This previously was #108, but it was closed by accident due to a push to a private repo referencing that PR)

mgabeler-lee-6rs avatar Apr 07 '25 13:04 mgabeler-lee-6rs

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 90.53%. Comparing base (d96c742) to head (a1ac8d3). Report is 56 commits behind head on master.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #110      +/-   ##
==========================================
- Coverage   94.24%   90.53%   -3.72%     
==========================================
  Files           2        2              
  Lines         139      169      +30     
==========================================
+ Hits          131      153      +22     
- Misses          5       14       +9     
+ Partials        3        2       -1     
Flag Coverage Δ
go- ?
go-1.18 ?
go-1.19 ?
go-1.20 ?
go-1.21 ?
go-1.22 ?
go-1.23 90.53% <100.00%> (?)
go-1.24 90.53% <100.00%> (?)
macos-latest ?
ubuntu-latest 90.53% <100.00%> (-3.72%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov-commenter avatar Apr 07 '25 13:04 codecov-commenter

Please resolve the conflicts.

appleboy avatar May 20 '25 10:05 appleboy

@appleboy done!

mgabeler-lee-6rs avatar May 21 '25 14:05 mgabeler-lee-6rs