monitor.events

MonitorEvent — a timestamped, annotated marker for the dashboard timeline.

Events appear as vertical lines on all metric charts. They can be created by:
  • The dashboard UI (user types a label and clicks “Mark Event”)

  • Test suite code via OttoSuite.add_monitor_event()

  • Automatically by OttoSuite.setUp() / tearDown() when monitoring is active

class otto.monitor.events.MonitorEvent(timestamp: datetime, label: str, source: str = 'manual', color: str = '#888888', dash: str = 'dash', id: int = 0, end_timestamp: datetime | None = None)

Bases: object

A labeled, timestamped marker for the monitoring dashboard.

timestamp : datetime

When the event occurred.

label : str

Human-readable description shown on hover in the dashboard.

source : str = 'manual'

Who created this event — 'manual' (dashboard UI), 'user_code' (test code), or 'auto' (lifecycle).

color : str = '#888888'

CSS color for the vertical marker line (hex, named color, or rgb()).

dash : str = 'dash'

Plotly line dash style — one of solid, dot, dash, longdash, dashdot, longdashdot.

id : int = 0

Unique integer id assigned by MetricCollector on creation (or loaded from SQLite).

end_timestamp : datetime | None = None

End timestamp for span events; None for instantaneous events.

to_dict() dict[str, object]

Serialize to a JSON-safe dict for the dashboard API.