Skip to content

Commit

Permalink
option always exists
Browse files Browse the repository at this point in the history
  • Loading branch information
dbolduc committed Jun 14, 2023
1 parent 327548f commit fab82f2
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions google/cloud/opentelemetry_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPENTELEMETRY_OPTIONS_H
#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPENTELEMETRY_OPTIONS_H

#ifdef GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY
#include "google/cloud/version.h"

namespace google {
Expand All @@ -26,20 +25,33 @@ namespace experimental {
/**
* Enables tracing with [OpenTelemetry]
*
* Setting this option enables the *generation* of [traces] by the client
* library. Note that it does not enable the *export* of traces.
* Setting this option enables the generation of [traces] by the client
* library. The library uses the global [tracer provider] to generate traces.
*
* The library uses the global [tracer provider] to generate traces. In order to
* export the traces, the application must set the global tracer provider. The
* client library recommends using
* @par Prerequisites
* The library must be compiled with OpenTelemetry in order for this option to
* take effect.
*
* @see [The OpenTelemetry tracing quickstart][gc-quickstart] for instructions
* on how to compile google-cloud-cpp with opentelemetry-cpp.
*
* @par Effect
* Setting this option enables the generation of [traces] by the client
* library. The library uses the global [tracer provider] to generate traces.
*
* @par Exporting traces
* Providing this option to a client only enables the *generation* of traces. It
* does not enable the *export* of traces.
*
* In order to export the traces, the application must set the global tracer
* provider. The client library recommends using
* `#google::cloud::otel::ConfigureBasicTracing()` to configure the global
* tracer provider. This will send the traces generated by the client library to
* [Cloud Trace], Google Cloud's visualizer for distributed traces.
*
* @see [The OpenTelemetry tracing quickstart][gc-quickstart].
*
* @see [Google Cloud C++ OpenTelemetry reference docs][gc-otel-docs].
*
* @par Environment variable
* This option is controlled by the `GOOGLE_CLOUD_CPP_OPENTELEMETRY_TRACING`
* environment variable. If the environment variable is set, tracing with
* OpenTelemetry is enabled.
Expand Down Expand Up @@ -67,6 +79,5 @@ struct OpenTelemetryTracingOption {
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
} // namespace cloud
} // namespace google
#endif // GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY

#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_OPENTELEMETRY_OPTIONS_H

0 comments on commit fab82f2

Please sign in to comment.