Skip to content

Commit a892095

Browse files
authored
Merge branch 'main' into fix_get_tracer_abiv2_2032
2 parents ecf6db7 + d9ad76f commit a892095

4 files changed

Lines changed: 35 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Increment the:
1717

1818
* [BUILD] Remove WITH_REMOVE_METER_PREVIEW, use WITH_ABI_VERSION_2 instead
1919
[#2370](https://github.com/open-telemetry/opentelemetry-cpp/pull/2370)
20+
* [BUILD] Make WITH_OTLP_HTTP_SSL_PREVIEW mainstream
21+
[#2378](https://github.com/open-telemetry/opentelemetry-cpp/pull/2378)
2022
* [API] Add InstrumentationScope attributes in TracerProvider::GetTracer()
2123
[#2371](https://github.com/open-telemetry/opentelemetry-cpp/pull/2371)
2224

@@ -30,6 +32,15 @@ Important changes:
3032
* When building with `CMake` option `WITH_ABI_VERSION_1=ON` (by default)
3133
the `ABI` is unchanged, and the fix is not available.
3234

35+
* [BUILD] Make WITH_OTLP_HTTP_SSL_PREVIEW mainstream
36+
[#2378](https://github.com/open-telemetry/opentelemetry-cpp/pull/2378)
37+
* The experimental `CMake` option `WITH_OTLP_HTTP_SSL_PREVIEW`
38+
is now promoted to stable. The default is changed to `ON`.
39+
* The experimental `CMake` option `WITH_OTLP_HTTP_SSL_TLS_PREVIEW`
40+
is now promoted to stable. The default is changed to `ON`.
41+
* These build options are scheduled to be removed by the next release,
42+
building without SSL/TLS will no longer be possible.
43+
3344
Breaking changes:
3445

3546
* [BUILD] Remove WITH_REMOVE_METER_PREVIEW, use WITH_ABI_VERSION_2 instead

CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,12 @@ endif()
275275

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

278-
# EXPERIMENTAL
279-
option(WITH_OTLP_HTTP_SSL_PREVIEW "Whether to enable otlp http ssl export" OFF)
278+
# STABLE
279+
option(WITH_OTLP_HTTP_SSL_PREVIEW "Whether to enable otlp http ssl export" ON)
280280

281-
# EXPERIMENTAL
281+
# STABLE
282282
option(WITH_OTLP_HTTP_SSL_TLS_PREVIEW
283-
"Whether to enable otlp http ssl tls min/max/cipher options" OFF)
283+
"Whether to enable otlp http ssl tls min/max/cipher options" ON)
284284

285285
# Exemplar specs status is experimental, so behind feature flag by default
286286
option(WITH_METRICS_EXEMPLAR_PREVIEW

sdk/include/opentelemetry/sdk/metrics/aggregation/default_aggregation.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ class DefaultAggregation
3535
case AggregationType::kSum:
3636
return (instrument_descriptor.value_type_ == InstrumentValueType::kLong)
3737
? std::move(std::unique_ptr<Aggregation>(new LongSumAggregation(is_monotonic)))
38-
: std::move(std::unique_ptr<Aggregation>(new DoubleSumAggregation(true)));
38+
: std::move(
39+
std::unique_ptr<Aggregation>(new DoubleSumAggregation(is_monotonic)));
3940
break;
4041
case AggregationType::kHistogram: {
4142
if (instrument_descriptor.value_type_ == InstrumentValueType::kLong)

sdk/test/metrics/sum_aggregation_test.cc

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,12 @@ TEST(CounterToSum, Double)
121121
ASSERT_EQ(1000275.0, opentelemetry::nostd::get<double>(actual.value_));
122122
}
123123

124-
TEST(UpDownCounterToSum, Double)
124+
class UpDownCounterToSumFixture : public ::testing::TestWithParam<bool>
125+
{};
126+
127+
TEST_P(UpDownCounterToSumFixture, Double)
125128
{
129+
bool is_matching_view = GetParam();
126130
MeterProvider mp;
127131
auto m = mp.GetMeter("meter1", "version1", "schema1");
128132
std::string instrument_name = "updowncounter1";
@@ -133,13 +137,16 @@ TEST(UpDownCounterToSum, Double)
133137
std::shared_ptr<MetricReader> reader{new MockMetricReader(std::move(exporter))};
134138
mp.AddMetricReader(reader);
135139

136-
std::unique_ptr<View> view{
137-
new View("view1", "view1_description", instrument_unit, AggregationType::kSum)};
138-
std::unique_ptr<InstrumentSelector> instrument_selector{
139-
new InstrumentSelector(InstrumentType::kUpDownCounter, instrument_name, instrument_unit)};
140-
std::unique_ptr<MeterSelector> meter_selector{new MeterSelector("meter1", "version1", "schema1")};
141-
mp.AddView(std::move(instrument_selector), std::move(meter_selector), std::move(view));
142-
140+
if (is_matching_view)
141+
{
142+
std::unique_ptr<View> view{
143+
new View("view1", "view1_description", instrument_unit, AggregationType::kSum)};
144+
std::unique_ptr<InstrumentSelector> instrument_selector{
145+
new InstrumentSelector(InstrumentType::kUpDownCounter, instrument_name, instrument_unit)};
146+
std::unique_ptr<MeterSelector> meter_selector{
147+
new MeterSelector("meter1", "version1", "schema1")};
148+
mp.AddView(std::move(instrument_selector), std::move(meter_selector), std::move(view));
149+
}
143150
auto h = m->CreateDoubleUpDownCounter(instrument_name, instrument_desc, instrument_unit);
144151

145152
h->Add(5, {});
@@ -168,4 +175,7 @@ TEST(UpDownCounterToSum, Double)
168175
const auto &actual = actuals.at(0);
169176
ASSERT_EQ(15.0, opentelemetry::nostd::get<double>(actual.value_));
170177
}
178+
INSTANTIATE_TEST_SUITE_P(UpDownCounterToSum,
179+
UpDownCounterToSumFixture,
180+
::testing::Values(true, false));
171181
#endif

0 commit comments

Comments
 (0)