Page MenuHomePhabricator

Find a replacement for the unmaintained eventrouter
Open, Stalled, LowPublic

Description

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.

Event Timeline

JMeybohm triaged this task as Low priority.
fgiunchedi subscribed.

Untagging o11y as there doesn't seem any immediate action, please reach out otherwise!

Two alternatives I see:

  • https://docs.fluentbit.io/manual
    • (+) CNCF graduated
    • (-) written in C, probably not the best choice for new software to add to the stack
  • do one thing and do it well single purpose binary written in Go, Rust wiring together exactly the events-API and kafka (supercreative projectname events2kafka)
    • would be interesting to get to know the requirements here :)

Reading through context in T262675: Store Kubernetes events for more than one hour, our previous challenge in writing events directly to kafka (in EventRouters case utilizing the kafksink directly rather than stdout) and by extension avoiding the rsyslog dependency, is implementing Kafka brokers discoverability from within the Kubernetes cluster.

Doing so would allow us also to avoid an in-place replacement for EventRouter and the need to maintain the rsyslog dependency regardless of the replacement.

Edit: It appears that do write to kafka brokers directly in eventgate-logging-external among others by setting the metadata.broker.list to a static list of brokers [0]

external_services:
  kafka: [logging-codfw]
main_app:
  conf:
    topic_prefix: codfw.
    kafka:
      conf:
        metadata.broker.list: kafka-logging2001.codfw.wmnet:9093,kafka-logging2002.codfw.wmnet:9093,kafka-logging2003.codfw.wmnet:9093,kafka-logging2004.codfw.wmnet:9093,kafka-logging2005.codfw.wmnet:9093

and in rdf-streaming-updater to kafka-main-codfw.external-services.svc.cluster.local:9093 [1] preforming round robin selection via external services.

app:
  config_files:
    rdf-streaming-updater-config.properties:
      brokers: kafka-main-codfw.external-services.svc.cluster.local:9093
      # TODO: This value is also constructed by the chart and fed to flink config, but the chart can't
      # know anything about our specific application. Is there some way to read the flink value
      # instead of copying it here?
      output_topic_prefix: codfw.

[0] - https://gerrit.wikimedia.org/r/plugins/gitiles/operations/deployment-charts/+/refs/heads/master/helmfile.d/services/eventgate-logging-external/values-codfw.yaml#9
[1] - https://gerrit.wikimedia.org/r/plugins/gitiles/operations/deployment-charts/+/refs/heads/master/helmfile.d/services/rdf-streaming-updater/values-codfw.yaml#8

Listing some options while we survey the landscape:

FluentBit/ Fluentd

Quick Links:

Possible AlternativeRepositoryHelm ChartDocumentation
Fluent BitSource CodeFluentBit Aggregator Helm ChartDocumentation

More of a full fledged telemetry agent, supports ingestion and forwarding “from any source to any destination” with extensive support for filtering/routing/buffering. It is a CNCF graduated project and appears to be more heavily well maintained. It offers the functionality for our use case, plus a bit more.

A couple of common architecture patterns can be found here [0]. The most relevant to ours being the forwarder/aggregator pattern potentially, which runs as an aggregation stateful set.

It offers a Kubernetes events input plug-in [1] which simplifies retrieving K8s events as logs and processes them through the pipeline as well as two kafka output plug-ins which export events through either the Kafka Producer or Kafka Rest Proxy [2], the latter more relevant to our use case. In addition to offering a standard output plug-in [3] as well.

Architecturally, if we go with this route, we’d have the option to either replace EventRouter in-place while continuing to write to rsyslog off worker nodes (using the standard output plug-in), or write to kafka brokers directly (using the kafka-rest proxy plug-in).

Post ingestion, It also offers a Kubernetes filter to enrich logs with metadata [4], which would potentially enable us to write events to kafka directly while avoiding some of the common issues we encountered previously with mmkubernetes needing a rsyslog restart. [5]

Noteworthy too is that FluentBit/Fluentd was previously considered for processing logs in T207200 . This however would be a different use case, but mentioning here as context.

Some additional items for consideration: a) whether or not it's too heavy duty/ general for our selective use case in particular / b) If we adopt such a telemetry agent for k8s events, we may presently or in the future like to consider evaluating the same telemetry agent for application logs as well. It wouldn’t be necessary as it seems that FluentBit offers precise and straightforward enough plugin support for our use case, but worth considering nonetheless.

[0] - https://fluentbit.io/blog/2020/12/03/common-architecture-patterns-with-fluentd-and-fluent-bit/
[1] - https://docs.fluentbit.io/manual/data-pipeline/inputs/kubernetes-events#configuration-parameters
[2] - https://docs.fluentbit.io/manual/data-pipeline/outputs/kafka-rest-proxy
[3] - https://docs.fluentbit.io/manual/data-pipeline/outputs/standard-output
[4] - https://docs.fluentbit.io/manual/data-pipeline/filters/kubernetes#fluent-bit.conf
[5] - https://wikitech.wikimedia.org/wiki/Kubernetes/Logging#Common_issues

This happens to be an ask we had not yet incorporated into our pre-kafka logging daemon evaluation. I have added it to the evaluation matrix.

Of the projects o11y is evaluating, Fluent-bit, Bento, and the OpenTelemetry Collector have native support for collecting events from the events api.

Also to consider, eventrouter has a few forks that appear maintained: openshift, kube-logging, et. al.

This happens to be an ask we had not yet incorporated into our pre-kafka logging daemon evaluation. I have added it to the evaluation matrix.

Of the projects o11y is evaluating, Fluent-bit, Bento, and the OpenTelemetry Collector have native support for collecting events from the events api.

Also to consider, eventrouter has a few forks that appear maintained: openshift, kube-logging, et. al.

Thanks for the comment! I've requested some additional context and was directed to https://docs.google.com/document/d/1dHjvgjb4uD7BpcbfBeszVyK-R5Fgg41iUkf02jLpKxc/edit?tab=t.0
@jasmine_ please take a look to see if we can influence the decision here with the research from o11y. When rsyslog gets replaced soon'ish anyways it might make sense to keep the "log-to-disk" approach and not invest in special tooling/config to bypass that.

This happens to be an ask we had not yet incorporated into our pre-kafka logging daemon evaluation. I have added it to the evaluation matrix.

Of the projects o11y is evaluating, Fluent-bit, Bento, and the OpenTelemetry Collector have native support for collecting events from the events api.

Also to consider, eventrouter has a few forks that appear maintained: openshift, kube-logging, et. al.

Thanks for the comment! I've requested some additional context and was directed to https://docs.google.com/document/d/1dHjvgjb4uD7BpcbfBeszVyK-R5Fgg41iUkf02jLpKxc/edit?tab=t.0
@jasmine_ please take a look to see if we can influence the decision here with the research from o11y. When rsyslog gets replaced soon'ish anyways it might make sense to keep the "log-to-disk" approach and not invest in special tooling/config to bypass that.

Thanks @JMeybohm & @colewhite ! Much appreciate the context here.

Updating the task with a summary of some recent 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 this week, and mainly considering that Eventrouter is not actively failing us at the moment, we’ve considered that the best move forward here is to hold off on replacing Eventrouter at the current moment, opting coordinate with o11y during the rsyslog replacement work or shortly after it lands. We’d like to re-iterate with o11y at the end of Q1 on whether a candidate rsyslog replacement has been identified & consolidate our timelines in either case.

jasmine_ updated the task description. (Show Details)
jasmine_ updated the task description. (Show Details)
jasmine_ updated the task description. (Show Details)
MLechvien-WMF added subscribers: hnowlan, MLechvien-WMF.

Thanks for the detailed analysis and conclusion Jasmine.

@colewhite @hnowlan is there a corresponding task on o11y side which we should link this to for future reference?

@jasmine_ @JMeybohm an admin question: given the conclusion captured and the link to the o11y task, should we close this task?

There will be onboarding/migration to do on o11y system for our use case, and this is probably one quarter away.

Do we want to reuse this task to track this onboarding, or better to open a new dedicated task when the time comes?

@colewhite @hnowlan is there a corresponding task on o11y side which we should link this to for future reference?

Linked! T333731: Investigate pre-kafka log agent replacement for rsyslog

Thanks Cole!

@jasmine_ @JMeybohm an admin question: given the conclusion captured and the link to the o11y task, should we close this task?

There will be onboarding/migration to do on o11y system for our use case, and this is probably one quarter away.

Do we want to reuse this task to track this onboarding, or better to open a new dedicated task when the time comes?

I'll propose closing the evaluation/investigation part of the discussion here and linking a dedicated implementation/migration work task following.
Granted the design considerations surfaced here have defined a more clear path forward, I lean towards itemizing these separately for clarity.

I'd keep this open since the requirement of replacing eventrouter at some point still stands. But if you feel like a new task is the better/cleaner approach feel free to close and backlink this one.

MLechvien-WMF changed the task status from Open to Stalled.Aug 28 2026, 10:20 AM
MLechvien-WMF edited projects, added: ServiceOps (Next quarter); removed: ServiceOps.

This is dependent on the progress of T333731 , but moving this to next quarter on our end as o11y has that task in their Q2 plans