mirror of https://github.com/tidwall/tile38.git
don't rely on stats code for new metrics if we can avoid it
This commit is contained in:
parent
5b3aeb5db7
commit
a233aaa66e
|
@ -3,6 +3,8 @@ package server
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/tidwall/tile38/core"
|
||||||
|
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||||
)
|
)
|
||||||
|
@ -79,6 +81,11 @@ func (s *Server) Collect(ch chan<- prometheus.Metric) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ch <- prometheus.MustNewConstMetric(
|
||||||
|
metricDescriptions["server_info"],
|
||||||
|
prometheus.GaugeValue, 1.0, s.config.serverID(), core.Version,
|
||||||
|
)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
add stats per collection
|
add stats per collection
|
||||||
*/
|
*/
|
||||||
|
@ -110,9 +117,4 @@ func (s *Server) Collect(ch chan<- prometheus.Metric) {
|
||||||
)
|
)
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
|
||||||
metricDescriptions["server_info"],
|
|
||||||
prometheus.GaugeValue, 1.0, m["id"].(string), m["version"].(string),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue