CMDP Module#

SPDX-FileCopyrightText: 2024 DESY and the Constellation authors SPDX-License-Identifier: EUPL-1.2

Module implementing the Constellation Monitoring Distribution Protocol

class core.cmdp.CMDPPublisher(name: str, socket: Socket)#

Bases: CMDPTransmitter

Class for sending and publishing monitoring information

has_log_subscribers(levelname: str, topic: str | None = None)#

Return whether or not there are subscribers for the given log level and topic.

has_log_subscribers_record(record: LogRecord) bool#

Return whether or not we have subscribers for the given log topic.

has_metric_subscribers(metric_name: str) bool#

Return whether or not we have subscribers for the given metric data topic.

register_log(topic: str, description: str | None = None) None#

Register a LOG topic that subscribers should be notified about.

register_stat(topic: str, description: str) None#

Register a STAT topic that subscribers should be notified about.

unregister_stat(topic: str) None#
update_subscriptions() None#

Receive and handle a subscription messages

class core.cmdp.CMDPTransmitter(sender: str, socket: Socket)#

Bases: object

Class for sending monitoring information via CMDP

close() None#

Close the socket

closed() bool#

Return whether socket is closed or not

send_log(record: LogRecord) None#

Send a log record

send_metric(metric: Metric, value: Any) None#

Send a metric

send_notification(topics_prefix: str, topics: dict[str, str]) None#