From be88d0793e6c0825050037140e8c3d95e0cd0fed Mon Sep 17 00:00:00 2001 From: mohanli-ml Date: Tue, 15 Dec 2020 03:47:53 +0000 Subject: [PATCH] feat(spanner): include User agent --- spanner/client.go | 1 + spanner/doc.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/spanner/client.go b/spanner/client.go index eb5ff9798d36..6785c2a09a86 100644 --- a/spanner/client.go +++ b/spanner/client.go @@ -177,6 +177,7 @@ func NewClientWithConfig(ctx context.Context, database string, config ClientConf ), ), option.WithGRPCConnectionPool(config.NumChannels), + option.WithUserAgent(clientUserAgent), } // opts will take precedence above allOpts, as the values in opts will be // applied after the values in allOpts. diff --git a/spanner/doc.go b/spanner/doc.go index eecaad06526d..eac06ddd944f 100644 --- a/spanner/doc.go +++ b/spanner/doc.go @@ -357,3 +357,7 @@ at https://godoc.org/go.opencensus.io/trace. OpenCensus tracing requires Go 1.8 or higher. */ package spanner // import "cloud.google.com/go/spanner" + +// clientUserAgent identifies the version of this package. +// It should be the same as https://pkg.go.dev/cloud.google.com/go/spanner. +const clientUserAgent = "spanner-go/v1.12.0"