You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(node): Split up http integration into composable parts (#17524)
This is a first step to de-compose the node/node-core `httpIntegration`
into multiple composable parts:
* `httpServerIntegration` - handles request isolation, sessions, trace
continuation, so core Sentry functionality
* `httpServerSpansIntegration` - emits `http.server` spans for incoming
requests
The `httpIntegration` sets these up under the hood, and for now it is
not really recommended for users to use these stand-alone (though it is
possible if users opt-out of the `httpIntegration`). The reason is to
remain backwards compatible with users using/customizing the
`httpIntegration`. We can revisit this in a later major.
These new integrations have a much slimmer API surface, and also allows
us to avoid having to prefix all the options etc. with what they are
about (e.g. `incomingXXX` or `outgoingXXX`). It also means you can
actually tree-shake certain features (span creation) out, in theory.
Outgoing request handling remains the same for the time being, once we
decoupled this from the otel http instrumentation we can do something
similar there.
The biggest challenge was how to make it possible to de-compose this
without having to monkey patch the http server twice. I opted to allow
to add callbacks to the `httpServerIntegration` which it will call on
any request. So the `httpServerSpansIntegration` can register a callback
for itself and plug into this with little overhead.
// All options below do not do anything anymore in this instrumentation, and will be removed in the future.
52
+
// They are only kept here for backwards compatibility - the respective functionality is now handled by the httpServerIntegration/httpServerSpansIntegration.
53
+
85
54
/**
86
-
* Do not capture spans for incoming HTTP requests to URLs where the given callback returns `true`.
87
-
*
88
-
* @param urlPath Contains the URL path and query string (if any) of the incoming request.
89
-
* @param request Contains the {@type IncomingMessage} object of the incoming request.
* Whether the integration should create [Sessions](https://docs.sentry.io/product/releases/health/#sessions) for incoming requests to track the health and crash-free rate of your releases in Sentry.
126
-
* Read more about Release Health: https://docs.sentry.io/product/releases/health/
127
-
*
128
-
* Defaults to `true`.
90
+
* @deprecated This no longer does anything.
129
91
*/
130
92
trackIncomingRequestsAsSessions?: boolean;
131
93
132
94
/**
133
-
* @deprecated This is deprecated in favor of `incomingRequestSpanHook`.
0 commit comments