Skip to content

Commit 0c2c4e1

Browse files
authored
doc(storage): update gRPC docs (googleapis#12031)
Clarify auth and other requirements for direct connectivity. Reduce metrics docs and rely on link to cloud docs instead.
1 parent 80545b2 commit 0c2c4e1

File tree

1 file changed

+30
-43
lines changed

1 file changed

+30
-43
lines changed

storage/doc.go

Lines changed: 30 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -333,12 +333,13 @@ to add a [custom audit logging] header:
333333
334334
# gRPC API
335335
336-
This package includes support for the Cloud Storage gRPC API. The
337-
implementation uses gRPC rather than the Default
338-
JSON & XML APIs to make requests to Cloud Storage.
339-
The Go Storage gRPC client is generally available.
340-
The Notifications, Serivce Account HMAC
341-
and GetServiceAccount RPCs are not supported through the gRPC client.
336+
This package includes support for the [Cloud Storage gRPC API]. This
337+
implementation uses gRPC rather than the default JSON & XML APIs
338+
to make requests to Cloud Storage. All methods on the [Client] support
339+
the gRPC API, with the exception of [GetServiceAccount], [Notification],
340+
and [HMACKey] methods.
341+
342+
The Cloud Storage gRPC API is generally available.
342343
343344
To create a client which will use gRPC, use the alternate constructor:
344345
@@ -349,43 +350,31 @@ To create a client which will use gRPC, use the alternate constructor:
349350
}
350351
// Use client as usual.
351352
352-
Using the gRPC API inside GCP with a bucket in the same region can allow for
353-
[Direct Connectivity] (enabling requests to skip some proxy steps and reducing
354-
response latency). A warning is emmitted if gRPC is not used within GCP to
355-
warn that Direct Connectivity could not be initialized. Direct Connectivity
356-
is not required to access the gRPC API.
353+
One major advantage of the gRPC API is that it can use [Direct Connectivity],
354+
enabling requests to skip some proxy steps and reducing responce latency.
355+
Requirements to use Direct Connectivity include:
356+
357+
- Your application must be running inside Google Cloud.
358+
- Your Cloud Storage [bucket location] must overlap with your VM or compute
359+
environment zone. For example, if your VM is in us-east1a, your bucket
360+
must be located in either us-east1 (single region), nam4 (dual region),
361+
or us (multi-region).
362+
- Your client must use service account authentication.
363+
364+
Additional requirements for Direct Connectivity are documented in the
365+
[Cloud Storage gRPC docs].
357366
358367
Dependencies for the gRPC API may slightly increase the size of binaries for
359368
applications depending on this package. If you are not using gRPC, you can use
360369
the build tag `disable_grpc_modules` to opt out of these dependencies and
361370
reduce the binary size.
362371
363-
The gRPC client emits metrics by default and will export the
364-
gRPC telemetry discussed in [gRFC/66] and [gRFC/78] to
365-
[Google Cloud Monitoring]. The metrics are accessible through Cloud Monitoring
366-
API and you incur no additional cost for publishing the metrics. Google Cloud
367-
Support can use this information to more quickly diagnose problems related to
368-
GCS and gRPC.
369-
Sending this data does not incur any billing charges, and requires minimal
370-
CPU (a single RPC every minute) or memory (a few KiB to batch the
371-
telemetry).
372-
373-
To access the metrics you can view them through Cloud Monitoring
374-
[metric explorer] with the prefix `storage.googleapis.com/client`. Metrics are emitted
375-
every minute.
376-
377-
You can disable metrics using the following example when creating a new gRPC
378-
client using [WithDisabledClientMetrics].
379-
380-
The metrics exporter uses Cloud Monitoring API which determines
381-
project ID and credentials doing the following:
382-
383-
* Project ID is determined using OTel Resource Detector for the environment
384-
otherwise it falls back to the project provided by [google.FindCredentials].
385-
386-
* Credentials are determined using [Application Default Credentials]. The
387-
principal must have `roles/monitoring.metricWriter` role granted. If not a
388-
logged warning will be emitted. Subsequent are silenced to prevent noisy logs.
372+
The gRPC client is instrumented with Open Telemetry metrics which export to
373+
Cloud Monitoring by default. More information is available in the
374+
[gRPC client-side metrics] documentation, including information about
375+
roles which must be enabled in order to do the export successfully. To
376+
disable this export, you can use the [WithDisabledClientMetrics] client
377+
option.
389378
390379
# Storage Control API
391380
@@ -394,11 +383,6 @@ and Managed Folder operations) are supported via the autogenerated Storage Contr
394383
client, which is available as a subpackage in this module. See package docs at
395384
[cloud.google.com/go/storage/control/apiv2] or reference the [Storage Control API] docs.
396385
397-
[Application Default Credentials]: https://cloud.google.com/docs/authentication/application-default-credentials
398-
[google.FindCredentials]: https://pkg.go.dev/golang.org/x/oauth2/google#FindDefaultCredentials
399-
[gRFC/66]: https://github.com/grpc/proposal/blob/master/A66-otel-stats.md
400-
[gRFC/78]: https://github.com/grpc/proposal/blob/master/A78-grpc-metrics-wrr-pf-xds.md
401-
[Google Cloud Monitoring]: https://cloud.google.com/monitoring/docs
402386
[Cloud Storage IAM docs]: https://cloud.google.com/storage/docs/access-control/iam
403387
[XML POST Object docs]: https://cloud.google.com/storage/docs/xml-api/post-object
404388
[Cloud Storage retry docs]: https://cloud.google.com/storage/docs/retry-strategy
@@ -408,7 +392,10 @@ client, which is available as a subpackage in this module. See package docs at
408392
[IAM Service Account Credentials API]: https://console.developers.google.com/apis/api/iamcredentials.googleapis.com/overview
409393
[custom audit logging]: https://cloud.google.com/storage/docs/audit-logging#add-custom-metadata
410394
[Storage Control API]: https://cloud.google.com/storage/docs/reference/rpc/google.storage.control.v2
411-
[metric explorer]: https://console.cloud.google.com/projectselector/monitoring/metrics-explorer
395+
[Cloud Storage gRPC API]: https://cloud.google.com/storage/docs/enable-grpc-api
412396
[Direct Connectivity]: https://cloud.google.com/vpc-service-controls/docs/set-up-private-connectivity#direct-connectivity
397+
[bucket location]: https://cloud.google.com/storage/docs/locations
398+
[Cloud Storage gRPC docs]: https://cloud.google.com/storage/docs/enable-grpc-api#limitations
399+
[gRPC client-side metrics]: https://cloud.google.com/storage/docs/client-side-metrics
413400
*/
414401
package storage // import "cloud.google.com/go/storage"

0 commit comments

Comments
 (0)