Monitoring Module#
SPDX-FileCopyrightText: 2024 DESY and the Constellation authors SPDX-License-Identifier: EUPL-1.2
- class core.monitoring.FileMonitoringListener(name: str, group: str, interface: list[str], output_path: str)#
Bases:
MonitoringListener
- class core.monitoring.MonitoringListener(*args, **kwargs)#
Bases:
StatListener
Simple monitor class to receive logs and metrics from a Constellation.
- class core.monitoring.MonitoringSender(**kwds: Any)#
Bases:
BaseSatelliteFrame
Sender mixin class for Constellation Monitoring Distribution Protocol.
Any method of inheriting classes that has the @schedule_metric decorator, will be regularly polled for new values and a corresponding Metric be sent on the monitoring port.
- reset_scheduled_metrics() None #
Reset all previously scheduled metrics.
Will only schedule metrics provided via decorator.
- schedule_metric(name: str, unit: str, handling: MetricsType, interval: float, callback: Callable[[...], Any]) None #
Schedule a callback at regular intervals.
The callable needs to return a value [any] and a unit [str] and take no arguments. If you have a callable that requires arguments, consider using functools.partial to fill in the necessary information at scheduling time.
- class core.monitoring.StatListener(name: str, group: str, interface: list[str], mon_port: int | None = None, **kwds: Any)#
Bases:
CHIRPBroadcaster
Simple listener class to receive metrics from a Constellation.
- class core.monitoring.ZeroMQSocketLogListener(transmitter: CMDPTransmitter, /, *handlers: Any, **kwargs: Any)#
Bases:
QueueListener
This listener receives messages from a CMDPTransmitter.
NOTE that the corresponding socket should only subscribe to LOG messages!
- dequeue(block: bool) LogRecord #
Dequeue a record and return it, optionally blocking.
The base implementation uses get. You may want to override this method if you want to use timeouts or work with custom queue implementations.