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

Allow adding custom HTTP client #2084

Open
lalitb opened this issue Apr 3, 2023 · 1 comment
Open

Allow adding custom HTTP client #2084

lalitb opened this issue Apr 3, 2023 · 1 comment
Labels

Comments

@lalitb
Copy link
Member

lalitb commented Apr 3, 2023

As of now, otel-cpp use Curl as the default HTTP Client, and is set here for CMake. It should be instead possible for users to bring their own HTTP Client library. Proposed solution could be:

  • Add cmake option (say WITH_CUSTOM_HTTP_CLIENT). And then WITH_HTTP_CLIENT_CURL shouldn't be set if the new option is enabled.
  • User need to provide following as part of their application code -
    • Implementation for opentelemetry::ext::http::client::HttpClientFactory::Create() and opentelemetry::ext::http::client::HttpClientFactory::CreateSync(). These two methods should return instances for custom implementation for HttpClient (async http client) and HttpClientSync (sync http client) as mentioned in step below.
    • Custom implementation for ext::http::client::HttpClientSync and :ext::http::client::HttpClient classes.
  • (Open Issue) opentelemetry_http_client_curl shouldn't be directly linked with other targets, probably some way to ensure that custom client library get's used at all the places.

This will ensure that only one definition/symbol for HttpClient and HttpClientSync is exposed (either from Custom http client, or the Curl http client) and would be invoked at run-time.

Also changes would be required in bazel build.

We can use this issue to finalize solution before implementation.

Related issue : #1145 #1146

@lalitb lalitb added the enhancement New feature or request label Apr 3, 2023
@github-actions
Copy link

github-actions bot commented Jun 3, 2023

This issue was marked as stale due to lack of activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants