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..564bb6dc468dd 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,7 +116,7 @@ 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` +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 @@ -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=CXXnn` flag. ### Package Managers