0

Evaluating Istio Sidecar proxies around the feature of distributed tracing, currently i am passing the tracing headers and accepting those as a part of the application code, Below are the headers:

  "x-request-id"

  "x-b3-spanid"

  "x-b3-parentspanid"

  "x-b3-sampled"

  "x-b3-flags"

  "x-ot-span-context"

Is there a way where in these headers could be configured to be passed with requests at POD/ingress level so that i do not have to make any changes in the code in order to achieve the tracing between the services?

vaibhav
  • 3,929
  • 8
  • 45
  • 81

1 Answers1

1

You can use a Virtual Service to add headers to any requests that gets routed by it:

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: sample-route
spec:
  hosts:
  - '*'
  http:
  - route:
    - destination:
        host: app.prod.svc.cluster.local
      headers:
        request:
          add:
            key1: value1
            key2: value2

From there, you can attach the Virtual Service to a Gateway for your Ingressgateway.

yyyyahir
  • 2,262
  • 1
  • 5
  • 14