-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Bigtable: integrate OpenCensus tracing into the bigtable data client #4493
Merged
igorbernstein2
merged 12 commits into
googleapis:master
from
igorbernstein2:data-tracing
Feb 26, 2019
Merged
Changes from 9 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
296f8c3
WIP: integrate OpenCensus tracing into the bigtable data client
igorbernstein2 05e13b6
doc
igorbernstein2 8579ac1
format
igorbernstein2 71c2658
Merge commit '9cf9e1a59b7b478a99764bdaa9e21f35c09397ae' into data-tra…
igorbernstein2 7407096
fix tracing for bulk mutations
igorbernstein2 60d1e13
Add instructions for tracing to readme
igorbernstein2 ed5e5a8
format
igorbernstein2 10e2148
Merge remote-tracking branch 'origin/master' into data-tracing
igorbernstein2 b485322
fix todo comment
igorbernstein2 7983fd4
typo in readme
igorbernstein2 c48e4e1
address feedback
igorbernstein2 8c1a89c
format
igorbernstein2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...d-bigtable/src/main/java/com/google/cloud/bigtable/gaxx/tracing/WrappedTracerFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright 2019 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.google.cloud.bigtable.gaxx.tracing; | ||
|
||
import com.google.api.core.InternalApi; | ||
import com.google.api.gax.tracing.ApiTracer; | ||
import com.google.api.gax.tracing.ApiTracerFactory; | ||
import com.google.api.gax.tracing.SpanName; | ||
|
||
/** | ||
* Simple wrapper around {@link ApiTracerFactory} to augment the client name of the generated | ||
* traces. | ||
* | ||
* <p>This is used to disambiguate traces in underlying GAPIC client from the manually written | ||
* overlay. | ||
* | ||
* <p>For internal use, public for technical reasons. | ||
*/ | ||
@InternalApi | ||
public class WrappedTracerFactory implements ApiTracerFactory { | ||
private final ApiTracerFactory innerFactory; | ||
private final String clientName; | ||
|
||
public WrappedTracerFactory(ApiTracerFactory tracerFactory, String clientName) { | ||
this.innerFactory = tracerFactory; | ||
this.clientName = clientName; | ||
} | ||
|
||
@Override | ||
public ApiTracer newTracer(ApiTracer parent, SpanName spanName, OperationType operationType) { | ||
spanName = SpanName.of(clientName, spanName.getMethodName()); | ||
|
||
return innerFactory.newTracer(parent, spanName, operationType); | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how to ensure that the opencensus versions in this readme stay up to date with google-cloud-clients/pom.xml properties. I thought about using version markers, but those seem to only be used for internal artifacts. It would be awesome if version.txt could be generalized to manage static external versions as well.