-
Notifications
You must be signed in to change notification settings - Fork 95
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
Issue #88 Adding Host Label to all metrics #89
Issue #88 Adding Host Label to all metrics #89
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #89 +/- ##
==========================================
- Coverage 59.79% 58.79% -1.00%
==========================================
Files 8 8
Lines 679 682 +3
==========================================
- Hits 406 401 -5
- Misses 252 258 +6
- Partials 21 23 +2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you tweak this testcase to look for host also
echo-contrib/prometheus/prometheus_test.go
Lines 51 to 56 in 3020071
assert.Regexp(t, "request_duration_seconds.*le=\"0.005\"", rec.Body.String(), "duration should have time bucket (like, 0.005s)") | |
assert.NotRegexp(t, "request_duration_seconds.*le=\"512000\"", rec.Body.String(), "duration should NOT have a size bucket (like, 512K)") | |
assert.Regexp(t, "response_size_bytes.*le=\"512000\"", rec.Body.String(), "response size should have a 512K (size) bucket") | |
assert.NotRegexp(t, "response_size_bytes.*le=\"0.005\"", rec.Body.String(), "response size should NOT have time bucket (like, 0.005s)") | |
assert.Regexp(t, "request_size_bytes.*le=\"512000\"", rec.Body.String(), "request size should have a 512K (size) bucket") | |
assert.NotRegexp(t, "request_size_bytes.*le=\"0.005\"", rec.Body.String(), "request should NOT have time bucket (like, 0.005s)") |
Done |
I think Before this PR we had lines like this in response body
With this PR we have:
it would be better if we change these regexps to ordinary contains checks like that: body := rec.Body.String()
assert.Contains(t, body, `echo_request_duration_seconds_bucket{code="404",host="example.com",method="GET",url="/ping",le="0.005"}`) |
@aldas Changed the checks to use contains/notContains instead of regex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
perfect. Request you to merge it and release update package as and when planned |
Added Changes for #88.
This change makes sense as the Host Label is crucial to identify similar metrics across multiple services with same running endpoints