Skip to content

Commit 0ea1f2c

Browse files
authored
[EXPORTER] Fix crash in ElasticsearchLogRecordExporter when (open-telemetry#3082)
using constructor with user given options (open-telemetry#3078) Closes open-telemetry#3078
1 parent fa0a520 commit 0ea1f2c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

exporters/elasticsearch/src/es_log_record_exporter.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,12 @@ class AsyncResponseHandler : public http_client::EventHandler
288288
#endif
289289

290290
ElasticsearchLogRecordExporter::ElasticsearchLogRecordExporter()
291-
: options_{ElasticsearchExporterOptions()},
291+
: ElasticsearchLogRecordExporter(ElasticsearchExporterOptions())
292+
{}
293+
294+
ElasticsearchLogRecordExporter::ElasticsearchLogRecordExporter(
295+
const ElasticsearchExporterOptions &options)
296+
: options_{options},
292297
http_client_{ext::http::client::HttpClientFactory::Create()}
293298
#ifdef ENABLE_ASYNC_EXPORT
294299
,
@@ -301,11 +306,6 @@ ElasticsearchLogRecordExporter::ElasticsearchLogRecordExporter()
301306
#endif
302307
}
303308

304-
ElasticsearchLogRecordExporter::ElasticsearchLogRecordExporter(
305-
const ElasticsearchExporterOptions &options)
306-
: options_{options}, http_client_{ext::http::client::HttpClientFactory::Create()}
307-
{}
308-
309309
std::unique_ptr<sdklogs::Recordable> ElasticsearchLogRecordExporter::MakeRecordable() noexcept
310310
{
311311
return std::unique_ptr<sdklogs::Recordable>(new ElasticSearchRecordable());

0 commit comments

Comments
 (0)