From aa495922a6578b6bf261010cdb59d84c3e3861da Mon Sep 17 00:00:00 2001 From: Scott Hart Date: Wed, 11 Feb 2026 13:59:52 -0500 Subject: [PATCH 1/2] impl(v3): update opentelemetry quickstart --- google/cloud/opentelemetry/quickstart/.bazelrc | 17 ----------------- .../cloud/opentelemetry/quickstart/README.md | 18 +++++++++--------- 2 files changed, 9 insertions(+), 26 deletions(-) diff --git a/google/cloud/opentelemetry/quickstart/.bazelrc b/google/cloud/opentelemetry/quickstart/.bazelrc index f31313cf406a4..c8de5504a2d7d 100644 --- a/google/cloud/opentelemetry/quickstart/.bazelrc +++ b/google/cloud/opentelemetry/quickstart/.bazelrc @@ -15,12 +15,9 @@ # Use host-OS-specific config lines from bazelrc files. build --enable_platform_specific_config=true - - build:linux --cxxopt=-std=c++17 build:macos --cxxopt=-std=c++17 - build:linux --host_cxxopt=-std=c++17 build:macos --host_cxxopt=-std=c++17 @@ -29,20 +26,6 @@ build:macos --host_cxxopt=-std=c++17 # the project separately. build --experimental_convenience_symlinks=ignore -# Enable OpenTelemetry tracing instrumentation for google-cloud-cpp. -build --@google_cloud_cpp//:enable_opentelemetry - -# OpenTelemetry versions < v1.16.0 are not compatible with Abseil -# out-of-the-box. If you are using a version of OpenTelemetry < v1.16.0, -# uncomment the following configuration: -# -# ``` -# build --@io_opentelemetry_cpp//api:with_abseil -# ``` -# -# Note that the flag is not required for OpenTelemetry versions >= v1.16.0. In -# fact, the flag may be removed in future versions of OpenTelemetry. - #Our quickstarts do not yet support bzlmod build --noenable_bzlmod build --enable_workspace diff --git a/google/cloud/opentelemetry/quickstart/README.md b/google/cloud/opentelemetry/quickstart/README.md index 673e63e41ca12..69303546af587 100644 --- a/google/cloud/opentelemetry/quickstart/README.md +++ b/google/cloud/opentelemetry/quickstart/README.md @@ -42,12 +42,11 @@ observability into their operation at runtime. To enable tracing, OpenTelemetry provides full [install instructions][opentelemetry-cpp-install]. We will highlight the important points. -### Compatibility with Abseil +### Standard Template Library (STL) types -OpenTelemetry vendors-in Abseil types, defining them in `namespace absl`. The -Google Cloud client libraries depends on Abseil, which also defines these types -in the same namespace. In order to avoid ambiguous symbols, we must set certain -flags when compiling `opentelemetry-cpp`. +OpenTelemetry provides implementations for some STL types via several sources: +Abseil, its own `nostd` implementation, and the STL bundled with your compiler. +The `google-cloud-cpp` libraries require using the STL implementation. ## Using with Bazel @@ -117,8 +116,8 @@ To enable these features, add the following to your CMake configuration command: #### Details -We must supply the `-DWITH_ABSEIL=ON` flag when compiling `opentelemetry-cpp` -for compatibility with Abseil. +We must supply the `-DWITH_STL=17` flag when compiling `opentelemetry-cpp` for +compatibility with Abseil. We must also ensure that the `-DCMAKE_CXX_STANDARD` used to compile `opentelemetry-cpp` matches the language standard used to compile `abseil-cpp`. @@ -126,8 +125,9 @@ We must also ensure that the `-DCMAKE_CXX_STANDARD` used to compile OpenTelemetry defaults the language standard if it is not explicitly set. So it is good practice to explicitly set the language standard. -While OpenTelemetry supports C++>=11, `google-cloud-cpp` requires C++>=14. So -you can use `-DCMAKE_CXX_STANDARD=14`, `-DCMAKE_CXX_STANDARD=17`, or higher. +While OpenTelemetry supports C++>=11, `google-cloud-cpp` requires C++>=17. So +you can use `-DCMAKE_CXX_STANDARD=17`, or higher, just make sure it matches the +standard value in the `-DWITH_STL=xx` flag. ### Package Managers From 9c8aacd7292232ae7a63c5e64ba4b6746a9bb06c Mon Sep 17 00:00:00 2001 From: Scott Hart Date: Wed, 11 Feb 2026 14:12:16 -0500 Subject: [PATCH 2/2] updated cmake flag name --- google/cloud/opentelemetry/quickstart/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/google/cloud/opentelemetry/quickstart/README.md b/google/cloud/opentelemetry/quickstart/README.md index 69303546af587..564bb6dc468dd 100644 --- a/google/cloud/opentelemetry/quickstart/README.md +++ b/google/cloud/opentelemetry/quickstart/README.md @@ -116,8 +116,8 @@ To enable these features, add the following to your CMake configuration command: #### Details -We must supply the `-DWITH_STL=17` flag when compiling `opentelemetry-cpp` for -compatibility with Abseil. +We must supply the `-DWITH_STL=CXX17` flag when compiling `opentelemetry-cpp` +for compatibility with Abseil. We must also ensure that the `-DCMAKE_CXX_STANDARD` used to compile `opentelemetry-cpp` matches the language standard used to compile `abseil-cpp`. @@ -127,7 +127,7 @@ is good practice to explicitly set the language standard. While OpenTelemetry supports C++>=11, `google-cloud-cpp` requires C++>=17. So you can use `-DCMAKE_CXX_STANDARD=17`, or higher, just make sure it matches the -standard value in the `-DWITH_STL=xx` flag. +standard value in the `-DWITH_STL=CXXnn` flag. ### Package Managers