Skip to content

Conversation

timfish
Copy link
Collaborator

@timfish timfish commented Sep 10, 2025

This PR:

  • Adds the @apm-js-collab/tracing-hooks as a dependency
  • Integrations can register instrumentations which causes the @apm-js-collab/tracing-hooks ESM hook and require patching to be initialised later
  • The @apm-js-collab/* dependencies only get included in any bundle when they are used by integrations
  • Adds a pinoIntegration() that:
    • Is not enabled by default (see below)
    • Registers where it needs code injecting into the pino library
    • Hooks the tracing channel events, including the event added to [email protected]
    • Captures Sentry logs for pino logs
    • Captures in the correct tracing context because this is all sync!
    • Captures exception/message events for the configured eventLevels

Supported Node versions

We can't enable this integration by default because TracingChannel, injected by @apm-js-collab/code-transformer requires Node >= v19.9.0 or v18.19.0.

Copy link
Contributor

github-actions bot commented Sep 10, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 24.22 kB - -
@sentry/browser - with treeshaking flags 22.74 kB - -
@sentry/browser (incl. Tracing) 40.23 kB - -
@sentry/browser (incl. Tracing, Replay) 78.6 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 68.27 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 83.26 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 95.49 kB - -
@sentry/browser (incl. Feedback) 40.94 kB - -
@sentry/browser (incl. sendFeedback) 28.88 kB - -
@sentry/browser (incl. FeedbackAsync) 33.78 kB - -
@sentry/react 25.93 kB - -
@sentry/react (incl. Tracing) 42.23 kB - -
@sentry/vue 28.71 kB - -
@sentry/vue (incl. Tracing) 42.04 kB - -
@sentry/svelte 24.24 kB - -
CDN Bundle 25.75 kB - -
CDN Bundle (incl. Tracing) 40.05 kB - -
CDN Bundle (incl. Tracing, Replay) 76.28 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 81.78 kB - -
CDN Bundle - uncompressed 75.23 kB - -
CDN Bundle (incl. Tracing) - uncompressed 118.58 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 233.71 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 246.47 kB - -
@sentry/nextjs (client) 44.23 kB - -
@sentry/sveltekit (client) 40.66 kB - -
@sentry/node-core 50.03 kB +0.15% +72 B 🔺
@sentry/node 151.34 kB +0.06% +81 B 🔺
@sentry/node - without tracing 91.94 kB +0.09% +77 B 🔺
@sentry/aws-serverless 105.4 kB +0.09% +86 B 🔺

View base workflow run

Copy link
Contributor

github-actions bot commented Sep 10, 2025

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.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 8,782 - 8,870 -1%
GET With Sentry 1,394 16% 1,378 +1%
GET With Sentry (error only) 5,932 68% 5,946 -0%
POST Baseline 1,194 - 1,176 +2%
POST With Sentry 499 42% 492 +1%
POST With Sentry (error only) 1,042 87% 988 +5%
MYSQL Baseline 3,320 - 3,255 +2%
MYSQL With Sentry 459 14% 450 +2%
MYSQL With Sentry (error only) 2,702 81% 2,620 +3%

View base workflow run

@timfish
Copy link
Collaborator Author

timfish commented Sep 10, 2025

@timfish
Copy link
Collaborator Author

timfish commented Sep 15, 2025

I think these both need to be merged and released before we can use this in production:

@timfish timfish mentioned this pull request Sep 18, 2025
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.

1 participant