Skip to content

Commit 1ed7975

Browse files
authored
impl(v3): update opentelemetry quickstart (#15955)
1 parent 7077419 commit 1ed7975

File tree

2 files changed

+8
-25
lines changed

2 files changed

+8
-25
lines changed

google/cloud/opentelemetry/quickstart/.bazelrc

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,9 @@
1515
# Use host-OS-specific config lines from bazelrc files.
1616
build --enable_platform_specific_config=true
1717

18-
19-
2018
build:linux --cxxopt=-std=c++17
2119
build:macos --cxxopt=-std=c++17
2220

23-
2421
build:linux --host_cxxopt=-std=c++17
2522
build:macos --host_cxxopt=-std=c++17
2623

@@ -29,20 +26,6 @@ build:macos --host_cxxopt=-std=c++17
2926
# the project separately.
3027
build --experimental_convenience_symlinks=ignore
3128

32-
# Enable OpenTelemetry tracing instrumentation for google-cloud-cpp.
33-
build --@google_cloud_cpp//:enable_opentelemetry
34-
35-
# OpenTelemetry versions < v1.16.0 are not compatible with Abseil
36-
# out-of-the-box. If you are using a version of OpenTelemetry < v1.16.0,
37-
# uncomment the following configuration:
38-
#
39-
# ```
40-
# build --@io_opentelemetry_cpp//api:with_abseil
41-
# ```
42-
#
43-
# Note that the flag is not required for OpenTelemetry versions >= v1.16.0. In
44-
# fact, the flag may be removed in future versions of OpenTelemetry.
45-
4629
#Our quickstarts do not yet support bzlmod
4730
build --noenable_bzlmod
4831
build --enable_workspace

google/cloud/opentelemetry/quickstart/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,11 @@ observability into their operation at runtime. To enable tracing,
4242
OpenTelemetry provides full [install instructions][opentelemetry-cpp-install].
4343
We will highlight the important points.
4444

45-
### Compatibility with Abseil
45+
### Standard Template Library (STL) types
4646

47-
OpenTelemetry vendors-in Abseil types, defining them in `namespace absl`. The
48-
Google Cloud client libraries depends on Abseil, which also defines these types
49-
in the same namespace. In order to avoid ambiguous symbols, we must set certain
50-
flags when compiling `opentelemetry-cpp`.
47+
OpenTelemetry provides implementations for some STL types via several sources:
48+
Abseil, its own `nostd` implementation, and the STL bundled with your compiler.
49+
The `google-cloud-cpp` libraries require using the STL implementation.
5150

5251
## Using with Bazel
5352

@@ -117,7 +116,7 @@ To enable these features, add the following to your CMake configuration command:
117116

118117
#### Details
119118

120-
We must supply the `-DWITH_ABSEIL=ON` flag when compiling `opentelemetry-cpp`
119+
We must supply the `-DWITH_STL=CXX17` flag when compiling `opentelemetry-cpp`
121120
for compatibility with Abseil.
122121

123122
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
126125
OpenTelemetry defaults the language standard if it is not explicitly set. So it
127126
is good practice to explicitly set the language standard.
128127

129-
While OpenTelemetry supports C++>=11, `google-cloud-cpp` requires C++>=14. So
130-
you can use `-DCMAKE_CXX_STANDARD=14`, `-DCMAKE_CXX_STANDARD=17`, or higher.
128+
While OpenTelemetry supports C++>=11, `google-cloud-cpp` requires C++>=17. So
129+
you can use `-DCMAKE_CXX_STANDARD=17`, or higher, just make sure it matches the
130+
standard value in the `-DWITH_STL=CXXnn` flag.
131131

132132
### Package Managers
133133

0 commit comments

Comments
 (0)