Observability/metrics update (#1962)

* Removing logging from the NOOP implementatino

* Simplifying the percentiles option

* Simple logging implementation

Co-authored-by: chris <chris@Profanity.local>
This commit is contained in:
Prawn
2020-08-21 20:57:10 +12:00
committed by GitHub
parent 1ae825032c
commit f9f61d29de
7 changed files with 142 additions and 20 deletions

View File

@@ -9,10 +9,16 @@ import (
func TestOptions(t *testing.T) {
// Make some new options:
options := NewOptions(Path("/prometheus"), DefaultTags(map[string]string{"service": "prometheus-test"}))
options := NewOptions(
Address(":9999"),
DefaultTags(map[string]string{"service": "prometheus-test"}),
Path("/prometheus"),
Percentiles([]float64{0.11, 0.22, 0.33}),
)
// Check that the defaults and overrides were accepted:
assert.Equal(t, ":9000", options.Address)
assert.Equal(t, "/prometheus", options.Path)
assert.Equal(t, ":9999", options.Address)
assert.Equal(t, "prometheus-test", options.DefaultTags["service"])
assert.Equal(t, "/prometheus", options.Path)
assert.Equal(t, []float64{0.11, 0.22, 0.33}, options.Percentiles)
}