Kubernetes错误:尝试使用Dapr设置Open Telemetry时出现未知字段”otel”错误。

huangapple go评论60阅读模式
英文:

Kubernetes error: unknown field "otel" error when trying to setup Open Telemetry with Dapr

问题

I'm following the Dapr documentation to have Dapr sending data to an Open Telemetry collector pod in Kubernetes. The first step is to configure Dapr to send distributed tracing data.

Tracing Docs

So I'm trying to add the following yaml file to Kubernetes:

apiVersion: dapr.io/v1alpha1
kind: Configuration
metadata:
  name: tracing
spec:
  tracing:
    samplingRate: "1"
    otel:
      endpointAddress: "localhost:4317"
      isSecure: false
      protocol: grpc

Using the command: kubectl apply -f .\tracing-config.yaml

Problem is that I'm getting the following error:

error: error validating ".\zeta\components\tracing-config.yaml": error validating data: ValidationError(Configuration.spec.tracing): unknown field "otel" in io.dapr.v1alpha1.Configuration.spec.tracing; if you choose to ignore these errors, turn validation off with --validate=false

Even if I try to use kubectl apply -f .\tracing-config.yaml --validate=false, what happens is that the field "otel" and its subfields are ignored when applied.

Since that yaml exists in Dapr's official documentation, I imagine this should be doable. Is there a way to add a field even if it is not recognized? Or some other workaround for this?

英文:

I'm following the Dapr documentation to have Dapr sending data to an Open Telemetry collector pod in kubernetes.
The first step is to configure Dapr to send distributed tracing data.
Tracing Docs

So I'm trying to add the following yaml file to kubernetes:

apiVersion: dapr.io/v1alpha1
kind: Configuration
metadata:
  name: tracing
spec:
  tracing:
    samplingRate: "1"
    otel:
      endpointAddress: "localhost:4317"
      isSecure: false
      protocol: grpc 

Using the command: kubectl apply -f .\tracing-config.yaml

Problem is that I'm getting the following error:
> error: error validating ".\zeta\components\tracing-config.yaml": error validating data: ValidationError(Configuration.spec.tracing): unknown field "otel" in io.dapr.v1alpha1.Configuration.spec.tracing; if you choose to ignore these errors, turn validation off with --validate=false

Even if I try to use kubectl apply -f .\tracing-config.yaml --validate=false, what happens is that the field "otel" and it's subfields are ignored when applied.

Since that yaml exists in Dapr's official documentation, I imagine this should be doable. Is there a way to add a field even if it is not recognized? Or some other workaround for this?

答案1

得分: 1

如Juliano Costa所提到的,事实上,我已经更新了dapr sidecars,但没有更新dapr本身,而我使用的版本不支持"otel"字段。将其更新到版本1.10解决了这个问题。

英文:

As Juliano Costa mentioned, in fact, I had the dapr sidecars updated, but not dapr it self and the version I was using did not support the "otel" field. Updating it to the version 1.10 fixed it.

huangapple
  • 本文由 发表于 2023年3月20日 23:26:55
  • 转载请务必保留本文链接:https://go.coder-hub.com/75792194.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定