You are browsing a read-only backup copy of Wikitech. The live site can be found at

Event Platform/EventStreams/Administration

From Wikitech-static
< Event Platform‎ | EventStreams
Revision as of 15:18, 26 March 2019 by imported>Ottomata (Ottomata moved page EventStreams/Administration to Event Platform/EventStreams/Administration: Collecting Event Platform pages under a hierarchy)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

See EventStreams for an overview of the EventStreams service.

EventStreams is a service-template-node based service. It glues together KafkaSSE with common Wikimedia service features, like logging, error reporting, metrics, configuration and deployment.

Internally, EventStreams is available at eventstreams.svc.${::site}.wmnet. It is routed to by varnish and LVS from


EventStreams is configured in puppet via role::eventstreams::* hiera variables. The production configuration is in the hiera scb role.

role::eventstreams::streams maps stream routes to composite topics in Kafka. Our event topics are prefixed by datacenter name. This is abstracted for EventStreams consumers via this mapping. Any combination of stream name -> composite topic list is possible, e.g.

      - eqiad.mediawiki.recentchange
      - codfw.mediawiki.recentchange


EventStreams is backed by the main Kafka clusters. As of 2018-08, EventStreams is multi-DC capable. By default, EventStreams in codfw still consumes from main-eqiad across DC boundries, but the backing Kafka cluster can be switched anytime. It does this so that the events themselves don't have rely on MirrorMaker propagation.

NodeJS Kafka Client

KafkaSSE uses node-rdkafka (as do other production NodeJS services that use Kafka).


Repository Description
KafkaSSE (github) Generic Kafka Consumer -> SSE NodeJS library.
eventstreams (github) EventStreams implementation using KafkaSSE and service-template-node.
eventstreams/deploy Deploy repository for EventStreams, contains scap3 config and node dependencies.


EventStreams is deployed by Scap3 to the scb production service cluster. In deployment-prep, EventStreams is deployed to sca hosts.

Submitting changes

Change to KafkaSSE library

KafkaSSE is hosted in Github, so you must either submit a pull request or push a change there.

kafka-sse is an npm dependency of EventStreams.

If you update kafka-sse, you should bump the package version and publish to npm:

Change to eventstreams repository

EventStreams is hosted in gerrit. Use git review to submit patches. If you've modified the KafkaSSE repository, you should update the kafka-sse dependency version in package.json.

Update eventstreams/deploy repository

Once you've made changes to either of the above to repositories, you'll need to rebuild the eventstreams/deploy repository. The easiest way to do this is to use service-runner's docker builder. Follow the instructions at to do so.


Ssh to the deploy server and run the following instructions to deploy the latest commit in the eventstreams/deploy repository.

ssh deployment.eqiad.wmnet # or deployment-tin.deployment-prep.eqiad.wmflabs
cd /srv/deployment/eventstreams/deploy
git pull && git submodule update
scap deploy


Logs are output to disk on target hosts in /srv/log/eventstreams/.