Comments (8)
Sooooo I've actually come to the conclusion that raven-for-redux and redux-raven-middleware are not the best idea. Even with all my 413 error handling and redux-undo
history removal, Sentry is still aggressively trimming the "additional data" and removing large chunks of my state. See:
- https://forum.sentry.io/t/additional-data-is-getting-agressively-truncated-trimmed/4940
- getsentry/sentry-javascript#1472
I came up with a new approach that I'm going to try out:
Maybe a better approach would be to just submit the state to my own server, store the compressed JSON in an S3 bucket, and only send the URL to Sentry. (The compression will actually make a huge difference, because I have a lot of repeated data in my state, so it can compress from 220KB down to 5KB.) And then I can just copy that URL, and paste it into the developer console to load the state.
I could even set an expiration rule on the S3 bucket, so that old files are deleted after 3 months. I think I'm going to create an open source library that can manage all of this, specifically for Ruby on Rails. Will call it something likeraven-redux-rails
.
Basically I'm going stop sending any Redux state to Sentry. I'm going to add some API endpoints to my own application, and store the compressed state in my own S3 bucket. Then I'll just send that URL to Sentry. The API specification should be really easy to implement if you're already using S3 and you have authentication for admin users. Let me know if you're interested in contributing a library for other languages/frameworks, like Django, Laravel, Spring, etc.
I've started a repo here, in case anyone wants to follow along: https://github.com/FormAPI/raven-redux-rails)
from raven-for-redux.
@beaugunderson Yeah I needed to make a few changes to get it working. I ended up with a solution and have opened a PR: #95
I've tested this in development and have written some tests that are all passing, so it seems to work pretty well. I'm going to deploy it to production now and see if there are any issues.
from raven-for-redux.
I suppose I could use the stateTransformer
option..
from raven-for-redux.
But also the conditions here: https://docs.sentry.io/learn/quotas/#attributes-limits seem quite limiting
from raven-for-redux.
Noting that now raven-js
and @sentry/browser
default to fetch()
with { keepalive: true }
if fetch()
is available. { keepalive: true }
limits POST
requests to a 64k body, so overriding fetchParams
with { keepalive: false }
can help here too (Sentry's documented limit is 100k, and onpremise users have effectively no limit).
More info at getsentry/sentry-javascript#1464
from raven-for-redux.
I just noticed this happening while I was testing errors in development, and now I'm really worried that I've been missing a lot of error reports in production! I'm using redux-undo
, so my state gets really large after only a few changes. Interestingly, compressing it with gzip turns 220kb of JSON into 5kb.
This should be a huge warning at the top of the README. I also think that raven-for-redux
should be responsible for handling 413 responses, and it could retry the request without any state data. I can try to work on a PR for this. I'm also going to try to gzip the data on the client, and will see if Sentry accepts these requests.
I imagine that this issue has probably caused thousands of error reports to be silently dropped, so this is a huge problem that users should be aware of.
from raven-for-redux.
@captbaritone I just saw your workaround here: getsentry/sentry-javascript#339 (comment)
I think it would be awesome if this was part of raven-for-redux
EDIT: Ah there was a bug in your code (or sentry-javascript has changed). We need to call originalTransport.call(Raven, opts);
now, otherwise this
is not correct inside _makeRequest
.
EDIT 2: Should also note that the maximum payload size has been increased to 200KB: https://docs.sentry.io/clients/javascript/usage/#raven-js-additional-context
from raven-for-redux.
from raven-for-redux.
Related Issues (20)
- SSR Usage instruction missing on README.md HOT 1
- What kind of errors will be captured? HOT 1
- React Native Sentry dosn't collect extradata HOT 22
- An in-range update of react is breaking the build 🚨 HOT 3
- An in-range update of prettier is breaking the build 🚨 HOT 20
- Running on node-js causes a memory leak HOT 2
- An in-range update of webpack is breaking the build 🚨 HOT 67
- any example how to use getusercontext ? HOT 2
- An in-range update of raven-js is breaking the build 🚨 HOT 4
- Is it possible to capture only certain errors? HOT 2
- An in-range update of react is breaking the build 🚨 HOT 22
- Not working for new @sentry v4 beta versions HOT 8
- An in-range update of eslint-config-prettier is breaking the build 🚨 HOT 1
- An in-range update of eslint-plugin-react is breaking the build 🚨 HOT 16
- An in-range update of webpack-dev-server is breaking the build 🚨 HOT 26
- License HOT 2
- Jest Test Error HOT 2
- Support for @sentry/browser HOT 1
- Add support for @sentry/browser HOT 15
- GDPR: Filter data before sending HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raven-for-redux.