From 992c47b2c7580cb2767a357bd3fbb244616b5c28 Mon Sep 17 00:00:00 2001 From: Brian Brazil Date: Fri, 7 Aug 2015 16:09:16 +0100 Subject: [PATCH] Add console template for Prometheus itself --- console_libraries/menu.lib | 13 ++++ consoles/index.html.example | 8 ++ consoles/prometheus-overview.html | 125 ++++++++++++++++++++++++++++++ consoles/prometheus.html | 35 +++++++++ 4 files changed, 181 insertions(+) create mode 100644 consoles/prometheus-overview.html create mode 100644 consoles/prometheus.html diff --git a/console_libraries/menu.lib b/console_libraries/menu.lib index 261aea6a4..71bf5a992 100644 --- a/console_libraries/menu.lib +++ b/console_libraries/menu.lib @@ -82,6 +82,19 @@ {{ end }} {{ end }} +{{ if query "up{job='prometheus'}" }} +{{ template "_menuItem" (args . "prometheus.html" "Prometheus") }} +{{ if match "^prometheus" .Path }} + {{ if .Params.instance }} + + {{ end }} +{{ end }} +{{ end }} + {{ if query "up{job='snmp'}" }} {{ template "_menuItem" (args . "snmp.html" "SNMP") }} diff --git a/consoles/index.html.example b/consoles/index.html.example index f85d7a22c..e4e0e2e55 100644 --- a/consoles/index.html.example +++ b/consoles/index.html.example @@ -17,6 +17,14 @@ Node Exporter node + + Prometheus + prometheus + + + SNMP Exporter + snmp + HAProxy Exporter haproxy diff --git a/consoles/prometheus-overview.html b/consoles/prometheus-overview.html new file mode 100644 index 000000000..f1a599881 --- /dev/null +++ b/consoles/prometheus-overview.html @@ -0,0 +1,125 @@ +{{ template "head" . }} + +{{ template "prom_right_table_head" }} + + Overview + + + CPU + {{ template "prom_query_drilldown" (args (printf "rate(process_cpu_seconds_total{job='prometheus',instance='%s'}[5m])" .Params.instance) "s/s" "humanizeNoSmallPrefix") }} + + + Memory + {{ template "prom_query_drilldown" (args (printf "process_resident_memory_bytes{job='prometheus',instance='%s'}" .Params.instance) "B" "humanize1024") }} + + + Version + {{ with query (printf "prometheus_build_info{job='prometheus',instance='%s'}" .Params.instance) }}{{. | first | label "version"}}{{end}} + + + + Storage + + + Ingested Samples + {{ template "prom_query_drilldown" (args (printf "rate(prometheus_local_storage_ingested_samples_total{job='prometheus',instance='%s'}[5m])" .Params.instance) "/s" "humanizeNoSmallPrefix") }} + + + Time Series + {{ template "prom_query_drilldown" (args (printf "prometheus_local_storage_memory_series{job='prometheus',instance='%s'}" .Params.instance) "" "humanize") }} + + + Indexing Queue + {{ template "prom_query_drilldown" (args (printf "prometheus_local_storage_indexing_queue_length{job='prometheus',instance='%s'}" .Params.instance) "" "humanize") }} + + + Chunks + {{ template "prom_query_drilldown" (args (printf "prometheus_local_storage_memory_chunks{job='prometheus',instance='%s'}" .Params.instance) "" "humanize") }} + + + Chunk Descriptors + {{ template "prom_query_drilldown" (args (printf "prometheus_local_storage_memory_chunkdescs{job='prometheus',instance='%s'}" .Params.instance) "" "humanize") }} + + + Chunks To Persist + {{ template "prom_query_drilldown" (args (printf "prometheus_local_storage_chunks_to_persist{job='prometheus',instance='%s'}" .Params.instance) "" "humanize") }} + + + Checkpoint Duration + {{ template "prom_query_drilldown" (args (printf "prometheus_local_storage_checkpoint_duration_milliseconds{job='prometheus',instance='%s'} / 1000" .Params.instance) "" "humanizeDuration") }} + + + + Rules + + + Evaluation Duration + {{ template "prom_query_drilldown" (args (printf "rate(prometheus_evaluator_duration_milliseconds_sum{job='prometheus',instance='%s'}[5m]) / rate(prometheus_evaluator_duration_milliseconds_count{job='prometheus',instance='%s'}[5m]) / 1000" .Params.instance .Params.instance) "" "humanizeDuration") }} + + + Notification Latency + {{ template "prom_query_drilldown" (args (printf "rate(prometheus_notifications_latency_milliseconds_sum{job='prometheus',instance='%s'}[5m]) / rate(prometheus_notifications_latency_milliseconds_count{job='prometheus',instance='%s'}[5m]) / 1000" .Params.instance .Params.instance) "" "humanizeDuration") }} + + + Notification Queue + {{ template "prom_query_drilldown" (args (printf "prometheus_notifications_queue_length{job='prometheus',instance='%s'}" .Params.instance) "" "humanize") }} + + + HTTP Server + +{{ range printf "http_request_duration_microseconds_count{job='prometheus',instance='%s',handler=~'^(query.*|federate|consoles)$'}" .Params.instance | query | sortByLabel "handler" }} + + {{ .Labels.handler }} + {{ template "prom_query_drilldown" (args (printf "rate(http_request_duration_microseconds_count{job='prometheus',instance='%s',handler='%s'}[5m])" .Labels.instance .Labels.handler) "/s" "humanizeNoSmallPrefix") }} + +{{ end }} + +{{ template "prom_right_table_tail" }} + +{{ template "prom_content_head" . }} +

Prometheus Overview - {{ .Params.instance }}

+ +

Ingested Samples

+
+ + +

Time Series

+
+ + +

HTTP Server

+
+ + +{{ template "prom_content_tail" . }} + +{{ template "tail" }} diff --git a/consoles/prometheus.html b/consoles/prometheus.html new file mode 100644 index 000000000..13809cc95 --- /dev/null +++ b/consoles/prometheus.html @@ -0,0 +1,35 @@ +{{ template "head" . }} + +{{ template "prom_right_table_head" }} + + Prometheus + {{ template "prom_query_drilldown" (args "sum(up{job='prometheus'})") }} / {{ template "prom_query_drilldown" (args "count(up{job='prometheus'})") }} + +{{ template "prom_right_table_tail" }} + +{{ template "prom_content_head" . }} +

Prometheus

+ + + + + + + + + +{{ range query "up{job='prometheus'}" | sortByLabel "instance" }} + + + + + + + +{{ else }} + +{{ end }} + +{{ template "prom_content_tail" . }} + +{{ template "tail" }}
PrometheusUpIngested SamplesTime SeriesMemory
{{ .Labels.instance }}Yes{{ else }} class="alert-danger">No{{ end }}{{ template "prom_query_drilldown" (args (printf "rate(prometheus_local_storage_ingested_samples_total{job='prometheus',instance='%s'}[5m])" .Labels.instance) "/s" "humanizeNoSmallPrefix") }}{{ template "prom_query_drilldown" (args (printf "prometheus_local_storage_memory_series{job='prometheus',instance='%s'}" .Labels.instance) "" "humanize") }}{{ template "prom_query_drilldown" (args (printf "process_resident_memory_bytes{job='prometheus',instance='%s'}" .Labels.instance) "B" "humanize1024")}}
No devices found.