Skip to content
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

Cocurrency otlp http session #1317

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
e072daa
install sdk config (#1273)
esigo Mar 21, 2022
6ec1b59
Bump actions/cache from 2 to 3 (#1277)
dependabot[bot] Mar 22, 2022
b5155a5
Add owent as an Approver (#1276)
lalitb Mar 23, 2022
0c9aece
Disable benchmark action failure (#1284)
esigo Mar 24, 2022
3c7b44b
metrics exemplar round 1 (#1264)
esigo Mar 24, 2022
2c9ce39
[Metrics SDK] - fix spelling (AggregationTemporarily to AggregationTe…
lalitb Mar 24, 2022
91b0572
fix compilation error with protobuf 3.5 (#1289)
esigo Mar 25, 2022
c1b9590
Fix span SetAttribute crash (#1283)
esigo Mar 26, 2022
a7e814a
Synchronous Metric collection (Delta , Cumulative) (#1265)
lalitb Mar 30, 2022
76c664a
Rename `http_client_curl` to `opentelemetry_http_client_curl` (#1301)
owent Mar 31, 2022
2034c9b
Don't show coverage annotation for pull requests (#1304)
ThomsonTan Apr 1, 2022
33d9c62
Implement periodic exporting metric reader (#1286)
lalitb Apr 1, 2022
48a4060
Add `async-changes` branch to pull_request of github action (#1309)
owent Apr 4, 2022
be75bbc
Add InstrumentationInfo and Resource to the metrics data to be export…
lalitb Apr 4, 2022
237a0b2
Excempt should be applied on issue instead of PR (#1316)
ThomsonTan Apr 5, 2022
fd338cc
Bump codecov/codecov-action from 2.1.0 to 3 (#1318)
dependabot[bot] Apr 6, 2022
fe9f81c
Merge remote-tracking branch 'opentelemetry/main' into merge_main_int…
owent Apr 6, 2022
b0e6484
Merge remote-tracking branch 'opentelemetry/main' into merge_main_int…
owent Apr 6, 2022
079dd3e
Switch to multi_handle for `curl::HttpClient`
owent Apr 28, 2022
8e603fd
Add `max_requests_per_connection` for all OTLP http exporters
owent May 5, 2022
731565a
Fix style
owent May 5, 2022
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Increment the:

* [SDK] Async Batch Span/Log processor with max async support ([#1306](https://github.com/open-telemetry/opentelemetry-cpp/pull/1306))
* [EXPORTER] OTLP http exporter allow concurrency session ([#1209](https://github.com/open-telemetry/opentelemetry-cpp/pull/1209))
* [EXT] `curl::HttpClient` use `curl_multi_handle` instead of creating a thread
for every request and it's able to reuse connections now. ([#1317](https://github.com/open-telemetry/opentelemetry-cpp/pull/1317))

## [1.3.0] 2022-04-11

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ struct OtlpHttpClientOptions
OtlpHeaders http_headers = GetOtlpDefaultHeaders();

// Concurrent requests
std::size_t max_concurrent_requests = 8;
std::size_t max_concurrent_requests = 64;

// Concurrent requests
std::size_t max_requests_per_connection = 8;

inline OtlpHttpClientOptions(nostd::string_view input_url,
HttpRequestContentType input_content_type,
Expand All @@ -88,15 +91,17 @@ struct OtlpHttpClientOptions
bool input_console_debug,
std::chrono::system_clock::duration input_timeout,
const OtlpHeaders &input_http_headers,
std::size_t input_concurrent_sessions = 8)
std::size_t input_concurrent_sessions = 64,
std::size_t input_max_requests_per_connection = 8)
: url(input_url),
content_type(input_content_type),
json_bytes_mapping(input_json_bytes_mapping),
use_json_name(input_use_json_name),
console_debug(input_console_debug),
timeout(input_timeout),
http_headers(input_http_headers),
max_concurrent_requests(input_concurrent_sessions)
max_concurrent_requests(input_concurrent_sessions),
max_requests_per_connection(input_max_requests_per_connection)
{}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ struct OtlpHttpExporterOptions
#ifdef ENABLE_ASYNC_EXPORT
// Concurrent requests
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/otlp.md#otlpgrpc-concurrent-requests
std::size_t max_concurrent_requests = 8;
std::size_t max_concurrent_requests = 64;

// Concurrent requests
std::size_t max_requests_per_connection = 8;
#endif
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ struct OtlpHttpLogExporterOptions
# ifdef ENABLE_ASYNC_EXPORT
// Concurrent requests
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/otlp.md#otlpgrpc-concurrent-requests
std::size_t max_concurrent_requests = 8;
std::size_t max_concurrent_requests = 64;

// Concurrent requests
std::size_t max_requests_per_connection = 8;
# endif
};

Expand Down
8 changes: 6 additions & 2 deletions exporters/otlp/src/otlp_http_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,9 @@ void ConvertListFieldToJson(nlohmann::json &value,

OtlpHttpClient::OtlpHttpClient(OtlpHttpClientOptions &&options)
: is_shutdown_(false), options_(options), http_client_(http_client::HttpClientFactory::Create())
{}
{
http_client_->SetMaxSessionsPerConnection(options_.max_requests_per_connection);
}

OtlpHttpClient::~OtlpHttpClient()
{
Expand Down Expand Up @@ -682,7 +684,9 @@ OtlpHttpClient::~OtlpHttpClient()
OtlpHttpClient::OtlpHttpClient(OtlpHttpClientOptions &&options,
std::shared_ptr<ext::http::client::HttpClient> http_client)
: is_shutdown_(false), options_(options), http_client_(http_client)
{}
{
http_client_->SetMaxSessionsPerConnection(options_.max_requests_per_connection);
}

// ----------------------------- HTTP Client methods ------------------------------
opentelemetry::sdk::common::ExportResult OtlpHttpClient::Export(
Expand Down
3 changes: 2 additions & 1 deletion exporters/otlp/src/otlp_http_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ OtlpHttpExporter::OtlpHttpExporter(const OtlpHttpExporterOptions &options)
options.http_headers
#ifdef ENABLE_ASYNC_EXPORT
,
options.max_concurrent_requests
options.max_concurrent_requests,
options.max_requests_per_connection
#endif
)))
{}
Expand Down
3 changes: 2 additions & 1 deletion exporters/otlp/src/otlp_http_log_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ OtlpHttpLogExporter::OtlpHttpLogExporter(const OtlpHttpLogExporterOptions &optio
options.http_headers
# ifdef ENABLE_ASYNC_EXPORT
,
options.max_concurrent_requests
options.max_concurrent_requests,
options.max_requests_per_connection
# endif
)))
{}
Expand Down
Loading