Skip to content

Commit

Permalink
[EXPORTER] Fix crash in ElasticsearchLogRecordExporter when (#3082)
Browse files Browse the repository at this point in the history
using constructor with user given options (#3078)

 Closes #3078
  • Loading branch information
ShadowMaxLeb authored Oct 8, 2024
1 parent fa0a520 commit 0ea1f2c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions exporters/elasticsearch/src/es_log_record_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,12 @@ class AsyncResponseHandler : public http_client::EventHandler
#endif

ElasticsearchLogRecordExporter::ElasticsearchLogRecordExporter()
: options_{ElasticsearchExporterOptions()},
: ElasticsearchLogRecordExporter(ElasticsearchExporterOptions())
{}

ElasticsearchLogRecordExporter::ElasticsearchLogRecordExporter(
const ElasticsearchExporterOptions &options)
: options_{options},
http_client_{ext::http::client::HttpClientFactory::Create()}
#ifdef ENABLE_ASYNC_EXPORT
,
Expand All @@ -301,11 +306,6 @@ ElasticsearchLogRecordExporter::ElasticsearchLogRecordExporter()
#endif
}

ElasticsearchLogRecordExporter::ElasticsearchLogRecordExporter(
const ElasticsearchExporterOptions &options)
: options_{options}, http_client_{ext::http::client::HttpClientFactory::Create()}
{}

std::unique_ptr<sdklogs::Recordable> ElasticsearchLogRecordExporter::MakeRecordable() noexcept
{
return std::unique_ptr<sdklogs::Recordable>(new ElasticSearchRecordable());
Expand Down

0 comments on commit 0ea1f2c

Please sign in to comment.