fabric8io / fluent-plugin-kubernetes_metadata_filter

Enrich your fluentd events with Kubernetes metadata
Apache License 2.0
351 stars 166 forks source link

What is the best way to troubleshoot getting a lot of "parsing container meta information failed for" errors? #294

Closed alex-vmw closed 3 years ago

alex-vmw commented 3 years ago

Hi, What is the best way to troubleshoot a lot of "parsing container meta information failed for" errors (yes, they only show up in debug mode)? We get these errors for normal running k8s pods and we don't see anything wrong with the pods or their metadata, so trying to figure out where to go from here:

2021-06-09 19:58:19 +0000 [debug]: [filter_kube_metadata] parsing container meta information failed for: decc-tests/test-ara-cns-storage-pod-105693
2021-06-09 19:58:19 +0000 [debug]: [filter_kube_metadata] parsing container meta information failed for: decc-tests/test-ara-cns-storage-pod-105693
2021-06-09 19:58:19 +0000 [debug]: [filter_kube_metadata] parsing container meta information failed for: decc-tests/test-ara-cns-storage-pod-105693
alex-vmw commented 3 years ago

@jcantrill Any pointers on the above? Thanks.

jcantrill commented 3 years ago

comes from this code:

       begin
         pod_object[:status][:containerStatuses].each do |container_status|
           # get plain container id (eg. docker://hash -> hash)
           container_id = container_status[:containerID].sub(%r{^[-_a-zA-Z0-9]+://}, '')
           container_meta[container_id] = if @skip_container_metadata
                                            {
                                              'name' => container_status[:name]
                                            }
                                          else
                                            {
                                              'name' => container_status[:name],
                                              'image' => container_status[:image],
                                              'image_id' => container_status[:imageID]
                                            }
                                          end
         end
       rescue StandardError
         log.debug("parsing container meta information failed for: #{pod_object[:metadata][:namespace]}/#{pod_object[:metadata][:name]} ")
       end

and it looks like it would have been helpful to actually dump the error as it is not clear where the issue originates.

alex-vmw commented 3 years ago

@jcantrill Sorry to bug you, do you have any possible ETA for a fix?

jcantrill commented 3 years ago

Released with https://rubygems.org/gems/fluent-plugin-kubernetes_metadata_filter/versions/2.8.1