Skip to content

feat(fxhttpclient): Updated metrics base name #169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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