Skip to content

RavenVue / Vue plugins: 413 Request Entity Too Large #937

Closed

Description

@bjunc

I'm just getting started with Sentry/Raven. I'd like to get this running in Vue 2, but I'm experiencing an issue that might be a bug, or at least requires better documentation.

Environment

Vue 2, Webpack 2, raven-js via yarn (npm). Attempting to use RavenVue and Vue plugins with .addPlugin(RavenVue, Vue).

What is the current behavior?

When using RavenVue and Vue plugins, I get a 413 (Request Entity Too Large) error response. If I delete data.extra.propsData in the config's dataCallback, the request will go through. What is the size limit, 100k (#339)?

Activity

  1. ehfeng commented on May 15, 2017

    @ehfeng

    Yes, the size limit is currently 100kb.

    I'd like to understand how your event is larger than 100kbs. Are you attaching a large number of tags or body data? Or is the naive configuration of vue.js sending 100kb+ events?

  2. benvinegar commented on May 15, 2017

    @benvinegar
    Contributor

    The Vue plugin basically dumps part of the app state (propsData) as extraData. That app state could be arbitrarily large (e.g. nested objects/arrays).

    We realistically need to summarize/limit it in an intelligent way (e.g. only pass shallow objects). This would be good for other plugins too (e.g. Redux middleware).

  3. bjunc commented on May 30, 2017

    @bjunc
    Author

    Our SPA makes many calls to a REST API, and all of that data gets stored within Vue (some of it is more than we need, but that's REST for you). Over the course of the app's life, the sum of all that JSON could add up. 100K is a lot of JSON, but I can't let a Raven limit dictate what the app loads/doesn't load from the server for the fear that it might go over 100k. Not sure I would call that "naive" on the part of Vue, but rather on the part of Raven for assuming the app state would never go above 100k.

    For us, we've simply disabled this part of the plugin by calling delete data.extra.propsData before send. It hasn't really hindered our ability to diagnose problems on the front-end, but it would be a nice feature to have (maybe a shallow version of objects are sent, or the data is clipped before the request reaches 100k).

  4. fcoury commented on Dec 7, 2017

    @fcoury

    I am running into this very same problem with raven-js and redux plugins. My app state has around 180kb. Is there a way to bump the limit on Sentry?

  5. bjunc commented on Dec 7, 2017

    @bjunc
    Author

    @fcoury maybe I don't know what I'm missing as far as the benefits of having the data in Sentry, but I just delete the propsData before send (see above). Even since moving from REST to GraphQL, it's not worth the hassle of worrying about going over 100k, and not capturing the exception.

  6. fcoury commented on Dec 7, 2017

    @fcoury

    @bjunc the benefit I see is that I can inspect the user's redux state when the error was triggered. That helps a lot with the insights about the issue.

  7. bjunc commented on Dec 7, 2017

    @bjunc
    Author

    @fcoury I know what it's supposed to be able to do. I'm simply saying, since I don't get to do it, I don't really "miss" it. I would like it, for sure (that's why I created the issue in the first place).

    Anyway, have you considered attempting to prune the data on your end, before sending? That's on my todo list, but I haven't gotten around to it. Basically, write a prune method that is called in the exception callback that recursively goes through the data until it hits 100k.

  8. fcoury commented on Dec 7, 2017

    @fcoury

    @bjunc I am trying to learn how to intercept and change the payload before sending it out to Sentry. Do you know where I add such intercepting code?

  9. fcoury commented on Dec 7, 2017

    @fcoury

    @bjunc just found dataCallback option. I am going to play with it a bit.

  10. bjunc commented on Dec 7, 2017

    @bjunc
    Author

    @fcoury I haven't really looked into it, but if I were to start somewhere, I was considering something along the lines of the json-size NPM package. If the data is less than 100k, then send the whole thing. If not, go through and prune (maybe something along the lines of _.cloneWith)

  11. fcoury commented on Dec 7, 2017

    @fcoury

    @bjunc for now I settled with removing the fields unconditionally but this seems like a good approach as well. I wish Sentry provided an add-on to allow going over the limit.

  12. kamilogorek commented on Sep 4, 2018

    @kamilogorek
    Contributor

    Documented in the latest docs

  13. bjunc commented on Sep 4, 2018

    @bjunc
    Author

    @kamilogorek can you share the exact link for this? What's the TL;DR?

  14. kamilogorek commented on Sep 4, 2018

    @kamilogorek
    Contributor

    @bjunc

    getsentry/sentry-docs#310

    tl;dr

    What is the size limit, 100k

    200kB, or 64kB you use keepalive:true in fetch

    Is there a way to bump the limit on Sentry?

    no, it's not JS SDK limitation, but rather a whole system's

    how to intercept and change the payload before sending it out to Sentry

    old SDK: dataCallback
    new SDK: beforeSend or event processors once we document them fully

    I was considering something along the lines of the json-size NPM package. If the data is less than

    100k, then send the whole thing. If not, go through and prune
    See my implementation of this approach here: #874 (comment) which can be easily modified to be used in the Vue. We'll most likely provide more straightforward solution moving forward.

  15. bjunc commented on Sep 4, 2018

    @bjunc
    Author

    @kamilogorek
    Great, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions