Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add OC stats example code #568

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

c24t
Copy link
Contributor

@c24t c24t commented Sep 13, 2021

Fixes GoogleCloudPlatform/python-docs-samples#6514 🦕,

Moved from GoogleCloudPlatform/python-docs-samples#6515.

The last PR included this note:

Note that we need to do extra work to instrument gRPC to emit the stats we're collecting here. We may want to wait to merge this PR or include this in public docs until we make the required gRPC changes.

But to make this clearer: this code won't emit gRPC stats because gRPC-python itself doesn't support OpenCensus tracing. See https://opencensus.io/guides/grpc/.

The sample also uses measures and views from the OpenCensus gRPC Stats
specification
. These ought to be moved somewhere like opencensus-ext-grpc.

@larkee I put these samples in a separate samples/opencensus/ dir because the other samples don't require OC, let me know if you want this arranged differently.

@c24t c24t requested review from a team as code owners September 13, 2021 22:42
@c24t c24t requested a review from tmatsuo September 13, 2021 22:42
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Sep 13, 2021
@snippet-bot
Copy link

snippet-bot bot commented Sep 13, 2021

Here is the summary of changes.

You are about to add 1 region tag.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/python-spanner API. label Sep 13, 2021
The example code describes creating OpenCensus measures and views, and
registering a stats exporter to export metrics to Cloud Monitoring.
Stats definitions are taken from the OpenCensus gRPC Stats
specification:
https://github.com/census-instrumentation/opencensus-specs/blob/80abe4c67b5322ba6f2254c105d4967f0f46ea99/stats/gRPC.md.
@c24t c24t changed the title Add OC stats example code docs: Add OC stats example code Sep 15, 2021
@dandhlee dandhlee requested a review from a team as a code owner February 19, 2022 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/python-spanner API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Cloud Spanner OpenCensus integration samples
4 participants