Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
marcalff committed Dec 6, 2023
1 parent 4bd64c9 commit c7bb4f5
Show file tree
Hide file tree
Showing 28 changed files with 3 additions and 214 deletions.
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,19 @@ 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 */
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
4 changes: 0 additions & 4 deletions exporters/otlp/src/otlp_http_metric_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,17 @@ OtlpHttpMetricExporter::OtlpHttpMetricExporter(const OtlpHttpMetricExporterOptio
aggregation_temporality_selector_{
OtlpMetricUtils::ChooseTemporalitySelector(options_.aggregation_temporality)},
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
Loading

0 comments on commit c7bb4f5

Please sign in to comment.