getsentry / sentry-javascript

Official Sentry SDKs for JavaScript
https://sentry.io
MIT License
8.02k stars 1.59k forks source link

Request for Hydrogen + Sentry demo repo with best-in-class instrumentation/context #9055

Closed Prithvirajkumar closed 1 month ago

Prithvirajkumar commented 1 year ago

Problem Statement

Currently we do not have a Hydrogen + Sentry demo repo with best-in-class instrumentation/context.

Solution Brainstorm

Overview: The request is to create a demo instance using Hydrogen, Shopify's React-based headless toolkit built on Remix. The demo instance should have Sentry's Remix SDK instrumented. Using the instance developers should be able to understand how to be successfully set up Sentry for a Hydrogen app.

Sentry Features that should be included:

Expected Outcome: We expect that the demo instance will provide developers with a clear understanding of how to integrate Sentry effectively with Hydrogen, showcasing best practices and demonstrating how to harness the full power of Sentry for error tracking and performance monitoring.

Additional Context: Hydrogen is based on Remix v2 which is supported by Sentry (GitHub PR)

Tasks

### Tasks
- [x] Create sample hydrogen v2 app (uses Remix under the hood)
- [x] Add Sentry Remix SDK to Hydrogen v2 demo app
- [x] Get sourcemaps uploading working
- [x] Get releases working for backend/frontend
- [x] Add Session Replay
- [x] Add Browser Profiling
- [ ] Add Node.js Profiling
- [ ] [Investigation] Add hydrogen specific context and information
- [ ] Create pages to show off error monitoring
- [ ] Create pages to show off setting custom tags
- [ ] Create pages to show off performance monitoring
- [ ] Instrument GraphQL
AbhiPrasad commented 1 year ago

@Prithvirajkumar where is this expected to live? Within https://github.com/sentry-demos/empower, or as a new repo?

@onurtemizkan would be great if you could help with tackling this! Building out a demo app of some kind with all these features - good opportunity for us to play around with Hydrogen as well to see what it can do.

AbhiPrasad commented 1 year ago

Alright we can make it a new repo in https://github.com/getsentry. @onurtemizkan when you're ready to take this on let me know and I can create a new repo for you.

onurtemizkan commented 1 year ago

@AbhiPrasad, sure I'm starting to work on this.

AbhiPrasad commented 1 year ago

I created https://github.com/getsentry/sentry-hydrogen-demo and sent an invite to you @onurtemizkan

AbhiPrasad commented 4 months ago

Please see https://github.com/getsentry/sentry-javascript/issues/5610#issuecomment-2263274411 - we have @sentry/cloudflare that folks can use to instrument cloudflare pages/workers which is what hydrogen relies on.

marisajackson commented 3 months ago

I'm confused on how this is complete? I am still not understanding how to integrate Sentry in to a Hydrogen/Oxygen app.

bitforcesrl commented 3 months ago

Hi @AbhiPrasad could you please confirm that this demo: https://github.com/getsentry/sentry-hydrogen-demo (or update it ) is still valid and working? we've tried the remix sentry wizard but is not working with hydrogen

thanks

petfriendlydev commented 3 months ago

Also looking to understand how to integrate sentry into hydrogen/oxygen. @AbhiPrasad - can you please assist?

petfriendlydev commented 2 months ago

Hey @AbhiPrasad! Hoping you might be able to follow up on this - can you confirm how we can integrate Sentry into Oxygen?

AbhiPrasad commented 2 months ago

Hey @petfriendlydev - I'll try to get something together to show this week! Sorry for the delay, just came back from vacation.

petfriendlydev commented 2 months ago

Hi @AbhiPrasad! Checking in to see if we're on track to get something this week? Thank you!

petfriendlydev commented 2 months ago

@AbhiPrasad hi again! follow up - can you help here? thank you!

vemundeldegard commented 2 months ago

I would love an example of this. Tried to set this up myself, without great success.

petfriendlydev commented 2 months ago

Trying one last time... @AbhiPrasad could you please circle back on how to integrate sentry into oxygen with more details? We remain unable to do so and are now assessing an alternative to sentry because of the roadblock here. Your help would be greatly appreciated.

AbhiPrasad commented 1 month ago

Assigning to myself so this doesn't get off track! We'll get this in this week for sure - sorry for the earlier delays.

AbhiPrasad commented 1 month ago

Here is an example repo: https://github.com/AbhiPrasad/sentry-shopify-hydrogen-example

The README has some instructions.

Screenshots:

Image

Image

PeterDKC commented 1 month ago

@AbhiPrasad Thanks for this.

In this example you've listed two plugins, one for Remix one for Cloudflare. In the server.ts there's a DSN.

Image

My question is, should this be:

Or

Or does that matter at all?

Thanks!

marisajackson commented 1 month ago

@AbhiPrasad I implemented everything in your example repo and I am now receiving:

Deployment failed, error: Uncaught TypeError: withSentry is not a function

I only get this upon deployment and it works locally without issue.