Flagged events
A flagged event is an event that is different from the usual events of its channel. The page shows flagged events in amber.
Why streamview flags events
Section titled “Why streamview flags events”A frequent cause of a fault is a change in a message. For example, a release changes a number to text, removes a field, or adds a field. The services that read the message then fail, or they ignore the message.
The producer does not see this fault. On a usual dashboard, the message rate stays the same. On the timeline, an amber range in a lane shows the time when the shape changed.
How streamview learns the usual shape
Section titled “How streamview learns the usual shape”streamview has no schemas. It learns from the events.
For each channel, streamview examines the data object of the first 20 events.
It records the name of each field, and the kind of its value, for example text, number, or object.
After the first 20 events, streamview compares each new event with that record. It flags an event if one of these conditions is true:
- A field has a different kind of value. For example,
totalis usually a number, and the event has text. - The event has a field that the first 20 events did not have.
- A field is missing that all the first 20 events had.
A field with the value null does not cause a flag.
The event panel shows each difference that streamview finds.
What a flag does not tell you
Section titled “What a flag does not tell you”A flag shows a change. It does not show an error.
- If the first 20 events of a channel are incorrect, streamview learns the incorrect shape.
- If a release adds a field on purpose, streamview flags all later events of that channel.
- streamview compares only the fields at the top level of
data. - streamview does not compare the values. A negative price has the correct shape.
Thus use a flag as a sign of where to look. To validate events against a schema, use a schema registry.
The mock day is different
Section titled “The mock day is different”streamview day shows one day of mock data.
In that mode, a flagged event does not agree with the schema of the mock data, and the page uses the words “schema violation”.