Skip to content

Commit

Permalink
feat(fxhttpclient): Updated metrics base name (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekkinox authored Mar 15, 2024
1 parent 4d28088 commit 7bb8e22
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion fxhttpclient/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/ankorstore/yokai/fxlog v1.1.0
github.com/ankorstore/yokai/fxmetrics v1.1.0
github.com/ankorstore/yokai/fxtrace v1.2.0
github.com/ankorstore/yokai/httpclient v1.3.1
github.com/ankorstore/yokai/httpclient v1.4.0
github.com/ankorstore/yokai/log v1.2.0
github.com/ankorstore/yokai/trace v1.2.0
github.com/prometheus/client_golang v1.19.0
Expand Down
4 changes: 2 additions & 2 deletions fxhttpclient/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ github.com/ankorstore/yokai/fxmetrics v1.1.0 h1:S0bLCwO37oiDG+5kQFGYt2g2FNGQLu/O
github.com/ankorstore/yokai/fxmetrics v1.1.0/go.mod h1:WBr76IIdlSZIpBsjKSdXCAJBWF0HCp46bwFX8bt0tFk=
github.com/ankorstore/yokai/fxtrace v1.2.0 h1:SXlWbjKSsb2wVH+hXSE9OD2VwyqkznwwW+kiQcNvEAU=
github.com/ankorstore/yokai/fxtrace v1.2.0/go.mod h1:ch72eVTlIedETOApK7SXk2NEWpn3yYeM018dNRccocg=
github.com/ankorstore/yokai/httpclient v1.3.1 h1:wvhHKCgNIkGodgi+Pl+n97034YoD8rwvYsDJsXV4KP0=
github.com/ankorstore/yokai/httpclient v1.3.1/go.mod h1:sBg8v79VgHtShuGUTo+BwWqvim7Ubd9eoWMJqK3MCwg=
github.com/ankorstore/yokai/httpclient v1.4.0 h1:m3pMhY62wj96J/k7C4Dv0a2eIQZyLa2O337DRNzTpvw=
github.com/ankorstore/yokai/httpclient v1.4.0/go.mod h1:sBg8v79VgHtShuGUTo+BwWqvim7Ubd9eoWMJqK3MCwg=
github.com/ankorstore/yokai/log v1.2.0 h1:jiuDiC0dtqIGIOsFQslUHYoFJ1qjI+rOMa6dI1LBf2Y=
github.com/ankorstore/yokai/log v1.2.0/go.mod h1:MVvUcms1AYGo0BT6l88B9KJdvtK6/qGKdgyKVXfbmyc=
github.com/ankorstore/yokai/trace v1.2.0 h1:Jnl++IGNpDYumsZJXP3qjhMdvyHbejiajQwIlU604w0=
Expand Down
44 changes: 22 additions & 22 deletions fxhttpclient/module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,17 @@ func TestModule(t *testing.T) {

expectedMetric := fmt.Sprintf(
`
# HELP foo_bar_httpclient_requests_total Number of performed HTTP requests
# TYPE foo_bar_httpclient_requests_total counter
foo_bar_httpclient_requests_total{host="%s",method="POST",path="",status="2xx"} 1
# HELP foo_bar_http_client_requests_total Number of performed HTTP requests
# TYPE foo_bar_http_client_requests_total counter
foo_bar_http_client_requests_total{host="%s",method="POST",path="",status="2xx"} 1
`,
httpServer.URL,
)

err = testutil.GatherAndCompare(
metricsRegistry,
strings.NewReader(expectedMetric),
"foo_bar_httpclient_requests_total",
"foo_bar_http_client_requests_total",
)
assert.NoError(t, err)

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

expectedMetric = fmt.Sprintf(
`
# HELP foo_bar_httpclient_requests_total Number of performed HTTP requests
# TYPE foo_bar_httpclient_requests_total counter
foo_bar_httpclient_requests_total{host="%s",method="POST",path="",status="2xx"} 1
foo_bar_httpclient_requests_total{host="%s",method="POST",path="",status="4xx"} 1
# HELP foo_bar_http_client_requests_total Number of performed HTTP requests
# TYPE foo_bar_http_client_requests_total counter
foo_bar_http_client_requests_total{host="%s",method="POST",path="",status="2xx"} 1
foo_bar_http_client_requests_total{host="%s",method="POST",path="",status="4xx"} 1
`,
httpServer.URL,
httpServer.URL,
Expand All @@ -170,7 +170,7 @@ func TestModule(t *testing.T) {
err = testutil.GatherAndCompare(
metricsRegistry,
strings.NewReader(expectedMetric),
"foo_bar_httpclient_requests_total",
"foo_bar_http_client_requests_total",
)
assert.NoError(t, err)

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

expectedMetric = fmt.Sprintf(
`
# HELP foo_bar_httpclient_requests_total Number of performed HTTP requests
# TYPE foo_bar_httpclient_requests_total counter
foo_bar_httpclient_requests_total{host="%s",method="POST",path="",status="2xx"} 1
foo_bar_httpclient_requests_total{host="%s",method="POST",path="",status="4xx"} 1
foo_bar_httpclient_requests_total{host="%s",method="POST",path="",status="5xx"} 1
# HELP foo_bar_http_client_requests_total Number of performed HTTP requests
# TYPE foo_bar_http_client_requests_total counter
foo_bar_http_client_requests_total{host="%s",method="POST",path="",status="2xx"} 1
foo_bar_http_client_requests_total{host="%s",method="POST",path="",status="4xx"} 1
foo_bar_http_client_requests_total{host="%s",method="POST",path="",status="5xx"} 1
`,
httpServer.URL,
httpServer.URL,
Expand All @@ -231,7 +231,7 @@ func TestModule(t *testing.T) {
err = testutil.GatherAndCompare(
metricsRegistry,
strings.NewReader(expectedMetric),
"foo_bar_httpclient_requests_total",
"foo_bar_http_client_requests_total",
)
assert.NoError(t, err)

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

expectedMetric = fmt.Sprintf(
`
# HELP foo_bar_httpclient_requests_total Number of performed HTTP requests
# TYPE foo_bar_httpclient_requests_total counter
foo_bar_httpclient_requests_total{host="%s",method="POST",path="",status="2xx"} 1
foo_bar_httpclient_requests_total{host="%s",method="GET",path="%s",status="3xx"} 1
foo_bar_httpclient_requests_total{host="%s",method="POST",path="",status="4xx"} 1
foo_bar_httpclient_requests_total{host="%s",method="POST",path="",status="5xx"} 1
# HELP foo_bar_http_client_requests_total Number of performed HTTP requests
# TYPE foo_bar_http_client_requests_total counter
foo_bar_http_client_requests_total{host="%s",method="POST",path="",status="2xx"} 1
foo_bar_http_client_requests_total{host="%s",method="GET",path="%s",status="3xx"} 1
foo_bar_http_client_requests_total{host="%s",method="POST",path="",status="4xx"} 1
foo_bar_http_client_requests_total{host="%s",method="POST",path="",status="5xx"} 1
`,
httpServer.URL,
httpServer.URL,
Expand All @@ -296,7 +296,7 @@ func TestModule(t *testing.T) {
err = testutil.GatherAndCompare(
metricsRegistry,
strings.NewReader(expectedMetric),
"foo_bar_httpclient_requests_total",
"foo_bar_http_client_requests_total",
)
assert.NoError(t, err)
}
Expand Down

0 comments on commit 7bb8e22

Please sign in to comment.