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
feat(datastore): add opencensus tracing/stats support #2804
Conversation
FYI, I think we want to be careful here. We should honor WithTelemetryDisabled. |
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.
Also FYI @codyoss , I believe that WithTelemetryDisabled
is handled here: https://github.com/googleapis/google-api-go-client/blob/00ea0dae70a28d5e659ad288fdee5f7f5ab56a96/transport/grpc/dial.go#L213 . It shouldn't require anything at the manual client layer (at least if transports work the same for gRPC as they do for HTTP).
Not a bad idea to test this manually to confirm, though.
datastore/client.go
Outdated
@@ -50,6 +51,9 @@ func newDatastoreClient(conn grpc.ClientConnInterface, projectID string) pb.Data | |||
} | |||
|
|||
func (dc *datastoreClient) Lookup(ctx context.Context, in *pb.LookupRequest, opts ...grpc.CallOption) (res *pb.LookupResponse, err error) { | |||
ctx = trace.StartSpan(ctx, "cloud.google.com/go/datastore.Lookup") |
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 think the name should be cloud.google.com/go/datastore.datastoreClient.Lookup
because it's a method on the client. Similar for other methods in this file. @codyoss do you agree?
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 updated all method names with regard of it
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.
Thanks, for quick review.
I've tested an integration test for AllocateIds
, and we've passed addOCStatsHandler
function and had false for settings.TelemetryDisabled
.
reserveIds
:There wasn't any wrapping function for this operation, only generated in code, so I added one in client.go, is it okay?
P.S. I guess some higher-level functions and tests for
reserveIds
for the following files could be added in another issue:Closes #2805