forked from civitatis/kubernetes-event-exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Description
The application is logging numerous errors with the message Failed to get object metadata error="name is required". This occurs when Kubernetes events have an InvolvedObject reference with an empty Name field.
Impact
- Error logs are flooding the application output
send_errorsmetric is incorrectly incremented even though events are successfully sent- Makes it difficult to identify actual problems in the logs
Root Cause
In pkg/kube/objects.go, the GetObjectMetadata function attempts to fetch object metadata from the Kubernetes API without validating that reference.Name is non-empty. The API call at line 86 requires a name parameter, causing it to fail with "name is required" when the reference has an empty name.
Solution
Add validation to check if reference.Name is empty before attempting the API call. If empty, return an empty ObjectMetadata{} without error, allowing the event to be processed normally without metadata enrichment.
Example Errors
2025-11-07T11:17:58Z ERR Failed to get object metadata error="name is required"
2025-11-07T11:17:22Z ERR Failed to get object metadata error="name is required"
Metadata
Metadata
Assignees
Labels
No labels