Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

Commit

Permalink
Merge pull request #25 from minor-fixes/update_deps
Browse files Browse the repository at this point in the history
go: Update all dependencies, imports
  • Loading branch information
tam7t authored Jun 21, 2023
2 parents 6b3e2bb + 89eb28b commit 3f39b18
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 538 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
fail-fast: false
matrix:
go: [
'1.15',
'1.16',
'1.17',
'1.18'
'1.18',
'1.19',
'1.20',
]

name: unit
Expand Down
6 changes: 3 additions & 3 deletions example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -27,8 +27,8 @@ import (
stackdriver "github.com/google/go-metrics-stackdriver"

"cloud.google.com/go/compute/metadata"
monitoring "cloud.google.com/go/monitoring/apiv3"
metrics "github.com/armon/go-metrics"
monitoring "cloud.google.com/go/monitoring/apiv3/v2"
metrics "github.com/hashicorp/go-metrics"
)

func main() {
Expand Down
37 changes: 27 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
module github.com/google/go-metrics-stackdriver

go 1.15
go 1.17

require (
cloud.google.com/go v0.101.1 // indirect
cloud.google.com/go/compute v1.6.1
cloud.google.com/go/monitoring v1.5.0
github.com/armon/go-metrics v0.3.11
github.com/golang/protobuf v1.5.2
github.com/google/go-cmp v0.5.8
google.golang.org/api v0.79.0
google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3
google.golang.org/grpc v1.46.2
cloud.google.com/go/compute/metadata v0.2.3
cloud.google.com/go/monitoring v1.14.0
github.com/google/go-cmp v0.5.9
github.com/hashicorp/go-metrics v0.4.2-0.20230519112806-858601465fcd
google.golang.org/api v0.123.0
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1
google.golang.org/grpc v1.55.0
google.golang.org/protobuf v1.30.0
)

require (
cloud.google.com/go/compute v1.19.3 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/s2a-go v0.1.4 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/googleapis/gax-go/v2 v2.8.0 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/golang-lru v0.5.0 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
)
559 changes: 63 additions & 496 deletions go.sum

Large diffs are not rendered by default.

28 changes: 9 additions & 19 deletions stackdriver.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ import (
"time"

"cloud.google.com/go/compute/metadata"
monitoring "cloud.google.com/go/monitoring/apiv3"
metrics "github.com/armon/go-metrics"
googlepb "github.com/golang/protobuf/ptypes/timestamp"
monitoring "cloud.google.com/go/monitoring/apiv3/v2"
"cloud.google.com/go/monitoring/apiv3/v2/monitoringpb"
metrics "github.com/hashicorp/go-metrics"
distributionpb "google.golang.org/genproto/googleapis/api/distribution"
metricpb "google.golang.org/genproto/googleapis/api/metric"
monitoredrespb "google.golang.org/genproto/googleapis/api/monitoredres"
monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"
"google.golang.org/protobuf/types/known/timestamppb"
)

// Logger is the log interface used in go-metrics-stackdriver
Expand Down Expand Up @@ -371,12 +371,8 @@ func (s *Sink) report(ctx context.Context) {
Points: []*monitoringpb.Point{
{
Interval: &monitoringpb.TimeInterval{
StartTime: &googlepb.Timestamp{
Seconds: v.startTime.Unix(),
},
EndTime: &googlepb.Timestamp{
Seconds: end.Unix(),
},
StartTime: timestamppb.New(v.startTime),
EndTime: timestamppb.New(end),
},
Value: &monitoringpb.TypedValue{
Value: &monitoringpb.TypedValue_DoubleValue{
Expand Down Expand Up @@ -407,9 +403,7 @@ func (s *Sink) report(ctx context.Context) {
Points: []*monitoringpb.Point{
{
Interval: &monitoringpb.TimeInterval{
EndTime: &googlepb.Timestamp{
Seconds: end.Unix(),
},
EndTime: timestamppb.New(end),
},
Value: &monitoringpb.TypedValue{
Value: &monitoringpb.TypedValue_DoubleValue{
Expand Down Expand Up @@ -447,12 +441,8 @@ func (s *Sink) report(ctx context.Context) {
Points: []*monitoringpb.Point{
{
Interval: &monitoringpb.TimeInterval{
StartTime: &googlepb.Timestamp{
Seconds: s.firstTime.Unix(),
},
EndTime: &googlepb.Timestamp{
Seconds: end.Unix(),
},
StartTime: timestamppb.New(s.firstTime),
EndTime: timestamppb.New(end),
},
Value: &monitoringpb.TypedValue{
Value: &monitoringpb.TypedValue_DistributionValue{
Expand Down
8 changes: 4 additions & 4 deletions stackdriver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ import (
"testing"
"time"

monitoring "cloud.google.com/go/monitoring/apiv3"
metrics "github.com/armon/go-metrics"
emptypb "github.com/golang/protobuf/ptypes/empty"
monitoring "cloud.google.com/go/monitoring/apiv3/v2"
"cloud.google.com/go/monitoring/apiv3/v2/monitoringpb"
"github.com/google/go-cmp/cmp"
metrics "github.com/hashicorp/go-metrics"
"google.golang.org/api/option"
distributionpb "google.golang.org/genproto/googleapis/api/distribution"
metricpb "google.golang.org/genproto/googleapis/api/metric"
monitoredrespb "google.golang.org/genproto/googleapis/api/monitoredres"
monitoringpb "google.golang.org/genproto/googleapis/monitoring/v3"
"google.golang.org/grpc"
"google.golang.org/grpc/test/bufconn"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)

func benchmarkAddSample(concurrency int, b *testing.B) {
Expand Down
2 changes: 1 addition & 1 deletion vault/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// conversions specific to HashiCorp Vault.
package vault

import "github.com/armon/go-metrics"
import "github.com/hashicorp/go-metrics"

// Extractor extracts known patterns from the key into metrics.Label for better metric grouping
// and to help avoid the limit of 500 custom metric descriptors per project
Expand Down
4 changes: 2 additions & 2 deletions vault/vault_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -16,9 +16,9 @@ package vault
import (
"testing"

"github.com/armon/go-metrics"
"github.com/google/go-cmp/cmp"
stackdriver "github.com/google/go-metrics-stackdriver"
"github.com/hashicorp/go-metrics"
)

func TestExtractor(t *testing.T) {
Expand Down

0 comments on commit 3f39b18

Please sign in to comment.