You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering what is the right way to use the Sentry integration with Posthog in the Vercel environment. Basically:
Sentry has you initialize in a sentry.server.ts file that Sentry's NextJS bindings seem to call on its own.
In practice you would need to pass the Posthog client to the posthog sentry integration init function, which is fine
But where would I call posthog.shutdown() as recommended in the docs?
And how would it work regarding assigning the user distinct ID during actual requests? Would there be any risk of misattributing Sentry logs if I was setting the ID on the posthog client during requests?
Or maybe should I use the option in posthog-node to provide the tag like so:
If I do this, still not sure how to handle the shutdown() function, should I be calling it perhaps by listening for events like SIGINT and calling it then or something?
Some guidance on the proper way to set this up so that server logs can also be tagged with Posthog would make tracking a user's journey across the backend and frontend much smoother, as it's clear how to set it up on the client side. Thanks!
The text was updated successfully, but these errors were encountered:
osdiab
changed the title
Using the Sentry Posthog integration with NextJS in
Using the Sentry Posthog integration with NextJS in Vercel
May 9, 2024
osdiab
changed the title
Using the Sentry Posthog integration with NextJS in Vercel
Using the Sentry Posthog integration on the server with NextJS in Vercel
May 9, 2024
I was wondering what is the right way to use the Sentry integration with Posthog in the Vercel environment. Basically:
sentry.server.ts
file that Sentry's NextJS bindings seem to call on its own.posthog.shutdown()
as recommended in the docs?posthog-node
to provide the tag like so:https://posthog.com/docs/libraries/node#example-implementation
If I do this, still not sure how to handle the
shutdown()
function, should I be calling it perhaps by listening for events likeSIGINT
and calling it then or something?Some guidance on the proper way to set this up so that server logs can also be tagged with Posthog would make tracking a user's journey across the backend and frontend much smoother, as it's clear how to set it up on the client side. Thanks!
The text was updated successfully, but these errors were encountered: