Repository navigation
feat(secretmanager): add OpenTelemetry distributed tracing samples - #14647
chalmerlowe wants to merge 7 commits into
Conversation
Add standalone snippets and unit test suites demonstrating native OpenTelemetry distributed tracing for SecretManagerServiceClient and SecretManagerServiceAsyncClient: - Basic quickstart snippet using ConsoleSpanExporter and environment variable activation - Google Cloud Trace exporter sample using CloudTraceSpanExporter and BatchSpanProcessor - Programmatic configuration sample using ClientOptions(tracer_provider=...) - Asynchronous client sample using SecretManagerServiceAsyncClient - Mocked unit test suites with conftest fixture for isolated test execution
There was a problem hiding this comment.
Code Review
This pull request introduces new Python snippets and unit tests demonstrating OpenTelemetry distributed tracing with the Secret Manager client libraries, covering synchronous, asynchronous, programmatic, and Google Cloud Trace configurations. The feedback highlights a critical anti-pattern where the global TracerProvider is initialized and shut down inside reusable functions, which can cause silent failures on subsequent invocations. The reviewer recommends moving the TracerProvider lifecycle management to the main entry points, updating the unit tests to set the global provider directly, and importing the root secretmanager module in the async snippet for consistency.
…artext secret logging
…et_version snippet
…tures into conftest.py
|
Here is the summary of changes. You are about to add 4 region tags.
This comment is generated by snippet-bot.
|
Add OpenTelemetry distributed tracing samples for Secret Manager.
There is a push to add OpenTelemetry (Observability) support to the GAPIC generated libraries.
This is a collection of samples that applies to Secret Manager, but is intended to help users of any GAPIC generated library to take advantage of the new Observability capabilities that are rolling out.
Note
For clarity:
secretmanager,translate, etc.