-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ElasticSearch exporter crashes when emitting a log (EXC_BAD_ACCESS) #3078
Comments
According to the trace, this line at exporters/elasticsearch/src/es_log_record_exporter.cc:353, crashes with a nullptr:
|
I think I found the issue. I will test it as soon as I can but I am using the ElasticsearchLogRecordExporter::ElasticsearchLogRecordExporter(
const ElasticsearchExporterOptions &options)
: options_{options}, http_client_{ext::http::client::HttpClientFactory::Create()}
{} and it never calls the other constructor that initiate the ElasticsearchLogRecordExporter::ElasticsearchLogRecordExporter()
: options_{ElasticsearchExporterOptions()},
http_client_{ext::http::client::HttpClientFactory::Create()}
#ifdef ENABLE_ASYNC_EXPORT
,
synchronization_data_(new SynchronizationData())
#endif
{
#ifdef ENABLE_ASYNC_EXPORT
synchronization_data_->finished_session_counter_.store(0);
synchronization_data_->session_counter_.store(0);
#endif
}
I will test to fix it and probably submit a PR or at least a patch here if I do not have time to properly create the PR. |
As expected, fixing the code fixes the crash. 0001-EXPORTER-Fix-crash-in-ElasticsearchLogRecordExporter.patch |
Thanks, Please file a PR for this. |
using constructor with user given options (open-telemetry#3078) Closes open-telemetry#3078
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:
Then, when logs needs to be sent a call to
m_Logger.EmitLogRecord(xxx)
What is the expected behavior?
The program should run and send the log to the ELK endpoint.
What is the actual behavior?
It crashes on
es_log_record_exporter.cc:353
Backtrace:
Additional context
There is no problem if using a
HttpLogRecordExporter
instead of aElasticsearchLogRecordExporter
with the exact samecodeThe text was updated successfully, but these errors were encountered: