Skip to content

Commit

Permalink
Merge pull request #1485 from cybozu/change_metrics_name
Browse files Browse the repository at this point in the history
Change metrics name
  • Loading branch information
takara9 authored Dec 4, 2024
2 parents fb5f6e6 + c37805f commit aca2a25
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion bmc-log-collector/TAG
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.5
0.9.6
8 changes: 4 additions & 4 deletions bmc-log-collector/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ import (

var counterRequestFailed = promauto.NewCounterVec(
prometheus.CounterOpts{
Name: "failed_counter",
Help: "The failed count for Redfish of BMC accessing",
Name: "bmc_log_requests_failed_total",
Help: "Failed count of accessing BMC to get the system event log",
},
[]string{"serial"},
)

var counterRequestSuccess = promauto.NewCounterVec(
prometheus.CounterOpts{
Name: "success_counter",
Help: "The success count for Redfish of BMC accessing",
Name: "bmc_log_requests_success_total",
Help: "Succeeded count of accessing BMC to get the system event log",
},
[]string{"serial"},
)
Expand Down
12 changes: 6 additions & 6 deletions bmc-log-collector/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ var _ = Describe("Get Metrics export", Ordered, func() {
})

It("verify HELP line in metrics", func() {
Expect(searchMetricsComment(metricsLines, "# HELP failed_counter The failed count for Redfish of BMC accessing")).To(Equal(true))
Expect(searchMetricsComment(metricsLines, "# HELP bmc_log_requests_failed_total Failed count of accessing BMC to get the system event log")).To(Equal(true))
})
It("verify TYPE line in metrics", func() {
Expect(searchMetricsComment(metricsLines, "# TYPE failed_counter counter")).To(Equal(true))
Expect(searchMetricsComment(metricsLines, "# TYPE bmc_log_requests_failed_total counter")).To(Equal(true))
})

It("iDRAC ABC123X 172.16.0.1 failed", func() {
metricsLine, err := findMetrics(metricsLines, "failed_counter")
metricsLine, err := findMetrics(metricsLines, "bmc_log_requests_failed_total")
Expect(err).NotTo(HaveOccurred())

p := expfmt.TextParser{}
Expand Down Expand Up @@ -93,14 +93,14 @@ var _ = Describe("Get Metrics export", Ordered, func() {
})

It("verify HELP line in metrics", func() {
Expect(searchMetricsComment(metricsLines, "# HELP success_counter The success count for Redfish of BMC accessing")).To(Equal(true))
Expect(searchMetricsComment(metricsLines, "# HELP bmc_log_requests_success_total Succeeded count of accessing BMC to get the system event log")).To(Equal(true))
})
It("verify TYPE line in metrics", func() {
Expect(searchMetricsComment(metricsLines, "# TYPE success_counter counter")).To(Equal(true))
Expect(searchMetricsComment(metricsLines, "# TYPE bmc_log_requests_success_total counter")).To(Equal(true))
})

It("iDRAC ABC123X 172.16.0.1 success", func() {
metricsLine, err := findMetrics(metricsLines, "success_counter")
metricsLine, err := findMetrics(metricsLines, "bmc_log_requests_success_total")
Expect(err).NotTo(HaveOccurred())
p := expfmt.TextParser{}
metricsFamily, err := p.TextToMetricFamilies(strings.NewReader(metricsLine))
Expand Down

0 comments on commit aca2a25

Please sign in to comment.