File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
exporters/user_events/src Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -52,9 +52,10 @@ sdk::common::ExportResult Exporter::Export(
5252 auto user_events_record =
5353 std::unique_ptr<Recordable>(static_cast <Recordable *>(record.release ()));
5454
55- user_events_record->PrepareExport ();
56-
57- // assert(user_events_record != nullptr, "Recordable is null");
55+ if (!user_events_record->PrepareExport ())
56+ {
57+ continue ;
58+ }
5859
5960 int level_index = user_events_record->GetLevelIndex ();
6061
Original file line number Diff line number Diff line change @@ -104,10 +104,17 @@ void Recordable::SetTimestamp(opentelemetry::common::SystemTimestamp timestamp)
104104
105105bool Recordable::PrepareExport () noexcept
106106{
107- if (cs_part_b_bookmark_size_ > 0 )
107+ if (cs_part_b_bookmark_size_ == 0 )
108+ {
109+ // Part B is mandatory for exporting to user_events.
110+ OTEL_INTERNAL_LOG_ERROR (" [user_events Log Exporter] Recordable: no data to export." );
111+ return false ;
112+ }
113+ else
108114 {
109115 event_builder_.SetStructFieldCount (cs_part_b_bookmark_, cs_part_b_bookmark_size_);
110116 }
117+
111118 if (cs_part_c_bookmark_size_ > 0 )
112119 {
113120 event_builder_.SetStructFieldCount (cs_part_c_bookmark_, cs_part_c_bookmark_size_);
You can’t perform that action at this time.
0 commit comments