opentelemetry-helm-charts icon indicating copy to clipboard operation
opentelemetry-helm-charts copied to clipboard

enhance otel demo env schema

Open Frapschen opened this issue 2 years ago • 5 comments

In some scenarios, we want to set some value from k8s metadata to our OTEL_RESOURCE_ATTRIBUTES, like namespace, we need the configuration below:

- name: OTEL_K8S_NAMESPACE
  valueFrom:
    fieldRef:
      apiVersion: v1
      fieldPath: metadata.namespace
- name: OTEL_RESOURCE_ATTRIBUTES
  value: k8s.namespace.name=$(OTEL_K8S_NAMESPACE)

I propose to add the schema to catch the feature described above.

Frapschen avatar Aug 03 '22 02:08 Frapschen

@Frapschen Please bump the chart version.

TylerHelmuth avatar Aug 03 '22 03:08 TylerHelmuth

/cc @wph95 as code owner

TylerHelmuth avatar Aug 03 '22 03:08 TylerHelmuth

@Frapschen Can you open an issue that lays out in more details the issue being solved by this PR? It's possible the solution will end up being a new section in the values.yaml instead.

TylerHelmuth avatar Aug 03 '22 03:08 TylerHelmuth

Are you ready to review this pr? I see that only values.schema.json/chart.yaml has been modified

For the need to add specific envs, I think need to be discussed(might create a issue first). In the absence of a context, I can't tell if this addition is feasible.

But if it's a generic solution for custom environment variables. I think it is necessary (but low priority for me) For example in value.yaml

default:
   env:
    - name: OTEL_K8S_NAMESPACE
      valueFrom:
        fieldRef:
          apiVersion: v1
          fieldPath: metadata.namespace
    - name: OTEL_RESOURCE_ATTRIBUTES
      value: k8s.namespace.name=$(OTEL_K8S_NAMESPACE)


It would be great if you could help with the implementation of the custom default env section

wph95 avatar Aug 03 '22 04:08 wph95

@Frapschen I will be gone next week, but @dmitryax @Allex1 and @wph95 can help move this forward.

TylerHelmuth avatar Aug 05 '22 21:08 TylerHelmuth

@wph95 can you have time to review?

Frapschen avatar Aug 09 '22 01:08 Frapschen