Add Sentry performance monitoring and environments #3106
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Performance tracing: adds the basic Sentry performance setup. The most valuable data here is the web vitals stuff, but it'll also be the foundation of future tracing for the new GraphQL server as well.
I've added a
Timing-Allow-Origin
header to api.nusmods.com so that we can see timing info for it in our traces.Sentry do provide a React integration that can log basic React lifecycle info for components wrapped in a
withProfiler
HoC. However, lifecycle info (i.e. mount, render, update, unmount) for single components isn't very useful, and you'll need to wrap each component of interest individually. I think it may be more useful to build our own React tracer using the user timing marks I helped add to React, which are enabled in experimental profiling builds of React, which will be able to provide timing information on React state updates, suspends, etc, as well as info on effect execution and render and commit phases.Environments: adds some heuristics to determine an environment.
Screenshots
All links are internal-only.
Environments
Performance tab
Transaction details