Page MenuHomePhabricator

EventBus mediawiki extension should support multiple 'event service' endpoints
Closed, ResolvedPublic5 Story Points

Description

In order to support both the eventlogging-service-eventbus, as well as multiple eventgate services, the EventBus mediawiki extension needs modified to support multiple endpoints. eventbus service and eventgate have the same HTTP API (although the format of the events they accept is slightly different), so the EventBus extension can be used as is, with either, as long as it is pointed at the correct endpoint.

I plan on modifying the existing single endpoint configs EventServiceUrl and EventServiceTimeout, to a single EventServices hash config.

Example:

$wgEventServices = [
    'eventbus' => [
        'url' => 'http://eventbus.discovery.wmnet:8085/v1/events',
        'timeout' => 30,
    ],
    'eventgate-analytics' => [
       'url' => 'http://eventgate-analytics.discovery.wmnet:30192/v1/events',
    ],
    'eventgate-main' => [
        'url' => 'http://eventgate-main.discovery.wmnet:30192/v1/events',
    ]


];

This will deprecated the global EventServiceUrl config, in favor of the hash. EventBus::getInstance will remain backwards compatible with EventServiceUrl. The new behavior will expect that pass in the name of the event service endpoint you want when you ask for an EventBus instance, e.g.

$eventbusService = EventBus::getInstance('eventbus');
// or
$eventgateAnalyticsService = EventBus::getInstance('eventgate-main');
// etc.

This way individual hooks can choose which service endpointm to send an event to.

Event Timeline

Ottomata triaged this task as Normal priority.Jan 22 2019, 11:02 PM
Ottomata created this task.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJan 22 2019, 11:02 PM

Change 485969 had a related patch set uploaded (by Ottomata; owner: Ottomata):
[mediawiki/extensions/EventBus@master] [WIP] Support multiple event service endpoints

https://gerrit.wikimedia.org/r/485969

Pchelolo moved this task from Backlog to watching on the Services board.Jan 23 2019, 5:27 PM
Pchelolo edited projects, added Services (watching); removed Services.
fdans moved this task from Incoming to Modern Event Platform on the Analytics board.
Ottomata added a comment.EditedFeb 11 2019, 7:15 PM

Order of operations:

  • T215834: EventBusRCFeedEngine should use FormattedRCFeed instead of RCFeedEngine to use updated configuration
    • Deploy backwards compatible rcfeed mediawiki-config change
    • Deploy code change
    • Remove unused rcfeed mediawiki-configs
  • Backwards compatible EventBus config change to support multiple endpoints
    • mediawiki-config change to configure multiple endpoints
  • EventBusRCFeedEngine code change to use EventBus multiple endpoint configs (via $wgEventServices)
    • deploy mediawiki-config change to update EventBusRCFeedEngine (set class param for $eventServiceName)
  • Remove any deprecated and unused config code in EventBus
Nuria moved this task from Next Up to In Progress on the Analytics-Kanban board.Feb 12 2019, 4:04 PM

Change 485969 merged by Ottomata:
[mediawiki/extensions/EventBus@master] Support multiple event service endpoints

https://gerrit.wikimedia.org/r/485969

Ottomata moved this task from Backlog to In Progress on the EventBus board.Feb 13 2019, 9:34 PM

Change 490418 had a related patch set uploaded (by Ottomata; owner: Ottomata):
[operations/mediawiki-config@master] Add EventBus multi endpoint configuration and add eventgate-analytics endpoint

https://gerrit.wikimedia.org/r/490418

Ottomata raised the priority of this task from Normal to High.Feb 21 2019, 5:53 PM

Change 492023 had a related patch set uploaded (by Ottomata; owner: Ottomata):
[mediawiki/extensions/EventBus@master] Remove support of wgEventServiceUrl in favor of multi instance wgEventServices

https://gerrit.wikimedia.org/r/492023

Change 490418 merged by Ottomata:
[operations/mediawiki-config@master] Use EventBus multi endpoint configuration for eventbus configs

https://gerrit.wikimedia.org/r/490418

Change 492023 merged by Ottomata:
[mediawiki/extensions/EventBus@master] Remove support of wgEventServiceUrl in favor of multi instance wgEventServices

https://gerrit.wikimedia.org/r/492023

Ottomata moved this task from In Progress to Done on the EventBus board.Mar 4 2019, 10:30 PM
Nuria closed this task as Resolved.Mar 11 2019, 6:14 PM