Skip to content

Add debug logging for metrics collection failures#778

Open
rishh09 wants to merge 1 commit into
prometheus:mainfrom
rishh09:add-debug-logging
Open

Add debug logging for metrics collection failures#778
rishh09 wants to merge 1 commit into
prometheus:mainfrom
rishh09:add-debug-logging

Conversation

@rishh09

@rishh09 rishh09 commented Jul 13, 2026

Copy link
Copy Markdown

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
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
},
"dependencies": {
"@opentelemetry/api": "^1.4.0",
"debug": "^4.4.1",

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.

Since this library is only used within other tools, should this be a dep or a peer dependency? @SimenB @zbjornson

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 integration with npm package debug

2 participants