Skip to content

Add debug logging for metrics collection failures#778

Merged
jdmarshall merged 5 commits into
prometheus:mainfrom
rishh09:add-debug-logging
Jul 14, 2026
Merged

Add debug logging for metrics collection failures#778
jdmarshall merged 5 commits into
prometheus:mainfrom
rishh09:add-debug-logging

Conversation

@rishh09

@rishh09 rishh09 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Fixes #649

What this PR does

Adds debug logging for metrics collection failures that were previously silently ignored.

The debug namespaces are scoped by metric area, for example:

  • prom:metrics:gc
  • prom:metrics:event-loop-lag
  • prom:metrics:process-open-fds
  • prom:metrics:process-max-fds

This keeps the default behavior quiet, while allowing users to inspect these failure paths with DEBUG=prom:*.

Notes

debug is moved from devDependencies to dependencies because it is now required by runtime library files.

Tests

  • npm run lint
  • npm run check-prettier
  • npm run compile-typescript
  • npm run test-unit -- --runInBand --forceExit
  • npm test -- --runInBand --forceExit

@rishh09

rishh09 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

Hi @jdmarshall, I opened this PR for #649 based on your latest comment about adding debug output to empty catch blocks.

I wasn’t able to add you as a reviewer directly, so tagging you here for visibility. Happy to adjust the namespace or message style if you prefer a different convention.

Signed-off-by: rishh09 <ra0182108@gmail.com>
@rishh09
rishh09 force-pushed the add-debug-logging branch from e57a3bd to 9a32906 Compare July 13, 2026 10:13
Comment thread package.json Outdated

@jdmarshall jdmarshall left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As @zbjornson recommended, please migrate to the Node native debug logging found in node:util

@jdmarshall jdmarshall mentioned this pull request Jul 14, 2026
@jdmarshall

jdmarshall commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@rishh09 If you would be so kind, would you mind fixing

const debug = require('debug')('benchmark');
while you're in here so we can remove debug entirely?

I'm thinking back to #708 and the fact that the benchmarks run as a CI action and maybe we should just not...

@rishh09

rishh09 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

sure, I'll proceed with these recommended changes and push a commit.

rishh09 and others added 3 commits July 14, 2026 10:30
Signed-off-by: rishh09 <ra0182108@gmail.com>
Signed-off-by: Jason Marshall <jdmarshall@users.noreply.github.com>
Signed-off-by: Jason Marshall <jdmarshall@users.noreply.github.com>
@jdmarshall

Copy link
Copy Markdown
Contributor

This one deserves a Changelog entry under additions: support for debug messages

@rishh09
rishh09 requested a review from jdmarshall July 14, 2026 09:20
Signed-off-by: rishh09 <ra0182108@gmail.com>
@jdmarshall
jdmarshall merged commit 9824e9d into prometheus:main Jul 14, 2026
15 checks passed
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.

Add debug integration

3 participants