Skip to content

Commit 9a17af5

Browse files
authored
[REMOVAL] Remove WITH_OTLP_RETRY_PREVIEW (#4668)
1 parent cf6b168 commit 9a17af5

17 files changed

Lines changed: 37 additions & 140 deletions

‎CHANGELOG.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ Breaking changes:
9898
* [BUG] Keep the curl retry deadline stable within each attempt
9999
[#4452](https://github.com/open-telemetry/opentelemetry-cpp/pull/4452)
100100

101+
* [REMOVAL] Remove WITH_OTLP_RETRY_PREVIEW - #4668
102+
[#4668](https://github.com/open-telemetry/opentelemetry-cpp/pull/4668)
103+
101104
## [1.29.0] 2026-09-13
102105

103106
* [RELEASE] Bump main branch to 1.29.0-dev (#4259)

‎CMakeLists.txt‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,6 @@ if(NOT OTELCPP_WITH_STL STREQUAL "OFF")
170170
endif()
171171
endif()
172172

173-
otelcpp_option_flag(OTELCPP_WITH_OTLP_RETRY_PREVIEW
174-
"Whether to enable retry functionality" ON)
175-
176173
otelcpp_option_flag(OTELCPP_WITH_OTLP_GRPC_SSL_MTLS_PREVIEW
177174
"Whether to enable mTLS support for gRPC" ON)
178175

@@ -639,8 +636,6 @@ message(
639636
STATUS
640637
"OTELCPP_WITH_OTLP_GRPC_CREDENTIAL_PREVIEW: ${OTELCPP_WITH_OTLP_GRPC_CREDENTIAL_PREVIEW}"
641638
)
642-
message(
643-
STATUS "OTELCPP_WITH_OTLP_RETRY_PREVIEW: ${OTELCPP_WITH_OTLP_RETRY_PREVIEW}")
644639
message(
645640
STATUS
646641
"OTELCPP_WITH_METRICS_BOUND_INSTRUMENTS_PREVIEW: ${OTELCPP_WITH_METRICS_BOUND_INSTRUMENTS_PREVIEW}"

‎DEPRECATED.md‎

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ The following legacy CMake option names are deprecated:
9494
| `WITH_OTLP_GRPC_SSL_MTLS_PREVIEW` | `OTELCPP_WITH_OTLP_GRPC_SSL_MTLS_PREVIEW` |
9595
| `WITH_OTLP_HTTP` | `OTELCPP_WITH_OTLP_HTTP` |
9696
| `WITH_OTLP_HTTP_COMPRESSION` | `OTELCPP_WITH_OTLP_HTTP_COMPRESSION` |
97-
| `WITH_OTLP_RETRY_PREVIEW` | `OTELCPP_WITH_OTLP_RETRY_PREVIEW` |
9897
| `WITH_OTLP_UTF8_VALIDITY` | `OTELCPP_WITH_OTLP_UTF8_VALIDITY` |
9998
| `WITH_PROMETHEUS` | `OTELCPP_WITH_PROMETHEUS` |
10099
| `WITH_RESOURCE_DETECTORS_PREVIEW` | `OTELCPP_WITH_RESOURCE_DETECTORS_PREVIEW` |
@@ -119,54 +118,6 @@ both names are set, the `OTELCPP_` name takes precedence.
119118
The legacy CMake option names will be removed in a future release. The
120119
replacement names are not affected by this removal.
121120

122-
### CMake OTELCPP_WITH_OTLP_RETRY_PREVIEW
123-
124-
#### Announcement (OTELCPP_WITH_OTLP_RETRY_PREVIEW)
125-
126-
The CMake compile flag `OTELCPP_WITH_OTLP_RETRY_PREVIEW`, formerly named
127-
`WITH_OTLP_RETRY_PREVIEW`, is deprecated by:
128-
129-
* Enable WITH_OTLP_RETRY_PREVIEW by default
130-
[#3953](https://github.com/open-telemetry/opentelemetry-cpp/pull/3953)
131-
132-
#### Motivation (OTELCPP_WITH_OTLP_RETRY_PREVIEW)
133-
134-
Flags like `OTELCPP_WITH_OTLP_RETRY_PREVIEW` are used to conditionally compile
135-
new features when they are introduced in the code base.
136-
137-
Now that this feature is stable, conditional compilation is no longer
138-
necessary.
139-
140-
#### Scope (OTELCPP_WITH_OTLP_RETRY_PREVIEW)
141-
142-
Remove the `OTELCPP_WITH_OTLP_RETRY_PREVIEW` compilation flag and its legacy
143-
name `WITH_OTLP_RETRY_PREVIEW` from CMake.
144-
145-
Remove the `ENABLE_OTLP_RETRY_PREVIEW` preprocessor condition from C++.
146-
147-
#### Mitigation (OTELCPP_WITH_OTLP_RETRY_PREVIEW)
148-
149-
Applications built with `OTELCPP_WITH_OTLP_RETRY_PREVIEW=ON` or
150-
`WITH_OTLP_RETRY_PREVIEW=ON` need to:
151-
152-
* remove the preview flag from CMake scripts
153-
154-
Applications built with `OTELCPP_WITH_OTLP_RETRY_PREVIEW=OFF` or
155-
`WITH_OTLP_RETRY_PREVIEW=OFF` need to:
156-
157-
* remove the preview flag from CMake scripts
158-
* use `retry_policy_max_attempts` = 0 in the OTLP exporter options.
159-
160-
For Bazel, no compilation option exists,
161-
the bazel build enables unconditionally ENABLE_OTLP_RETRY_PREVIEW.
162-
163-
Make sure to properly initialize `retry_policy_max_attempts`
164-
to enable or disable the retry feature.
165-
166-
#### Planned removal (OTELCPP_WITH_OTLP_RETRY_PREVIEW)
167-
168-
This compilation flag will be removed after October 1st, 2026.
169-
170121
### CMake OTELCPP_WITH_OTLP_GRPC_SSL_MTLS_PREVIEW
171122

172123
#### Announcement (OTELCPP_WITH_OTLP_GRPC_SSL_MTLS_PREVIEW)

‎api/CMakeLists.txt‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,6 @@ if(OTELCPP_WITH_METRICS_BOUND_INSTRUMENTS_PREVIEW)
8787
INTERFACE ENABLE_METRICS_BOUND_INSTRUMENTS_PREVIEW)
8888
endif()
8989

90-
if(OTELCPP_WITH_OTLP_RETRY_PREVIEW)
91-
target_compile_definitions(opentelemetry_api
92-
INTERFACE ENABLE_OTLP_RETRY_PREVIEW)
93-
else()
94-
message(WARNING "OTELCPP_WITH_OTLP_RETRY_PREVIEW=OFF is deprecated")
95-
endif()
96-
9790
if(OTELCPP_WITH_OTLP_GRPC_SSL_MTLS_PREVIEW)
9891
target_compile_definitions(opentelemetry_api
9992
INTERFACE ENABLE_OTLP_GRPC_SSL_MTLS_PREVIEW)

‎ci/do_ci.ps1‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,6 @@ switch ($action) {
554554
-DOTELCPP_WITH_OPENTRACING=OFF `
555555
-DOTELCPP_WITH_OTLP_GRPC_SSL_MTLS_PREVIEW=OFF `
556556
-DOTELCPP_WITH_OTLP_GRPC_CREDENTIAL_PREVIEW=OFF `
557-
-DOTELCPP_WITH_OTLP_RETRY_PREVIEW=OFF `
558557
-DOTELCPP_WITH_OTLP_GRPC=OFF `
559558
-DOTELCPP_WITH_OTLP_HTTP=OFF `
560559
-DOTELCPP_WITH_OTLP_FILE=OFF `

‎ci/do_ci.sh‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ elif [[ "$1" == "cmake.maintainer.yaml.test" ]]; then
176176
-DOTELCPP_MAINTAINER_MODE=ON \
177177
-DOTELCPP_WITH_NO_DEPRECATED_CODE=ON \
178178
-DOTELCPP_WITH_OTLP_HTTP_COMPRESSION=ON \
179-
-DOTELCPP_WITH_OTLP_RETRY_PREVIEW=ON \
180179
-DOTELCPP_WITH_THREAD_INSTRUMENTATION_PREVIEW=ON \
181180
-DOTELCPP_WITH_CONFIGURATION=ON \
182181
-DOTELCPP_WITH_RESOURCE_DETECTORS_PREVIEW=ON \
@@ -402,7 +401,6 @@ elif [[ "$1" == "cmake.exporter.otprotocol.test" ]]; then
402401
-DOTELCPP_WITH_OTLP_FILE=ON \
403402
-DOTELCPP_WITH_OTLP_GRPC_SSL_MTLS_PREVIEW=ON \
404403
-DOTELCPP_WITH_OTLP_GRPC_CREDENTIAL_PREVIEW=ON \
405-
-DOTELCPP_WITH_OTLP_RETRY_PREVIEW=ON \
406404
"${SRC_DIR}"
407405
cmake --build . "${CMAKE_BUILD_ARGS[@]}"
408406
ctest --output-on-failure
@@ -587,7 +585,6 @@ elif [[ "$1" == "cmake.legacy_options.test" ]]; then
587585
-DWITH_NO_DEPRECATED_CODE=ON \
588586
-DWITH_STL=ON \
589587
-DWITH_GSL=ON \
590-
-DWITH_OTLP_RETRY_PREVIEW=OFF \
591588
-DWITH_OTLP_GRPC_SSL_MTLS_PREVIEW=OFF \
592589
-DWITH_OTLP_GRPC_CREDENTIAL_PREVIEW=ON \
593590
-DWITH_OTLP_GRPC=ON \
@@ -625,7 +622,6 @@ elif [[ "$1" == "cmake.legacy_options.test" ]]; then
625622
WITH_NO_DEPRECATED_CODE \
626623
WITH_STL \
627624
WITH_GSL \
628-
WITH_OTLP_RETRY_PREVIEW \
629625
WITH_OTLP_GRPC_SSL_MTLS_PREVIEW \
630626
WITH_OTLP_GRPC_CREDENTIAL_PREVIEW \
631627
WITH_OTLP_GRPC \
@@ -667,7 +663,6 @@ elif [[ "$1" == "cmake.legacy_options.test" ]]; then
667663
"OTELCPP_WITH_NO_DEPRECATED_CODE:BOOL=ON" \
668664
"OTELCPP_WITH_STL:STRING=ON" \
669665
"OTELCPP_WITH_GSL:BOOL=ON" \
670-
"OTELCPP_WITH_OTLP_RETRY_PREVIEW:BOOL=OFF" \
671666
"OTELCPP_WITH_OTLP_GRPC_SSL_MTLS_PREVIEW:BOOL=OFF" \
672667
"OTELCPP_WITH_OTLP_GRPC_CREDENTIAL_PREVIEW:BOOL=ON" \
673668
"OTELCPP_WITH_OTLP_GRPC:BOOL=ON" \

‎cmake/tools.cmake‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,6 @@ set(_otelcpp_legacy_option_name_OTELCPP_WITH_OTLP_GRPC_SSL_MTLS_PREVIEW
353353
set(_otelcpp_legacy_option_name_OTELCPP_WITH_OTLP_HTTP "WITH_OTLP_HTTP")
354354
set(_otelcpp_legacy_option_name_OTELCPP_WITH_OTLP_HTTP_COMPRESSION
355355
"WITH_OTLP_HTTP_COMPRESSION")
356-
set(_otelcpp_legacy_option_name_OTELCPP_WITH_OTLP_RETRY_PREVIEW
357-
"WITH_OTLP_RETRY_PREVIEW")
358356
set(_otelcpp_legacy_option_name_OTELCPP_WITH_OTLP_UTF8_VALIDITY
359357
"WITH_OTLP_UTF8_VALIDITY")
360358
set(_otelcpp_legacy_option_name_OTELCPP_WITH_PROMETHEUS "WITH_PROMETHEUS")

‎exporters/otlp/BUILD‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ cc_library(
107107
defines = select({
108108
":enable_otlp_grpc_credential_preview": ["ENABLE_OTLP_GRPC_CREDENTIAL_PREVIEW"],
109109
"//conditions:default": [],
110-
}) + ["ENABLE_OTLP_GRPC_SSL_MTLS_PREVIEW"] + ["ENABLE_OTLP_RETRY_PREVIEW"],
110+
}) + ["ENABLE_OTLP_GRPC_SSL_MTLS_PREVIEW"],
111111
strip_include_prefix = "include",
112112
tags = [
113113
"otlp",
@@ -796,7 +796,6 @@ cc_test(
796796
cc_test(
797797
name = "otlp_http_exporter_test",
798798
srcs = ["test/otlp_http_exporter_test.cc"],
799-
defines = ["ENABLE_OTLP_RETRY_PREVIEW"],
800799
tags = [
801800
"otlp",
802801
"otlp_http",

‎exporters/otlp/src/otlp_grpc_client.cc‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,19 @@
77
#include <grpcpp/resource_quota.h>
88
#include <grpcpp/security/credentials.h>
99
#include <grpcpp/support/channel_arguments.h>
10+
#include <algorithm>
1011
#include <atomic>
1112
#include <chrono>
1213
#include <cstdint>
14+
#include <cstdio>
1315
#include <fstream>
1416
#include <iterator>
1517
#include <memory>
1618
#include <string>
1719
#include <utility>
1820

1921
#include "opentelemetry/ext/http/common/url_parser.h"
22+
#include "opentelemetry/nostd/string_view.h"
2023
#include "opentelemetry/sdk/common/global_log_handler.h"
2124

2225
// clang-format off
@@ -31,14 +34,11 @@
3134
// clang-format on
3235

3336
#ifdef ENABLE_ASYNC_EXPORT
34-
# include <algorithm>
3537
# include <condition_variable>
36-
# include <cstdio>
3738
# include <mutex>
3839
# include <unordered_set>
3940

4041
# include "opentelemetry/common/timestamp.h"
41-
# include "opentelemetry/nostd/string_view.h"
4242
#endif /* ENABLE_ASYNC_EXPORT */
4343

4444
OPENTELEMETRY_BEGIN_NAMESPACE
@@ -414,7 +414,6 @@ void OtlpGrpcClient::PopulateChannelArguments(const OtlpGrpcClientOptions &optio
414414
grpc_arguments.SetCompressionAlgorithm(GRPC_COMPRESS_GZIP);
415415
}
416416

417-
#ifdef ENABLE_OTLP_RETRY_PREVIEW
418417
if (options.retry_policy_max_attempts > 0U &&
419418
options.retry_policy_initial_backoff > std::chrono::duration<float>::zero() &&
420419
options.retry_policy_max_backoff > std::chrono::duration<float>::zero() &&
@@ -453,7 +452,6 @@ void OtlpGrpcClient::PopulateChannelArguments(const OtlpGrpcClientOptions &optio
453452

454453
grpc_arguments.SetServiceConfigJSON(service_config);
455454
}
456-
#endif // ENABLE_OTLP_RETRY_PREVIEW
457455
}
458456

459457
std::unique_ptr<grpc::ClientContext> OtlpGrpcClient::MakeClientContext(

‎exporters/otlp/test/otlp_grpc_exporter_test.cc‎

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@
88
#include <cstddef>
99
#include <cstdlib>
1010
#include <functional>
11+
#include <future>
1112
#include <map>
1213
#include <mutex>
1314
#include <string>
1415
#include <thread>
16+
#include <tuple>
1517
#include <utility>
18+
#include <variant>
1619
#include <vector>
1720
#include "gmock/gmock.h"
1821

1922
#include "opentelemetry/exporters/otlp/otlp_grpc_exporter.h"
23+
#include "opentelemetry/exporters/otlp/otlp_grpc_exporter_factory.h"
2024
#include "opentelemetry/exporters/otlp/otlp_grpc_exporter_options.h"
2125
#include "opentelemetry/nostd/shared_ptr.h"
2226
#include "opentelemetry/nostd/span.h"
@@ -26,7 +30,9 @@
2630
#include "opentelemetry/sdk/trace/processor.h"
2731
#include "opentelemetry/sdk/trace/recordable.h"
2832
#include "opentelemetry/sdk/trace/simple_processor.h"
33+
#include "opentelemetry/sdk/trace/simple_processor_factory.h"
2934
#include "opentelemetry/sdk/trace/tracer_provider.h"
35+
#include "opentelemetry/sdk/trace/tracer_provider_factory.h"
3036
#include "opentelemetry/test_common/sdk/common/scoped_test_log_handler.h"
3137
#include "opentelemetry/trace/span.h"
3238
#include "opentelemetry/trace/tracer.h"
@@ -43,19 +49,8 @@
4349

4450
// IWYU pragma: no_include <grpc/support/port_platform.h>
4551
// IWYU pragma: no_include <grpcpp/support/status.h>
46-
47-
#ifdef ENABLE_OTLP_RETRY_PREVIEW
48-
# include <future>
49-
# include <tuple>
50-
# include <variant>
51-
5252
// IWYU pragma: no_include <grpcpp/security/server_credentials.h>
5353

54-
# include "opentelemetry/exporters/otlp/otlp_grpc_exporter_factory.h"
55-
# include "opentelemetry/sdk/trace/simple_processor_factory.h"
56-
# include "opentelemetry/sdk/trace/tracer_provider_factory.h"
57-
#endif
58-
5954
#if defined(_MSC_VER)
6055
# include "opentelemetry/sdk/common/env_variables.h"
6156
using opentelemetry::sdk::common::setenv;
@@ -620,7 +615,6 @@ TEST_F(OtlpGrpcExporterTestPeer, ConfigRetryGenericValuesFromEnv)
620615
}
621616
#endif // NO_GETENV
622617

623-
#ifdef ENABLE_OTLP_RETRY_PREVIEW
624618
namespace
625619
{
626620
struct TestTraceService : public opentelemetry::proto::collector::trace::v1::TraceService::Service
@@ -780,7 +774,6 @@ TEST_P(OtlpGrpcExporterRetryIntegrationTests, StatusCodes)
780774

781775
ASSERT_EQ(expected_attempts, service.request_count_);
782776
}
783-
#endif // ENABLE_OTLP_RETRY_PREVIEW
784777

785778
} // namespace otlp
786779
} // namespace exporter

0 commit comments

Comments
 (0)