-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Note
The pull request "feat(core, node): portable Express integration" was created by @isaacs but did not reference an issue. Therefore this issue was created for better visibility in external tools like Linear.
This extracts the functionality from the OTel Express intstrumentation,
replacing it with a portable standalone integration in @sentry/core,
which can be extended and applied to patch any Express module import in
whatever way makes sense for the platform in question.
Currently in node, that is still an OpenTelemetry intstrumentation, but
just handling the automatic module load instrumentation, not the entire
tracing integration.
This is somewhat a proof of concept, to see what it takes to port a
fairly invovled OTel integration into a state where it can support all
of the platforms that we care about, but it does impose a bit less of a
translation layer between OTel and Sentry semantics (for example, no
need to use the no-op span.recordException()).
The only user-visible change (beyond the additional export in
@sentry/core, of course) is that spans have an origin of
auto.http.express rather than auto.http.otel.express, since it's no
longer technically an otel integration.
Obviously this is not a full clean-room reimplementation, and relies on
the fact that the opentelemetry-js-contrib project is Apache 2.0
licensed. I included the link to the upstream license in the index file
for the Express integration, but there may be a more appropriate way to
ensure that the license is respected properly. It was arguably a
derivative work already, but simple redistribution is somewhat different
than re-implementation with subtly different context.