GatherAndCompare gathers all metrics from the provided Gatherer and compares it to an expected output read from the provided Reader in the Prometheus text exposition format. If any metricNames are provided, only metrics with those names are compared. NOTE: Be mindful of accidental discrepancies bet
(g prometheus.Gatherer, expected io.Reader, metricNames ...string)
| 209 | // NOTE: Be mindful of accidental discrepancies between expected and metricNames; metricNames filter |
| 210 | // both expected and gathered metrics. See https://github.com/prometheus/client_golang/issues/1351. |
| 211 | func GatherAndCompare(g prometheus.Gatherer, expected io.Reader, metricNames ...string) error { |
| 212 | return TransactionalGatherAndCompare(prometheus.ToTransactionalGatherer(g), expected, metricNames...) |
| 213 | } |
| 214 | |
| 215 | // TransactionalGatherAndCompare gathers all metrics from the provided Gatherer and compares |
| 216 | // it to an expected output read from the provided Reader in the Prometheus text |