-
Notifications
You must be signed in to change notification settings - Fork 680
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
Support Access Log Service (ALS) #1691
Comments
Sounds like this could be implemented like our discussions with the RateLimiting service. Contour configures the endpoint and then the receiving end is responsible for implementing its side. |
ping @m2 for backlog prioritisation. |
Now that we've added the In my mind, this feature will be much less usable without full support for #2495 however, as Contour has no way to tell you that the logging that you've configured won't work. |
FWIW, for our use case, we don't need this to be configurable at the But if we can leverage
Now, for status propagation all the way to the Are you thinking that Contour would initiate its own gRPC checks against the ALS service before handing it off to Envoy? Does it do that just once or continuously? Would the fallback to STDOUT also be dynamic? If Contour really wants to go down that path...
IMO, it's a lot of moving parts, and likely out of scope for Contour. |
I meant more that, if the ALS service is running inside Kubernetes, it will have a Service object, with Endpoints that will come and go based on healthchecks, so the Endpoints (which Contour watches already) will tell us if the configured service is accepting traffic. That's a simple way that we could get a If the ALS is a sidecar, that is interesting. Any design that we propose definitely needs to be able to handle that use case as well, thanks. |
Maybe. We can consistently support ALS in the ExtensionService model, which lets the services scale independently (and arguably gives better resource management and resource visibility). The cost is increased deployment complexity, and potentially decreased reliability. One way to support side-car services could be with a new CRD that would cause Contour to inject and configure the sidecar. The difficulty there is that Contour today doesn't manage the Envoy deployment at all, so we would need to deal with that. I guess another way would be a CRD that expresses the operators' commitment to have already configured such a sidecar :) I don't know that ALS is special WRT being deployed as a sidecar (you could make a similar for deploying ext_authz and rate limit proxies as sidecars). |
Seems like the sidecar question is a blocker to this work? Could you sort of cheat and expose the services running in a sidecar with an (well, it might not work to try to expose 127.0.0.1 this way) Or instead to add another concept in addition to |
I don't think we need extensionService in play for this. You create your ALS service which might be I feel like we're over complicating this problem or possibly I'm over simplifying it. =) |
Using a sidecar is not a hard requirement. ALS would work fine behind a Service and Deployment. The sidecar pattern was our preference only because it scales linearly with the number of Envoy nodes (a fair balancing), and the convenience of not needing endpoint discovery. |
Yeah, if the ask is to just add GRPC access logging support to the HTTP connection manager this sounds right Using |
If the consensus is to add to the existing global access log configuration, the required pieces potentially look like this (spelling it out since I'm new to validate my understanding):
Lmk if this is something that is involved enough to require a design doc instead |
ExtensionService could come into play as in the proposed RLS design: https://github.com/projectcontour/contour/pull/3178/files#diff-20429b7228686401b67018e240efb3c4ff9ff1289328f9922da0ba90ae10d806R143 |
The list of request/response headers to send to ALS is one of the configurations needed. Simple ones like Content-type are not included by default. |
The reason I brought up |
I agree that the point of ExtensionService is to express the location and the policy for a cluster we're going to tell Envoy about. That would fit well with "you're connecting to localhost" at a conceptual level, but we probably need some more general guidance about how we do policy for the cluster (this has come up in the discussion about tracing as well). For the specific config here, we're going to need something similar to the discussions about Tracing in #399, probably. |
Nick, are we ready to begin to pick this up within the next couple releases? Regarding granularity, I absolutely agree that we start at global instance level and move down to route if we really need to. Further, to James’ point on watching the envoy deployment, if we go with that approach can we think about adding this logic to the Contour Operator once again. I know we’re stuffing a lot of stuff into the Operator already Furthermore, can these Access Logs then be streamed to something like Fluent Bit. To be quite transparent here, fluent is very popular solution that has already been well integrated into a few telemetry platforms in downstream DIY k8s on the market; that are capable of being post processed and plotted in time series charts etc |
Envoy has its own gRPC logging protocol, that's ALS. Currently, it seems that Fluent Bit doesn't have support for ingesting ALS. So to fully implement this, we may need to implement a basic ALS sink (similar to how we made contour-authserver), or add support for ALS to other projects (like Fluent Bit). The work of actually adding the config items to enable sending ALS from Envoy is a reasonably straightforward addition to the So we can definitely provide the facility to configure this, but we won't be able to validate that it works in CI until we have a sink we can check. |
@youngnick @skriss I am interested in working with someone to add ALS support to Contour. @youngnick As you said, we will have to add the ALS cluster as part of Let me know what do you think? |
This is great work @abhide! Yes, what I see is that we have a way to tell the Contour bootstrap to configure ALS by looking at a named ExtensionService object. The ExtensionService object then allows us to configure the cluster that will be generated in the boostrap (timeouts and load balancing policy, mainly). In addition, you can point an ExtensionService object to You make a good point that we also need to decide how to enable this. I had originally thought that we would just have a boolean config item for Maybe that looks like: We tell the controller the ExtensionService that controls ALS, and that serves both as a boolean that ALS should be enabled, and a check that the service is working before we configure the connection manager to do it for everything? This would be a global config file item for However, I think that this feature needs a design document, that walks through what to add to @abhide Do you want to make a start and open a WIP PR? I'll help you with polish, so please feel free to submit early and we'll iterate. |
Thanks @youngnick. Will starta WIP design doc PR and we can collaborate on this. |
Updates: projectcontour#1691 Signed-off-by: Amey Bhide <amey15@gmail.com>
Seems like this will slip to 1.16, ok to move? |
Yep, move this one out to 1.16. |
Still in flight, moving to 1.17., |
Okay, @abhide's design PR was auto-closed by the staleness bot, so I thought I would do an update of what I think the current status is here, and hopefully we can get this moving again. What this comes down to is that adding the ALS config isn't very hard, but finding the correct place to specify the config is. Currently, the example Contour install recommends using In order to be able to specify ALS config, Envoy needs the clusters configured in its bootstrap. This doesn't seem changeable without a lot of Envoy work. Some of the things we discussed in the PR:
For the next steps, I think that with the Managed Envoy (#3545) work coming, that's the best way to add this sort of functionality. We'll probably need a backstop as well for people who don't use managed Envoy, which I agree could be the named-by-convention, always-included-in-bootstrap cluster, maybe. @projectcontour/maintainers, thoughts? |
The Contour project currently lacks enough contributors to adequately respond to all Issues. This bot triages Issues according to the following rules:
You can:
Please send feedback to the #contour channel in the Kubernetes Slack |
The Contour project currently lacks enough contributors to adequately respond to all Issues. This bot triages Issues according to the following rules:
You can:
Please send feedback to the #contour channel in the Kubernetes Slack |
Structured logging for the Envoy access logs (ie. JSON access logs) was requested in #624 and implemented in #1511. Envoy supports a more advanced and flexible access logging option: an Access Log Service (ALS).
With this activated, Envoy uses gRPC streams to pass rich and strongly typed protobufs with all details to a sink. This sink is free to do whatever it pleases with the access logs.
Use cases valuable to us:
We've implemented this as a proof of concept with the following strategy:
127.0.0.1
(note: this cannot be done via CDS, we've tried -- Allow Envoy gRPC access log service to be dynamically configured envoyproxy/envoy#3660)If Contour supported this, fewer hacks would be needed. I think the minimum would be:
I don't think Contour needs to provide anything related to implementing an ALS receiver, though we'd be happy to contribute this somewhere if there is interest.
This may be too complex for the scope of Contour and too niche of a feature, but I thought I'd file an issue regardless following @youngnick's recommendation.
The text was updated successfully, but these errors were encountered: