Merge pull request #1 from turmoni/master

Update label handling to cope with current prometheus client.
This commit is contained in:
David Soria Parra 2021-01-18 23:12:37 +00:00 committed by GitHub
commit 4d174a86da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -71,9 +71,9 @@ def main():
g_uptime = server.getUptime() g_uptime = server.getUptime()
logger.debug('mumble_user_connected: %d' % g_user) logger.debug('mumble_user_connected: %d' % g_user)
logger.debug('mumble_uptime: %d' % g_uptime) logger.debug('mumble_uptime: %d' % g_uptime)
labels = {'server_id': server.id(), 'ice_server': ice_server} label_values = [ice_server, server.id()]
gauges['users'].labels(labels).set(g_user) gauges['users'].labels(*label_values).set(g_user)
gauges['uptime'].labels(labels).set(g_uptime) gauges['uptime'].labels(*label_values).set(g_uptime)
time_to_wait = args.interval - (time.time() - t1) time_to_wait = args.interval - (time.time() - t1)
if time_to_wait > 0: if time_to_wait > 0: