| 13 | ) |
| 14 | |
| 15 | func (m *KV) createAndRegisterMetrics() { |
| 16 | const subsystem = "memberlist_client" |
| 17 | |
| 18 | m.numberOfReceivedMessages = promauto.With(m.registerer).NewCounter(prometheus.CounterOpts{ |
| 19 | Namespace: m.cfg.MetricsNamespace, |
| 20 | Subsystem: subsystem, |
| 21 | Name: "received_broadcasts_total", |
| 22 | Help: "Number of received broadcast user messages", |
| 23 | }) |
| 24 | |
| 25 | m.totalSizeOfReceivedMessages = promauto.With(m.registerer).NewCounter(prometheus.CounterOpts{ |
| 26 | Namespace: m.cfg.MetricsNamespace, |
| 27 | Subsystem: subsystem, |
| 28 | Name: "received_broadcasts_bytes_total", |
| 29 | Help: "Total size of received broadcast user messages", |
| 30 | }) |
| 31 | |
| 32 | m.numberOfInvalidReceivedMessages = promauto.With(m.registerer).NewCounter(prometheus.CounterOpts{ |
| 33 | Namespace: m.cfg.MetricsNamespace, |
| 34 | Subsystem: subsystem, |
| 35 | Name: "received_broadcasts_invalid_total", |
| 36 | Help: "Number of received broadcast user messages that were invalid. Hopefully 0.", |
| 37 | }) |
| 38 | |
| 39 | m.numberOfDroppedMessages = promauto.With(m.registerer).NewCounter(prometheus.CounterOpts{ |
| 40 | Namespace: m.cfg.MetricsNamespace, |
| 41 | Subsystem: subsystem, |
| 42 | Name: "received_broadcasts_dropped_total", |
| 43 | Help: "Number of received broadcast user messages that were dropped. Hopefully 0.", |
| 44 | }) |
| 45 | |
| 46 | m.numberOfPushes = promauto.With(m.registerer).NewCounter(prometheus.CounterOpts{ |
| 47 | Namespace: m.cfg.MetricsNamespace, |
| 48 | Subsystem: subsystem, |
| 49 | Name: "state_pushes_total", |
| 50 | Help: "How many times did this node push its full state to another node", |
| 51 | }) |
| 52 | |
| 53 | m.totalSizeOfPushes = promauto.With(m.registerer).NewCounter(prometheus.CounterOpts{ |
| 54 | Namespace: m.cfg.MetricsNamespace, |
| 55 | Subsystem: subsystem, |
| 56 | Name: "state_pushes_bytes_total", |
| 57 | Help: "Total size of pushed state", |
| 58 | }) |
| 59 | |
| 60 | m.numberOfPulls = promauto.With(m.registerer).NewCounter(prometheus.CounterOpts{ |
| 61 | Namespace: m.cfg.MetricsNamespace, |
| 62 | Subsystem: subsystem, |
| 63 | Name: "state_pulls_total", |
| 64 | Help: "How many times did this node pull full state from another node", |
| 65 | }) |
| 66 | |
| 67 | m.totalSizeOfPulls = promauto.With(m.registerer).NewCounter(prometheus.CounterOpts{ |
| 68 | Namespace: m.cfg.MetricsNamespace, |
| 69 | Subsystem: subsystem, |
| 70 | Name: "state_pulls_bytes_total", |
| 71 | Help: "Total size of pulled state", |
| 72 | }) |