Skip to content

annotationDiscovery requires K8S_NODE_NAME env. #2067

@tavrez

Description

@tavrez

When any of presets.annotationDiscovery.(logs|metrics) are enabled, this configuration is generated:

extensions:
  k8s_observer:
    auth_type: serviceAccount
    node: ${env:K8S_NODE_NAME}

However K8S_NODE_NAME is not added by default to pod, it is only added if kubeletMetrics is enabled or kubernetesAttributes is enabled on agent mode:

{{- if or .Values.presets.kubeletMetrics.enabled (and .Values.presets.kubernetesAttributes.enabled (eq .Values.mode "daemonset")) }}
      - name: K8S_NODE_NAME
        valueFrom:
          fieldRef:
            fieldPath: spec.nodeName
      - name: K8S_NODE_IP
        valueFrom:
          fieldRef:
            fieldPath: status.hostIP
      {{- end }}

I should also suggest that it would be good if node: ${env:K8S_NODE_NAME} is not getting added if installation is other than daemonset(metrics discovery could be used with non-agent mode)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingchart:collectorIssue related to opentelemetry-collector helm chartgood first issueGood for newcomershelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions