File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 88 "net/http"
99 "os/exec"
1010 "sort"
11+ "strings"
1112 "time"
1213
1314 "github.com/prometheus/client_golang/prometheus"
@@ -312,13 +313,11 @@ func main() {
312313 clusterNodes .WithLabelValues ("expected_up" ).Set (float64 (metrics .Node .ExpectedUp ))
313314 clusterNodes .WithLabelValues ("DC" ).Set (float64 (metrics .Node .DC ))
314315
315- // this will produce a metric like this:
316- // cluster_resources{node="dma-dog-hana01" resource_name="RA1" role="master"} 1
316+ // this produce a metric like: cluster_resources{node="dma-dog-hana01" resource_name="RA1" role="master"} 1
317317 for _ , nod := range status .Nodes .Node {
318318 for _ , rsc := range nod .Resources {
319- // if there is the same resource just add it. At each iteration it will be destroyed this metric so
320- // this is safe.
321- clusterResources .WithLabelValues (nod .Name , rsc .ID , rsc .Role ).Inc ()
319+ // increment if same resource is present
320+ clusterResources .WithLabelValues (strings .ToLower (nod .Name ), strings .ToLower (rsc .ID ), strings .ToLower (rsc .Role )).Inc ()
322321 }
323322 }
324323 // TODO: this is historically, we might don't need to do like this. investigate on this later
You can’t perform that action at this time.
0 commit comments