Skip to content
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

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

Merged
merged 1 commit into from
Dec 15, 2022

Conversation

mbana
Copy link
Contributor

@mbana mbana commented Dec 14, 2022

Issue and Discussion

See: #784.

Resolves #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:

  • smoketests/basic/envoyfleet.yaml.
  • smoketests/mocking/envoyfleet.yaml.
  • smoketests/mocking/envoyfleet.yaml.

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

Copy link
Contributor

@jasmingacic jasmingacic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking alright, my concern is how is this going to work with envoy logs in the dashboard or in the websocket we implemented?

@netlify
Copy link

netlify bot commented Dec 14, 2022

Deploy Preview for kusk-docs-preview canceled.

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

Issue and Discussion
====================

See: #784.

Resolves #784.

Example Output
==============

```json
{"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:

```yaml
  accesslog:
    format: json
```

Same applies to:

* `smoketests/basic/envoyfleet.yaml`.
* `smoketests/mocking/envoyfleet.yaml`.
* `smoketests/mocking/envoyfleet.yaml`.

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>
@mbana mbana force-pushed the mbana-change-access-loggers-stdout-to-json branch from 2b011d9 to da9eba3 Compare December 15, 2022 12:04
@mbana mbana requested a review from jasmingacic December 15, 2022 12:04
@mbana mbana changed the title Change Access logging to JSON Change Access logging to JSON and update kubeshop/kusk-gateway-dashboard to v1.2.6 Dec 15, 2022
@mbana mbana merged commit 37c8dc8 into main Dec 15, 2022
@mbana mbana deleted the mbana-change-access-loggers-stdout-to-json branch December 15, 2022 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make envoy's text template fixed - envoy.access_loggers.stdout
2 participants