Skip to content

Commit 21b0d68

Browse files
authored
Initialize success and error counters (#60)
* Initialize success and error counters We need to initialize success and error counters properly in order to avoid having undefined metrics. Closes: #59 * Add release info
1 parent ee3de08 commit 21b0d68

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.5.1] - 2023-11-06
9+
10+
### Added
11+
12+
- Bugfix for #59
13+
814
## [0.5.0] - 2023-10-11
915

1016
### Added

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Minigun
22

3-
[![Minigun Version](https://img.shields.io/badge/Minigun-0.5.0-7f187f.svg)](https://github.com/wayfair-incubator/minigun/blob/main/CHANGELOG.md)
3+
[![Minigun Version](https://img.shields.io/badge/Minigun-0.5.1-7f187f.svg)](https://github.com/wayfair-incubator/minigun/blob/main/CHANGELOG.md)
44
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.0-4baaaa.svg)](CODE_OF_CONDUCT.md)
55

66
## About The Project

main.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import (
3535
)
3636

3737
// Constants and vars
38-
const version = "0.5.0"
38+
const version = "0.5.1"
3939
const workersCannelSize = 1024
4040
const errorBadHTTPCode = "Bad HTTP status code"
4141

@@ -516,9 +516,7 @@ func worker(ctx context.Context, id int, config appConfig, comm chan message, st
516516
}
517517

518518
} else {
519-
520519
config.metrics.requestsSendSuccess.WithLabelValues(config.metrics.labelValues...).Inc()
521-
522520
}
523521
}
524522
}

metrics.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,8 @@ func initMetrics(config appConfig, labelNames, labelValues []string) appMetrics
329329
am.channelConfigLength.WithLabelValues(labelValues...).Set(float64(workersCannelSize))
330330
am.channelLength.WithLabelValues(labelValues...).Set(float64(0))
331331
am.channelFullEvents.WithLabelValues(labelValues...).Add(0)
332+
am.requestsSendSuccess.WithLabelValues(labelValues...).Add(0)
333+
am.requestsSendErrors.WithLabelValues(labelValues...).Add(0)
332334

333335
return am
334336
}

0 commit comments

Comments
 (0)