英文:
Disable Observability and telemetry in istio 1.14
问题
我们已从 Istio 1.10 升级到 1.14,并观察到在向上游发送 HTTP 请求时,istio 入口网关会添加诸如 x-envoy-peer-metadata、x-b3-traceid 等标头。是否在版本 1.10+ 中有某些更改导致这些标头默认添加?
是否有可能禁用可观测性/遥测,以确保这些标头不会被添加到发送给上游服务的请求中?我们仅将 Istio 用于流量管理,而不用于可观测性,因此这些标头会不必要地增加负担。
我尝试使用 Envoy 过滤器来移除这些标头;以下是示例代码:
patch:
operation: INSERT_BEFORE
value:
name: envoy.lua
typed_config:
'@type': type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua
inlineCode: |
function envoy_on_request(request_handle)
request_handle:headers():remove("x-envoy-peer-metadata");
这似乎有效,但我原本认为应该有一种方法可以在第一次添加这些标头之前停止它们,从而避免所有这些开销。
英文:
We have upgraded from istio 1.10 to 1.14 and observe that headers like x-envoy-peer-metadata, x-b3-traceid are being added by the istio ingress gateway when send http requests to the upstreams. Has there been some change in versions 1.10+ that is causing these headers to be added by default ?
Is it possible to disable observability/telemetry to ensure these headers are not added to the requests sent out to the upstream services ? We are using istio only for traffic management and not for observability so these headers are unnecessarily adding overhead.
I tried using an Envoy filter to remove these headers; something on the lines of:
patch:
operation: INSERT_BEFORE
value:
name: envoy.lua
typed_config:
'@type': type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua
inlineCode: |
function envoy_on_request(request_handle)
request_handle:headers():remove("x-envoy-peer-metadata");
And this seems to work but I would have thought that there is a way to stop these headers from being added in the first place and hence avoid all this overhead.
答案1
得分: 1
有一个当前在 Istio 上已打开的 PR(https://github.com/istio/api/pull/2240),该 PR 将使您能够控制这些标头。
所以,要回答您的问题,您无法全局打开/关闭此功能;您可以使用 Envoyfilter 或在 VirtualService 中删除标头。
英文:
There's a PR opened on Istio currently that would enable controlling these headers.
So to answer your question, you can't turn this on/off globally; you can either use the Envoyfilter or remove the headers in VirtualService.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论