-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
*: Change gRPC proxy to expose endpoint /metrics #10618
Conversation
4e4ae90
to
ddde6ef
Compare
Codecov Report
@@ Coverage Diff @@
## master #10618 +/- ##
==========================================
- Coverage 71.76% 71.65% -0.12%
==========================================
Files 393 393
Lines 36571 36632 +61
==========================================
+ Hits 26247 26249 +2
- Misses 8495 8555 +60
+ Partials 1829 1828 -1
Continue to review full report at Codecov.
|
proxy/grpcproxy/metrics.go
Outdated
pathMetrics := etcdhttp.PathMetrics | ||
target := fmt.Sprintf("%s%s", eps[0], pathMetrics) | ||
if !strings.HasPrefix(target, "http") { | ||
target = fmt.Sprintf("%s%s", "http://", target) |
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.
We don't handle https
here?
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.
reads if not if !strings.HasPrefix(target, "http")
if scheme = https
target does not change as http
matches https
as well. If no scheme we assume http.
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.
But we are setting the scheme http://
?
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.
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.
What if "member:2379"
were for TLS endpoints? I remember scheme was not required for etcd gRPC endpoints.
Could you check?
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.
I think Get fails without scheme.
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 check?
sounds good
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.
Thanks!
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.
Updated is that what you were thinking?
9545f68
to
da742ff
Compare
@hexfusion Can we update the doc and changelog? |
7c8cebc
to
d5a31db
Compare
@gyuho updated. |
e73f7ae
to
2bc147f
Compare
Semaphore failure |
@gyuho ptal |
This PR resolves an issue where the `/metrics` endpoints exposed by the proxy were not returning metrics of the etcd members servers but of the proxy itself. Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
…rics" PR Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
2bc147f
to
ebafb2a
Compare
Updated and per @gyuho #10618 (comment) I am merging with greens. |
@gyuho thank you for the review |
Currently,
grpc-proxy
exposes only metrics for proxy itself and does not allow the client to consume endpoint/metrics
. The/health
endpoint forwards a request against endpoint and so should/metrics
. This PR resolves an issue where metrics returned by/metrics
were the metrics of the proxy itself instead of the etcd member server.Fixes: #10611