【问题标题】:Add custom tag to span in Jaeger when using in Istio service mesh在 Istio 服务网格中使用时将自定义标签添加到 Jaeger 中
【发布时间】:2021-11-14 22:11:28
【问题描述】:

我想在 Jaeger span 中添加自定义标签,我尝试使用以下命令在我的 Kubernetes 集群上安装 Istio:

istioctl install --set profile=demo --set meshConfig.accessLogFile=/dev/stdout --set meshConfig.outboundTrafficPolicy.mode=REGISTRY_ONLY -f .\tracing.yaml -y

这是tracing.yaml:

apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
spec:
  meshConfig:
    enableTracing: true
    defaultConfig:
      tracing:
        sampling: 100.0
        custom_tags:
          my_tag_header:
            header:
              name: test
              defaultValue: test

但是 spans 中没有 test 标签: 我该怎么办?

【问题讨论】:

  • 您使用的是哪个版本的 Istio?
  • istioctl version client version: 1.11.2 control plane version: 1.11.2 data plane version: 1.11.2 (2 proxies)

标签: kubernetes istio jaeger


【解决方案1】:

当使用 Istio 操作符时,你必须先初始化它

istioctl operator init

默认情况下,Istio 操作员仅安装和监视 istio-operator 命名空间。如果您想指定另一个名称空间供其监视(例如 default),请添加 --watchedNamespaces 参数

istioctl operator init --watchedNamespaces=default

安装操作员后,您现在可以通过部署 IstioOperator 资源来创建网格。要使用 operator 安装 Istio 演示配置文件,请运行以下命令:

kubectl apply -f - <<EOF
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
  namespace: istio-system
  name: example-istiocontrolplane
spec:
  profile: demo
EOF

现在,在控制器运行的情况下,您可以通过编辑或替换 IstioOperator 资源来更改 Istio 配置。控制器将检测到更改并通过相应地更新 Istio 安装来响应。

【讨论】:

  • @p10l 感谢您的解决方案,它对我有用。
  • @WytrzymałyWiktor 我没有通过--watchedNamespaces 参数,当我添加它时,它起作用了。
猜你喜欢
  • 2022-01-03
  • 1970-01-01
  • 2021-03-27
  • 2022-11-04
  • 1970-01-01
  • 2023-03-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多