From 21194d2e4aa62aabc0bb50f4040422b4426c2761 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sat, 27 Jul 2019 22:53:42 +0100 Subject: [PATCH] samples: make prometheus template less klunky This should work nicer when displaying various statistics from prometheus with grafana. Signed-off-by: Sami Kerola --- samples/prometheus.template | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/samples/prometheus.template b/samples/prometheus.template index f8a5726..d48f959 100644 --- a/samples/prometheus.template +++ b/samples/prometheus.template @@ -1,30 +1,11 @@ # This mustach template can be used as Prometheus text file. # https://prometheus.io/ - -# HELP dhcpd_pools_ranges The range statistics. -# TYPE dhcpd_pools_ranges gauge -{{#subnets}}dhcpd_pools_ranges{range="{{first_ip}}",used="1"} {{used}} {{gettimeofday}}000 -dhcpd_pools_ranges{range="{{first_ip}}",touched="1"} {{touched}} {{gettimeofday}}000 -dhcpd_pools_ranges{range="{{first_ip}}",defined="1"} {{defined}} {{gettimeofday}}000 -dhcpd_pools_ranges{range="{{first_ip}}",free="1"} {{free}} {{gettimeofday}}000 -dhcpd_pools_ranges{range="{{first_ip}}",touch_count="1"} {{touch_count}} {{gettimeofday}}000 -dhcpd_pools_ranges{range="{{first_ip}}",status="1"} {{status}} {{gettimeofday}}000 +# HELP dhcpd_pools ISC dhcpd statistics +# TYPE dhcpd_pools gauge +{{#subnets}}dhcpd_pools{location="{{location}}",range="{{first_ip}}",used="1"} {{used}} {{gettimeofday}}000 +dhcpd_pools{location="{{location}}",range="{{first_ip}}",touched="1"} {{touched}} {{gettimeofday}}000 +dhcpd_pools{location="{{location}}",range="{{first_ip}}",defined="1"} {{defined}} {{gettimeofday}}000 +dhcpd_pools{location="{{location}}",range="{{first_ip}}",free="1"} {{free}} {{gettimeofday}}000 +dhcpd_pools{location="{{location}}",range="{{first_ip}}",touch_count="1"} {{touch_count}} {{gettimeofday}}000 +dhcpd_pools{location="{{location}}",range="{{first_ip}}",status="1"} {{status}} {{gettimeofday}}000 {{/subnets}} -# HELP dhcpd_pools_shared_nets The shared networks statistics. -# TYPE dhcpd_pools_shared_nets gauge -{{#shared-networks}}dhcpd_pools_shared_nets{location="{{location}}",defined="1"} {{defined}} {{gettimeofday}}000 -dhcpd_pools_shared_nets{location="{{location}}",used="1"} {{used}} {{gettimeofday}}000 -dhcpd_pools_shared_nets{location="{{location}}",touched="1"} {{touched}} {{gettimeofday}}000 -dhcpd_pools_shared_nets{location="{{location}}",free="1"} {{free}} {{gettimeofday}}000 -dhcpd_pools_shared_nets{location="{{location}}",touch_count="1"} {{touch_count}} {{gettimeofday}}000 -dhcpd_pools_shared_nets{location="{{location}}",status="1"} {{status}} {{gettimeofday}}000 -{{/shared-networks}} -# HELP dhcpd_pools_summary Statistics of the all networks. -# TYPE dhcpd_pools_summary gauge -{{#summary}}dhcpd_pools_summary{location="{{location}}",defined="1"} {{defined}} {{gettimeofday}}000 -dhcpd_pools_summary{location="{{location}}",used="1"} {{used}} {{gettimeofday}}000 -dhcpd_pools_summary{location="{{location}}",touched="1"} {{touched}} {{gettimeofday}}000 -dhcpd_pools_summary{location="{{location}}",free="1"} {{free}} {{gettimeofday}}000 -dhcpd_pools_summary{location="{{location}}",touch_count="1"} {{touch_count}} {{gettimeofday}}000 -dhcpd_pools_summary{location="{{location}}",status="1"} {{status}} {{gettimeofday}}000 -{{/summary}}