0

I'd like to log request and response json bodies for my kubernetes microservice. I use Istio service mesh. I know that Istio doesn't implement logging, but as far as I know I could use WASM and Envoy Filter for it.

Here is my attemp using Tap Envoy extension:

apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
  name: request-logging
  namespace: my-namespace
spec:
  configPatches:
  - applyTo: NETWORK_FILTER
    match:
      context: ANY
      listener:
        portNumber: 8080
        filterChain:
          filter:
            name: envoy.filters.http.tap
    patch:
      operation: INSERT_AFTER
      value:
        name: envoy.filters.http.tap
        typed_config:
          "@type": type.googleapis.com/envoy.extensions.filters.http.tap.v3.Tap
          common_config:
            static_config:
              match_config:
                any_match: true
              output_config:
                sinks:
                  - format: JSON_BODY_AS_BYTES
                    streaming_admin: {}

I expect to see json body logged in kubectl logs ..., but I don't it there.

Do you know how to create a filter that will log request & response json data?

Thank you in advance!

matined
  • 13
  • 1
  • 5

0 Answers0