Skip to content

Cloud Spanner: Adds tracing #2677

Merged
vkedia merged 15 commits into
googleapis:masterfrom
vkedia:tracing
Dec 20, 2017
Merged

Cloud Spanner: Adds tracing #2677
vkedia merged 15 commits into
googleapis:masterfrom
vkedia:tracing

Conversation

@vkedia

@vkedia vkedia commented Dec 2, 2017

Copy link
Copy Markdown

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 2, 2017
Comment thread google-cloud-spanner/pom.xml Outdated
<dependency>
<groupId>io.opencensus</groupId>
<artifactId>opencensus-api</artifactId>
<version>0.6.0</version>

This comment was marked as spam.

}

static void endSpanWithFailure(Span span, SpannerException e) {
span.end(EndSpanOptions.builder()

This comment was marked as spam.

This comment was marked as spam.

.build());
}

private static Status getOpenCensusStatus(ErrorCode code) {

This comment was marked as spam.

This comment was marked as spam.

* environment required to show a consistent set of methods relating to Cloud Bigtable on the
* grpcz page. If HBase artifacts are present, this will add tracing metadata for HBase methods.
*/
private static void setupTracingConfig() {

This comment was marked as spam.

This comment was marked as spam.

} catch (RuntimeException e) {
TraceUtil.endSpanWithFailure(span, e);
throw e;
}

This comment was marked as spam.

This comment was marked as spam.

try (Scope s = tracer.withSpan(span)) {
com.google.spanner.v1.Session session =
runWithRetries(
new Callable<com.google.spanner.v1.Session>() {

This comment was marked as spam.

This comment was marked as spam.

@vkedia vkedia added the api: spanner Issues related to the Spanner API. label Dec 14, 2017
@vkedia vkedia requested a review from vam-google December 16, 2017 01:26

@vam-google vam-google left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I have to approve this PR even though the final result looks not very pretty: a lot of code the only purpose of which is to track execution flow, which significantly complicates the client code and affects readability.

Comment thread google-cloud-spanner/pom.xml Outdated
<groupId>io.opencensus</groupId>
<artifactId>opencensus-api</artifactId>
<exclusions>
<exclusion>

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

*
* TODO: Remove this when we depend on gRPC 1.8
*/
private static void setupTracingConfig() {

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@vkedia

vkedia commented Dec 20, 2017

Copy link
Copy Markdown
Author

@vam-google Thanks for the approval. I agree it does make the code less readable but this is a pretty important feature.

@vkedia vkedia merged commit ccdc935 into googleapis:master Dec 20, 2017
@vkedia vkedia deleted the tracing branch December 20, 2017 21:06
@vkedia vkedia restored the tracing branch December 20, 2017 21:06
chingor13 pushed a commit that referenced this pull request Mar 24, 2026
In this PR:
- Remove CLI in `generate_repo.py` and `generate_pr_description.py`
since these CLIs are migrated to `entry_point.py`.
meltsufin pushed a commit that referenced this pull request Apr 29, 2026
Replace old teams with new ones.
b/479542582
meltsufin pushed a commit that referenced this pull request May 1, 2026
Replace old teams with new ones.
b/479542582
rahul2393 pushed a commit to akash329d/google-cloud-java that referenced this pull request May 21, 2026
Change-Id: Icae25650f2f44f9ebb803da98b587074f91fbaba

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
- [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/java-bigtable/issues/new/choose) before writing your code!  That way we can discuss the change, evaluate designs, and agree on the general idea
- [ ] Ensure the tests and linter pass
- [ ] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)
- [ ] Rollback plan is reviewed and LGTMed
- [ ] All new data plane features have a completed end to end testing plan

Fixes #<issue_number_goes_here> ☕️

If you write sample code, please follow the [samples format](
https://togithub.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md).
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 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.

5 participants