diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f9f1ed6bf..a258f6d15e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,9 @@ Increment the: * [CODE HEALTH] Fix clang-tidy performance enum size warnings [#3923](https://github.com/open-telemetry/opentelemetry-cpp/pull/3923) +* [EXPORTER] Allow custom HttpClient in OTLP HTTP + [#3930](https://github.com/open-telemetry/opentelemetry-cpp/pull/3930) + Important changes: * [BUILD] Revisit EventLogger deprecation diff --git a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_client.h b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_client.h index dff27d92f2..15197cf4d6 100644 --- a/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_client.h +++ b/exporters/otlp/include/opentelemetry/exporters/otlp/otlp_http_client.h @@ -158,6 +158,14 @@ class OtlpHttpClient */ explicit OtlpHttpClient(OtlpHttpClientOptions &&options); + /** + * Create an OtlpHttpClient using the specified http client. + * @param options the Otlp http client options to be used for exporting + * @param http_client the http client to be used for exporting + */ + OtlpHttpClient(OtlpHttpClientOptions &&options, + std::shared_ptr http_client); + ~OtlpHttpClient(); OtlpHttpClient(const OtlpHttpClient &) = delete; OtlpHttpClient &operator=(const OtlpHttpClient &) = delete; @@ -266,20 +274,6 @@ class OtlpHttpClient */ bool cleanupGCSessions() noexcept; - // For testing - friend class OtlpHttpExporterTestPeer; - friend class OtlpHttpLogRecordExporterTestPeer; - friend class OtlpHttpMetricExporterTestPeer; - - /** - * Create an OtlpHttpClient using the specified http client. - * Only tests can call this constructor directly. - * @param options the Otlp http client options to be used for exporting - * @param http_client the http client to be used for exporting - */ - OtlpHttpClient(OtlpHttpClientOptions &&options, - std::shared_ptr http_client); - // Stores if this HTTP client had its Shutdown() method called std::atomic is_shutdown_;