Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
17 changes: 0 additions & 17 deletions google/cloud/opentelemetry/quickstart/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
16 changes: 8 additions & 8 deletions google/cloud/opentelemetry/quickstart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down