sentry-javascript
sentry-javascript copied to clipboard
feat(deno): add Deno.serve integration
closes #12450
the code is mostly taken from the bun sdk
Before submitting a pull request, please take a look at our Contributing guidelines and verify:
- [x] If you've added code that should be tested, please add tests.
- [x] Ensure your code lints and the test suite passes (
yarn lint) & (yarn test).
sorry, this has been open for a very long time - is this still relevant to the state of deno today (where we are basically node-compatible)? This has run quite out of sync and would need rebasing on develop.
is this still relevant to the state of deno today
Yes. Deno.serve is still a separate API. Node code won't instrument it. This PR is blocked by #15455 (see https://github.com/getsentry/sentry-javascript/issues/12450#issuecomment-2690727567)
where we are basically node-compatible
Node.js compatibility here means you will be able to use Sentry's Node.js httpIntegration but that will only apply to Node.js-style servers (the ones directly or indirectly using node:http in Deno).
Also, even then the Node.js compatibility mode and Deno globals are different (see #12400 and https://github.com/denoland/deno/issues/20826) and since Sentry v9 is no longer published to deno.land and the JSR version is pretty much unusable, there is no official way for stuff like console integration to work with Deno.
This has run quite out of sync and would need rebasing on develop.
Yeah, I can rebase it, but I don't think it's gonna be unblocked anytime soon, so it will get stale again 🤷♂️
However, if the OLTP endpoint lands, then it will fix both these issues. See #85902 and https://github.com/denoland/deno/issues/28330#issuecomment-2724417332
On a side note, we have been using a patched version in prod for almost an year now - https://github.com/globalbrain/hado/blob/main/src/sentry.ts - so if anyone using Deno wants to use Sentry with fixes for console and fetch capturing and Deno.serve integration, they can use it.