Skip to content
This repository was archived by the owner on Dec 3, 2024. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3f39b18

Browse files
authoredJun 21, 2023
Merge pull request #25 from minor-fixes/update_deps
go: Update all dependencies, imports
2 parents 6b3e2bb + 89eb28b commit 3f39b18

File tree

8 files changed

+112
-538
lines changed

8 files changed

+112
-538
lines changed
 

‎.github/workflows/go.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
go: [
16-
'1.15',
17-
'1.16',
1816
'1.17',
19-
'1.18'
17+
'1.18',
18+
'1.19',
19+
'1.20',
2020
]
2121

2222
name: unit

‎example/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// you may not use this file except in compliance with the License.
55
// You may obtain a copy of the License at
66
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
7+
// http://www.apache.org/licenses/LICENSE-2.0
88
//
99
// Unless required by applicable law or agreed to in writing, software
1010
// distributed under the License is distributed on an "AS IS" BASIS,
@@ -27,8 +27,8 @@ import (
2727
stackdriver "github.com/google/go-metrics-stackdriver"
2828

2929
"cloud.google.com/go/compute/metadata"
30-
monitoring "cloud.google.com/go/monitoring/apiv3"
31-
metrics "github.com/armon/go-metrics"
30+
monitoring "cloud.google.com/go/monitoring/apiv3/v2"
31+
metrics "github.com/hashicorp/go-metrics"
3232
)
3333

3434
func main() {

‎go.mod

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,32 @@
11
module github.com/google/go-metrics-stackdriver
22

3-
go 1.15
3+
go 1.17
44

55
require (
6-
cloud.google.com/go v0.101.1 // indirect
7-
cloud.google.com/go/compute v1.6.1
8-
cloud.google.com/go/monitoring v1.5.0
9-
github.com/armon/go-metrics v0.3.11
10-
github.com/golang/protobuf v1.5.2
11-
github.com/google/go-cmp v0.5.8
12-
google.golang.org/api v0.79.0
13-
google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3
14-
google.golang.org/grpc v1.46.2
6+
cloud.google.com/go/compute/metadata v0.2.3
7+
cloud.google.com/go/monitoring v1.14.0
8+
github.com/google/go-cmp v0.5.9
9+
github.com/hashicorp/go-metrics v0.4.2-0.20230519112806-858601465fcd
10+
google.golang.org/api v0.123.0
11+
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1
12+
google.golang.org/grpc v1.55.0
13+
google.golang.org/protobuf v1.30.0
14+
)
15+
16+
require (
17+
cloud.google.com/go/compute v1.19.3 // indirect
18+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
19+
github.com/golang/protobuf v1.5.3 // indirect
20+
github.com/google/s2a-go v0.1.4 // indirect
21+
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
22+
github.com/googleapis/gax-go/v2 v2.8.0 // indirect
23+
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
24+
github.com/hashicorp/golang-lru v0.5.0 // indirect
25+
go.opencensus.io v0.24.0 // indirect
26+
golang.org/x/crypto v0.9.0 // indirect
27+
golang.org/x/net v0.10.0 // indirect
28+
golang.org/x/oauth2 v0.8.0 // indirect
29+
golang.org/x/sys v0.8.0 // indirect
30+
golang.org/x/text v0.9.0 // indirect
31+
google.golang.org/appengine v1.6.7 // indirect
1532
)

‎go.sum

Lines changed: 63 additions & 496 deletions
Large diffs are not rendered by default.

‎stackdriver.go

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ import (
2929
"time"
3030

3131
"cloud.google.com/go/compute/metadata"
32-
monitoring "cloud.google.com/go/monitoring/apiv3"
33-
metrics "github.com/armon/go-metrics"
34-
googlepb "github.com/golang/protobuf/ptypes/timestamp"
32+
monitoring "cloud.google.com/go/monitoring/apiv3/v2"
33+
"cloud.google.com/go/monitoring/apiv3/v2/monitoringpb"
34+
metrics "github.com/hashicorp/go-metrics"
3535
distributionpb "google.golang.org/genproto/googleapis/api/distribution"
3636
metricpb "google.golang.org/genproto/googleapis/api/metric"
3737
monitoredrespb "google.golang.org/genproto/googleapis/api/monitoredres"
38-
monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"
38+
"google.golang.org/protobuf/types/known/timestamppb"
3939
)
4040

4141
// Logger is the log interface used in go-metrics-stackdriver
@@ -371,12 +371,8 @@ func (s *Sink) report(ctx context.Context) {
371371
Points: []*monitoringpb.Point{
372372
{
373373
Interval: &monitoringpb.TimeInterval{
374-
StartTime: &googlepb.Timestamp{
375-
Seconds: v.startTime.Unix(),
376-
},
377-
EndTime: &googlepb.Timestamp{
378-
Seconds: end.Unix(),
379-
},
374+
StartTime: timestamppb.New(v.startTime),
375+
EndTime: timestamppb.New(end),
380376
},
381377
Value: &monitoringpb.TypedValue{
382378
Value: &monitoringpb.TypedValue_DoubleValue{
@@ -407,9 +403,7 @@ func (s *Sink) report(ctx context.Context) {
407403
Points: []*monitoringpb.Point{
408404
{
409405
Interval: &monitoringpb.TimeInterval{
410-
EndTime: &googlepb.Timestamp{
411-
Seconds: end.Unix(),
412-
},
406+
EndTime: timestamppb.New(end),
413407
},
414408
Value: &monitoringpb.TypedValue{
415409
Value: &monitoringpb.TypedValue_DoubleValue{
@@ -447,12 +441,8 @@ func (s *Sink) report(ctx context.Context) {
447441
Points: []*monitoringpb.Point{
448442
{
449443
Interval: &monitoringpb.TimeInterval{
450-
StartTime: &googlepb.Timestamp{
451-
Seconds: s.firstTime.Unix(),
452-
},
453-
EndTime: &googlepb.Timestamp{
454-
Seconds: end.Unix(),
455-
},
444+
StartTime: timestamppb.New(s.firstTime),
445+
EndTime: timestamppb.New(end),
456446
},
457447
Value: &monitoringpb.TypedValue{
458448
Value: &monitoringpb.TypedValue_DistributionValue{

‎stackdriver_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ import (
2424
"testing"
2525
"time"
2626

27-
monitoring "cloud.google.com/go/monitoring/apiv3"
28-
metrics "github.com/armon/go-metrics"
29-
emptypb "github.com/golang/protobuf/ptypes/empty"
27+
monitoring "cloud.google.com/go/monitoring/apiv3/v2"
28+
"cloud.google.com/go/monitoring/apiv3/v2/monitoringpb"
3029
"github.com/google/go-cmp/cmp"
30+
metrics "github.com/hashicorp/go-metrics"
3131
"google.golang.org/api/option"
3232
distributionpb "google.golang.org/genproto/googleapis/api/distribution"
3333
metricpb "google.golang.org/genproto/googleapis/api/metric"
3434
monitoredrespb "google.golang.org/genproto/googleapis/api/monitoredres"
35-
monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"
3635
"google.golang.org/grpc"
3736
"google.golang.org/grpc/test/bufconn"
37+
emptypb "google.golang.org/protobuf/types/known/emptypb"
3838
)
3939

4040
func benchmarkAddSample(concurrency int, b *testing.B) {

‎vault/vault.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// conversions specific to HashiCorp Vault.
1717
package vault
1818

19-
import "github.com/armon/go-metrics"
19+
import "github.com/hashicorp/go-metrics"
2020

2121
// Extractor extracts known patterns from the key into metrics.Label for better metric grouping
2222
// and to help avoid the limit of 500 custom metric descriptors per project

‎vault/vault_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// you may not use this file except in compliance with the License.
55
// You may obtain a copy of the License at
66
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
7+
// http://www.apache.org/licenses/LICENSE-2.0
88
//
99
// Unless required by applicable law or agreed to in writing, software
1010
// distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,9 +16,9 @@ package vault
1616
import (
1717
"testing"
1818

19-
"github.com/armon/go-metrics"
2019
"github.com/google/go-cmp/cmp"
2120
stackdriver "github.com/google/go-metrics-stackdriver"
21+
"github.com/hashicorp/go-metrics"
2222
)
2323

2424
func TestExtractor(t *testing.T) {

0 commit comments

Comments
 (0)
This repository has been archived.