Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[processor/resourcedetection]: Add support for k8s.cluster.name for local clusters #35116

Open
MichaelKatsoulis opened this issue Sep 10, 2024 · 8 comments
Assignees
Labels
enhancement New feature or request never stale Issues marked with this label will be never staled and automatically removed processor/resourcedetection Resource detection processor

Comments

@MichaelKatsoulis
Copy link

Component(s)

processor/k8sattributes

Is your feature request related to a problem? Please describe.

When running Otel collector and resourcedetection processor in a local Kubernetes cluster created by kind, minikube or kube-adm there is no way currently to get the Kubernetes cluster name. These clusters are used very often for development, testing but also in production.

Describe the solution you'd like

Clusters created by kind, minikube and kube-adm produce a configmap in kube-system namespace called kubeadm-config. This looks like this and contains the cluster name.

apiVersion: v1
data:
  ClusterConfiguration: |
    apiServer:
      certSANs:
      - localhost
      - 127.0.0.1
      extraArgs:
        authorization-mode: Node,RBAC
        runtime-config: ""
      timeoutForControlPlane: 4m0s
    apiVersion: kubeadm.k8s.io/v1beta3
    certificatesDir: /etc/kubernetes/pki
    clusterName: kind
    controlPlaneEndpoint: kind-control-plane:6443

Describe alternatives you've considered

No response

Additional context

No response

@MichaelKatsoulis MichaelKatsoulis added enhancement New feature or request needs triage New item requiring triage labels Sep 10, 2024
@github-actions github-actions bot added processor/resourcedetection Resource detection processor processor/k8sattributes k8s Attributes processor labels Sep 10, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@dashpole
Copy link
Contributor

This seems reasonable. I would consider this a new "kubeadm" resource detector. Are there any other resource attribute it could detect?

@dashpole dashpole removed processor/k8sattributes k8s Attributes processor needs triage New item requiring triage labels Sep 10, 2024
@odubajDT
Copy link
Contributor

Hello, I would like to take this issue if possible

@ChrsMark
Copy link
Member

Thank's @odubajDT, I have assigned this to you.

@ChrsMark
Copy link
Member

This seems reasonable. I would consider this a new "kubeadm" resource detector. Are there any other resource attribute it could detect?

There is also the k8s.cluster.uid resource attribute which is defined in the current K8s semantic conventions: https://github.com/open-telemetry/semantic-conventions/blob/b780f480e73ffc2d1da117689475b7b9c8af610b/docs/attributes-registry/k8s.md?plain=1#L19

Maybe that would also make sense to be included in this detector?

@dashpole
Copy link
Contributor

Maybe that would also make sense to be included in this detector?

I would omit that here, and recommend users use the k8sattributes processor, which detects that by default: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/k8sattributesprocessor/README.md#configuration

Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Nov 26, 2024
@odubajDT
Copy link
Contributor

Still valid

@ChrsMark ChrsMark added never stale Issues marked with this label will be never staled and automatically removed and removed Stale labels Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request never stale Issues marked with this label will be never staled and automatically removed processor/resourcedetection Resource detection processor
Projects
None yet
Development

No branches or pull requests

4 participants