-
Notifications
You must be signed in to change notification settings - Fork 559
Http client factory #445
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
Merged
Merged
Http client factory #445
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
73b79ab
add client factory
lalitb ea73ca4
missing file
lalitb fd94634
conditional include on curl header
lalitb 81ef002
fix conflict
lalitb 9a79a6c
Merge branch 'master' into http-client-factory
lalitb 5651b32
remove newline
lalitb b76d66d
fix bazel build
lalitb 3de0387
make compile fail if client lib missing
lalitb cc64f15
Merge branch 'master' into http-client-factory
lalitb b402c7d
Merge branch 'master' into http-client-factory
lalitb 2f248fe
review comments
lalitb 2cc2da0
merge conflict
lalitb 9d7f612
fix cmake
lalitb 34213e3
fix curl for bazel
lalitb 865e54b
Merge branch 'master' into http-client-factory
lalitb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
ext/include/opentelemetry/ext/http/client/http_client_factory.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #pragma once | ||
| #include "opentelemetry/ext/http/client/http_client.h" | ||
|
|
||
| OPENTELEMETRY_BEGIN_NAMESPACE | ||
| namespace ext | ||
| { | ||
| namespace http | ||
| { | ||
| namespace client | ||
| { | ||
| class HttpClientFactory | ||
| { | ||
| public: | ||
| static std::shared_ptr<SessionManager> Create(); | ||
| }; | ||
| } // namespace client | ||
| } // namespace http | ||
| } // namespace ext | ||
| OPENTELEMETRY_END_NAMESPACE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| add_subdirectory(zpages) | ||
| add_subdirectory(http/client/curl) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| package(default_visibility = ["//visibility:public"]) | ||
|
|
||
| cc_library( | ||
| name = "http_client_curl", | ||
| srcs = ["http_client_factory_curl.cc"], | ||
| include_prefix = "src/http/client/curl", | ||
| deps = [ | ||
| "//api", | ||
| "//ext:headers", | ||
| "//sdk:headers", | ||
| "//sdk/src/common:random", | ||
| "@curl", | ||
| ], | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| find_package(CURL) | ||
| if(CURL_FOUND) | ||
| add_library(opentelemetry_curl_factory http_client_factory_curl) | ||
| endif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #include "opentelemetry/ext/http/client/curl/http_client_curl.h" | ||
| #include "opentelemetry/ext/http/client/http_client.h" | ||
| #include "opentelemetry/ext/http/client/http_client_factory.h" | ||
|
|
||
| std::shared_ptr<opentelemetry::ext::http::client::SessionManager> | ||
| opentelemetry::ext::http::client::HttpClientFactory::Create() | ||
| { | ||
| return std::make_shared<opentelemetry::ext::http::client::curl::SessionManager>(); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.