charlie
charlie14mo ago

Best practice for forwarding webhook errors to Sentry?

I noticed one of my webhooks (HTTP actions) is erroring out, but I didn't get any kind of notification about it -- I only noticed because the data looked wrong on the frontend. Is there a way for Convex to notify me when this happens? If not, what's the best way to hook up Sentry here? In order to use @sentry/node, it seems I'd have to switch to the Node.js runtime -- is that the best practice?
10 Replies
ballingt
ballingt14mo ago
Baked-in Sentry support is in progress right now, it'll be "paste in your Sentry key and you're good to go." re notifying from Convex, the slickest you can do today is using log streaming with DataDog ir similar or a command line log tail process that notices errors. https://docs.convex.dev/production/log-streams
Log Streams | Convex Developer Hub
Configure logging integrations for your Convex deployment
charlie
charlieOP14mo ago
Glad to hear it re: baked-in! For now should I just move to the Node runtime and use Sentry in that case? As I am sans DataDog for now 🐕
rkbh
rkbh14mo ago
@sentry/node is a bit awkward to get to work nicely in serverless runtimes, since the package internally buffers and flushes events using exit handlers. This is why @sentry/serverless exists, but alas there is no Convex client here yet. If you want to use @sentry/node, you should be able to manually await the Sentry base client's flush method at the end of function invocations to be sure that the internal buffers are flushed
rkbh
rkbh14mo ago
If you're without Datadog, I'd highly recommend Axiom https://axiom.co/ ! They have a generous free tier and are super easy to use
Axiom
All your data, all the time - Axiom
All your data, all the time - meet Axiom's serverless log management solution
charlie
charlieOP14mo ago
Thanks @rkbh@ballingt ! I don't think I can add another tool right now, so I may give it a shot with @sentry/node (thanks for the tip about flush !) unless you feel like the Convex-Sentry integration is likely to launch pretty soon. As always thanks for jumping on Discord and helping us devs out, it's an awesome experience working with Convex
nipunn
nipunn14mo ago
Hoping to get out a built in sentry within a week or so, in case that timeline is helpful to you.
charlie
charlieOP14mo ago
Incredible! Thank you for that, I can hold out for a week 😄
nipunn
nipunn14mo ago
You caught us right when we’re almost done - just a few finishing touches I’ll message you here when it’s out!
charlie
charlieOP14mo ago
Don't rush on my account, that's great to hear! Thank you again!