(MAINT) Clarity refactor of Prom Stats code

Introducing the Prometheus Stats code into ABS showed that the Clarity
could be improved a bit with better variable naming, some refactoring
to reduce repitition and documenting the Metrics table itself.

Filtering these changes back to the vmpooler code base.
This commit is contained in:
John O'Connor 2020-07-30 20:25:37 +01:00
parent 2556ed6105
commit 0a6ad896f5
5 changed files with 173 additions and 56 deletions

View file

@ -38,8 +38,8 @@ module Vmpooler
# Using customised collector that filters out hostnames on API paths
require 'vmpooler/metrics/promstats/collector_middleware'
require 'prometheus/middleware/exporter'
use Vmpooler::Metrics::Promstats::CollectorMiddleware, metrics_prefix: "#{metrics.metrics_prefix}_http"
use Prometheus::Middleware::Exporter, path: metrics.endpoint
use Vmpooler::Metrics::Promstats::CollectorMiddleware, metrics_prefix: "#{metrics.prometheus_prefix}_http"
use Prometheus::Middleware::Exporter, path: metrics.prometheus_endpoint
end
if torun.include? :api