ElasticSearch http client URL is wrongly formated #3079
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?
Host targeted by the exporter should have the
<host>:<port>
format/What is the actual behavior?
The exporter was reporting this error
opentelemetry: [ES Log Exporter] Connection to elasticsearch failed
.When adding the
reason
to the string it was outputing this: Could not resolve host:elastic.mydomain.com9200
(missing:
)The text was updated successfully, but these errors were encountered: