dcramer / peated

https://peated.com
Apache License 2.0
63 stars 13 forks source link

Use `@sentry/node-experimental` with OTEL-powered tracing #59

Closed mydea closed 1 year ago

mydea commented 1 year ago

This replaces @sentry/node with @sentry/node-experimental, which under the hood uses OTEL for performance instrumentation.

While this is experimental (!!), it seems to work OK enough in my initial tests, but more testing etc. is needed for sure.

Changes that are necessary to make this work:

  1. SDK needs to be initialized before any imports are made - so moved this to the top.
  2. Replaced trace() with startSpan() - only the new performance APIs startSpan and startInactiveSpan work in node-experimental.
  3. Performance instrumentations are auto-discovered, no need to configure something for them.
  4. Async context management is delegated to OTEL under the hood, no need to add any code for this anymore.

Happy about any feedback - as this is experimental, there may (will) def. be rough edges or cases where stuff does not work as expected!