diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 88004ed8..ef695d06 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -15,6 +15,6 @@ jobs: - name: Install Go uses: actions/setup-go@v2 with: - go-version: 1.16.x + go-version: 1.17.x - name: Test run: go test ./... diff --git a/go.mod b/go.mod index d4a02a50..2b59c5a3 100644 --- a/go.mod +++ b/go.mod @@ -12,6 +12,7 @@ require ( github.com/onsi/ginkgo v1.16.5 github.com/onsi/gomega v1.17.0 github.com/pkg/errors v0.9.1 + github.com/prometheus/client_golang v1.11.0 github.com/stretchr/testify v1.7.0 go.uber.org/zap v1.19.1 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c @@ -43,7 +44,6 @@ require ( github.com/modern-go/reflect2 v1.0.1 // indirect github.com/nxadm/tail v1.4.8 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.11.0 // indirect github.com/prometheus/client_model v0.2.0 // indirect github.com/prometheus/common v0.26.0 // indirect github.com/prometheus/procfs v0.6.0 // indirect diff --git a/interceptor/main.go b/interceptor/main.go index 9b744e49..5b66863b 100644 --- a/interceptor/main.go +++ b/interceptor/main.go @@ -17,6 +17,7 @@ import ( kedanet "github.com/kedacore/http-add-on/pkg/net" "github.com/kedacore/http-add-on/pkg/queue" "github.com/kedacore/http-add-on/pkg/routing" + "github.com/prometheus/client_golang/prometheus/promhttp" "golang.org/x/sync/errgroup" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" @@ -183,7 +184,9 @@ func runAdminServer( timeoutConfig *config.Timeouts, ) error { lggr = lggr.WithName("runAdminServer") + promHdl := promhttp.Handler() adminServer := nethttp.NewServeMux() + adminServer.Handle("/prometheus", promHdl) queue.AddCountsRoute( lggr, adminServer,