diff --git a/google/cloud/opentelemetry_options.h b/google/cloud/opentelemetry_options.h index ca7f28f060aff..c3c31e37fbce3 100644 --- a/google/cloud/opentelemetry_options.h +++ b/google/cloud/opentelemetry_options.h @@ -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 { @@ -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. @@ -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