fix: migrate to cloud.google.com/go/monitoring/apiv3/v2 (#9880)
This commit is contained in:
parent
282ec85cd7
commit
15753a6f7f
|
|
@ -9,7 +9,7 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
monitoring "cloud.google.com/go/monitoring/apiv3"
|
||||
monitoring "cloud.google.com/go/monitoring/apiv3/v2"
|
||||
googlepbduration "github.com/golang/protobuf/ptypes/duration"
|
||||
googlepbts "github.com/golang/protobuf/ptypes/timestamp"
|
||||
"github.com/influxdata/telegraf"
|
||||
|
|
@ -397,7 +397,7 @@ func (s *Stackdriver) newTimeSeriesConf(
|
|||
StartTime: &googlepbts.Timestamp{Seconds: startTime.Unix()},
|
||||
}
|
||||
tsReq := &monitoringpb.ListTimeSeriesRequest{
|
||||
Name: monitoring.MetricProjectPath(s.Project),
|
||||
Name: fmt.Sprintf("projects/%s", s.Project),
|
||||
Filter: filter,
|
||||
Interval: interval,
|
||||
}
|
||||
|
|
@ -533,7 +533,7 @@ func (s *Stackdriver) generatetimeSeriesConfs(
|
|||
|
||||
ret := []*timeSeriesConf{}
|
||||
req := &monitoringpb.ListMetricDescriptorsRequest{
|
||||
Name: monitoring.MetricProjectPath(s.Project),
|
||||
Name: fmt.Sprintf("projects/%s", s.Project),
|
||||
}
|
||||
|
||||
filters := s.newListMetricDescriptorsFilters()
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import (
|
|||
"sort"
|
||||
"strings"
|
||||
|
||||
monitoring "cloud.google.com/go/monitoring/apiv3" // Imports the Stackdriver Monitoring client package.
|
||||
monitoring "cloud.google.com/go/monitoring/apiv3/v2" // Imports the Stackdriver Monitoring client package.
|
||||
googlepb "github.com/golang/protobuf/ptypes/timestamp"
|
||||
"github.com/influxdata/telegraf"
|
||||
"github.com/influxdata/telegraf/internal"
|
||||
|
|
@ -218,7 +218,7 @@ func (s *Stackdriver) Write(metrics []telegraf.Metric) error {
|
|||
|
||||
// Prepare time series request.
|
||||
timeSeriesRequest := &monitoringpb.CreateTimeSeriesRequest{
|
||||
Name: monitoring.MetricProjectPath(s.Project),
|
||||
Name: fmt.Sprintf("projects/%s", s.Project),
|
||||
TimeSeries: timeSeries,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
monitoring "cloud.google.com/go/monitoring/apiv3"
|
||||
monitoring "cloud.google.com/go/monitoring/apiv3/v2"
|
||||
"github.com/golang/protobuf/proto"
|
||||
emptypb "github.com/golang/protobuf/ptypes/empty"
|
||||
googlepb "github.com/golang/protobuf/ptypes/timestamp"
|
||||
|
|
|
|||
Loading…
Reference in New Issue