Initialize schedule Prometheus metrics to have them created beforehand (see https://prometheus.io/docs/practices/instrumentation/#avoid-missing-metrics)

Signed-off-by: Alex Lemaresquier <alex+github@lemaresquier.org>
This commit is contained in:
Alex Lemaresquier
2018-07-20 23:30:24 +02:00
parent 7a964ae2ca
commit 450fa72fbb
4 changed files with 23 additions and 0 deletions
@@ -34,6 +34,7 @@ import (
api "github.com/heptio/ark/pkg/apis/ark/v1"
"github.com/heptio/ark/pkg/generated/clientset/versioned/fake"
informers "github.com/heptio/ark/pkg/generated/informers/externalversions"
"github.com/heptio/ark/pkg/metrics"
"github.com/heptio/ark/pkg/util/collections"
arktest "github.com/heptio/ark/pkg/util/test"
)
@@ -129,6 +130,7 @@ func TestProcessSchedule(t *testing.T) {
sharedInformers.Ark().V1().Schedules(),
time.Duration(0),
logger,
metrics.NewServerMetrics(),
)
var (