Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self):
config = Configuration().Plugins.PrometheusMonitoring
self._port = config.port
self._addr = config.addr
self._svr_started = False
self._drones = {}
self._svr = Service()
self._gauges = {
ResourceStatus.Booting: Gauge("booting", "Booting drones"),
ResourceStatus.Running: Gauge("running", "Running drones"),
ResourceStatus.Stopped: Gauge("stopped", "Stopped drones"),
ResourceStatus.Deleted: Gauge("deleted", "Deleted drones"),
ResourceStatus.Error: Gauge("error", "Drones in error state"),
}
for gauge in self._gauges.values():
self._svr.register(gauge)
gauge.set({}, 0)