metrics.go 795 B

123456789101112131415161718192021222324252627
  1. // Copyright (C) 2023 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 serve
  7. import (
  8. "github.com/prometheus/client_golang/prometheus"
  9. "github.com/prometheus/client_golang/prometheus/promauto"
  10. )
  11. var metricReportsTotal = promauto.NewCounterVec(prometheus.CounterOpts{
  12. Namespace: "syncthing",
  13. Subsystem: "ursrv",
  14. Name: "reports_total",
  15. }, []string{"version"})
  16. func init() {
  17. metricReportsTotal.WithLabelValues("fail")
  18. metricReportsTotal.WithLabelValues("duplicate")
  19. metricReportsTotal.WithLabelValues("v1")
  20. metricReportsTotal.WithLabelValues("v2")
  21. metricReportsTotal.WithLabelValues("v3")
  22. }