feat(metrics): Add default server.address attribute on server runtimes#18242
Merged
feat(metrics): Add default server.address attribute on server runtimes#18242
server.address attribute on server runtimes#18242Conversation
dev-packages/node-integration-tests/suites/public-api/metrics/server-address/test.ts
Show resolved
Hide resolved
Lms24
approved these changes
Nov 18, 2025
Member
Lms24
left a comment
There was a problem hiding this comment.
I like the pattern. As discussed, we'll likely need a hook like this one for spans and logs as well, so this makes sense to me. Naming wise, we can still add (pre|post)ProcessMetric later on should we need it, so I think this is a good naming choice (and inline with the processEvent hooks on our Integration interface).
Contributor
size-limit report 📦
|
Contributor
node-overhead report 🧳Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.
|
Co-authored-by: Lukas Stracke <lukas.stracke@sentry.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Attaches a
server.addressattribute to all captured metrics on aserverRuntimeClientDid this by emitting a new
processMetrichook in core, that we listen to in theserverRuntimeClient. This way we do not need to re-export all metrics functions from server runtime packages and still only get a minimal client bundle size bump.Added integration tests for node + cloudflare
closes #18240
closes https://linear.app/getsentry/issue/JS-1178/attach-serveraddress-as-a-default-attribute-to-metrics