buildgrid.server.monitoring module

class buildgrid.server.monitoring.MonitoringOutputType(value)

Bases: Enum

An enumeration.

STDOUT = 'stdout'
FILE = 'file'
SOCKET = 'socket'
UDP = 'udp'
SILENT = 'silent'
class buildgrid.server.monitoring.MonitoringOutputFormat(value)

Bases: Enum

An enumeration.

BINARY = 'binary'
JSON = 'json'
STATSD = 'statsd'
class buildgrid.server.monitoring.StatsDTagFormat(value)

Bases: Enum

An enumeration.

NONE = 'none'
INFLUX_STATSD = 'influx-statsd'
DOG_STATSD = 'dogstatsd'
GRAPHITE = 'graphite'
class buildgrid.server.monitoring.UdpWrapper(endpoint_location: str)

Bases: object

Wraps socket sendto() in write() so it can be used polymorphically

write(message: bytes) None
close() None
buildgrid.server.monitoring.setup_monitoring_bus(endpoint_type: MonitoringOutputType = MonitoringOutputType.SOCKET, endpoint_location: str | None = None, metric_prefix: str = '', serialisation_format: MonitoringOutputFormat = MonitoringOutputFormat.STATSD, tag_format: StatsDTagFormat = StatsDTagFormat.NONE) _MonitoringBus

Sets up the monitoring bus.

Throws an error if a non-silent monitoring bus has already been set up. However a silent monitoring bus can be overridden by a non-silent one. If a silent monitoring bus attempts to override a non-silent one, it is not overridden and the non-silent one is returned

buildgrid.server.monitoring.get_monitoring_bus() _MonitoringBus

Get the monitoring bus.

If a monitoring bus does not exist, a silent bus will be created and no metrics will be published.