Skip to content

feat(instrumentation): inject k8s.cluster.name (+ cloud.platform on EKS) into instrumented pods#397

Draft
jj22ee wants to merge 1 commit into
aws:mainfrom
jj22ee:sdk-deployment-env-pr
Draft

feat(instrumentation): inject k8s.cluster.name (+ cloud.platform on EKS) into instrumented pods#397
jj22ee wants to merge 1 commit into
aws:mainfrom
jj22ee:sdk-deployment-env-pr

Conversation

@jj22ee

@jj22ee jj22ee commented Jul 8, 2026

Copy link
Copy Markdown
Member

The ADOT SDKs resolve aws.local.environment (eks:/) for ServiceEvents / Dynamic Instrumentation, but the in-pod EKS detector is blocked by RBAC (HTTP 403), so the SDK can't discover the cluster name on its own. The operator already has the cluster name (from the agent config's hosted_in) and the K8S_MODE, so it injects them into every instrumented pod's default Instrumentation resource attributes:

  • k8s.cluster.name from the agent config's application_signals.hosted_in.
  • cloud.platform=aws_eks only when K8S_MODE==EKS, so the SDK yields the "eks:" prefix (vs the generic "k8s:" for ROSA / native K8s) — mirroring the agent's KubernetesMode-driven prefix.

K8S_MODE is read from the operator env (set by the Helm chart from .Values.k8sMode). Returns nil when no cluster name is available, leaving resolution unchanged.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…KS) into instrumented pods

The ADOT SDKs resolve aws.local.environment (eks:<cluster>/<namespace>) for
ServiceEvents / Dynamic Instrumentation, but the in-pod EKS detector is blocked by
RBAC (HTTP 403), so the SDK can't discover the cluster name on its own. The operator
already has the cluster name (from the agent config's hosted_in) and the K8S_MODE, so
it injects them into every instrumented pod's default Instrumentation resource
attributes:

- k8s.cluster.name from the agent config's application_signals.hosted_in.
- cloud.platform=aws_eks only when K8S_MODE==EKS, so the SDK yields the "eks:" prefix
  (vs the generic "k8s:" for ROSA / native K8s) — mirroring the agent's
  KubernetesMode-driven prefix.

K8S_MODE is read from the operator env (set by the Helm chart from .Values.k8sMode).
Returns nil when no cluster name is available, leaving resolution unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant