Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit 2dcf1bf

Browse files
author
Ramon Nogueira
authored
Include OpenCensus base library version in user-agent header (#11)
Fixes: #7
1 parent c6ab546 commit 2dcf1bf

3 files changed

Lines changed: 15 additions & 11 deletions

File tree

Gopkg.lock

Lines changed: 9 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727

2828
[[constraint]]
2929
name = "cloud.google.com/go"
30-
version = ">=0.23.0, <1.0.0"
30+
version = ">=0.23.0"
3131

3232
[[constraint]]
3333
name = "github.com/golang/protobuf"
3434
version = "1.1.0"
3535

3636
[[constraint]]
3737
name = "go.opencensus.io"
38-
version = ">=0.9.0, <1.0.0"
38+
version = ">=0.12.0"
3939

4040
[[constraint]]
4141
branch = "master"

stats.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import (
3232

3333
"cloud.google.com/go/monitoring/apiv3"
3434
"github.com/golang/protobuf/ptypes/timestamp"
35+
"go.opencensus.io/exporterutil"
3536
"google.golang.org/api/option"
3637
"google.golang.org/api/support/bundler"
3738
distributionpb "google.golang.org/genproto/googleapis/api/distribution"
@@ -47,10 +48,11 @@ const (
4748
opencensusTaskKey = "opencensus_task"
4849
opencensusTaskDescription = "Opencensus task identifier"
4950
defaultDisplayNamePrefix = "OpenCensus"
50-
51-
userAgent = "opencensus-go [0.8.0]"
51+
version = "0.3.0"
5252
)
5353

54+
var userAgent = fmt.Sprintf("opencensus-go %s; stackdriver-exporter %s", exporterutil.Version, version)
55+
5456
// statsExporter exports stats to the Stackdriver Monitoring.
5557
type statsExporter struct {
5658
bundler *bundler.Bundler

0 commit comments

Comments
 (0)