Skip to content

Commit

Permalink
Promrus' counters now follow Prometheus' naming conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
marccarre committed Oct 19, 2018
1 parent 9791d9b commit fcdd1c0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion promrus.go
Expand Up @@ -17,7 +17,7 @@ var supportedLevels = []logrus.Level{logrus.DebugLevel, logrus.InfoLevel, logrus
// Use NewPrometheusHook if you want more control. Use MustNewPrometheusHook if you want a less verbose hook creation.
func NewPrometheusHook() (*PrometheusHook, error) {
counterVec := prometheus.NewCounterVec(prometheus.CounterOpts{
Name: "log_messages",
Name: "log_messages_total",
Help: "Total number of log messages.",
}, []string{"level"})
// Initialise counters for all supported levels:
Expand Down
2 changes: 1 addition & 1 deletion promrus_test.go
Expand Up @@ -114,7 +114,7 @@ func countFor(t *testing.T, level log.Level, lines []string) int {
// # HELP test_debug Number of log statements at debug level.
// # TYPE test_debug counter
// test_debug 0
metric := fmt.Sprintf("log_messages{level=\"%v\"}", level)
metric := fmt.Sprintf("log_messages_total{level=\"%v\"}", level)
for _, line := range lines {
items := strings.Split(line, " ")
if len(items) != 2 { // e.g. {"test_debug", "0"}
Expand Down

0 comments on commit fcdd1c0

Please sign in to comment.