-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
Description
Component(s)
exporter/elasticsearch
What happened?
Description
If the Elasticsearch exporter is configured with a persistent queue (sending_queue.storage: filestorage
) and new data is written to this persistent queue while the Elasticsearch cluster is temporarily unavailable, this data should be indexed into Elasticsearch once the cluster becomes available again.
Steps to Reproduce
- Configure the collector like so:
receivers: filelog: include: /tmp/*.log storage: file_storage/filelogreceiver exporters: elasticsearch: endpoints: [ "http://localhost:9200" ] index: foo flush: interval: 1s sending_queue: enabled: true storage: file_storage/elasticsearchexporter extensions: file_storage/filelogreceiver: directory: /tmp/otelcol/file_storage/filelogreceiver file_storage/elasticsearchexporter: directory: /tmp/otelcol/file_storage/elasticsearchexporter service: extensions: [file_storage/filelogreceiver, file_storage/elasticsearchexporter] pipelines: logs: receivers: [filelog] exporters: [elasticsearch] telemetry: logs: level: debug
- Start the collector.
- Add a log entry to the file.
echo "1 foo bar $RANDOM" >> /tmp/test.log
- Query the Elasticsearch cluster to verify that the log entry made it into the index.
- Stop the Elasticsearch cluster.
- Add a new log entry to the file.
echo "2 foo bar $RANDOM" >> /tmp/test.log
- Restart the Elasticsearch cluster.
- Query the Elasticsearch cluster to verify that the second log entry made it into the index.
Expected Result
- In step 8, there should be two log entries in the index.
Actual Result
- In step 8, only the first log entry (added in step 3) is in the index.
Collector version
v0.93.0
Environment information
Environment
OS: (e.g., "Ubuntu 20.04") MacOS
Compiler(if manually compiled): (e.g., "go 14.2") go 1.21.6
OpenTelemetry Collector configuration
receivers:
filelog:
include: /tmp/*.log
storage: file_storage/filelogreceiver
exporters:
elasticsearch:
endpoints: [ "http://localhost:9200" ]
index: foo
flush:
interval: 1s
sending_queue:
enabled: true
storage: file_storage/elasticsearchexporter
extensions:
file_storage/filelogreceiver:
directory: /tmp/otelcol/file_storage/filelogreceiver
file_storage/elasticsearchexporter:
directory: /tmp/otelcol/file_storage/elasticsearchexporter
service:
extensions: [file_storage/filelogreceiver, file_storage/elasticsearchexporter]
pipelines:
logs:
receivers: [filelog]
exporters: [elasticsearch]
telemetry:
logs:
level: debug
Log output
No response
Additional context
No response