-
Notifications
You must be signed in to change notification settings - Fork 448
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
Added max async export support using separate AsyncBatchSpan/LogProcessor #1306
Changes from 1 commit
f218940
0c8dfcf
39df6c8
e4bc6e8
b15931f
1421910
4f2fc3b
ca556b1
c2c5860
f5324c9
3c3bb3e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
# include "opentelemetry/ext/http/client/nosend/http_client_nosend.h" | ||
# include "opentelemetry/ext/http/server/http_server.h" | ||
# include "opentelemetry/logs/provider.h" | ||
# include "opentelemetry/sdk/logs/async_batch_log_processor.h" | ||
# include "opentelemetry/sdk/logs/batch_log_processor.h" | ||
# include "opentelemetry/sdk/logs/exporter.h" | ||
# include "opentelemetry/sdk/logs/log_record.h" | ||
|
@@ -103,13 +104,15 @@ class OtlpHttpLogExporterTestPeer : public ::testing::Test | |
std::string attribute_storage_string_value[] = {"vector", "string"}; | ||
|
||
auto provider = nostd::shared_ptr<sdk::logs::LoggerProvider>(new sdk::logs::LoggerProvider()); | ||
provider->AddProcessor(std::unique_ptr<sdk::logs::LogProcessor>( | ||
new sdk::logs::BatchLogProcessor(std::move(exporter), 5, std::chrono::milliseconds(256), 5 | ||
# ifdef ENABLE_ASYNC_EXPORT | ||
, | ||
is_async | ||
provider->AddProcessor( | ||
std::unique_ptr<sdk::logs::LogProcessor>(new sdk::logs::AsyncBatchLogProcessor( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we create one test for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, done in the next PR |
||
std::move(exporter), 5, std::chrono::milliseconds(256), 5))); | ||
# else | ||
provider->AddProcessor( | ||
std::unique_ptr<sdk::logs::LogProcessor>(new sdk::logs::BatchLogProcessor( | ||
std::move(exporter), 5, std::chrono::milliseconds(256), 5))); | ||
# endif | ||
))); | ||
|
||
std::string report_trace_id; | ||
std::string report_span_id; | ||
|
@@ -213,16 +216,22 @@ class OtlpHttpLogExporterTestPeer : public ::testing::Test | |
double attribute_storage_double_value[] = {3.2, 3.3}; | ||
std::string attribute_storage_string_value[] = {"vector", "string"}; | ||
|
||
auto provider = nostd::shared_ptr<sdk::logs::LoggerProvider>(new sdk::logs::LoggerProvider()); | ||
# ifdef ENABLE_ASYNC_EXPORT | ||
sdk::logs::AsyncBatchLogProcessorOptions processor_options; | ||
processor_options.max_export_batch_size = 5; | ||
processor_options.max_queue_size = 5; | ||
processor_options.schedule_delay_millis = std::chrono::milliseconds(256); | ||
provider->AddProcessor(std::unique_ptr<sdk::logs::LogProcessor>( | ||
new sdk::logs::AsyncBatchLogProcessor(std::move(exporter), processor_options))); | ||
# else | ||
sdk::logs::BatchLogProcessorOptions processor_options; | ||
processor_options.max_export_batch_size = 5; | ||
processor_options.max_queue_size = 5; | ||
processor_options.schedule_delay_millis = std::chrono::milliseconds(256); | ||
# ifdef ENABLE_ASYNC_EXPORT | ||
processor_options.is_export_async = is_async; | ||
# endif | ||
auto provider = nostd::shared_ptr<sdk::logs::LoggerProvider>(new sdk::logs::LoggerProvider()); | ||
provider->AddProcessor(std::unique_ptr<sdk::logs::LogProcessor>( | ||
new sdk::logs::BatchLogProcessor(std::move(exporter), processor_options))); | ||
# endif | ||
|
||
std::string report_trace_id; | ||
std::string report_span_id; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add a CI build for
ENABLE_ASYNC_EXPORT
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I will add on this PR