-
Notifications
You must be signed in to change notification settings - Fork 369
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
Default to Key, Value based Access Logging to STDOUT #1446
Comments
thoughts @envoyproxy/gateway-maintainers ? |
In our gateway, we use the format type to directly output the json type to replace the json_format type, because when we actually use the json_format type, the performance is very poor. Here is an example of using
|
haha @tmsnan, nice workaround :) , can you share any relevant upstream link that highlights the poor performance |
@arkodg ,field data was not saved at the time. But this scene is easy to compare. If necessary, I will try to compare it locally. The reason is that the json format output needs to be serialized, while the text only needs to be simply spliced according to the format |
I would prefer keeping the default to text due to the serialization cost @tmsnan mentioned. I don't think I've ever seen json format set as the default for logs in other places and probably for good reason. logs can be voluminous so the serialization can add a lot of extra CPU cycles/memory util and I'm not sure that's a cost I want to enable by default to users. |
related upstream issue envoyproxy/envoy#10415 |
chatted with @cpakulski who confirmed the extra cost for serialization when using json format, so I'm a
|
I will be -1 to use it as default. |
im personally tired of staring at
and figuring out which field maps to which attribute. |
That's why EG offer the ability to customize |
I think changing to json string type by default is more friendly to novices. |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. |
had a chat with @zirain who is not completely opposed to this :), but worries about perf . Hoping we can get @tmsnan's suggestion in #1446 (comment) |
assigning this to myself |
Before ``` [2023-08-18T22:15:14.085Z] "GET /get HTTP/1.1" 200 - 0 509 1 0 "10.1.3.156" "curl/7.86.0" "ec7ca022-80c8-4e7c-8271-167b260bd190" "www.example.com" "10.102.226.25:3000" ``` After ``` "start_time":"2023-08-18T22:01:23.901Z","method":"GET","x-envoy-origin-path":"/get","protocol":"HTTP/1.1","response_code":"200","response_flags":"-","response_code_details":"via_upstream","connection_termination_details":"-","upstream_transport_failure_reason":"-","bytes_received":"0","bytes_sent":"511","duration":"0","x-envoy-upstream-service-time":"0","x-forwarded-for":"192.168.65.4","user-agent":"curl/7.86.0","x-request-id":"000985ce-a62d-4899-95f8-c60fa9e5f246",":authority":"www.example.com","upstream_host":"10.104.223.83:3000","upstream_cluster":"default/backend/rule/0/match/0-www.example.com","upstream_local_address":"10.1.3.145:55664","downstream_local_address":"10.1.3.145:10080","downstream_remote_address":"192.168.65.4:50042","requested_server_name":"-","route_name":"default/backend/rule/0/match/0-www.example.com" ``` Fixes: envoyproxy#1446 Signed-off-by: Arko Dasgupta <[email protected]>
Before ``` [2023-08-18T22:15:14.085Z] "GET /get HTTP/1.1" 200 - 0 509 1 0 "10.1.3.156" "curl/7.86.0" "ec7ca022-80c8-4e7c-8271-167b260bd190" "www.example.com" "10.102.226.25:3000" ``` After ``` "start_time":"2023-08-18T22:01:23.901Z","method":"GET","x-envoy-origin-path":"/get","protocol":"HTTP/1.1","response_code":"200","response_flags":"-","response_code_details":"via_upstream","connection_termination_details":"-","upstream_transport_failure_reason":"-","bytes_received":"0","bytes_sent":"511","duration":"0","x-envoy-upstream-service-time":"0","x-forwarded-for":"192.168.65.4","user-agent":"curl/7.86.0","x-request-id":"000985ce-a62d-4899-95f8-c60fa9e5f246",":authority":"www.example.com","upstream_host":"10.104.223.83:3000","upstream_cluster":"default/backend/rule/0/match/0-www.example.com","upstream_local_address":"10.1.3.145:55664","downstream_local_address":"10.1.3.145:10080","downstream_remote_address":"192.168.65.4:50042","requested_server_name":"-","route_name":"default/backend/rule/0/match/0-www.example.com" ``` Fixes: envoyproxy#1446 Signed-off-by: Arko Dasgupta <[email protected]>
* Add a key to the access default log text format Before ``` [2023-08-18T22:15:14.085Z] "GET /get HTTP/1.1" 200 - 0 509 1 0 "10.1.3.156" "curl/7.86.0" "ec7ca022-80c8-4e7c-8271-167b260bd190" "www.example.com" "10.102.226.25:3000" ``` After ``` {"start_time":"2023-08-30T19:39:16.694Z","method":"GET","x-envoy-origin-path":"/get","protocol":"HTTP/1.1","response_code":"200","response_flags":"-","response_code_details":"via_upstream","connection_termination_details":"-","upstream_transport_failure_reason":"-","bytes_received":"0","bytes_sent":"508","duration":"1","x-envoy-upstream-service-time":"0","x-forwarded-for":"10.1.4.12","user-agent":"curl/7.86.0","x-request-id":"df9cc5ed-8f92-4376-b045-34669dde0ea1",":authority":"www.example.com","upstream_host":"10.110.21.140:3000","upstream_cluster":"httproute/default/backend/rule/0","upstream_local_address":"10.1.4.12:36496","downstream_local_address":"127.0.0.1:10080","downstream_remote_address":"127.0.0.1:53826","requested_server_name":"-","route_name":"httproute/default/backend/rule/0/match/0/www_example_com"} ``` Fixes: #1446 Signed-off-by: Arko Dasgupta <[email protected]> * use space instead of , Signed-off-by: Arko Dasgupta <[email protected]> * use json format Signed-off-by: Arko Dasgupta <[email protected]> * fix json Signed-off-by: Arko Dasgupta <[email protected]> --------- Signed-off-by: Arko Dasgupta <[email protected]> Co-authored-by: zirain <[email protected]>
Description:
Default to the JSON format for Access Logs written to STDOUT
https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log/usage#format-dictionaries
this reduces the burden on the end user to parse the text based access logs enabled by default today which dont have the field name printed beside it
https://www.envoyproxy.io/docs/envoy/latest/configuration/observability/access_log/usage#default-format-string
which was enabled with #704
The text was updated successfully, but these errors were encountered: