From 7d3eaf79ffe165199fdce2b5297e307c2b0c478e Mon Sep 17 00:00:00 2001 From: Krishna Srinivas Date: Mon, 13 Nov 2017 19:06:51 -0800 Subject: [PATCH] Set Minio user-agent for GCS calls (#5154) --- cmd/gateway-gcs.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/gateway-gcs.go b/cmd/gateway-gcs.go index 3c48c5ece..a3780d10d 100644 --- a/cmd/gateway-gcs.go +++ b/cmd/gateway-gcs.go @@ -39,6 +39,7 @@ import ( cloudresourcemanager "google.golang.org/api/cloudresourcemanager/v1" "google.golang.org/api/googleapi" "google.golang.org/api/iterator" + "google.golang.org/api/option" ) var ( @@ -381,7 +382,9 @@ func newGCSGatewayLayer(projectID string) (GatewayLayer, error) { } // Initialize a GCS client. - client, err := storage.NewClient(ctx) + // Send user-agent in this format for Google to obtain usage insights while participating in the + // Google Cloud Technology Partners (https://cloud.google.com/partners/) + client, err := storage.NewClient(ctx, option.WithUserAgent(fmt.Sprintf("Minio/%s (GPN:Minio;)", Version))) if err != nil { return nil, err }