Implement prometheus endpoint

This commit is contained in:
katainaka0503
2020-03-01 21:56:02 +09:00
parent 0b39353c12
commit 3fe7ad04e9
10 changed files with 266 additions and 31 deletions
+3 -1
View File
@@ -1,6 +1,7 @@
package controller
import (
"github.com/stakater/Reloader/internal/pkg/metrics"
"os"
"testing"
"time"
@@ -25,6 +26,7 @@ var (
data = "dGVzdFNlY3JldEVuY29kaW5nRm9yUmVsb2FkZXI="
newData = "dGVzdE5ld1NlY3JldEVuY29kaW5nRm9yUmVsb2FkZXI="
updatedData = "dGVzdFVwZGF0ZWRTZWNyZXRFbmNvZGluZ0ZvclJlbG9hZGVy"
collectors = metrics.NewCollectors()
)
func TestMain(m *testing.M) {
@@ -33,7 +35,7 @@ func TestMain(m *testing.M) {
logrus.Infof("Creating controller")
for k := range kube.ResourceMap {
c, err := NewController(clients.KubernetesClient, k, namespace, []string{})
c, err := NewController(clients.KubernetesClient, k, namespace, []string{}, collectors)
if err != nil {
logrus.Fatalf("%s", err)
}