Skip to content

Exporter set metadata but do not send metadata when using Persistent Queue #38666

Closed
@m-4ever

Description

@m-4ever

Component(s)

extension/storage/filestorage

What happened?

Description

I want to use otlpexporter to push data and set the metadata with 'ctls_otel_token', but it can not set the metadata when i use the Persistent Queue 'file_storage' on the exporter. I debug the exporter to check the trouble and find that the incoming ctx is emptyCtx, but i remove the sending_queue.storage: file_storage, it works.

Steps to Reproduce

the config of collector as follow:
receivers:
nop:
otlp/1:
protocols:
grpc:
endpoint: 0.0.0.0:4317
include_metadata: true
exporters:
otlp/ctls:
endpoint: server:4317
retry_on_failure:
enabled: true
initial_interval: 5s
max_interval: 30s
max_elapsed_time: 0
sending_queue:
storage: file_storage/otc
tls:
insecure: true
auth:
authenticator: headers_setter

extensions:
headers_setter:
headers:
- action: upsert
key: ctls_otel_token
from_context: "ctls_otel_token"
file_storage/otc:
directory: /tmp/otel/storage/otc
timeout: 10s
compaction:
on_start: true
directory: /tmp/otel/storage/otc/compaction
max_transaction_size: 65536

Expected Result

I hope to export data with metadata from the last component.

Actual Result

export data without metadata.

Collector version

v0.106.0

Environment information

Image Image

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

Log output

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