-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Document that there's a limit in the size of the data that can be sent #339
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
Comments
This has changed drastically in 2.0.0 since we now send data via POST. But, there is still a limitation depending on your server. If you're using on-premise, it's impossible to determine, but if you're talking to our servers (app.getsentry.com), our limit as of now is 100KB for the body. If the message is too large, it'll be rejected. @benvinegar We should add this to docs now. |
Hey guys, have you considered adding a check for the Sentry message size limit into Raven? What do you think would be the best way to check / truncate the (cc @benvinegar @mattrobenolt) |
Now, there's no way to communicate this back to the server until it fails to make the request and is rejected. In theory, we could change the error that's kicked back to be JSON and be something like, it's also worth noting that we don't deal with this in other clients nearly as often since they all gzip their payloads before transmitting, so it's very rare to cross our |
Thanks for the reply @mattrobenolt. I understand the situation, but what if this was configurable? When configuring or instantiating the Raven client I'd add a parameter specifying the limit for one event and the client would automatically trim the contents somehow. Would it make sense? (cc @vojtatranta) |
There's also not a really easy way to say "limit this to 100kb". Users can pass We've experimented with payload size, and found that for a typical maxed out stack trace, and 100 breadcrumbs, the payload is roughly ~15 KB. That's not a lot of bytes for a ton of information. Users only really hit the 100kb limit if they add arbitrarily large arrays/objects to I think if anything, we should add a note to the |
Yeah that's true. Actually, the large objects in |
I just ran into this with an error that had a bunch of breadcrumbs. It would be nice if the client would re-send the error without breadcrumbs or extra data so that it doesn't disappear completely. |
With redux sentry middleware our entire redux state gets sent in |
It's currently 100kB. You can use |
Yeah thanks I found the relevant docs. isn't |
It is indeed a global callback, which will be called for every event.
It's not that easy to do. We cannot simply calculate the size of the request and strip something if it's too large. We have to be performant and low in size. Adding something like this would require serialization of a whole payload, calculating the size and recursively trying to get it down to "sendable" size, which can be just too heavy process if someone will send tenths of errors in a very short period of time. |
Yeah I see that that is an issue - I looked at doing this myself. But Im
not suggesting trying to prune dynamic parts of the data - Im suggesting
only sending the parts that are truly essential and which cannot
collectively be too big. My suggestion would be: on a '413 Request entity
too large' sentry retries the same request, but this time without sending
`extra`, `breadcrumbs` and `stack` (and any other data which could be
(realistically) unbounded in size).
…On Thu, Oct 19, 2017 at 1:32 PM, Kamil Ogórek ***@***.***> wrote:
It is indeed a global callback, which will be called for every event.
Additionally I feel that the best policy is to report the error to sentry
without the heavy extra payload (or breadcrumbs or stack) rather than
simply failing on the client...
It's not that easy to do. We cannot simply calculate the size of the
request and strip something if it's too large. We have to be performant and
low in size. Adding something like this would require serialization of a
whole payload, calculating the size and recursively trying to get it down
to "sendable" size, which can be just too heavy process if someone will
send tenths of errors in a very short period of time.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#339 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAlhcP5xGZObiITHpqQV039kBtdbPaY4ks5stzNIgaJpZM4D2Amd>
.
|
Clearly the best solution to the problem of excessively large payloads, is to trim them down, and we have nice APIs to do just this ( So, at the very least it would nice to know when you've sent an exception that was rejected by Sentry. I understand the infeasibility of doing this on the server, but as @davidfurlong points out, it could easily be done on the client. I took a look at implementing this outside the library, but I don't think it's currently possible without depending upon some private implementation details of Raven. Something like this does seem to work, but it relies on being able to access the default transport implementation via Hack:function captureMessageWithoutContext(message) {
Raven.setDataCallback((data, originalCallback) => {
Raven.setDataCallback(originalCallback);
data.breadcrumbs.values = [];
return data;
});
Raven.captureMessage(message);
}
const originalTransport = Raven._makeRequest;
Raven.setTransport(opts => {
const originalOnError = opts.onError;
opts.onError = error => {
originalOnError(error);
if (error.request.status === 413) {
captureMessageWithoutContext(
"Failed to submit exception to Sentry. 413 request too large. " + error
);
}
};
originalTransport(opts);
}); I think if we included the actual XHR error, or even just the status code, in the 413 detection may very well be something that should live inside of Raven, but in the mean time, this would be a nice escape hatch and would let the community explore ways to handle 413 errors. This topic is especially interesting to me, since |
I agree that 413 should live inside of Raven, but even just making it easier to implement your own 413 handling would be a big improvement. Currently struggling to balance:
The issue is that our redux state can vary tremendously in size & |
We can most likely utilize Node's serializer here as well. Just a note to myself. |
Why is this not there in documentation ? |
Just come across this after several users sent in support requests about a frontend application. I'm rather surprised raven doesn't handle this given sentry's tagline "Stop hoping your users will report errors". Also a hit to our adoption of sentry! (We're getting big-ish breadcrumbns ~600k when catching Vue exceptions) |
with recent Chrome the limit is even smaller (65536 bytes) due to a bug: #1464 edit: not a bug! part of the |
As long as I understand, after reading #58 and other issues, raven-js uses HTTP GET requests to send data to Sentry. Apparently (and unlucky for me) it is a design decision related to the difficulties of handling CORS.
In any case, the fact is that there's a strict limit on the size of the error reports, that depends on the max url size supported by the Sentry web server. As I'm using the getsentry service, there's nothing I can do about it.
So, careless of how much I'd love to be able to POST longer reports to Sentry, I'd strongly recommend that you document this issue properly. I consider it to be very important and should be somewhere in the official documentation of the API.
Finally, thanks a lot for this great product.
The text was updated successfully, but these errors were encountered: