Skip to content

Commit

Permalink
Merge pull request kubernetes#5256 from kkorekk/fix-prometheus-metric…
Browse files Browse the repository at this point in the history
…s-for-custom-error-page

Register metrics for custom-error-pages
  • Loading branch information
k8s-ci-robot authored Jul 24, 2020
2 parents 7994e9a + 857c044 commit 82997a9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions images/custom-error-pages/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"strings"
"time"

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
)

Expand Down Expand Up @@ -63,6 +64,11 @@ const (
ErrFilesPathVar = "ERROR_FILES_PATH"
)

func init() {
prometheus.MustRegister(requestCount)
prometheus.MustRegister(requestDuration)
}

func main() {
errFilesPath := "/www"
if os.Getenv(ErrFilesPathVar) != "" {
Expand Down

0 comments on commit 82997a9

Please sign in to comment.