Sitelet https://github.com/cybertec-postgresql/pgwatch/pull/980
Skip to content

[-] add source and metric tags to pgx traces, fixes #978 - #980

Merged
pashagolub merged 1 commit into
cybertec-postgresql:masterfrom
0xgouda:fix-logger-fields-usage
Oct 6, 2025
Merged

pashagolub merged 1 commit into
cybertec-postgresql:masterfrom
0xgouda:fix-logger-fields-usage

Conversation

@0xgouda

@0xgouda 0xgouda commented Oct 3, 2025

Copy link
Copy Markdown
Collaborator
  • Resave logger to ctx after every .WithField() update, so that logs from called functions will use the same updated logger.

closes: #978

@0xgouda 0xgouda changed the title [*] resave the logger to ctx after .WithField() update. [*] resave the logger to ctx after every .WithField() update. Oct 3, 2025
@coveralls

coveralls commented Oct 3, 2025 •

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 18283396249

Details

  • 0 of 5 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.04%) to 70.819%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/reaper/reaper.go 0 5 0.0%
Totals Coverage Status
Change from base Build 18283269981: -0.04%
Covered Lines: 3536
Relevant Lines: 4993

馃挍 - Coveralls

@0xgouda 0xgouda changed the title [*] resave the logger to ctx after every .WithField() update. [*] Fix source and metric fields logging. Oct 3, 2025
@pashagolub pashagolub self-assigned this Oct 3, 2025
@pashagolub pashagolub added bug Something isn't working enhancement New feature or request labels Oct 3, 2025
@pashagolub
pashagolub force-pushed the fix-logger-fields-usage branch from daff72d to 17a105e Compare October 3, 2025 10:38
Comment thread internal/reaper/database.go Outdated
@pashagolub
pashagolub force-pushed the fix-logger-fields-usage branch from 17a105e to 92eee9a Compare October 6, 2025 13:59
@pashagolub
pashagolub force-pushed the fix-logger-fields-usage branch from 92eee9a to 1a5d525 Compare October 6, 2025 13:59

@pashagolub pashagolub left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! What was needed!

@pashagolub pashagolub changed the title [*] Fix source and metric fields logging. [-] add source and metric tags to pgx traces, fixes #978 Oct 6, 2025
@pashagolub
pashagolub merged commit 32a3e9a into cybertec-postgresql:master Oct 6, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Log level 芦 error 禄, get "source" info in each message

3 participants