juturna.telemetry package¶
Subpackages¶
Module contents¶
- class juturna.telemetry.TelemetryContext(transport: TransportBackend, worker: str, pipe_path: str)¶
Bases:
objectWhat a pipeline hands to the telemetry manager it builds
- pipe_path: str¶
- transport: TransportBackend¶
- worker: str¶
- class juturna.telemetry.TelemetryManager(*args, **kwargs)¶
Bases:
ProtocolCollects the telemetry records of a pipeline
- record_telemetry(record_batch: list[tuple]) None¶
Take a batch of records. It runs in the thread of a node: it must never block, and drops the batch rather than slow the node down.
- records() list[tuple]¶
The records collected so far, oldest first
- requires: ClassVar[frozenset[str]]¶
- start() None¶
Start whatever the manager needs to collect the records
- stop() None¶
Write what is left and release what
startacquired
- juturna.telemetry.check_pipeline_telemetry(pipeline: dict) None¶
Check the telemetry of a pipeline configuration.
The transport and the manager are built and dropped: their constructors validate the options and hold no resource (the csv file is opened on start).
- Parameters:
pipeline (dict) – The
pipelineentry of a pipeline configuration.- Raises:
ValueError – If the transport or the telemetry cannot be built from it.
- juturna.telemetry.get_telemetry(spec: dict | None, ctx: TelemetryContext) TelemetryManager | None¶
Build the telemetry manager a pipeline asks for.
- Parameters:
spec (dict | None) – The
telemetryentry of the pipeline configuration: a dictionary with thenameof the manager and its options.Nonemeans the telemetry is off.ctx (TelemetryContext) – The context of the pipeline.
- Returns:
A new manager, or
Noneif the telemetry is off.- Return type:
TelemetryManager | None
- Raises:
ValueError – If the configuration does not ask for a registered manager with options it accepts, or the manager needs something the transport does not offer.
- juturna.telemetry.tag_records(record_batch: list[tuple], worker: str) list[tuple]¶
Append the worker to every record: message ids collide across workers