You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
get the node name from an existing variable such as MY_NODE_NAME and
disable the k8s.node.uid resource label and
disable the k8snode auth by setting auth_type to none
the k8snode still calls the K8s API to get the K8s node UID, resulting in a resource detection error
This is a bug in the K8s node detector where even if you disable the K8s node uid label it will still query the k8s API.
Steps to Reproduce
Expected Result
k8snode detector should be able to set the k8s.node.name value from a given environment variable without having to call the K8s API and it should not call the K8s APIs to get the k8s.node.uid when it has been explicitly disabled.
Actual Result
2024-03-25T18:42:26.207519786Z 2024-03-25T18:42:26.207Z warn internal/resourcedetection.go:130 failed to detect resource {"kind": "processor", "name": "resourcedetection", "pipeline": "metrics/splunk", "error": "failed getting k8s node UID: failed to fetch node with name sv2-rkeworkervm3-1a-lab from K8s API: Unauthorized"}
Adding a conditional logic around this line should address the issue.
…e attributes when enabled (#32039)
**Description:**
Detecting k8s node resource attributes requires specific permissions and
configuration. If they're disabled we shouldn't hit errors trying to
detect them. This change makes it so that these resource attributes are
only attempted to be detected when enabled.
**Link to tracking Issue:**
Resolves#31941
**Testing:**
Existing tests are passing. New test was failing before changes,
succeeds after.
Component(s)
processor/resourcedetection
What happened?
Description
When you configure the K8snode detector to
k8s.node.uid
resource label andauth_type
tonone
the k8snode still calls the K8s API to get the K8s node UID, resulting in a resource detection error
This is a bug in the K8s node detector where even if you disable the K8s node uid label it will still query the k8s API.
Steps to Reproduce
Expected Result
k8snode detector should be able to set the
k8s.node.name
value from a given environment variable without having to call the K8s API and it should not call the K8s APIs to get thek8s.node.uid
when it has been explicitly disabled.Actual Result
Adding a conditional logic around this line should address the issue.
Collector version
0.96.0
Environment information
Environment
OS: Linux
Env: K8s
OpenTelemetry Collector configuration
Log output
Additional context
Code where detection happens without attributes enablement check. https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/resourcedetectionprocessor/internal/k8snode/k8snode.go#L51
The text was updated successfully, but these errors were encountered: