Skip to content

Commit

Permalink
Rvalverd - remove vs collector (#22)
Browse files Browse the repository at this point in the history
This PR will remove the eos_vs_* metrics and include the previously provided metrics to the eos_node collector. Metadata (like EOS version) is now included in a new metric eos_node_info. Uptime metric has been removed for now as output from EOS is not actually parse-able.

---------

Co-authored-by: Roberto Valverde <[email protected]>
  • Loading branch information
robvalca and Roberto Valverde authored Aug 16, 2023
1 parent bb6b65d commit 0a28cbe
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 254 deletions.
64 changes: 63 additions & 1 deletion collector/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ type NodeCollector struct {
SumStatRopen *prometheus.GaugeVec
SumStatWopen *prometheus.GaugeVec
CfgStatSysThreads *prometheus.GaugeVec
CfgStatSysVsize *prometheus.GaugeVec
CfgStatSysRss *prometheus.GaugeVec
CfgStatSysSockets *prometheus.GaugeVec
SumStatNetInratemib *prometheus.GaugeVec
SumStatNetOutratemib *prometheus.GaugeVec
Info *prometheus.GaugeVec
}

/*
Expand Down Expand Up @@ -77,7 +81,7 @@ cfg.gw.rate=120
cfg.gw.ntx=10
*/

//NewNodeCollector creates an cluster of the NodeCollector
// NewNodeCollector creates an cluster of the NodeCollector
func NewNodeCollector(cluster string) *NodeCollector {
labels := make(prometheus.Labels)
labels["cluster"] = cluster
Expand Down Expand Up @@ -200,6 +204,33 @@ func NewNodeCollector(cluster string) *NodeCollector {
},
[]string{"node", "port"},
),
CfgStatSysVsize: prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: "eos",
Name: "node_vsize",
Help: "Node virtual memory size",
ConstLabels: labels,
},
[]string{"node", "port"},
),
CfgStatSysRss: prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: "eos",
Name: "node_rss",
Help: "Node resident memory set size",
ConstLabels: labels,
},
[]string{"node", "port"},
),
CfgStatSysSockets: prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: "eos",
Name: "node_sockets",
Help: "Node Number of sockets",
ConstLabels: labels,
},
[]string{"node", "port"},
),
SumStatNetInratemib: prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: "eos",
Expand All @@ -218,6 +249,15 @@ func NewNodeCollector(cluster string) *NodeCollector {
},
[]string{"node", "port"},
),
Info: prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: "eos",
Name: "node_info",
Help: "Node metadata",
ConstLabels: labels,
},
[]string{"node", "port", "eos_version", "xrootd_version", "kernel", "geotag"},
),
}
}

Expand All @@ -236,8 +276,12 @@ func (o *NodeCollector) collectorList() []prometheus.Collector {
o.SumStatRopen,
o.SumStatWopen,
o.CfgStatSysThreads,
o.CfgStatSysVsize,
o.CfgStatSysRss,
o.CfgStatSysSockets,
o.SumStatNetInratemib,
o.SumStatNetOutratemib,
o.Info,
}
}

Expand Down Expand Up @@ -347,6 +391,24 @@ func (o *NodeCollector) collectNodeDF() error {
if err == nil {
o.CfgStatSysThreads.WithLabelValues(m.Host, m.Port).Set(threads)
}

vsize, err := strconv.ParseFloat(m.CfgStatSysVsize, 64)
if err == nil {
o.CfgStatSysVsize.WithLabelValues(m.Host, m.Port).Set(vsize)
}

rss, err := strconv.ParseFloat(m.CfgStatSysRss, 64)
if err == nil {
o.CfgStatSysRss.WithLabelValues(m.Host, m.Port).Set(rss)
}

sockets, err := strconv.ParseFloat(m.CfgStatSysSockets, 64)
if err == nil {
o.CfgStatSysSockets.WithLabelValues(m.Host, m.Port).Set(sockets)
}

// We send just a dummy 1 as value for the eos_node_info metric, and metadata on labels
o.Info.WithLabelValues(m.Host, m.Port, m.EOSVersion, m.XRootDVersion, m.Kernel, m.Geotag).Set(1)
}

return nil
Expand Down
165 changes: 0 additions & 165 deletions collector/vs.go

This file was deleted.

1 change: 0 additions & 1 deletion eos_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ func NewEOSExporter(instance string) *EOSExporter {
collector.NewGroupCollector(instance), // eos scheduling group stats
collector.NewNodeCollector(instance), // eos node stats
collector.NewFSCollector(instance), // eos filesystem stats
collector.NewVSCollector(instance), // eos FST versions information
collector.NewIOInfoCollector(instance), // eos io stat information
collector.NewIOAppInfoCollector(instance), // eos io stat information per App
collector.NewNSCollector(instance), // eos namespace information
Expand Down
Loading

0 comments on commit 0a28cbe

Please sign in to comment.