google-cloud-go
google-cloud-go copied to clipboard
fix(bigtable): Error logging for client side metrics
- Use Bigtable client options while creating Metrics client. For e.g. if service account key is getting used to create Bigtable client, same will be used for GCM client. E.g.
serviceAccountKeyFile := "key.json"
credOpt := option.WithCredentialsFile(serviceAccountKeyFile)
adminClient, err = bigtable.NewAdminClient(ctx, project, instance, credOpt)
- Prefixed the errors with "bigtable-metrics: " Unless the user has set their own error handler, error log will be of the format below:
2024/08/28 15:06:46 bigtable-metrics: rpc error: code = PermissionDenied desc = Permission monitoring.timeSeries.create denied (or the resource may not exist).
- Moving tests for metrics_util.go into their own file.
@igorbernstein2 As discussed, I have removed all the log writes and just prefixed the error messages with bigtable-metrics