Thanks, Bjoern! Does https://github.com/vickleford/promex/commit/bfa0880f56a480e2cb1f5ebac89e11e10bf6d938 capture your suggestion correctly? Am I unknowingly showing some anti-pattern that needs to get corrected?
On Tue, Apr 14, 2020 at 12:00 PM Bjoern Rabenstein <[email protected]> wrote: > On 04.04.20 12:44, Victor Watkins wrote: > > > > I get your point about comparing a simple counter to a logger and not > needing > > to put that under test. Thanks, that sanity-checks an opinion I had > already > > formed. But suppose we're writing an exporter and that is our core logic > that > > we want to prove under test. Following the above example for both > styles, how > > do I read a metric without going as far as making an http call to > /metrics? > > Perhaps > https://github.com/vickleford/promex/blob/master/flopper/flopper.go#L68 > > asks this more succinctly than I can. > > You would usually call `Gather` on your registry and inspect the > result. > https://pkg.go.dev/github.com/prometheus/[email protected]/prometheus/testutil?tab=doc > is a package to help you with that. > > -- > Björn Rabenstein > [PGP-ID] 0x851C3DA17D748D03 > [email] [email protected] > -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CAKT_a9fK0S9r4cLf-1w1cme%3DQdSNG_8%2BKbJcob4we-i8_mSvoQ%40mail.gmail.com.

