Skip to content

Commit

Permalink
feat(spanner): include User agent (#3465)
Browse files Browse the repository at this point in the history
Co-authored-by: Knut Olav Løite <koloite@gmail.com>
  • Loading branch information
mohanli-ml and olavloite authored Dec 22, 2020
1 parent 404b6c6 commit 4e1ef1b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions spanner/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions spanner/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 4e1ef1b

Please sign in to comment.