kubeshop / kusk-gateway

Kusk-gateway is an OpenAPI-driven API Gateway for Kubernetes
https://kubeshop.github.io/kusk-gateway/
MIT License
268 stars 20 forks source link

Change Access logging to JSON and update `kubeshop/kusk-gateway-dashboard` to `v1.2.6` #1033

Closed mbana closed 1 year ago

mbana commented 1 year ago

Issue and Discussion

See: https://github.com/kubeshop/kusk-gateway/issues/784.

Resolves kubeshop/kusk-gateway#784.

Example Output

{"response_code":200,"bytes_received":0,"bytes_sent":47,"upstream_local_address":"172.17.0.5:50434","response_flags":"-","start_time":"2022-12-14T14:51:21.281Z","protocol":"HTTP/1.1","upstream_transport_failure_reason":null,"upstream_host":"10.96.207.174:80","requested_server_name":null,"duration":0,"downstream_local_address":"172.17.0.5:8080","downstream_remote_address":"172.17.0.1:62724","response_code_details":"via_upstream","x_forwarded_for":null,"method":"GET","upstream_cluster":"traffic-splitting-httpbin-1.default.svc.cluster.local.-80","authority":"traffic-splitting-httpbin-1.default.svc.cluster.local.","route_name":"/uuid-GET","path":"/uuid","connection_termination_details":null,"request_id":"1c15c266-7e62-4dee-b5fa-cec1c83237f4","user_agent":"curl/7.85.0","upstream_service_time":"0"}

Changes

config/samples/gateway_v1_envoyfleet.yaml

Default to json format for envoy.access_loggers.stdout.

internal/envoy/config/logging.go

Slight refactoring.

cmd/kusk/manifests/dashboard.yaml

Update image to kubeshop/kusk-gateway-dashboard:v1.2.6.

cmd/kusk/manifests/fleets.yaml, cmd/kusk/manifests/devportal.yaml and cmd/kusk/manifests/dashboard_envoyfleet.yaml

Change

apiVersion: gateway.kusk.io/v1alpha1
kind: EnvoyFleet

to use JSON as the logging format by using:

  accesslog:
    format: json

Same applies to:

References

  1. https://www.envoyproxy.io/docs/envoy/v1.23.1/configuration/observability/access_log/usage#config-access-log.
  2. https://istio.io/latest/docs/tasks/observability/logs/access-log/#default-access-log-format.

Signed-off-by: Mohamed Bana mohamed@bana.io

netlify[bot] commented 1 year ago

Deploy Preview for kusk-docs-preview canceled.

Name Link
Latest commit da9eba3bcc035c51965bdb5abcc4a34ba53881ae
Latest deploy log https://app.netlify.com/sites/kusk-docs-preview/deploys/639b0d51171e77000b4a314c