Skip to content
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

Allow forwarding healthz/ to a different backend port #404

Open
ashi009 opened this issue Jun 18, 2018 · 9 comments
Open

Allow forwarding healthz/ to a different backend port #404

ashi009 opened this issue Jun 18, 2018 · 9 comments

Comments

@ashi009
Copy link

ashi009 commented Jun 18, 2018

For gRPC implementation in go, serving both HTTP and gRPC on the same port is still problematic, so a production service is unlikely to serve monitoring endpoints (healthz/, metricz/ and those *z/ ones) on the grpc port.

So I think it's a good idea to allow healthz/ to be forwarded to a different port other than the grpc port.

@ashi009 ashi009 changed the title Allow forward healthz from a different backend port Allow forwarding healthz/ to a different backend port Jun 18, 2018
@lizan
Copy link
Contributor

lizan commented Jun 19, 2018

It is possible to do this with custom nginx.conf by adding something like this:

location /healthz {
  proxy_pass http://<point to another endpoint>;
}

before the regular grpc_pass directive. I haven't got chance to try but it should work.

@ashi009
Copy link
Author

ashi009 commented Jun 19, 2018

Yep, I know this would work but would love to have this out-of-the-box.

@lizan
Copy link
Contributor

lizan commented Jun 19, 2018

I see. We already have kind of support in nginx.conf template to let ESP return a hardcoded 200 here, feel free to open an PR to endpoints-tools to make it generates proxy_pass directive.

@ashi009
Copy link
Author

ashi009 commented Jun 19, 2018

Speaking of that, I found that providing a healthz/ handler with consistent 200 response is just misleading and for that case it should be called nullz/ instead.

@qiwzhang
Copy link
Contributor

@ashi009 agreed that the new health port forwarding to the backend should be called healthz. But to be backward compatible (not to break existing customers), we may have to keep the current name. We have to come up a new name for the new port.

@qiwzhang
Copy link
Contributor

revisit this issue. Not sure if it is still required.

Since backend is grpc, forward a healhz call to another http endpoint may not work. it is not really the health of the grpc backend unless the http endpoints monitors the grpc server.

So not sure if suggested solution will help

@ashi009
Copy link
Author

ashi009 commented Apr 27, 2019 via email

@qiwzhang
Copy link
Contributor

In this case, users just need to expose the grpc health check service in the service config, ESP will happily pass the call from LB to the grpc service. ESP doesn't need to do anything special.

@ashi009
Copy link
Author

ashi009 commented Apr 27, 2019 via email

@qiwzhang qiwzhang self-assigned this Apr 29, 2019
@qiwzhang qiwzhang removed their assignment Feb 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants