metrics.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 main
  7. import (
  8. "github.com/prometheus/client_golang/prometheus"
  9. "github.com/prometheus/client_golang/prometheus/promauto"
  10. )
  11. var (
  12. metricCrashReportsTotal = promauto.NewCounterVec(prometheus.CounterOpts{
  13. Namespace: "syncthing",
  14. Subsystem: "crashreceiver",
  15. Name: "crash_reports_total",
  16. }, []string{"result"})
  17. metricFailureReportsTotal = promauto.NewCounterVec(prometheus.CounterOpts{
  18. Namespace: "syncthing",
  19. Subsystem: "crashreceiver",
  20. Name: "failure_reports_total",
  21. }, []string{"result"})
  22. metricDiskstoreFilesTotal = promauto.NewGauge(prometheus.GaugeOpts{
  23. Namespace: "syncthing",
  24. Subsystem: "crashreceiver",
  25. Name: "diskstore_files_total",
  26. })
  27. metricDiskstoreBytesTotal = promauto.NewGauge(prometheus.GaugeOpts{
  28. Namespace: "syncthing",
  29. Subsystem: "crashreceiver",
  30. Name: "diskstore_bytes_total",
  31. })
  32. metricDiskstoreOldestAgeSeconds = promauto.NewGauge(prometheus.GaugeOpts{
  33. Namespace: "syncthing",
  34. Subsystem: "crashreceiver",
  35. Name: "diskstore_oldest_age_seconds",
  36. })
  37. )