David-VTUK / prometheus-rancher-exporter

MIT License
7 stars 7 forks source link

Refactor storing version numbers #5

Closed David-VTUK closed 2 years ago

David-VTUK commented 2 years ago

Currently using separate metrics to store versions:

cluster_major_version{Name="cluster-1"} 1
cluster_major_version{Name="cluster-2"} 1

cluster_minor_version{Name="cluster-1"} 22
cluster_minor_version{Name="cluster-2"} 24

cluster_patch_version{Name="cluster-1"} 13
cluster_patch_version{Name="cluster-2"} 4

However the most established method is to use labels, like:

cluster_patch_version{Name="cluster-1",version="1.22.13"} = 1

This is how Prometheus itself exposes similar metrics:

prometheus_build_info{branch="HEAD",goversion="go1.6.2",
    revision="16d70a8b6bd90f0ff793813405e84d5724a9ba65",version="1.0.1"} 1

This will make it much more flexible to query and visualise in Grafana