ROHIT SHARMA


Grammars & Language Support

Two ANTLR grammars and the editor built on top of them: a templating language for monitor notifications where the conditionals decide who gets paged, and the boolean expression that composes monitors out of each other.

The notification body is markdown with a template layer over it. Values interpolate โ€” the threshold, the observed value, whichever attributes the monitor groups by โ€” and conditional sections come in positive and inverted forms, nest freely, and two of them take quoted arguments for exact and substring matching against a named variable.

Monitor notification editor with a markdown toolbar, template tokens highlighted in the body text, and an open autocomplete listing every available condition with a description

The detail that set the correctness bar: a recipient written inside a conditional block is only notified when that condition holds. The template does not just decide what the message says, it decides who receives it โ€” so the parse tree drives delivery, and getting it wrong pages the wrong team at three in the morning.

A rendered monitor notification showing the template resolved into a formatted alert message

The second grammar is smaller and less forgiving. Constituent monitors bind to single letters and compose with AND, OR, a unary negation and arbitrary parenthesised nesting, in one free-text field that a non-engineer is expected to fill in correctly. Precedence and grouping in a field that small want a real parser and real error reporting rather than a regular expression.

Composite monitor configuration showing constituent monitors bound to letters above a trigger expression field combining them with boolean operators

The editor was built as a component rather than a feature, so the markdown half could be lifted away from the templating half. It shipped again as a dashboard widget for free-form notes and instructions, carrying the same authoring surface without the conditionals.

Dashboard markdown widget showing the same editor reused for free-form notes alongside other dashboard panels

Notification templating ยท Composite monitors