Skip to content

Commit

Permalink
Set user agent in stackdriver output (influxdata#5901)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkohen authored and danielnelson committed May 24, 2019
1 parent 597814e commit adb7a52
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/outputs/stackdriver/stackdriver.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import (
monitoring "cloud.google.com/go/monitoring/apiv3" // Imports the Stackdriver Monitoring client package.
googlepb "github.com/golang/protobuf/ptypes/timestamp"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/internal"
"github.com/influxdata/telegraf/plugins/outputs"
"google.golang.org/api/option"
metricpb "google.golang.org/genproto/googleapis/api/metric"
monitoredrespb "google.golang.org/genproto/googleapis/api/monitoredres"
monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"
Expand Down Expand Up @@ -88,7 +90,7 @@ func (s *Stackdriver) Connect() error {

if s.client == nil {
ctx := context.Background()
client, err := monitoring.NewMetricClient(ctx)
client, err := monitoring.NewMetricClient(ctx, option.WithUserAgent(internal.ProductToken()))
if err != nil {
return err
}
Expand Down

0 comments on commit adb7a52

Please sign in to comment.