Skip to content

[exporter/kafkaexporter] Enable Partitioning by Specific Attribute for Logs & Metrics  #38484

@danielkatz

Description

@danielkatz

Component(s)

exporter/kafka

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

Currently, the Kafka exporter supports partitioning traces by trace id, which is very useful for context-aware data processing. However, for logs and metrics, we only have options like partition_metrics_by_resource_attributes and partition_logs_by_resource_attributes. These work well for load-balancing Kafka partitions but fall short when we need to partition data based on a single, specific attribute of a log/metric (such as trace_id or tenant_id). This limitation complicates tasks like merging related logs or metrics for enhanced processing.

Describe the solution you'd like

I propose introducing configuration options that allow specifying one attribute for partitioning logs and metrics. For instance, options like:

partition_logs_by_attribute: <name_of_the_attribute>
partition_metrics_by_attribute: <name_of_the_attribute>

This would extend the functionality provided for traces to logs and metrics, enabling context-aware data routing (e.g., merging by a specific attribute like trace_id, tenant_id, etc.) and improving the overall flexibility of the Kafka exporter.

Describe alternatives you've considered

There is non i could see, bar from exporting to kafka as-is, and then consuming and reemitting them into kafka with the proper partitioning by a custom service.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions