Skip to content
Snippets Groups Projects
Unverified Commit 4fd9c750 authored by Levente Pap's avatar Levente Pap
Browse files

Export nodeID via prometheus

parent b522e4a1
No related branches found
No related tags found
No related merge requests found
package prometheus
import (
"github.com/iotaledger/goshimmer/plugins/autopeering/local"
"github.com/iotaledger/goshimmer/plugins/banner"
"github.com/iotaledger/goshimmer/plugins/metrics"
"github.com/prometheus/client_golang/prometheus"
......@@ -9,6 +10,7 @@ import (
var (
infoApp *prometheus.GaugeVec
sync prometheus.Gauge
nodeID string
)
func registerInfoMetrics() {
......@@ -17,9 +19,12 @@ func registerInfoMetrics() {
Name: "iota_info_app",
Help: "Node software name and version.",
},
[]string{"name", "version"},
[]string{"name", "version", "nodeID"},
)
infoApp.WithLabelValues(banner.AppName, banner.AppVersion).Set(1)
if local.GetInstance() != nil {
nodeID = local.GetInstance().ID().String()
}
infoApp.WithLabelValues(banner.AppName, banner.AppVersion, nodeID).Set(1)
sync = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "sync",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment