Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ struct OPENTELEMETRY_EXPORT OtlpHttpExporterOptions

#ifdef ENABLE_ASYNC_EXPORT
/** Max number of concurrent requests. */
std::size_t max_concurrent_requests;
std::size_t max_concurrent_requests{64};

/** Max number of requests per connection. */
std::size_t max_requests_per_connection;
std::size_t max_requests_per_connection{8};
#endif

/** True do disable SSL. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ struct OPENTELEMETRY_EXPORT OtlpHttpLogRecordExporterOptions

#ifdef ENABLE_ASYNC_EXPORT
/** Max number of concurrent requests. */
std::size_t max_concurrent_requests;
std::size_t max_concurrent_requests{64};

/** Max number of requests per connection. */
std::size_t max_requests_per_connection;
std::size_t max_requests_per_connection{8};
#endif

/** True do disable SSL. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ struct OPENTELEMETRY_EXPORT OtlpHttpMetricExporterOptions

#ifdef ENABLE_ASYNC_EXPORT
/** Max number of concurrent requests. */
std::size_t max_concurrent_requests;
std::size_t max_concurrent_requests{64};

/** Max number of requests per connection. */
std::size_t max_requests_per_connection;
std::size_t max_requests_per_connection{8};
#endif

/** True do disable SSL. */
Expand Down
7 changes: 1 addition & 6 deletions exporters/otlp/src/otlp_http_exporter_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,7 @@ OtlpHttpExporterOptions::OtlpHttpExporterOptions()
retry_policy_initial_backoff(GetOtlpDefaultTracesRetryInitialBackoff()),
retry_policy_max_backoff(GetOtlpDefaultTracesRetryMaxBackoff()),
retry_policy_backoff_multiplier(GetOtlpDefaultTracesRetryBackoffMultiplier())
{
#ifdef ENABLE_ASYNC_EXPORT
max_concurrent_requests = 64;
max_requests_per_connection = 8;
#endif /* ENABLE_ASYNC_EXPORT */
}
{}

OtlpHttpExporterOptions::~OtlpHttpExporterOptions() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,7 @@ OtlpHttpLogRecordExporterOptions::OtlpHttpLogRecordExporterOptions()
retry_policy_initial_backoff(GetOtlpDefaultLogsRetryInitialBackoff()),
retry_policy_max_backoff(GetOtlpDefaultLogsRetryMaxBackoff()),
retry_policy_backoff_multiplier(GetOtlpDefaultLogsRetryBackoffMultiplier())
{
#ifdef ENABLE_ASYNC_EXPORT
max_concurrent_requests = 64;
max_requests_per_connection = 8;
#endif
}
{}

OtlpHttpLogRecordExporterOptions::~OtlpHttpLogRecordExporterOptions() {}

Expand Down
7 changes: 1 addition & 6 deletions exporters/otlp/src/otlp_http_metric_exporter_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,7 @@ OtlpHttpMetricExporterOptions::OtlpHttpMetricExporterOptions()
retry_policy_initial_backoff(GetOtlpDefaultMetricsRetryInitialBackoff()),
retry_policy_max_backoff(GetOtlpDefaultMetricsRetryMaxBackoff()),
retry_policy_backoff_multiplier(GetOtlpDefaultMetricsRetryBackoffMultiplier())
{
#ifdef ENABLE_ASYNC_EXPORT
max_concurrent_requests = 64;
max_requests_per_connection = 8;
#endif
}
{}

OtlpHttpMetricExporterOptions::~OtlpHttpMetricExporterOptions() {}

Expand Down
11 changes: 10 additions & 1 deletion ext/src/http/client/curl/http_operation_curl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@ std::chrono::system_clock::time_point HttpOperation::NextRetryTime()
# define HAVE_TLS_VERSION
#endif

// NOLINTNEXTLINE(google-runtime-int)
static long parse_min_ssl_version(const std::string &version)
{
#ifdef HAVE_TLS_VERSION
Expand All @@ -532,6 +533,7 @@ static long parse_min_ssl_version(const std::string &version)
return 0;
}

// NOLINTNEXTLINE(google-runtime-int)
static long parse_max_ssl_version(const std::string &version)
{
#ifdef HAVE_TLS_VERSION
Expand Down Expand Up @@ -591,6 +593,7 @@ CURLcode HttpOperation::SetCurlPtrOption(CURLoption option, void *value)
return rc;
}

// NOLINTNEXTLINE(google-runtime-int)
CURLcode HttpOperation::SetCurlLongOption(CURLoption option, long value)
{
CURLcode rc;
Expand Down Expand Up @@ -877,8 +880,10 @@ CURLcode HttpOperation::Setup()

#ifdef HAVE_TLS_VERSION
/* By default, TLSv1.2 or better is required (if we have TLS). */
// NOLINTNEXTLINE(google-runtime-int)
long min_ssl_version = CURL_SSLVERSION_TLSv1_2;
#else
// NOLINTNEXTLINE(google-runtime-int)
long min_ssl_version = 0;
#endif

Expand All @@ -903,6 +908,7 @@ CURLcode HttpOperation::Setup()
* The CURL + openssl library may be more recent than this code,
* and support a version we do not know about.
*/
// NOLINTNEXTLINE(google-runtime-int)
long max_ssl_version = 0;

if (!ssl_options_.ssl_max_tls.empty())
Expand All @@ -921,6 +927,7 @@ CURLcode HttpOperation::Setup()
#endif
}

// NOLINTNEXTLINE(google-runtime-int)
long version_range = min_ssl_version | max_ssl_version;
if (version_range != 0)
{
Expand Down Expand Up @@ -967,6 +974,7 @@ CURLcode HttpOperation::Setup()
if (ssl_options_.ssl_insecure_skip_verify)
{
/* 6 - DO NOT ENFORCE VERIFICATION, This is not secure. */
// NOLINTNEXTLINE(google-runtime-int)
rc = SetCurlLongOption(CURLOPT_USE_SSL, static_cast<long>(CURLUSESSL_NONE));
if (rc != CURLE_OK)
{
Expand All @@ -988,6 +996,7 @@ CURLcode HttpOperation::Setup()
else
{
/* 6 - ENFORCE VERIFICATION */
// NOLINTNEXTLINE(google-runtime-int)
rc = SetCurlLongOption(CURLOPT_USE_SSL, static_cast<long>(CURLUSESSL_ALL));
if (rc != CURLE_OK)
{
Expand Down Expand Up @@ -1042,7 +1051,7 @@ CURLcode HttpOperation::Setup()

// TODO: control local port to use
// curl_easy_setopt(curl, CURLOPT_LOCALPORT, dcf_port);

// NOLINTNEXTLINE(google-runtime-int)
rc = SetCurlLongOption(CURLOPT_TIMEOUT_MS, static_cast<long>(http_conn_timeout_.count()));
if (rc != CURLE_OK)
{
Expand Down
2 changes: 1 addition & 1 deletion ext/test/http/curl_http_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "opentelemetry/nostd/function_ref.h"
#include "opentelemetry/nostd/string_view.h"

#define HTTP_PORT 19000
constexpr int HTTP_PORT{19000};

namespace curl = opentelemetry::ext::http::client::curl;
namespace http_client = opentelemetry::ext::http::client;
Expand Down
2 changes: 1 addition & 1 deletion sdk/include/opentelemetry/sdk/metrics/data/point_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class HistogramPointData
HistogramPointData &operator=(HistogramPointData &&) = default;
HistogramPointData(const HistogramPointData &) = default;
HistogramPointData() = default;
HistogramPointData(std::vector<double> &boundaries) : boundaries_(boundaries) {}
HistogramPointData(const std::vector<double> &boundaries) : boundaries_(boundaries) {}
HistogramPointData &operator=(const HistogramPointData &other) = default;
~HistogramPointData() = default;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void Base2ExponentialHistogramAggregation::Aggregate(
int64_t value,
const PointAttributes & /* attributes */) noexcept
{
Aggregate(double(value));
Aggregate(static_cast<double>(value));
}

void Base2ExponentialHistogramAggregation::Aggregate(
Expand Down
3 changes: 2 additions & 1 deletion sdk/test/common/attribute_utils_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ TEST(AttributeMapTest, EqualTo)
Attributes attributes_different_size = {{"key0", "some value"}};

// check for the case where the number of attributes is the same but all keys are different
Attributes attributes_different_all = {{"a", "b"}, {"c", "d"}, {"e", 4.0}, {"f", uint8_t(5)}};
Attributes attributes_different_all = {
{"a", "b"}, {"c", "d"}, {"e", 4.0}, {"f", static_cast<uint8_t>(5)}};

auto kv_iterable_different_value =
opentelemetry::common::MakeKeyValueIterableView<Attributes>(attributes_different_value);
Expand Down
2 changes: 1 addition & 1 deletion sdk/test/metrics/aggregation_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ TEST(Aggregation, Base2ExponentialHistogramAggregation)

// Create a new aggreagte based in point data
{
auto point_data = histo_point;
const auto &point_data = histo_point;
Base2ExponentialHistogramAggregation scale0_aggr2(point_data);
scale0_aggr2.Aggregate(0.0, {});

Expand Down
10 changes: 5 additions & 5 deletions sdk/test/metrics/instrument_descriptor_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ TEST(InstrumentDescriptorUtilTest, IsDuplicate)
InstrumentDescriptorUtil::IsDuplicate(instrument_existing, instrument_different_name));

// not a duplicate - identical instrument
auto instrument_identical = instrument_existing;
const auto &instrument_identical = instrument_existing;
EXPECT_FALSE(InstrumentDescriptorUtil::IsDuplicate(instrument_existing, instrument_identical));

// not a duplicate - instrument with same case-insensitive name
Expand Down Expand Up @@ -87,8 +87,8 @@ TEST(InstrumentDescriptorTest, EqualNameCaseInsensitiveOperator)
{
// equal by name, description, unit, type and value type
InstrumentEqualNameCaseInsensitive equal_operator{};
auto instrument_existing = CreateInstrumentDescriptor("counter");
auto instrument_identical = instrument_existing;
auto instrument_existing = CreateInstrumentDescriptor("counter");
const auto &instrument_identical = instrument_existing;
EXPECT_TRUE(equal_operator(instrument_existing, instrument_identical));

// equal by name with different case
Expand Down Expand Up @@ -127,8 +127,8 @@ TEST(InstrumentDescriptorTest, HashOperator)
InstrumentDescriptorHash hash_operator{};

// identical instrument - hash must match
auto instrument_existing = CreateInstrumentDescriptor("counter");
auto instrument_identical = instrument_existing;
auto instrument_existing = CreateInstrumentDescriptor("counter");
const auto &instrument_identical = instrument_existing;
EXPECT_EQ(hash_operator(instrument_existing), hash_operator(instrument_identical));

// name case conflict - hash must match
Expand Down
8 changes: 4 additions & 4 deletions sdk/test/resource/resource_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,10 @@ TEST(ResourceTest, DerivedResourceDetector)
{
TestResourceDetector detector;

detector.attributes = {{"key", "value"}};
detector.schema_url = "https://opentelemetry.io/schemas/v3.1.4";
const auto resource = detector.Detect();
const auto received_attributes = resource.GetAttributes();
detector.attributes = {{"key", "value"}};
detector.schema_url = "https://opentelemetry.io/schemas/v3.1.4";
const auto resource = detector.Detect();
const auto &received_attributes = resource.GetAttributes();

EXPECT_EQ(received_attributes.size(), 1);
EXPECT_EQ(resource.GetSchemaURL(), detector.schema_url);
Expand Down
Loading