chore: systematic syncthing_build_info metric

Signed-off-by: Jakob Borg <jakob@kastelo.net>
This commit is contained in:
Jakob Borg
2026-04-06 09:44:49 +02:00
parent e2cb283155
commit b594b7491f
8 changed files with 37 additions and 14 deletions
-3
View File
@@ -14,7 +14,6 @@ import (
"net/http"
"os"
"os/signal"
"runtime"
"time"
"github.com/alecthomas/kong"
@@ -96,8 +95,6 @@ func main() {
}
slog.Info(build.LongVersionFor("stdiscosrv"))
buildInfo.WithLabelValues(build.Version, runtime.Version(), build.User, build.Date.UTC().Format("2006-01-02T15:04:05Z")).Set(1)
var cert tls.Certificate
if !cli.HTTP {
var err error
+1 -9
View File
@@ -11,14 +11,6 @@ import (
)
var (
buildInfo = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: "syncthing",
Subsystem: "discovery",
Name: "build_info",
Help: "A metric with a constant '1' value labeled by version, goversion, builduser and builddate from which stdiscosrv was built.",
}, []string{"version", "goversion", "builduser", "builddate"})
apiRequestsTotal = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: "syncthing",
@@ -132,7 +124,7 @@ const (
)
func init() {
prometheus.MustRegister(buildInfo,
prometheus.MustRegister(
apiRequestsTotal, apiRequestsSeconds,
lookupRequestsTotal, announceRequestsTotal,
replicationSendsTotal, replicationRecvsTotal,