diff --git a/spanner/client.go b/spanner/client.go index 8f14968e04b..1a52fa5abfd 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 eecaad06526..86e44b2c395 100644 --- a/spanner/doc.go +++ b/spanner/doc.go @@ -357,3 +357,8 @@ 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. +// TODO: We will want to automate the version with a bash script. +const clientUserAgent = "spanner-go/v1.12.0"