google / go-metrics-stackdriver Goto Github PK
View Code? Open in Web Editor NEWThis library provides a stackdriver sink for applications instrumented with the go-metrics library
License: Apache License 2.0
This library provides a stackdriver sink for applications instrumented with the go-metrics library
License: Apache License 2.0
Hi.
In some cases, there is a graceful shutdown logic of the application (such as in Cloud Run), and I need a way to gracefully shutdown the Sink as well, so pending metrics will get sent upon closure and not lost.
It turns out that a counter metrics use a gauge metric type as here
MetricKind: metricpb.MetricDescriptor_GAUGE,
This doesn't seem to be right. According to documentation of Aligner I am unable to calculate deltas if the metric is not defined as delta or cumulative. This is a big limitation. Should we consider switching to cumulative in case of counters?
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 #16 but would be a breaking change to the package.
gometrics supports gauge/counter/histograms with all the same "key".
Proposal: append count
or gauge
to the metric key name (and leave histograms naked).
go-metrics has added a Shutdown() method to the interface ( https://pkg.go.dev/github.com/armon/go-metrics?utm_source=godoc#MetricSink )
func (s *Sink) Shutdown() { s.Close(context.Background()) }
This library used to work, but lately it started to produce weird and inaccurate values.
If I run the full example and check in stackdriver UI for foo
metric: m.AddSample([]string{"foo"}, 100)
, the result in stackdriver is 75 for some reason. It happens on every sample in the basic example.
The expectations in stackdriver_test.go
would be much more readable of a package like protocmp was used for ensuring the requests had the correct data.
Failed to write time series data: rpc error: code = InvalidArgument desc = One or more TimeSeries could not be written: Field timeSeries[8] had an invalid value: Duplicate TimeSeries encountered. Only one point can be written per TimeSeries per request.: timeSeries[8]
Related Issues:
census-ecosystem/opencensus-go-exporter-stackdriver#73
census-ecosystem/opencensus-go-exporter-stackdriver#120
We are facing this error when using the library:
2021/02/12 18:23:36 Failed to write time series data: rpc error: code = InvalidArgument desc = One or more TimeSeries could not be written: Field timeSeries[11] had an invalid value: Duplicate TimeSeries encountered. Only one point can be written per TimeSeries per request.: timeSeries[11];
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.