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

feat(datastore): add opencensus tracing/stats support #2804

Merged
merged 9 commits into from Sep 18, 2020

Conversation

@AlisskaPie
Copy link
Contributor

@AlisskaPie AlisskaPie commented Sep 1, 2020

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:

  • integration_test.go
  • key.go
  • example_test.go
  • datastore_ test.go

Closes #2805

@google-cla google-cla bot added the cla: yes label Sep 1, 2020
@AlisskaPie AlisskaPie marked this pull request as ready for review Sep 1, 2020
@AlisskaPie AlisskaPie requested a review from tritone as a code owner Sep 1, 2020
@AlisskaPie AlisskaPie requested a review from codyoss Sep 1, 2020
@codyoss
Copy link
Member

@codyoss codyoss commented Sep 1, 2020

FYI, I think we want to be careful here. We should honor WithTelemetryDisabled.

Loading

Copy link
Collaborator

@tritone tritone left a comment

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.

Loading

@@ -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")
Copy link
Collaborator

@tritone tritone Sep 2, 2020

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?

Loading

Copy link
Contributor Author

@AlisskaPie AlisskaPie Sep 3, 2020

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

Loading

datastore/client.go Outdated Show resolved Hide resolved
Loading
datastore/transaction.go Show resolved Hide resolved
Loading
Copy link
Contributor Author

@AlisskaPie AlisskaPie left a comment

Thanks, for quick review.
I've tested an integration test for AllocateIds, and we've passed addOCStatsHandler function and had false for settings.TelemetryDisabled.

Loading

datastore/client.go Outdated Show resolved Hide resolved
Loading
datastore/transaction.go Show resolved Hide resolved
Loading
datastore/transaction.go Show resolved Hide resolved
Loading
datastore/transaction.go Show resolved Hide resolved
Loading
datastore/transaction.go Show resolved Hide resolved
Loading
@tritone tritone merged commit 5e6c350 into googleapis:master Sep 18, 2020
3 checks passed
Loading
@AlisskaPie AlisskaPie deleted the datastore_tracing branch Sep 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants