Skip to content

Commit

Permalink
[REMOVAL] Remove option WITH_OTLP_HTTP_SSL_PREVIEW (#2435)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcalff authored Dec 13, 2023
1 parent 0b9371d commit 51c2ee5
Show file tree
Hide file tree
Showing 29 changed files with 63 additions and 273 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,21 @@ Increment the:

## [Unreleased]

* [REMOVAL] Remove option WITH_OTLP_HTTP_SSL_PREVIEW
[#2435](https://github.com/open-telemetry/opentelemetry-cpp/pull/2435)
* [BUILD] Fix removing of NOMINMAX on Windows
[#2449](https://github.com/open-telemetry/opentelemetry-cpp/pull/2449)

Important changes:

Breaking changes:

* [REMOVAL] Remove option WITH_OTLP_HTTP_SSL_PREVIEW
[#2435](https://github.com/open-telemetry/opentelemetry-cpp/pull/2435)
* CMake options `WITH_OTLP_HTTP_SSL_PREVIEW`
and `WITH_OTLP_HTTP_SSL_TLS_PREVIEW` are removed.
Building opentelemetry-cpp without SSL support is no longer possible.

## [1.13.0] 2023-12-06

* [BUILD] Remove WITH_REMOVE_METER_PREVIEW, use WITH_ABI_VERSION_2 instead
Expand Down
14 changes: 0 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,6 @@ endif()

option(WITH_ASYNC_EXPORT_PREVIEW "Whether to enable async export" OFF)

# STABLE
option(WITH_OTLP_HTTP_SSL_PREVIEW "Whether to enable otlp http ssl export" ON)

# STABLE
option(WITH_OTLP_HTTP_SSL_TLS_PREVIEW
"Whether to enable otlp http ssl tls min/max/cipher options" ON)

# Exemplar specs status is experimental, so behind feature flag by default
option(WITH_METRICS_EXEMPLAR_PREVIEW
"Whether to enable exemplar within metrics" OFF)
Expand All @@ -295,13 +288,6 @@ if(WITH_EXAMPLES_HTTP AND NOT WITH_EXAMPLES)
message(FATAL_ERROR "WITH_EXAMPLES_HTTP=ON requires WITH_EXAMPLES=ON")
endif()

if(WITH_OTLP_HTTP_SSL_TLS_PREVIEW AND NOT WITH_OTLP_HTTP_SSL_PREVIEW)
message(
FATAL_ERROR
"WITH_OTLP_HTTP_SSL_TLS_PREVIEW=ON requires WITH_OTLP_HTTP_SSL_PREVIEW=ON"
)
endif()

find_package(Threads)

function(install_windows_deps)
Expand Down
15 changes: 0 additions & 15 deletions api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,21 +117,6 @@ target_compile_definitions(
opentelemetry_api
INTERFACE OPENTELEMETRY_ABI_VERSION_NO=${OPENTELEMETRY_ABI_VERSION_NO})

# A better place should be in sdk, not api
if(WITH_OTLP_HTTP_SSL_PREVIEW)
target_compile_definitions(opentelemetry_api
INTERFACE ENABLE_OTLP_HTTP_SSL_PREVIEW)
target_compile_definitions(opentelemetry_api
INTERFACE ENABLE_HTTP_SSL_PREVIEW)

if(WITH_OTLP_HTTP_SSL_TLS_PREVIEW)
target_compile_definitions(opentelemetry_api
INTERFACE ENABLE_OTLP_HTTP_SSL_TLS_PREVIEW)
target_compile_definitions(opentelemetry_api
INTERFACE ENABLE_HTTP_SSL_TLS_PREVIEW)
endif()
endif()

if(WITH_OTLP_GRPC_SSL_MTLS_PREVIEW)
target_compile_definitions(opentelemetry_api
INTERFACE ENABLE_OTLP_GRPC_SSL_MTLS_PREVIEW)
Expand Down
8 changes: 0 additions & 8 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ elif [[ "$1" == "cmake.maintainer.sync.test" ]]; then
rm -rf *
cmake ${CMAKE_OPTIONS[@]} \
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_HTTP_SSL_PREVIEW=ON \
-DWITH_OTLP_HTTP_SSL_TLS_PREVIEW=ON \
-DWITH_PROMETHEUS=ON \
-DWITH_EXAMPLES=ON \
-DWITH_EXAMPLES_HTTP=ON \
Expand All @@ -132,8 +130,6 @@ elif [[ "$1" == "cmake.maintainer.async.test" ]]; then
rm -rf *
cmake ${CMAKE_OPTIONS[@]} \
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_HTTP_SSL_PREVIEW=ON \
-DWITH_OTLP_HTTP_SSL_TLS_PREVIEW=ON \
-DWITH_PROMETHEUS=ON \
-DWITH_EXAMPLES=ON \
-DWITH_EXAMPLES_HTTP=ON \
Expand All @@ -155,8 +151,6 @@ elif [[ "$1" == "cmake.maintainer.cpp11.async.test" ]]; then
cmake ${CMAKE_OPTIONS[@]} \
-DCMAKE_CXX_STANDARD=11 \
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_HTTP_SSL_PREVIEW=ON \
-DWITH_OTLP_HTTP_SSL_TLS_PREVIEW=ON \
-DWITH_PROMETHEUS=ON \
-DWITH_EXAMPLES=ON \
-DWITH_EXAMPLES_HTTP=ON \
Expand All @@ -176,8 +170,6 @@ elif [[ "$1" == "cmake.maintainer.abiv2.test" ]]; then
rm -rf *
cmake ${CMAKE_OPTIONS[@]} \
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_HTTP_SSL_PREVIEW=ON \
-DWITH_OTLP_HTTP_SSL_TLS_PREVIEW=ON \
-DWITH_PROMETHEUS=ON \
-DWITH_EXAMPLES=ON \
-DWITH_EXAMPLES_HTTP=ON \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ std::string GetOtlpDefaultTracesSslClientCertificateString();
std::string GetOtlpDefaultMetricsSslClientCertificateString();
std::string GetOtlpDefaultLogsSslClientCertificateString();

#ifdef ENABLE_OTLP_HTTP_SSL_TLS_PREVIEW
std::string GetOtlpDefaultTracesSslTlsMinVersion();
std::string GetOtlpDefaultMetricsSslTlsMinVersion();
std::string GetOtlpDefaultLogsSslTlsMinVersion();
Expand All @@ -117,7 +116,6 @@ std::string GetOtlpDefaultLogsSslTlsCipher();
std::string GetOtlpDefaultTracesSslTlsCipherSuite();
std::string GetOtlpDefaultMetricsSslTlsCipherSuite();
std::string GetOtlpDefaultLogsSslTlsCipherSuite();
#endif /* ENABLE_OTLP_HTTP_SSL_TLS_PREVIEW */

std::chrono::system_clock::duration GetOtlpDefaultTracesTimeout();
std::chrono::system_clock::duration GetOtlpDefaultMetricsTimeout();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ struct OtlpHttpClientOptions
{
std::string url;

#ifdef ENABLE_OTLP_HTTP_SSL_PREVIEW
/** SSL options. */
ext::http::client::HttpSslOptions ssl_options;
#endif /* ENABLE_OTLP_HTTP_SSL_PREVIEW */

// By default, post json data
HttpRequestContentType content_type = HttpRequestContentType::kJson;
Expand Down Expand Up @@ -83,21 +81,17 @@ struct OtlpHttpClientOptions
std::string user_agent;

inline OtlpHttpClientOptions(nostd::string_view input_url,
#ifdef ENABLE_OTLP_HTTP_SSL_PREVIEW
bool input_ssl_insecure_skip_verify,
nostd::string_view input_ssl_ca_cert_path,
nostd::string_view input_ssl_ca_cert_string,
nostd::string_view input_ssl_client_key_path,
nostd::string_view input_ssl_client_key_string,
nostd::string_view input_ssl_client_cert_path,
nostd::string_view input_ssl_client_cert_string,
#endif /* ENABLE_OTLP_HTTP_SSL_PREVIEW */
#ifdef ENABLE_OTLP_HTTP_SSL_TLS_PREVIEW
nostd::string_view input_ssl_min_tls,
nostd::string_view input_ssl_max_tls,
nostd::string_view input_ssl_cipher,
nostd::string_view input_ssl_cipher_suite,
#endif /* ENABLE_OTLP_HTTP_SSL_TLS_PREVIEW */
HttpRequestContentType input_content_type,
JsonBytesMappingKind input_json_bytes_mapping,
bool input_use_json_name,
Expand All @@ -108,24 +102,18 @@ struct OtlpHttpClientOptions
std::size_t input_max_requests_per_connection = 8,
nostd::string_view input_user_agent = GetOtlpDefaultUserAgent())
: url(input_url),
#ifdef ENABLE_OTLP_HTTP_SSL_PREVIEW
ssl_options(input_url,
input_ssl_insecure_skip_verify,
input_ssl_ca_cert_path,
input_ssl_ca_cert_string,
input_ssl_client_key_path,
input_ssl_client_key_string,
input_ssl_client_cert_path,
input_ssl_client_cert_string
# ifdef ENABLE_OTLP_HTTP_SSL_TLS_PREVIEW
,
input_ssl_client_cert_string,
input_ssl_min_tls,
input_ssl_max_tls,
input_ssl_cipher,
input_ssl_cipher_suite
# endif /* ENABLE_OTLP_HTTP_SSL_TLS_PREVIEW */
),
#endif /* ENABLE_OTLP_HTTP_SSL_PREVIEW */
input_ssl_cipher_suite),
content_type(input_content_type),
json_bytes_mapping(input_json_bytes_mapping),
use_json_name(input_use_json_name),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ struct OPENTELEMETRY_EXPORT OtlpHttpExporterOptions
std::size_t max_requests_per_connection;
#endif

#ifdef ENABLE_OTLP_HTTP_SSL_PREVIEW
/** True do disable SSL. */
bool ssl_insecure_skip_verify;

Expand All @@ -89,9 +88,7 @@ struct OPENTELEMETRY_EXPORT OtlpHttpExporterOptions

/** CLIENT CERT, as a string. */
std::string ssl_client_cert_string;
#endif /* ENABLE_OTLP_HTTP_SSL_PREVIEW */

#ifdef ENABLE_OTLP_HTTP_SSL_TLS_PREVIEW
/** Minimum TLS version. */
std::string ssl_min_tls;

Expand All @@ -103,7 +100,6 @@ struct OPENTELEMETRY_EXPORT OtlpHttpExporterOptions

/** TLS cipher suite. */
std::string ssl_cipher_suite;
#endif /* ENABLE_OTLP_HTTP_SSL_TLS_PREVIEW */
};

} // namespace otlp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ struct OPENTELEMETRY_EXPORT OtlpHttpLogRecordExporterOptions
std::size_t max_requests_per_connection;
#endif

#ifdef ENABLE_OTLP_HTTP_SSL_PREVIEW
/** True do disable SSL. */
bool ssl_insecure_skip_verify;

Expand All @@ -89,9 +88,7 @@ struct OPENTELEMETRY_EXPORT OtlpHttpLogRecordExporterOptions

/** CLIENT CERT, as a string. */
std::string ssl_client_cert_string;
#endif /* ENABLE_OTLP_HTTP_SSL_PREVIEW */

#ifdef ENABLE_OTLP_HTTP_SSL_TLS_PREVIEW
/** Minimum TLS version. */
std::string ssl_min_tls;

Expand All @@ -103,7 +100,6 @@ struct OPENTELEMETRY_EXPORT OtlpHttpLogRecordExporterOptions

/** TLS cipher suite. */
std::string ssl_cipher_suite;
#endif /* ENABLE_OTLP_HTTP_SSL_TLS_PREVIEW */
};

} // namespace otlp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ struct OPENTELEMETRY_EXPORT OtlpHttpMetricExporterOptions
std::size_t max_requests_per_connection;
#endif

#ifdef ENABLE_OTLP_HTTP_SSL_PREVIEW
/** True do disable SSL. */
bool ssl_insecure_skip_verify;

Expand All @@ -92,9 +91,7 @@ struct OPENTELEMETRY_EXPORT OtlpHttpMetricExporterOptions

/** CLIENT CERT, as a string. */
std::string ssl_client_cert_string;
#endif /* ENABLE_OTLP_HTTP_SSL_PREVIEW */

#ifdef ENABLE_OTLP_HTTP_SSL_TLS_PREVIEW
/** Minimum TLS version. */
std::string ssl_min_tls;

Expand All @@ -106,7 +103,6 @@ struct OPENTELEMETRY_EXPORT OtlpHttpMetricExporterOptions

/** TLS cipher suite. */
std::string ssl_cipher_suite;
#endif /* ENABLE_OTLP_HTTP_SSL_TLS_PREVIEW */
};

} // namespace otlp
Expand Down
4 changes: 0 additions & 4 deletions exporters/otlp/src/otlp_environment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -660,8 +660,6 @@ std::string GetOtlpDefaultLogsSslClientCertificateString()
return std::string{};
}

#ifdef ENABLE_OTLP_HTTP_SSL_TLS_PREVIEW

/*
EXPERIMENTAL:
Environment variable names do not exist in the spec,
Expand Down Expand Up @@ -872,8 +870,6 @@ std::string GetOtlpDefaultLogsSslTlsCipherSuite()
return std::string{};
}

#endif /* ENABLE_OTLP_HTTP_SSL_TLS_PREVIEW */

std::chrono::system_clock::duration GetOtlpDefaultTracesTimeout()
{
constexpr char kSignalEnv[] = "OTEL_EXPORTER_OTLP_TRACES_TIMEOUT";
Expand Down
2 changes: 0 additions & 2 deletions exporters/otlp/src/otlp_http_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -951,9 +951,7 @@ OtlpHttpClient::createSession(
request->AddHeader(header.first, header.second);
}
request->SetUri(http_uri_);
#ifdef ENABLE_OTLP_HTTP_SSL_PREVIEW
request->SetSslOptions(options_.ssl_options);
#endif /* ENABLE_OTLP_HTTP_SSL_PREVIEW */
request->SetTimeoutMs(std::chrono::duration_cast<std::chrono::milliseconds>(options_.timeout));
request->SetMethod(http_client::Method::Post);
request->SetBody(body_vec);
Expand Down
4 changes: 0 additions & 4 deletions exporters/otlp/src/otlp_http_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,17 @@ OtlpHttpExporter::OtlpHttpExporter() : OtlpHttpExporter(OtlpHttpExporterOptions(
OtlpHttpExporter::OtlpHttpExporter(const OtlpHttpExporterOptions &options)
: options_(options),
http_client_(new OtlpHttpClient(OtlpHttpClientOptions(options.url,
#ifdef ENABLE_OTLP_HTTP_SSL_PREVIEW
options.ssl_insecure_skip_verify,
options.ssl_ca_cert_path,
options.ssl_ca_cert_string,
options.ssl_client_key_path,
options.ssl_client_key_string,
options.ssl_client_cert_path,
options.ssl_client_cert_string,
#endif /* ENABLE_OTLP_HTTP_SSL_PREVIEW */
#ifdef ENABLE_OTLP_HTTP_SSL_TLS_PREVIEW
options.ssl_min_tls,
options.ssl_max_tls,
options.ssl_cipher,
options.ssl_cipher_suite,
#endif /* ENABLE_OTLP_HTTP_SSL_TLS_PREVIEW */
options.content_type,
options.json_bytes_mapping,
options.use_json_name,
Expand Down
4 changes: 0 additions & 4 deletions exporters/otlp/src/otlp_http_exporter_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,18 @@ OtlpHttpExporterOptions::OtlpHttpExporterOptions()
max_requests_per_connection = 8;
#endif /* ENABLE_ASYNC_EXPORT */

#ifdef ENABLE_OTLP_HTTP_SSL_PREVIEW
ssl_insecure_skip_verify = false;
ssl_ca_cert_path = GetOtlpDefaultTracesSslCertificatePath();
ssl_ca_cert_string = GetOtlpDefaultTracesSslCertificateString();
ssl_client_key_path = GetOtlpDefaultTracesSslClientKeyPath();
ssl_client_key_string = GetOtlpDefaultTracesSslClientKeyString();
ssl_client_cert_path = GetOtlpDefaultTracesSslClientCertificatePath();
ssl_client_cert_string = GetOtlpDefaultTracesSslClientCertificateString();
#endif /* ENABLE_OTLP_HTTP_SSL_PREVIEW */

#ifdef ENABLE_OTLP_HTTP_SSL_TLS_PREVIEW
ssl_min_tls = GetOtlpDefaultTracesSslTlsMinVersion();
ssl_max_tls = GetOtlpDefaultTracesSslTlsMaxVersion();
ssl_cipher = GetOtlpDefaultTracesSslTlsCipher();
ssl_cipher_suite = GetOtlpDefaultTracesSslTlsCipherSuite();
#endif /* ENABLE_OTLP_HTTP_SSL_TLS_PREVIEW */
}

OtlpHttpExporterOptions::~OtlpHttpExporterOptions() {}
Expand Down
4 changes: 0 additions & 4 deletions exporters/otlp/src/otlp_http_log_record_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,17 @@ OtlpHttpLogRecordExporter::OtlpHttpLogRecordExporter(
const OtlpHttpLogRecordExporterOptions &options)
: options_(options),
http_client_(new OtlpHttpClient(OtlpHttpClientOptions(options.url,
#ifdef ENABLE_OTLP_HTTP_SSL_PREVIEW
options.ssl_insecure_skip_verify,
options.ssl_ca_cert_path,
options.ssl_ca_cert_string,
options.ssl_client_key_path,
options.ssl_client_key_string,
options.ssl_client_cert_path,
options.ssl_client_cert_string,
#endif /* ENABLE_OTLP_HTTP_SSL_PREVIEW */
#ifdef ENABLE_OTLP_HTTP_SSL_TLS_PREVIEW
options.ssl_min_tls,
options.ssl_max_tls,
options.ssl_cipher,
options.ssl_cipher_suite,
#endif /* ENABLE_OTLP_HTTP_SSL_TLS_PREVIEW */
options.content_type,
options.json_bytes_mapping,
options.use_json_name,
Expand Down
4 changes: 0 additions & 4 deletions exporters/otlp/src/otlp_http_log_record_exporter_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,18 @@ OtlpHttpLogRecordExporterOptions::OtlpHttpLogRecordExporterOptions()
max_requests_per_connection = 8;
#endif

#ifdef ENABLE_OTLP_HTTP_SSL_PREVIEW
ssl_insecure_skip_verify = false;
ssl_ca_cert_path = GetOtlpDefaultLogsSslCertificatePath();
ssl_ca_cert_string = GetOtlpDefaultLogsSslCertificateString();
ssl_client_key_path = GetOtlpDefaultLogsSslClientKeyPath();
ssl_client_key_string = GetOtlpDefaultLogsSslClientKeyString();
ssl_client_cert_path = GetOtlpDefaultLogsSslClientCertificatePath();
ssl_client_cert_string = GetOtlpDefaultLogsSslClientCertificateString();
#endif /* ENABLE_OTLP_HTTP_SSL_PREVIEW */

#ifdef ENABLE_OTLP_HTTP_SSL_TLS_PREVIEW
ssl_min_tls = GetOtlpDefaultLogsSslTlsMinVersion();
ssl_max_tls = GetOtlpDefaultLogsSslTlsMaxVersion();
ssl_cipher = GetOtlpDefaultLogsSslTlsCipher();
ssl_cipher_suite = GetOtlpDefaultLogsSslTlsCipherSuite();
#endif /* ENABLE_OTLP_HTTP_SSL_TLS_PREVIEW */
}

OtlpHttpLogRecordExporterOptions::~OtlpHttpLogRecordExporterOptions() {}
Expand Down
Loading

2 comments on commit 51c2ee5

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'OpenTelemetry-cpp sdk Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 51c2ee5 Previous: 0b9371d Ratio
BM_BaselineBuffer/4 14650032.52029419 ns/iter 7317333.221435547 ns/iter 2.00
BM_LockFreeBuffer/2 5777404.308319092 ns/iter 1458026.9354208498 ns/iter 3.96
BM_LockFreeBuffer/4 10040946.006774902 ns/iter 1416118.2715829494 ns/iter 7.09

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'OpenTelemetry-cpp api Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 51c2ee5 Previous: 0b9371d Ratio
BM_ProcYieldSpinLockThrashing/4/process_time/real_time 5.486090195002814 ms/iter 0.7255937232345832 ms/iter 7.56

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.