istio / old_issues_repo

Deprecated issue-tracking repo, please post new issues or feature requests to istio/istio instead.
37 stars 9 forks source link

Filter health probing checks from Tracing #335

Open day0ops opened 6 years ago

day0ops commented 6 years ago

Is there anyway to filter out K8 health check probes from Tracing ?

I have been looking at few old posts about this question but none of give any solution. Everything is pointing to adding this as a feature to Envoy.

dgurindapalli commented 6 years ago

We are also looking for same feature from istio proxy

https://stackoverflow.com/questions/50594137/how-can-i-control-which-data-gets-reported-to-the-istio-mixer-by-the-side-car

objectiser commented 6 years ago

It is possible in envoy to configure the health check endpoint, and then it will be ignored by tracing. For example, I updated the jaeger tracing example front-envoy-jaeger.yaml to include the health check filter:

          http_filters:
          - name: envoy.health_check
            config:
              endpoint: "/health"
              pass_through_mode: false
          - name: envoy.router
            config: {}

I then called the app using curl -v http://localhost:8000/trace/1 and saw a trace as expected in the Jaeger UI. Then I issued a request on the health endpoint:

$ curl -v http://localhost:8000/health
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 8000 (#0)
> GET /health HTTP/1.1
> Host: localhost:8000
> User-Agent: curl/7.59.0
> Accept: */*
> 
< HTTP/1.1 200 OK
< x-envoy-upstream-healthchecked-cluster: front-proxy
< date: Wed, 30 May 2018 09:43:40 GMT
< server: envoy
< content-length: 0
< 
* Connection #0 to host localhost left intact

which did not result in a trace instance.

The issue is I currently don't know how this v2 config can be passed from Istio to the Envoy proxy. Hopefully someone with knowledge of the v2 api can answer that.

objectiser commented 6 years ago

@nixgadget Just wondered, have you tried adding the http header X-B3-Sampled: 0 to the liveness probe?

day0ops commented 6 years ago

Honestly didnt know about that header. Il look into it and report back

objectiser commented 6 years ago

Have tested it, and it works, e.g.

        livenessProbe:
          httpGet:
            path: "/health"
            port: 8080
            httpHeaders:
            - name: X-B3-Sampled
              value: "0"
          initialDelaySeconds: 60
          periodSeconds: 10