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/20200414180022.GG2315%40jahnn.

