server: add prometheus metrics for CRI operations
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
9d3c442b7b
commit
b959f8996d
29 changed files with 324 additions and 54 deletions
|
@ -20,6 +20,7 @@ import (
|
|||
"github.com/kubernetes-incubator/cri-o/oci"
|
||||
"github.com/kubernetes-incubator/cri-o/pkg/storage"
|
||||
"github.com/kubernetes-incubator/cri-o/server/apparmor"
|
||||
"github.com/kubernetes-incubator/cri-o/server/metrics"
|
||||
"github.com/kubernetes-incubator/cri-o/server/seccomp"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
|
@ -348,6 +349,7 @@ func (s *Server) getPodSandboxFromRequest(podSandboxID string) (*sandbox.Sandbox
|
|||
// CreateMetricsEndpoint creates a /metrics endpoint
|
||||
// for prometheus monitoring
|
||||
func (s *Server) CreateMetricsEndpoint() (*http.ServeMux, error) {
|
||||
metrics.Register()
|
||||
mux := &http.ServeMux{}
|
||||
mux.Handle("/metrics", prometheus.Handler())
|
||||
return mux, nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue