-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add request information to Angular ssr events #12757
Comments
Hi @MarcoGlauser thanks for writing in! At the moment we do not officially support SSR Angular apps. The From my limited understanding about Angular SSR, I'd say Just to confirm: Did you get things to work in the end as you wanted? I'd love to get a more complete picture about how you're currently setting up Sentry in an SSR Angular application. Maybe we can extract a guide out of this to make it available to others. I think having this documentation is the first step. Either we stop there and users have at least a guide what to do or we base an SSR-compatible SDK on the findings from it (this is usually how we go about developing meta/SSR framework SDKs). Would you be interested in writing a small guide what to do? It could be just in this thread, in our docs or if you have your own blog or similar, that's also totally fine. In that case, I'd only ask if we may eventually link to it from our docs or copy some of the contents (with attribution of course) when we create an in-house guide. |
Hi @Lms24, Using only The SDKs don't seem to mind that both are running at the same time but we also have the imports strictly separated. |
Ahh so in
Sorry, you actually already shared this. I'm just wondering where the |
I can't easily share our server.ts, since we also inject things like redis caches and have some api routes that make the whole thing bigger than I'd like :/ In the server.ts file, we're initializing Since angular has it's own way of handling errors, we're only passing With this setup, I hope this helps. Let me know if anything is unclear. Sadly, angular ssr has been a bit neglected by the core devs and only recently started getting some love again. So it's very understandable that third party devs haven't invested heavily into the eco system. We have found that Should I open a separate issue for that or do you not intend for |
Thanks for the details!
Yup, I saw the recent improvements (also regarding their docs) but it looks like it's still rather niche overall. Still we should invest some time into investigating what we can do here to at least unblock folks wanting to use Sentry in Angular SSR applications.
I think the fix should be fairly straight forward (i.e. guard with a
To be honest, not sure yet! For the moment we don't expect it to run in server environments at all. Could be that we'd eventually have to create a separate Angular SSR package. |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you remove the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
Problem Statement
We run Angular in ssr mode and use Sentry to track errors. The errors themselves come through, but they don't have any metadata associated, since the angular sdk expects to run in a browser.
It would be great, if Sentry would automagically collect metadata from the ssr environment.
Solution Brainstorm
We managed to get some meta information added but had to jump through quite a few hoops:
tokens.ts
server.ts
The main challenge was that if we loaded the node integrations directly(or even lazy), we would get compilation errors, since the frontend code would complain that there's no node api. By injecting the integrations from server.ts, we managed to avoid those errors, since sentry node will never appear in a browser bundle.
I hope that makes some sense but I have no idea, how viable it is to integrate into the sdk.
The text was updated successfully, but these errors were encountered: