monitoring.py/exporter/statsdExporter.py
2019-12-30 16:25:34 +01:00

11 lines
381 B
Python

import socket
import statsd
class StatsdExporter:
def __init__(self):
self.servername = socket.gethostname()
self.c = statsd.StatsClient('grafana2.keks.cloud', 8125)
def gauge(self, name, value):
self.c.gauge("server."+self.servername+"."+name, value)
def incr(self, name, value):
self.c.incr("server."+self.servername+"."+name, value)