feat(instrumentation): inject k8s.cluster.name (+ cloud.platform on EKS) into instrumented pods#397
Draft
jj22ee wants to merge 1 commit into
Draft
feat(instrumentation): inject k8s.cluster.name (+ cloud.platform on EKS) into instrumented pods#397jj22ee wants to merge 1 commit into
jj22ee wants to merge 1 commit into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_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.