-
Notifications
You must be signed in to change notification settings - Fork 690
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 custom JSON fields for Envoy access logs #3032
Comments
+1 |
Historically, new fields were added to the internal list, see #1734. I think that customizing the fields is a reasonable need, however IIUC there's always been a concern that directly exposing the envoy config is too risky because an invalid config would break the envoy config, and we don't have good ways to surface the error. Maybe we can address this without directly exposing the envoy config, or maybe it's time to just accept the risk 🤷 |
@jpeach do you think restricting fields to only take custom headers names will increase the chances of accepting this feature? For example: json-fields:
- "@timestamp"
- custom_field
extra-json-fields-headers:
custom_field: "X-CUSTOM-HEADER" So it won't be the exact Envoy config, and will help Contour to keep this API in future if Envoy decides to change it. |
This is the only thing that stops us to move from nginx-controller to contour, the ability to add headers to log |
When we send an unsupported log token, the listener resource is rejected:
Neither Contour nor go-control-plane recover gracefully from a rejected update, so we want to be careful to only push valid configuration. |
I'm not sure that we need to be as restrictive as that. What if we allow known-good envoy log tokens within the same
We can validate the right hand-side of the key=value pair against the internal list of non-parameterized log tokens. For parameterized tokens, we ought to be able to validate If the field name conflicts with a built-in field name, we probably should treat this as an override (e.g. it would make sense for many organizations to override the |
Yes, to put this another way, the risk of accepting config directly from users is that the failure case is really bad. One typo, and your Envoys will stop accepting config from Contour, until they are restarted, even if you fix the issue. (!) This is not handled well in either the original Contour xDS implementation (#1176) or the go-control-plane one (envoyproxy/go-control-plane#46). @jpeach's suggestion seems reasonable, I'd like to see a design proposal for something similar (That is, a PR to |
@youngnick I'll open a PR for a design. Also, just curious why the Envoy JSON logging proposal is still in a draft stage? |
It's probably still in draft because we forgot to update it to final, oops. Thanks for pointing that out. |
Add support for custon Envoy JSON fields via use of `=` in the field name. See [design doc](design/envoy-json-logging-custom-fields-design.md) for more information. Fixes projectcontour#3032 Signed-off-by: Mikael Manukyan <mmanukyan@vmware.com>
Fixes projectcontour#3032, projectcontour#1507 Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com>
Add support for custon Envoy JSON fields via use of `=` in the field name. See [design doc](design/envoy-json-logging-custom-fields-design.md) for more information. Fixes projectcontour#3032 Signed-off-by: Mikael Manukyan <mmanukyan@vmware.com> Co-authored-by: Clay Kauzlaric KauzClay <ckauzlaric@vmware.com>
Fixes projectcontour#3032, projectcontour#1507 Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com> Co-authored-by: Mikael Manukyan <mmanukyan@vmware.com>
Add support for custon Envoy JSON fields via use of `=` in the field name. See [design doc](design/envoy-json-logging-custom-fields-design.md) for more information. Fixes projectcontour#3032 Signed-off-by: Mikael Manukyan <mmanukyan@vmware.com> Co-authored-by: Mikael Manukyan <mmanukyan@vmware.com>
Fixes projectcontour#3032, projectcontour#1507 Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com> Co-authored-by: Mikael Manukyan <mmanukyan@vmware.com>
Add support for custon Envoy JSON fields via use of `=` in the field name. See [design doc](design/envoy-json-logging-custom-fields-design.md) for more information. Fixes projectcontour#3032 Signed-off-by: Mikael Manukyan <mmanukyan@vmware.com> Co-authored-by: Mikael Manukyan <mmanukyan@vmware.com>
Fixes projectcontour#3032, projectcontour#1507 Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com> Co-authored-by: Clay Kauzlaric <ckauzlaric@vmware.com>
Add support for custon Envoy JSON fields via use of `=` in the field name. See [design doc](design/envoy-json-logging-custom-fields-design.md) for more information. Fixes projectcontour#3032 Signed-off-by: Mikael Manukyan <mmanukyan@vmware.com> Co-authored-by: Mikael Manukyan <mmanukyan@vmware.com> Co-authored-by: Alexander Standke <astandke@vmware.com>
Fixes projectcontour#3032, projectcontour#1507 Signed-off-by: Clay Kauzlaric <ckauzlaric@vmware.com> Co-authored-by: Clay Kauzlaric <ckauzlaric@vmware.com> Co-authored-by: Alexander Standke <astandke@vmware.com>
Add support for custon Envoy JSON fields via use of `=` in the field name. See [design doc](design/envoy-json-logging-custom-fields-design.md) for more information. Fixes projectcontour#3032, projectcontour#1507 Signed-off-by: Mikael Manukyan <mmanukyan@vmware.com> Co-authored-by: Mikael Manukyan <mmanukyan@vmware.com> Co-authored-by: Alexander Standke <astandke@vmware.com>
Add support for custon Envoy JSON fields via use of `=` in the field name. See [design doc](design/envoy-json-logging-custom-fields-design.md) for more information. Fixes projectcontour#3032, projectcontour#1507 Signed-off-by: Mikael Manukyan <mmanukyan@vmware.com> Co-authored-by: Clay Kauzlaric <ckauzlaric@vmware.com> Co-authored-by: Alexander Standke <astandke@vmware.com>
Add support for custon Envoy JSON fields via use of `=` in the field name. See [design doc](design/envoy-json-logging-custom-fields-design.md) for more information. Fixes projectcontour#3032, projectcontour#1507 Signed-off-by: Mikael Manukyan <mmanukyan@vmware.com> Co-authored-by: Clay Kauzlaric <ckauzlaric@vmware.com> Co-authored-by: Alexander Standke <astandke@vmware.com>
Add support for custon Envoy JSON fields via use of `=` in the field name. See [design doc](design/envoy-json-logging-custom-fields-design.md) for more information. Fixes projectcontour#3032, projectcontour#1507 Signed-off-by: Mikael Manukyan <mmanukyan@vmware.com> Co-authored-by: Clay Kauzlaric <ckauzlaric@vmware.com> Co-authored-by: Alexander Standke <astandke@vmware.com>
Add support for custon Envoy JSON fields via use of `=` in the field name. See [design doc](design/envoy-json-logging-custom-fields-design.md) for more information. Fixes #3032, #1507 Signed-off-by: Mikael Manukyan <mmanukyan@vmware.com> Co-authored-by: Clay Kauzlaric <ckauzlaric@vmware.com> Co-authored-by: Alexander Standke <astandke@vmware.com>
We want to be able to configure Contour to have custom JSON access log fields, such as
custom_field: %REQ(OUR-CUSTOM-HEADER)%
.We are thinking that this can be achieved by having a new property with the JSON fields mapping like for DefaultField in the Contour config. For example:
We @cloudfoundry/cf-for-k8s-networking are happy to contribute this feature to upstream.
The text was updated successfully, but these errors were encountered: