sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

test: Add OTEL E2E test app using sdk-node

Open mydea opened this issue 1 year ago • 1 comments

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:

  1. An app using @opentelemetry/sdk-trace-node and some more custom tracing setup (e.g. more instrumentation, custom sampler, ....)
  2. An app using @opentelemetry/sdk-trace-node that 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

mydea avatar Jun 28 '24 06:06 mydea

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 :)

mydea avatar Jun 28 '24 07:06 mydea