ampproject / ampproject/amppackager

Testing non-deterministic Prometheus metrics e.g. latency?

Open
#435 0 comments 0 reactions 1 assignee Claimed by @MichaelRybak View on GitHub
fixit
Dominant language
Go
Stars
141
Forks
46
PR merge metrics
No merged PRs in 30d

Description

TL;DR: I'm unit-testing Prometheus metrics: server's requests count and latencies. The server is written in Go. Latencies are non-determinstic and there seems to be no good way to fake clock in Prometheus or Go. Does Prometheus provide a method similar to CollectAndCompare that lets validating a value (e.g. latency) against a range, not exact expectation? If not, would it be a good feature to add to Prometheus? Alternatively, is there a way to fake clock in Prometheus, so e.g. InstrumentHandlerDuration would propagate the pre-defined fake duration? Or, is there a good way to fake clock in Go?

* Research existing options
* Possibly propose new features to Prometheus

https://groups.google.com/g/prometheus-developers/c/do7t-vmktk0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.