-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Http logs for Kubernetes services #11221
Comments
Do you mean logs for the kubernetes apiserver? We plan to do that but haven't gotten around to it. It is sort of covered by #2203. Or do you mean logs for web servers in user-created pods? We don't have a general way to do that at the moment. There are multiple ways to reach a kubernetes service:
Related: |
Happy to hear a longer description of your requirements. |
@lavalamp to fact check above. |
I think the easiest way to get this is to actually just use HAProxy in place of a load balancer (some assembly required). If you're already using a load balancer, your cloud provider should be keeping the logs you desire. At the moment, we do store access logs for requests that go through the apiserver's proxy; however it's not in HAProxy's format, and it's mixed in with all api calls. I don't think it makes sense to make the apiserver proxy fancy, since for production work you almost certainly want to use a load balancer/HAProxy/nginx for getting users to your services. It might make sense to do something fancier with apiserver's log if there's a compelling reason for people to want to scrape it for data; it shouldn't be too hard to make it conform to any desired format, and I don't think we have strong opinions about what the format should be (other than useful). |
@erictune, I meant logs for web servers in user-created pods. Api server logs would be useful as well, but less critical, I guess. Usually, having an application consisted of many services with service to service communication I try to hide each service behind HAProxy (other L7 proxies would work as well I guess). This configuration works very well for me on production. For example, having HAProxy HTTP logs I can get information such as:
For now I didn't find the way to get such information for service-to-service communication inside Kubernetes and I'm afraid I will have to little information to investigate production issues (my application is not on production yet). That said I'm looking forward for #561 to be implemented. @lavalamp, I will certainly use a load balancer to get users to my services, but this will allow me only to log external traffic. I won't be able to get log for service-to-service communication. |
subscribe me |
That's a fair point. Your options for this are a) scrape kube-proxy logs on every machine. Kube-proxy does TCP proxying, not HTTP, so you'll not get much useful data this way; or b) aggregate logs from each pod running the service. |
@thockin we just talked about this. You said that you thought doing L7 in kube-proxy might degrade network performance. But, if someone is already using ha-proxy between their microservices, maybe there isn't much change when moving to kubernetes with L7-enabled kube-proxy. |
L7 in userspace may also defeat some micro-segmentation plans which operate On Tue, Jul 14, 2015 at 10:53 AM, Eric Tune notifications@github.com
|
@lavalamp, do you mean aggregating application logs? that's must have, but still I find HTTP logs extremely useful. Application logs are of different quality and it's often hard to reason from them. |
This is clearly useful. I'm not sure whether it is a core feature of kubernetes or a feature of a PaaS/Framework that runs on top of it. @smarterclayton does OpenShift provide a standard way to log intra-cluster http requests along with latency stats for them? |
Wouldn't best practice to be to run the web server as a foreground process On Wed, Jul 15, 2015, 09:19 Eric Tune notifications@github.com wrote:
|
It (Openshift) does not automatically (doesn't change the Kube proxy internally to an L7 aware). I know a few folks have replaced the service proxy with HAProxy, and we plan on exposing some metrics data from our edge HAProxy to heapster / influx for use in autoscaling, and that HAProxy and Apache and others could easily generate the latency numbers. I don't think we have a short term plan to track latency, but would be interested to see what folks come up with. When the service proxy goes to iptables stats will be harder. Pods can definitely log and aggregate their own http metrics - would be nice to have a way to roll those up and process then to extract latency and other metrics. |
Hi guys ! As you said, it is easy to debug external requests that go into the cluster through an HA proxy but for internal requests I don't know how to do it... |
I wonder if there is a way to get HTTP (access) logs for Kubernetes services. Ideally it would look similar to logs provided by HAProxy: http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#8.2.3
I guess it would be helpful in investigating issues in microservices environment.
The text was updated successfully, but these errors were encountered: