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
|
@ -6,6 +6,7 @@ import (
|
|||
"io"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/docker/docker/pkg/pools"
|
||||
"github.com/kubernetes-incubator/cri-o/oci"
|
||||
|
@ -15,11 +16,15 @@ import (
|
|||
)
|
||||
|
||||
// PortForward prepares a streaming endpoint to forward ports from a PodSandbox.
|
||||
func (s *Server) PortForward(ctx context.Context, req *pb.PortForwardRequest) (*pb.PortForwardResponse, error) {
|
||||
func (s *Server) PortForward(ctx context.Context, req *pb.PortForwardRequest) (resp *pb.PortForwardResponse, err error) {
|
||||
const operation = "port_forward"
|
||||
defer func() {
|
||||
recordOperation(operation, time.Now())
|
||||
recordError(operation, err)
|
||||
}()
|
||||
logrus.Debugf("PortForwardRequest %+v", req)
|
||||
|
||||
resp, err := s.GetPortForward(req)
|
||||
|
||||
resp, err = s.GetPortForward(req)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to prepare portforward endpoint")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue