graphite-project / carbon

Carbon is one of the components of Graphite, and is responsible for receiving metrics over the network and writing them down to disk using a storage backend.
http://graphite.readthedocs.org/
Apache License 2.0
1.51k stars 490 forks source link

Make max pickle string length configurable #826

Closed semyonslepov closed 5 years ago

semyonslepov commented 5 years ago

By default, max length for a pickle string is 1mb and it's not configurable. I have recently hit this limit on our setup where statsd collects data from many other senders and sends it to Graphite. This change allows to configure the max length.

codecov-io commented 5 years ago

Codecov Report

Merging #826 into master will increase coverage by 0.02%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #826      +/-   ##
==========================================
+ Coverage    50.1%   50.13%   +0.02%     
==========================================
  Files          37       37              
  Lines        3439     3441       +2     
  Branches      495      495              
==========================================
+ Hits         1723     1725       +2     
  Misses       1604     1604              
  Partials      112      112
Impacted Files Coverage Δ
lib/carbon/conf.py 40.72% <ø> (ø) :arrow_up:
lib/carbon/protocols.py 73.56% <100%> (+0.23%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b469e99...884e3d5. Read the comment docs.

piotr1212 commented 5 years ago

Seems like a good addition, thanks.

I think it would be better to have the setting name start with PICKLERECEIVER as it only applies to the pickle receiver (and not the carbonlink) and would me more in line with the existing options. I suggest PICKLE_RECEIVER_MAX_LENGTH.

And it would be a good thing to add it to the example.conf with a short description, somewhere here: https://github.com/graphite-project/carbon/blob/master/conf/carbon.conf.example#L107