Skip to content

Metric names disappear when metricRequest is split in metric_batch.go with sending_queue #13236

Open
@lsj4401

Description

@lsj4401

Component(s)

exporter/exporterhelper

What happened?

Describe the bug
When using sending_queue with the exporter, the logic in metric_batch.go that splits metricRequest based on batch size causes the name field of some metrics to disappear after the split, not all of them.

Steps to reproduce

  1. Configure an exporter to use sending_queue.
  2. Send a batch of metrics large enough to trigger the metricRequest splitting logic in metric_batch.go.
  3. Observe the metricRequest objects after they have been split.

What did you expect to see?
I expected the name field of all metrics within the split metricRequest objects to be preserved, consistent with the original metricRequest.

What did you see instead?
The name field of some metrics within the newly created metricRequest objects after the split was empty or null, effectively causing those specific metric names to disappear.

Collector version

v0.126.0

Environment information

Environment

OpenTelemetry Collector configuration

receivers:
  otlp:
    protocols:
      grpc:
        endpoint: localhost:4317
      http:
        endpoint: localhost:4318
exporters:
  clickhouse:
    endpoint: tcp://localhost:9000
    sending_queue:
      batch:
        flush_timeout: 2s
        max_size: 4
        min_size: 2
      enabled: true
      queue_size: 10000
      sizer: items

Log output

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions