getlogbook / logbook

A cool logging replacement for Python.
http://logbook.readthedocs.org
Other
1.48k stars 165 forks source link

RiemannHandler implementation #217

Closed zaibacu closed 8 years ago

zaibacu commented 8 years ago

New handler type which allows to push logs to Riemann via TCP or UDP.

Currently missing: TLS support, and riemann-client (https://github.com/borntyping/python-riemann-client) uses experimental protobuf support for Python 3. However, I haven't got any issues with it.

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-0.05%) to 74.948% when pulling 2b7853b681b19bba984f4ee964ce8d92788c2c8a on CodersOfTheNight:master into f5038a0371cb1f7999477f3dac37416738eb01e0 on getlogbook:master.

coveralls commented 8 years ago

Coverage Status

Coverage increased (+0.3%) to 75.261% when pulling a3351c6cf6f5c619d87b3b1ff4d60eb2ede12c2e on CodersOfTheNight:master into f5038a0371cb1f7999477f3dac37416738eb01e0 on getlogbook:master.

coveralls commented 8 years ago

Coverage Status

Coverage increased (+0.3%) to 75.261% when pulling 1ccd1118fa25043c93966eb6404ab825715ac717 on CodersOfTheNight:master into f5038a0371cb1f7999477f3dac37416738eb01e0 on getlogbook:master.

vmalloc commented 8 years ago

So if I understand correctly the test doesn't really send any data to riemann? Otherwise I don't understand how it works on Travis without starting an actual server...

zaibacu commented 8 years ago

Well there's not much point in testing: riemann-client -> riemann traffic, because it is already done, and kinda is https://github.com/borntyping/python-riemann-client responsability.

I would agree with creating stub TCP server and checking if there's traffic in it. This way riemann-client would be provoked to use protobuf and do actual serialization, any field mismatch would result in exception which would signal that something is not right at this side

vmalloc commented 8 years ago

Ok, I'll merge this for now, but it will wait before an official release to gather some run time.

vmalloc commented 7 years ago

@zaibacu It seams like this feature is broken (See https://travis-ci.org/getlogbook/logbook/jobs/204330723 for more details). I'm temporary removing this from setup.py and from Travis. Would appreciate if you could help by looking into it. Thanks!

zaibacu commented 7 years ago

@vmalloc ok, I will look into it tomorrow

vmalloc commented 7 years ago

@zaibacu Thanks a lot!

zaibacu commented 7 years ago

Ok, so the deal is, that protobuf version 3.2 broke everything. riemann-client library requires protobuf to be protobuf>=3.0.0b2,<4.0.0 thus installing broken version. One quick fix would be preinstall protobuf 3.1.0 version before installing riemann-client. Another - https://github.com/borntyping/python-riemann-client/issues/30 there's already issue registered for that, I guess there will be PR sooner or later to fix this :)

vmalloc commented 7 years ago

@zaibacu ok. So disabling for now, and I'll reintroduce it once it's stable again. Thanks!