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 This human has signed the Contributor License Agreement. label Sep 1, 2020
@AlisskaPie AlisskaPie marked this pull request as ready for review September 1, 2020 10:54
@codyoss
Copy link
Member

codyoss commented Sep 1, 2020

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

Copy link
Contributor

@tritone tritone left a 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.

@@ -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
Contributor

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?

Copy link
Contributor Author

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

datastore/client.go Outdated Show resolved Hide resolved
datastore/transaction.go Show resolved Hide resolved
@product-auto-label product-auto-label bot added the api: datastore Issues related to the Datastore API. label Sep 2, 2020
Copy link
Contributor Author

@AlisskaPie AlisskaPie left a 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.

datastore/client.go Outdated Show resolved Hide resolved
datastore/transaction.go Show resolved Hide resolved
datastore/transaction.go Show resolved Hide resolved
datastore/transaction.go Show resolved Hide resolved
datastore/transaction.go Show resolved Hide resolved
@tritone tritone added the automerge Merge the pull request once unit tests and other checks pass. label Sep 18, 2020
@tritone tritone merged commit 5e6c350 into googleapis:master Sep 18, 2020
@AlisskaPie AlisskaPie deleted the datastore_tracing branch September 30, 2020 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API. automerge Merge the pull request once unit tests and other checks pass. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

datastore: add OpenCensus spans to all Datastore clients
4 participants