Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cluster/configs/shared/scratchnet.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
!include(base.yaml)
infra:
istio:
enableIngressAccessLogging: true
prometheus:
retentionDuration: "30d"
retentionSize: "200GB"
Expand Down
1 change: 1 addition & 0 deletions cluster/expected/infra/expected.json
Original file line number Diff line number Diff line change
Expand Up @@ -2300,6 +2300,7 @@
"meshConfig": {
"accessLogEncoding": "JSON",
"accessLogFile": "",
"accessLogFormat": "{\"trace_id\":\"%TRACE_ID%\",\"authority\":\"%REQ(:AUTHORITY)%\",\"bytes_received\":\"%BYTES_RECEIVED%\",\"bytes_sent\":\"%BYTES_SENT%\",\"downstream_local_address\":\"%DOWNSTREAM_LOCAL_ADDRESS%\",\"downstream_remote_address\":\"%DOWNSTREAM_REMOTE_ADDRESS%\",\"duration\":\"%DURATION%\",\"method\":\"%REQ(:METHOD)%\",\"path\":\"%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%\",\"protocol\":\"%PROTOCOL%\",\"request_id\":\"%REQ(X-REQUEST-ID)%\",\"requested_server_name\":\"%REQUESTED_SERVER_NAME%\",\"response_code\":\"%RESPONSE_CODE%\",\"response_code_details\":\"%RESPONSE_CODE_DETAILS%\",\"response_flags\":\"%RESPONSE_FLAGS%\",\"start_time\":\"%START_TIME%\",\"upstream_cluster\":\"%UPSTREAM_CLUSTER%\",\"upstream_host\":\"%UPSTREAM_HOST%\",\"upstream_local_address\":\"%UPSTREAM_LOCAL_ADDRESS%\",\"upstream_service_time\":\"%RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)%\",\"user_agent\":\"%REQ(USER-AGENT)%\",\"x_forwarded_for\":\"%REQ(X-FORWARDED-FOR)%\"}",
"defaultConfig": {
"gatewayTopology": {
"numTrustedProxies": 1
Expand Down
25 changes: 25 additions & 0 deletions cluster/pulumi/infra/src/istio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,31 @@ function configureIstiod(
// taken from https://github.com/istio/istio/issues/37682
accessLogFile: infraConfig.istio.enableClusterAccessLogging ? '/dev/stdout' : '',
accessLogEncoding: 'JSON',
// taken from https://www.envoyproxy.io/docs/envoy/latest/configuration/advanced/substitution_formatter#config-advanced-substitution-operators
accessLogFormat: JSON.stringify({
trace_id: '%TRACE_ID%',
authority: '%REQ(:AUTHORITY)%',
bytes_received: '%BYTES_RECEIVED%',
bytes_sent: '%BYTES_SENT%',
downstream_local_address: '%DOWNSTREAM_LOCAL_ADDRESS%',
downstream_remote_address: '%DOWNSTREAM_REMOTE_ADDRESS%',
duration: '%DURATION%',
method: '%REQ(:METHOD)%',
path: '%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%',
protocol: '%PROTOCOL%',
request_id: '%REQ(X-REQUEST-ID)%',
requested_server_name: '%REQUESTED_SERVER_NAME%',
response_code: '%RESPONSE_CODE%',
response_code_details: '%RESPONSE_CODE_DETAILS%',
response_flags: '%RESPONSE_FLAGS%',
start_time: '%START_TIME%',
upstream_cluster: '%UPSTREAM_CLUSTER%',
upstream_host: '%UPSTREAM_HOST%',
upstream_local_address: '%UPSTREAM_LOCAL_ADDRESS%',
upstream_service_time: '%RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)%',
user_agent: '%REQ(USER-AGENT)%',
x_forwarded_for: '%REQ(X-FORWARDED-FOR)%',
}),
// https://istio.io/latest/docs/ops/integrations/prometheus/#option-1-metrics-merging disable as we don't use annotations
enablePrometheusMerge: false,
defaultConfig: {
Expand Down
Loading