spacemonkeygo / monkit

A flexible process data collection, metrics, monitoring, instrumentation, and tracing client library for Go
http://godoc.org/gopkg.in/spacemonkeygo/monkit.v2
Apache License 2.0
480 stars 33 forks source link

monkit: add context-sensitive delta calculations. #39

Closed jtolio closed 3 years ago

jtolio commented 3 years ago

one downside with the previous delta implementation is that if two different metric outputs were in use (e.g. a udp packet sink and prometheus scraping), the delta would get reset in between different outputs, instead of being output-specific.

this change rethinks delta calculations as being a context-specific transform applied on top of existing metrics. this allows for different output styles to have their own transforms applied.

one downside of this change is deltas go away without downstream changes, so go.mod shouldn't be bumped to this version without appropriate changes to include the DeltaTransformer in the right calls to (*Registry).WithTransformers

jtolio commented 3 years ago

example of how to implement: https://review.dev.storj.io/c/storj/private/+/5123