Comments (9)
Hi, are you going to accept my pull request or do you see another solution?
from cron-sentry.
Sorry, @tltx, I missed github's email notification. I will comment on your PR.
from cron-sentry.
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.
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.
@ralish, how is your suggestion different from @tltx's pull request #14?
from cron-sentry.
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.
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.
@hltbra do you have any feedback on the PR or is it time to merge it?
from cron-sentry.
Apologies for never replying to this! The notification got lost in a mail deluge. Good result regardless :)
from cron-sentry.
Related Issues (12)
- It's not possible to use pipes with cron-sentry HOT 1
- support for sending additional data? HOT 6
- Rename the project HOT 1
- Change README to be reStructuredText instead of Markdown HOT 1
- No handlers could be found for logger "sentry.errors" HOT 1
- Option to write logs to syslog
- Option to not crop messages written to stdout and stderr with max string max length HOT 2
- Catch invalid commands (OSError) HOT 1
- Add proper exit status
- Make the `cmd` parameter required
- Add command-line parameters `string-max-length` and `max-list-length` 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 cron-sentry.