Skip to content

Commit 6696213

Browse files
committed
updated prom metric names
1 parent 8a530ad commit 6696213

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

rxtx.go

+8-11
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,11 @@ import (
1111
"runtime/pprof"
1212
"time"
1313

14+
"github.com/gin-contrib/zap"
15+
"github.com/gin-gonic/gin"
1416
"github.com/prometheus/client_golang/prometheus"
1517
"github.com/prometheus/client_golang/prometheus/promauto"
16-
17-
"github.com/gin-contrib/zap"
18-
1918
"github.com/prometheus/client_golang/prometheus/promhttp"
20-
21-
"github.com/gin-gonic/gin"
2219
"github.com/txn2/rxtx/rtq"
2320
"go.uber.org/zap"
2421
)
@@ -104,32 +101,32 @@ func main() {
104101

105102
// Prometheus Metrics
106103
processed := promauto.NewCounter(prometheus.CounterOpts{
107-
Name: "total_messages_received",
104+
Name: "rxtx_total_messages_received",
108105
Help: "Total number of messages received.",
109106
})
110107

111108
queued := promauto.NewGauge(prometheus.GaugeOpts{
112-
Name: "messages_in_queue",
109+
Name: "rxtx_messages_in_queue",
113110
Help: "Number os messages in the queue.",
114111
})
115112

116113
txBatches := promauto.NewCounter(prometheus.CounterOpts{
117-
Name: "tx_batches",
114+
Name: "rxtx_tx_batches",
118115
Help: "Total number of batch transmissions.",
119116
})
120117

121118
txFail := promauto.NewCounter(prometheus.CounterOpts{
122-
Name: "tx_fails",
119+
Name: "rxtx_tx_fails",
123120
Help: "Total number of transaction errors.",
124121
})
125122

126123
dbErr := promauto.NewCounter(prometheus.CounterOpts{
127-
Name: "db_errors",
124+
Name: "rxtx_db_errors",
128125
Help: "Total number database errors.",
129126
})
130127

131128
msgErr := promauto.NewCounter(prometheus.CounterOpts{
132-
Name: "msg_errors",
129+
Name: "rxtx_msg_errors",
133130
Help: "Total number message errors.",
134131
})
135132

0 commit comments

Comments
 (0)