system-config/doc/source/firehose_schema.rst
Matthew Treinish d9fda5b81f Add firehose schema docs
This commit starts a new page for documenting the firehose schema. Right
now it only includes the schema for gerrit events, but it will be
expanded in future patches to include the other services reporting.
Hopefully this will serve as a better guide for people to actually being
able to consume events from firehose.

Change-Id: I2157f702c87f32055ba2fad842a05e31539bc857
2017-04-26 22:03:29 +00:00

1.9 KiB

title

Firehose Schema

Firehose Schema

This attempts to document the topic and payload schema for all the services reporting to the firehose. However since much of what is reported to firehose is dynamically generated it is possible this document misses a case.

Gerrit

Messages on firehose for gerrit are generated using the germqtt project. For the most part these are basically identical to what gerrit returns on it's native event stream except over MQTT.

Topics

The topics for gerrit are generated dynamically. However, they follow a fairly straightforward pattern. The basic formula for this is:

gerrit/<git namespace>/<repo name>/<gerrit event>

So for example a typical topic would be:

gerrit/openstack/nova/comment-added

The git namespace and repo name are pretty self explanatory and are just from the git repository the change in gerrit is for. The event is defined in the gerrit event stream. You can see the full reference for topics in the Gerrit docs for Gerrit events. However, for simplicity the possible values are:

  • change-abandoned
  • change-merged
  • change-restored
  • comment-added
  • draft-published
  • hashtags-changed
  • merge-failed
  • patchset-created
  • ref-updated
  • reviewer-added
  • topic-changed

Payload

The payload for gerrit messages are basically the same JSON that gets returned by gerrit's event stream command. Instead of repeating the entire gerrit schema doc here just refer to gerrit's docs on the JSON payload which documents the contents of each JSON object and refer to the doc on Gerrit events for which JSON objects are included with which event type.