ElasticSearch exporter does not give the possibility to add custom headers (auth headers for instance) #3080
Labels
bug
Something isn't working
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
Describe your environment
Using a manually built version of OpenTelemetry 1.16.1 on macOS with :
Steps to reproduce
The usage is pretty simple:
First an init of the exporter with a single log record processor:
opentelemetry::exporter::logs::ElasticsearchExporterOptions opts(
,
9200,
"logs",
30,
true);
auto elkExporter = std::make_uniqueopentelemetry::exporter::logs::ElasticsearchLogRecordExporter(opts);
auto elkProcessor = opentelemetry::sdk::logs::SimpleLogRecordProcessorFactory::Create(std::move(elkExporter));
std::shared_ptropentelemetry::logs::LoggerProvider provider = opentelemetry::sdk::logs::LoggerProviderFactory::Create(
std::move(elkProcessor), resource);
opentelemetry::logs::Provider::SetLoggerProvider(provider);
m_Logger = provider->GetLogger("MyLogger", SOURCE_NAME);
Then, when logs needs to be sent a call to m_Logger.EmitLogRecord(xxx)
What is the expected behavior?
Since the ELK endpoint requires a basic auth, the call is rejected with a 401 error as we cannot set any custom headers to the request.
What is the actual behavior?
Add possibility to add custom headers (probably more of a feature request than an actual bug).
The text was updated successfully, but these errors were encountered: