sentry-javascript
sentry-javascript copied to clipboard
test: Add OTEL E2E test app using sdk-node
This adds an E2E app using a custom OTEL setup with @opentelemetry/sdk-node.
It tests that data is sent both to sentry as well as to another OTLP exporter. For this, I adjusted the event proxy code to also allow to spin up a generic event proxy server (which I use for the OTLP exporter). I also rewrote this to use fetch as this is a bit easier to read IMHO.
This is a decent first step, we should add at least 2 more E2E test apps IMHO related to OTEL:
- An app using
@opentelemetry/sdk-trace-nodeand some more custom tracing setup (e.g. more instrumentation, custom sampler, ....) - An app using
@opentelemetry/sdk-trace-nodethat does not use Sentry for performance at all, but only for errors, and only uses OTEL for trace monitoring.
Part of https://github.com/getsentry/sentry-javascript/issues/12494
Looks good, thanks for adding this test! Would it make sense to also add one with
.cjs?
We can def. do this! Though this is transpiled to cjs, so it is at least run with cjs already :) Using ts helps to also test that types etc. match everywhere correctly :)