OSError: [Errno 36] File name too long
File "/var/graphite/env/lib/python2.7/site-packages/kenshin-0.2.6-py2.7-linux-x86_64.egg/kenshin/utils.py", line 24, in mkdir_p
os.makedirs(path)
File "/var/graphite/env/lib64/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/var/graphite/env/lib64/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
a 340 characters metric name
Maximum filename length on XFS is 255 bytes. https://en.wikipedia.org/wiki/Comparison_of_file_systems#Limits
.hs file successful created, but symlink failed.
Ignore filename too long while os.symlink or set a limit(for each part of metric name) in Kenshin Storage? @zzl0
3 options:
- Optimize metric names.
Ignore filename too long while os.symlink or set a limit(for each part of metric name) in Kenshin Storage- Investigate how the graphite team solve this problem
https://github.com/graphite-project/carbon/issues/181
Adding a regex and a string manipulation on every insert can be very costly at high volume. There used to be code to "correct" malformed metrics but it was removed because of the performance impact. If you want good metric namespaces you should send good metric namespaces, the code shouldn't be a nanny that everyone has to pay for.
match ^.*[^.]{256,}.*$
send to blackhole
stop
;
add this to relay.conf will prevent bad metrics send to rurouni cache limit (256 here) depends on your file system
@camper42 想了下,我觉得应该在这里(即 instrumentation.incr('creates')前面)加上检查指标格式的逻辑,如果不合法就拒绝,并用 instrumentation 统计不合法的指标数量。
为什么这个检查对 cpu/性能 消耗不大?
- 只有新的指标才会走到这里。
- 而且我们使用了 token_bucket 控制新指标的数量(我们线上应该是1000 个每分钟,具体参见 settings.MAX_CREATES_PER_MINUTE)。