Observability#
The Pipeline Event stream emitted by the orchestrators (StructuralProfiler)
and consumed by a user-supplied Progress Observer (ADR-0054, ADR-0055).
- class dataforge_ml.observability.PipelineEvent(event_type, phase, stage, message, column=None, index=None, total=None)[source]#
Bases:
objectA single structured observability record emitted by an orchestrator.
Progress and Trace share this one shape. Consumers filter on
event_typeand read the rawindex/totalfields to drive a progress bar, or print the ready-mademessageas-is.- Parameters:
event_type (EventType) – The kind of event; also fixes the Trace log level.
phase (str) – The pipeline phase emitting the event (e.g.
"profiling").stage (str) – The stage within the phase (e.g.
"column_profiling").message (str) – A ready-made human-readable sentence describing the event.
column (str, optional) – The column an
itemorsubstepevent concerns;Nonefor stage boundaries and column-independent work.index (int, optional) – The 1-based position of the current item within its stage, or the Substep sub-progression (e.g. fold
3of5) on asubstepevent;Nonefor stage boundaries.total (int, optional) – The total number of items the stage will process, or the Substep sub-total (e.g.
5folds) on asubstepevent;Nonefor stage boundaries.
- column: str | None = None#
- index: int | None = None#
- message: str#
- phase: str#
- stage: str#
- total: int | None = None#
- class dataforge_ml.observability.EventType(*values)[source]#
Bases:
StrEnumThe kind of a
PipelineEvent, used to route and filter the stream.The value also determines the Trace log level:
stage_start,stage_end,itemandsubsteplog atDEBUG,decisionatINFO, andwarningatWARNING.substepis a Substep heartbeat below the column (a strategy-block fit, a diagnostics fold, a per-column model fit within a set); it is additive, so an observer that ignores it is unaffected, and a consumer drives a coarse progress bar offitemwhile reading a live detail line offsubstep(ADR-0055).- decision = 'decision'#
- item = 'item'#
- stage_end = 'stage_end'#
- stage_start = 'stage_start'#
- substep = 'substep'#
- warning = 'warning'#
- dataforge_ml.observability.stderr_observer(event)[source]#
Write an event’s
messageto stderr; the shipped opt-in observer.Pass this as
observer=to an orchestrator to see progress on stderr without wiring up a custom callback. Writes only to stderr, never stdout.- Parameters:
event (PipelineEvent) – The event to render.
- Return type:
None