metrics.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright (C) 2024 The Syncthing Authors.
  2. //
  3. // This Source Code Form is subject to the terms of the Mozilla Public
  4. // License, v. 2.0. If a copy of the MPL was not distributed with this file,
  5. // You can obtain one at https://mozilla.org/MPL/2.0/.
  6. package main
  7. import (
  8. "github.com/prometheus/client_golang/prometheus"
  9. "github.com/prometheus/client_golang/prometheus/promauto"
  10. )
  11. var (
  12. metricUpgradeChecks = promauto.NewCounter(prometheus.CounterOpts{
  13. Namespace: "syncthing",
  14. Subsystem: "upgrade",
  15. Name: "metadata_requests",
  16. })
  17. metricFilterCalls = promauto.NewCounterVec(prometheus.CounterOpts{
  18. Namespace: "syncthing",
  19. Subsystem: "upgrade",
  20. Name: "filter_calls",
  21. }, []string{"result"})
  22. metricHTTPRequests = promauto.NewCounterVec(prometheus.CounterOpts{
  23. Namespace: "syncthing",
  24. Subsystem: "upgrade",
  25. Name: "http_requests",
  26. }, []string{"target", "result"})
  27. metricLatestReleaseInfo = promauto.NewGaugeVec(prometheus.GaugeOpts{
  28. Namespace: "syncthing",
  29. Subsystem: "upgrade",
  30. Name: "latest_release_info",
  31. Help: "Release information",
  32. }, []string{"latest_release", "latest_pre"})
  33. )