Skip to content

Commit 7bb8e22

Browse files
authored
feat(fxhttpclient): Updated metrics base name (#169)
1 parent 4d28088 commit 7bb8e22

File tree

3 files changed

+25
-25
lines changed

3 files changed

+25
-25
lines changed

fxhttpclient/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/ankorstore/yokai/fxlog v1.1.0
99
github.com/ankorstore/yokai/fxmetrics v1.1.0
1010
github.com/ankorstore/yokai/fxtrace v1.2.0
11-
github.com/ankorstore/yokai/httpclient v1.3.1
11+
github.com/ankorstore/yokai/httpclient v1.4.0
1212
github.com/ankorstore/yokai/log v1.2.0
1313
github.com/ankorstore/yokai/trace v1.2.0
1414
github.com/prometheus/client_golang v1.19.0

fxhttpclient/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ github.com/ankorstore/yokai/fxmetrics v1.1.0 h1:S0bLCwO37oiDG+5kQFGYt2g2FNGQLu/O
88
github.com/ankorstore/yokai/fxmetrics v1.1.0/go.mod h1:WBr76IIdlSZIpBsjKSdXCAJBWF0HCp46bwFX8bt0tFk=
99
github.com/ankorstore/yokai/fxtrace v1.2.0 h1:SXlWbjKSsb2wVH+hXSE9OD2VwyqkznwwW+kiQcNvEAU=
1010
github.com/ankorstore/yokai/fxtrace v1.2.0/go.mod h1:ch72eVTlIedETOApK7SXk2NEWpn3yYeM018dNRccocg=
11-
github.com/ankorstore/yokai/httpclient v1.3.1 h1:wvhHKCgNIkGodgi+Pl+n97034YoD8rwvYsDJsXV4KP0=
12-
github.com/ankorstore/yokai/httpclient v1.3.1/go.mod h1:sBg8v79VgHtShuGUTo+BwWqvim7Ubd9eoWMJqK3MCwg=
11+
github.com/ankorstore/yokai/httpclient v1.4.0 h1:m3pMhY62wj96J/k7C4Dv0a2eIQZyLa2O337DRNzTpvw=
12+
github.com/ankorstore/yokai/httpclient v1.4.0/go.mod h1:sBg8v79VgHtShuGUTo+BwWqvim7Ubd9eoWMJqK3MCwg=
1313
github.com/ankorstore/yokai/log v1.2.0 h1:jiuDiC0dtqIGIOsFQslUHYoFJ1qjI+rOMa6dI1LBf2Y=
1414
github.com/ankorstore/yokai/log v1.2.0/go.mod h1:MVvUcms1AYGo0BT6l88B9KJdvtK6/qGKdgyKVXfbmyc=
1515
github.com/ankorstore/yokai/trace v1.2.0 h1:Jnl++IGNpDYumsZJXP3qjhMdvyHbejiajQwIlU604w0=

fxhttpclient/module_test.go

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,17 @@ func TestModule(t *testing.T) {
101101

102102
expectedMetric := fmt.Sprintf(
103103
`
104-
# HELP foo_bar_httpclient_requests_total Number of performed HTTP requests
105-
# TYPE foo_bar_httpclient_requests_total counter
106-
foo_bar_httpclient_requests_total{host="%s",method="POST",path="",status="2xx"} 1
104+
# HELP foo_bar_http_client_requests_total Number of performed HTTP requests
105+
# TYPE foo_bar_http_client_requests_total counter
106+
foo_bar_http_client_requests_total{host="%s",method="POST",path="",status="2xx"} 1
107107
`,
108108
httpServer.URL,
109109
)
110110

111111
err = testutil.GatherAndCompare(
112112
metricsRegistry,
113113
strings.NewReader(expectedMetric),
114-
"foo_bar_httpclient_requests_total",
114+
"foo_bar_http_client_requests_total",
115115
)
116116
assert.NoError(t, err)
117117

@@ -158,10 +158,10 @@ func TestModule(t *testing.T) {
158158

159159
expectedMetric = fmt.Sprintf(
160160
`
161-
# HELP foo_bar_httpclient_requests_total Number of performed HTTP requests
162-
# TYPE foo_bar_httpclient_requests_total counter
163-
foo_bar_httpclient_requests_total{host="%s",method="POST",path="",status="2xx"} 1
164-
foo_bar_httpclient_requests_total{host="%s",method="POST",path="",status="4xx"} 1
161+
# HELP foo_bar_http_client_requests_total Number of performed HTTP requests
162+
# TYPE foo_bar_http_client_requests_total counter
163+
foo_bar_http_client_requests_total{host="%s",method="POST",path="",status="2xx"} 1
164+
foo_bar_http_client_requests_total{host="%s",method="POST",path="",status="4xx"} 1
165165
`,
166166
httpServer.URL,
167167
httpServer.URL,
@@ -170,7 +170,7 @@ func TestModule(t *testing.T) {
170170
err = testutil.GatherAndCompare(
171171
metricsRegistry,
172172
strings.NewReader(expectedMetric),
173-
"foo_bar_httpclient_requests_total",
173+
"foo_bar_http_client_requests_total",
174174
)
175175
assert.NoError(t, err)
176176

@@ -217,11 +217,11 @@ func TestModule(t *testing.T) {
217217

218218
expectedMetric = fmt.Sprintf(
219219
`
220-
# HELP foo_bar_httpclient_requests_total Number of performed HTTP requests
221-
# TYPE foo_bar_httpclient_requests_total counter
222-
foo_bar_httpclient_requests_total{host="%s",method="POST",path="",status="2xx"} 1
223-
foo_bar_httpclient_requests_total{host="%s",method="POST",path="",status="4xx"} 1
224-
foo_bar_httpclient_requests_total{host="%s",method="POST",path="",status="5xx"} 1
220+
# HELP foo_bar_http_client_requests_total Number of performed HTTP requests
221+
# TYPE foo_bar_http_client_requests_total counter
222+
foo_bar_http_client_requests_total{host="%s",method="POST",path="",status="2xx"} 1
223+
foo_bar_http_client_requests_total{host="%s",method="POST",path="",status="4xx"} 1
224+
foo_bar_http_client_requests_total{host="%s",method="POST",path="",status="5xx"} 1
225225
`,
226226
httpServer.URL,
227227
httpServer.URL,
@@ -231,7 +231,7 @@ func TestModule(t *testing.T) {
231231
err = testutil.GatherAndCompare(
232232
metricsRegistry,
233233
strings.NewReader(expectedMetric),
234-
"foo_bar_httpclient_requests_total",
234+
"foo_bar_http_client_requests_total",
235235
)
236236
assert.NoError(t, err)
237237

@@ -279,12 +279,12 @@ func TestModule(t *testing.T) {
279279

280280
expectedMetric = fmt.Sprintf(
281281
`
282-
# HELP foo_bar_httpclient_requests_total Number of performed HTTP requests
283-
# TYPE foo_bar_httpclient_requests_total counter
284-
foo_bar_httpclient_requests_total{host="%s",method="POST",path="",status="2xx"} 1
285-
foo_bar_httpclient_requests_total{host="%s",method="GET",path="%s",status="3xx"} 1
286-
foo_bar_httpclient_requests_total{host="%s",method="POST",path="",status="4xx"} 1
287-
foo_bar_httpclient_requests_total{host="%s",method="POST",path="",status="5xx"} 1
282+
# HELP foo_bar_http_client_requests_total Number of performed HTTP requests
283+
# TYPE foo_bar_http_client_requests_total counter
284+
foo_bar_http_client_requests_total{host="%s",method="POST",path="",status="2xx"} 1
285+
foo_bar_http_client_requests_total{host="%s",method="GET",path="%s",status="3xx"} 1
286+
foo_bar_http_client_requests_total{host="%s",method="POST",path="",status="4xx"} 1
287+
foo_bar_http_client_requests_total{host="%s",method="POST",path="",status="5xx"} 1
288288
`,
289289
httpServer.URL,
290290
httpServer.URL,
@@ -296,7 +296,7 @@ func TestModule(t *testing.T) {
296296
err = testutil.GatherAndCompare(
297297
metricsRegistry,
298298
strings.NewReader(expectedMetric),
299-
"foo_bar_httpclient_requests_total",
299+
"foo_bar_http_client_requests_total",
300300
)
301301
assert.NoError(t, err)
302302
}

0 commit comments

Comments
 (0)