Skip to content

Commit

Permalink
<review commit> revert unit test change
Browse files Browse the repository at this point in the history
  • Loading branch information
anurag4DSB committed Jan 9, 2025
1 parent ba40440 commit fb8f695
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/metrics/prometheus_middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ var _ = Describe("AttachPrometheusMiddleware", func() {
requestDuration = prometheus.NewHistogramVec(prometheus.HistogramOpts{
Name: "request_duration_seconds",
Help: "Duration of requests",
}, []string{"operation", "status", "trace_id"})
}, []string{"operation", "status"})

requestsTotal = prometheus.NewCounterVec(prometheus.CounterOpts{
Name: "requests_total",
Help: "Total number of requests",
}, []string{"operation", "status", "trace_id"})
}, []string{"operation", "status"})

stack = middleware.NewStack("testStack", nil)

Expand Down Expand Up @@ -146,7 +146,7 @@ var _ = Describe("AttachPrometheusMiddleware", func() {

metrics := testutil.CollectAndCount(requestDuration)
Expect(metrics).To(BeNumerically(">", 0)) // Ensure metrics are collected
Expect(requestDuration.WithLabelValues("TestOperation", "error", "trace_id")).NotTo(BeNil())
Expect(requestsTotal.WithLabelValues("TestOperation", "error", "trace_id")).NotTo(BeNil())
Expect(requestDuration.WithLabelValues("TestOperation", "error")).NotTo(BeNil())
Expect(requestsTotal.WithLabelValues("TestOperation", "error")).NotTo(BeNil())
})
})

0 comments on commit fb8f695

Please sign in to comment.