Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Append EOL before call Export of backend
  • Loading branch information
owent committed May 31, 2024
commit 85758da8a89f648dd1c72e9d613f487ec49e688c
3 changes: 1 addition & 2 deletions exporters/otlp/src/otlp_file_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,6 @@ class OPENTELEMETRY_LOCAL_SYMBOL OtlpFileSystemBackend : public OtlpFileAppender
}

fwrite(data.data(), 1, data.size(), out.get());
fputc('\n', out.get());

{
std::lock_guard<std::mutex> lock_guard{file_->file_lock};
Expand Down Expand Up @@ -1527,7 +1526,6 @@ class OPENTELEMETRY_LOCAL_SYMBOL OtlpFileOstreamBackend : public OtlpFileAppende
void Export(nostd::string_view data, std::size_t /*record_count*/) override
{
os_.get().write(data.data(), data.size());
os_.get().write("\n", 1);
}

bool ForceFlush(std::chrono::microseconds /*timeout*/) noexcept override
Expand Down Expand Up @@ -1595,6 +1593,7 @@ opentelemetry::sdk::common::ExportResult OtlpFileClient::Export(

if (backend_)
{
post_body_json += '\n';
backend_->Export(post_body_json, record_count);
return ::opentelemetry::sdk::common::ExportResult::kSuccess;
}
Expand Down