Replies: 4 comments 5 replies
-
|
give a try with latest envoy, looks like [2023-12-21T09:07:13.121Z] 2 "GET /get HTTP/1.1" 200 - via_upstream "-" 0 600 1 1 "-" "curl/8.5.0" "371a0dc2-c607-967f-a7b2-010d0a46f551" "httpbin:8000" "10.244.0.23:8080" outbound|8000||httpbin.default.svc.cluster.local 10.244.0.24:47768 10.96.235.15:8000 10.244.0.24:47234 - default |
Beta Was this translation helpful? Give feedback.
-
|
Just for ref: here is my report to envoy repo envoyproxy/envoy#31483 (feel free to add anything) |
Beta Was this translation helpful? Give feedback.
-
|
@mprokopjc
So although it isn't pretty, |
Beta Was this translation helpful? Give feedback.
-
|
This is the EnvoyFilter we have provisioned to log gRPC errors based on above suggestions apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: access-logs-errors
namespace: istio-system
spec:
configPatches:
- applyTo: NETWORK_FILTER
match:
context: ANY
listener:
filterChain:
filter:
name: "envoy.filters.network.http_connection_manager"
patch:
operation: MERGE
value:
typed_config:
"@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager"
access_log:
- name: envoy.access_loggers.file
typed_config:
"@type": "type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog"
path: /dev/stdout
typed_json_format:
method: '%REQ(:METHOD)%'
path: '%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%'
# etc...
grpc_status: "%GRPC_STATUS%"
filter:
or_filter:
filters:
# Only log requests with response codes >= 400 or == 0.
- status_code_filter:
comparison:
op: GE
value:
default_value: "400"
runtime_key: "400"
- status_code_filter:
comparison:
op: EQ
value:
default_value: "0"
runtime_key: "0"
# gRPC error have an HTTP response of 200, but have a non-zero gRPC status
- extension_filter:
name: envoy.access_loggers.extension_filters.cel
typed_config:
"@type": type.googleapis.com/envoy.extensions.access_loggers.filters.cel.v3.ExpressionFilter
expression: >-
has(request.headers) && 'content-type' in request.headers && request.headers['content-type'].startsWith("application/grpc") && response.grpc_status > 0 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
π , I am trying to configure Istio (v1.19.3) access logging to log only non-OK HTTP & gRPC requests. I tried following configuration:
but it doesn't work as expected. It logs:
grpc_status- this is desiredAny suggestion?
Side note
Previously, I was using
expression: "response.code >= 400 || xds.cluster_name == 'BlackHoleCluster'"and it worked as intended. It was logging just 4xx and 5xx requests. However, it didn't log any gRPC requests. When I addedresponse.grpc_status > 0condition later, it started to log also non-OK gRPC requests (as expected) but filtering of "plain" HTTP requests broke.Beta Was this translation helpful? Give feedback.
All reactions