Skip to content

Add processor to tag fluent-bit logs with metadata using k8sprocessor #1094

@sumo-drosiek

Description

@sumo-drosiek

Is your feature request related to a problem? Please describe.

Pod logs on the k8s node are named using four attributes:

  • pod_name
  • namespace
  • container_name
  • docker_id

The name of the log is passed as part of the fluent.tag by the fluentforwarderreceiver.

Unfortunately there is no pod ip which is used by the k8sprocessor to tag logs with metadata

In order to use fluentbit and k8sprocessor in kubernetes environment the fluentd tag should be converted to the ip somehow.

Describe the solution you'd like

My idea consists of two parts:

I want to split the fluent.tag on several attributes like pod_name, namespace etc, like fluentd kubernetes plugin does do it:

pod_name, container_id and container_name are retrieved locally from the log file names

I want put that functionality into separate processor named fluentbitk8sprocessor.

After attributes are extracted, the pair namespace, pod_name should be used either:

  • to retrieve metadata by k8s processor (require changes in k8sprocessor)
  • to retrieve pod ip from the k8s api, so k8s processor can be used in current shape (require using kubeclient so unnecessary complicates proposed processor)

I would love to provide PR with the solution, but want to clarify proper path of extracting metadata by the k8sprocessor (adding extraction by pod name and namespace or took the ip by the proposed processor) first

Describe alternatives you've considered

Moving extraction of fields to fluentdforwarder receiver but I'm not a fan of this solution

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions