Merge pull request #5256 from kkorekk/fix-prometheus-metrics-for-custom-error-page
Register metrics for custom-error-pages
This commit is contained in:
commit
82997a9711
1 changed files with 6 additions and 0 deletions
|
@ -27,6 +27,7 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
)
|
||||
|
||||
|
@ -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) != "" {
|
||||
|
|
Loading…
Reference in a new issue