We're currently using the officially dead https://github.com/vmware-archive/eventrouter to store kubernetes events in logstash.
The project is abandoned for some time but as the API is stable this is not an immediate issue. Although we should probably look out for alternatives at some point.
It would also be nice to be able to send events directly to kafka instead of going though: write to disk -> imfile -> mmkubernetes -> omkafka
Context
At current, our event logging pipeline consists of an Eventrouter deployment which runs in all clusters, is configured to make K8s API calls and output events through the stdout sink. Event logs are then read by rsyslog from disk (written to a file on worker nodes watched for changes via imfile), injected with metadata from Kubernetes via mmkubernetes, sent to kafka via omkafka plugin, and finally received by Logstash. [Diagram 1]
Conclusions following o11y x ServiceOps discussions:
Design considerations
In summary, following some discussion with o11y, we learned that the ongoing rsyslog replacement work above will introduce a logging agent placed as a gate to kafka-logging, plan being to funnel all traffic to kafka-logging through this rsyslog replacement agent without fully doing away with rsyslog (for ex. the replacement would still support reading logs from rsyslog where needed). This placement in particular would allow us to rate-limit, throttle, inspect, and sample incoming log streams before they end up in kafka and eventually migrate away from services writing to kafka-logging directly.
Impact
The impact of this in terms of the Eventrouter replacement work being that we’ll need to reconsider the replacement software writing event logs to kafka-logging directly, and pivot instead to either writing to the rsyslog replacement introduced by o11y or continue writing to disk then read by rsyslog still configured to write to the o11y agent. At the very least, the latter is guaranteed, but the former being the ideal here.
The high level objectives here remain the same, being three fold: (1) replace Eventrouter to avoid running unmaintained software in production and which poses the risk of needing frequent emergency patchwork & (2) reduce the rsysylog dependency that has been an active point of failure in the past and finally (3) explore the possibility of integrating event logging within the rsyslog replacement agent altogether (continued ServiceOps ownership), with consideration to continue do so post-adoption.
Next steps
Following some discussion with ServiceOps as well and mainly considering that Eventrouter is not actively failing us at the moment, we’ve considered that the best move forward here might be to wait for the rsyslog replacement work to land then reassess the landscape following. We’d like to re-iterate with o11y at the end of Q1 on whether a candidate replacement has been identified & consolidate our timelines in either case.