metrics.go 748 B

1234567891011121314151617181920212223242526
  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 events
  7. import (
  8. "github.com/prometheus/client_golang/prometheus"
  9. "github.com/prometheus/client_golang/prometheus/promauto"
  10. )
  11. var metricEvents = promauto.NewCounterVec(prometheus.CounterOpts{
  12. Namespace: "syncthing",
  13. Subsystem: "events",
  14. Name: "total",
  15. Help: "Total number of created/forwarded/dropped events",
  16. }, []string{"event", "state"})
  17. const (
  18. metricEventStateCreated = "created"
  19. metricEventStateDelivered = "delivered"
  20. metricEventStateDropped = "dropped"
  21. )