Giter Site home page Giter Site logo

Comments (9)

tltx avatar tltx commented on August 23, 2024

Hi, are you going to accept my pull request or do you see another solution?

from cron-sentry.

hltbra avatar hltbra commented on August 23, 2024

Sorry, @tltx, I missed github's email notification. I will comment on your PR.

from cron-sentry.

ralish avatar ralish commented on August 23, 2024

The cause of this bug is due to the meaning of -1 as it applies to Python's slice notation. By setting the string_max_length parameter to -1 it's interpreted by some of Raven's serializers to mean "the string minus the last character". Take a look at the highlighted serializers in raven/utils/serializer/base.py.

In short, there's no sane way that I can see to specify no limit for the string data. This is I think generally fair, as the Sentry server is always going to impose its limits, and the client has good reason to impose its own either in recognition of the upstream server limits or for its own reasons.

Taking the current Sentry sources as an example, SENTRY_MAX_EXTRA_VARIABLE_SIZE is set to 4096, and so each key's value in the extra dictionary will be trimmed to this value regardless, up to a maximum number of keys defined by SENTRY_MAX_DICTIONARY_ITEMS, which defaults to 50. As for Raven, string_max_length defaults to MAX_LENGTH_STRING which is 400 (though the documentation doesn't seem to reflect this).

My suggestion would be to set the limit to 4096 to reflect the current Sentry default, in recognition that anything higher than this will require overriding the default in Sentry's conf/server.py. A comment should be added to indicate this to help eliminate confusion as to why keys in the extra data structure with values larger than this limit are being silently truncated.

Happy to create a pull request to implement the above change if this is agreeable.

from cron-sentry.

tltx avatar tltx commented on August 23, 2024

This is what I tried to do in my PR. Setting the default of string_max_length to 4096 and adding a comment about the Sentry default is a good idea. Please make a PR, this is how it should be.

from cron-sentry.

hltbra avatar hltbra commented on August 23, 2024

@ralish, how is your suggestion different from @tltx's pull request #14?

from cron-sentry.

hltbra avatar hltbra commented on August 23, 2024

I am eager to merge #14 and release a new version, but I would like to understand what's missing or wrong from your understanding, @ralish.

from cron-sentry.

tltx avatar tltx commented on August 23, 2024

As far as I can tell SENTRY_MAX_EXTRA_VARIABLE_SIZE in the Sentry config limits the total number of chars in strings in the extra dict, that cron-sentry use. I have updated my PR to reflect this.

from cron-sentry.

tltx avatar tltx commented on August 23, 2024

@hltbra do you have any feedback on the PR or is it time to merge it?

from cron-sentry.

ralish avatar ralish commented on August 23, 2024

Apologies for never replying to this! The notification got lost in a mail deluge. Good result regardless :)

from cron-sentry.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.