go-metrics-stackdriver
go-metrics-stackdriver copied to clipboard
This library provides a stackdriver sink for applications instrumented with the go-metrics library
This library used to work, but lately it started to produce weird and inaccurate values. If I run the [full example](https://github.com/google/go-metrics-stackdriver/blob/main/example/main.go) and check in stackdriver UI for `foo` metric: `m.AddSample([]string{"foo"},...
It turns out that a counter metrics use a gauge metric type as [here](https://github.com/google/go-metrics-stackdriver/blob/main/stackdriver.go#L368) ``` MetricKind: metricpb.MetricDescriptor_GAUGE, ``` This doesn't seem to be right. According to documentation of [Aligner](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.alertPolicies#Aligner) I...
https://pkg.go.dev/github.com/google/go-metrics-stackdriver#NewSink currently only accepts a https://pkg.go.dev/cloud.google.com/go/monitoring/apiv3#MetricClient which says: ``` Deprecated: Please use cloud.google.com/go/monitoring/apiv3/v2. ``` This was also mentioned https://github.com/google/go-metrics-stackdriver/pull/16 but would be a breaking change to the package.
The expectations in `stackdriver_test.go` would be much more readable of a package like [protocmp](https://pkg.go.dev/google.golang.org/[email protected]/testing/protocmp?tab=doc) was used for ensuring the requests had the correct data.