Skip to content

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

@lsj4401

Description

@lsj4401
Contributor

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

Activity

github-actions

github-actions commented on Jun 19, 2025

@github-actions
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

added a commit that references this issue on Jul 3, 2025
26a1aed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @lsj4401

      Issue actions

        Metric names disappear when metricRequest is split in metric_batch.go with sending_queue · Issue #13236 · open-telemetry/opentelemetry-collector