google-cloud-go icon indicating copy to clipboard operation
google-cloud-go copied to clipboard

fix(bigtable): Error logging for client side metrics

Open bhshkh opened this issue 1 year ago • 1 comments

  1. 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)
  1. 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).
  1. Moving tests for metrics_util.go into their own file.

bhshkh avatar Aug 08 '24 22:08 bhshkh

@igorbernstein2 As discussed, I have removed all the log writes and just prefixed the error messages with bigtable-metrics

bhshkh avatar Aug 28 '24 04:08 bhshkh