add metrics endpoint

This commit is contained in:
rushtehrani
2020-02-11 00:37:36 -08:00
parent 96364938cd
commit bf9ad3ddce
6 changed files with 454 additions and 68 deletions

View File

@@ -324,6 +324,100 @@ func (m *GetWorkflowLogsRequest) GetContainerName() string {
return "" return ""
} }
type GetWorkflowMetricsRequest struct {
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
PodName string `protobuf:"bytes,3,opt,name=podName,proto3" json:"podName,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetWorkflowMetricsRequest) Reset() { *m = GetWorkflowMetricsRequest{} }
func (m *GetWorkflowMetricsRequest) String() string { return proto.CompactTextString(m) }
func (*GetWorkflowMetricsRequest) ProtoMessage() {}
func (*GetWorkflowMetricsRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_892c7f566756b0be, []int{6}
}
func (m *GetWorkflowMetricsRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetWorkflowMetricsRequest.Unmarshal(m, b)
}
func (m *GetWorkflowMetricsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetWorkflowMetricsRequest.Marshal(b, m, deterministic)
}
func (m *GetWorkflowMetricsRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetWorkflowMetricsRequest.Merge(m, src)
}
func (m *GetWorkflowMetricsRequest) XXX_Size() int {
return xxx_messageInfo_GetWorkflowMetricsRequest.Size(m)
}
func (m *GetWorkflowMetricsRequest) XXX_DiscardUnknown() {
xxx_messageInfo_GetWorkflowMetricsRequest.DiscardUnknown(m)
}
var xxx_messageInfo_GetWorkflowMetricsRequest proto.InternalMessageInfo
func (m *GetWorkflowMetricsRequest) GetNamespace() string {
if m != nil {
return m.Namespace
}
return ""
}
func (m *GetWorkflowMetricsRequest) GetName() string {
if m != nil {
return m.Name
}
return ""
}
func (m *GetWorkflowMetricsRequest) GetPodName() string {
if m != nil {
return m.PodName
}
return ""
}
type GetWorkflowMetricsResponse struct {
Metrics string `protobuf:"bytes,1,opt,name=metrics,proto3" json:"metrics,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *GetWorkflowMetricsResponse) Reset() { *m = GetWorkflowMetricsResponse{} }
func (m *GetWorkflowMetricsResponse) String() string { return proto.CompactTextString(m) }
func (*GetWorkflowMetricsResponse) ProtoMessage() {}
func (*GetWorkflowMetricsResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_892c7f566756b0be, []int{7}
}
func (m *GetWorkflowMetricsResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_GetWorkflowMetricsResponse.Unmarshal(m, b)
}
func (m *GetWorkflowMetricsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_GetWorkflowMetricsResponse.Marshal(b, m, deterministic)
}
func (m *GetWorkflowMetricsResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_GetWorkflowMetricsResponse.Merge(m, src)
}
func (m *GetWorkflowMetricsResponse) XXX_Size() int {
return xxx_messageInfo_GetWorkflowMetricsResponse.Size(m)
}
func (m *GetWorkflowMetricsResponse) XXX_DiscardUnknown() {
xxx_messageInfo_GetWorkflowMetricsResponse.DiscardUnknown(m)
}
var xxx_messageInfo_GetWorkflowMetricsResponse proto.InternalMessageInfo
func (m *GetWorkflowMetricsResponse) GetMetrics() string {
if m != nil {
return m.Metrics
}
return ""
}
type ListWorkflowsRequest struct { type ListWorkflowsRequest struct {
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
WorkflowTemplateUid string `protobuf:"bytes,2,opt,name=workflowTemplateUid,proto3" json:"workflowTemplateUid,omitempty"` WorkflowTemplateUid string `protobuf:"bytes,2,opt,name=workflowTemplateUid,proto3" json:"workflowTemplateUid,omitempty"`
@@ -337,7 +431,7 @@ func (m *ListWorkflowsRequest) Reset() { *m = ListWorkflowsRequest{} }
func (m *ListWorkflowsRequest) String() string { return proto.CompactTextString(m) } func (m *ListWorkflowsRequest) String() string { return proto.CompactTextString(m) }
func (*ListWorkflowsRequest) ProtoMessage() {} func (*ListWorkflowsRequest) ProtoMessage() {}
func (*ListWorkflowsRequest) Descriptor() ([]byte, []int) { func (*ListWorkflowsRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_892c7f566756b0be, []int{6} return fileDescriptor_892c7f566756b0be, []int{8}
} }
func (m *ListWorkflowsRequest) XXX_Unmarshal(b []byte) error { func (m *ListWorkflowsRequest) XXX_Unmarshal(b []byte) error {
@@ -391,7 +485,7 @@ func (m *ListWorkflowsResponse) Reset() { *m = ListWorkflowsResponse{} }
func (m *ListWorkflowsResponse) String() string { return proto.CompactTextString(m) } func (m *ListWorkflowsResponse) String() string { return proto.CompactTextString(m) }
func (*ListWorkflowsResponse) ProtoMessage() {} func (*ListWorkflowsResponse) ProtoMessage() {}
func (*ListWorkflowsResponse) Descriptor() ([]byte, []int) { func (*ListWorkflowsResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_892c7f566756b0be, []int{7} return fileDescriptor_892c7f566756b0be, []int{9}
} }
func (m *ListWorkflowsResponse) XXX_Unmarshal(b []byte) error { func (m *ListWorkflowsResponse) XXX_Unmarshal(b []byte) error {
@@ -438,7 +532,7 @@ func (m *LogEntry) Reset() { *m = LogEntry{} }
func (m *LogEntry) String() string { return proto.CompactTextString(m) } func (m *LogEntry) String() string { return proto.CompactTextString(m) }
func (*LogEntry) ProtoMessage() {} func (*LogEntry) ProtoMessage() {}
func (*LogEntry) Descriptor() ([]byte, []int) { func (*LogEntry) Descriptor() ([]byte, []int) {
return fileDescriptor_892c7f566756b0be, []int{8} return fileDescriptor_892c7f566756b0be, []int{10}
} }
func (m *LogEntry) XXX_Unmarshal(b []byte) error { func (m *LogEntry) XXX_Unmarshal(b []byte) error {
@@ -489,7 +583,7 @@ func (m *Workflow) Reset() { *m = Workflow{} }
func (m *Workflow) String() string { return proto.CompactTextString(m) } func (m *Workflow) String() string { return proto.CompactTextString(m) }
func (*Workflow) ProtoMessage() {} func (*Workflow) ProtoMessage() {}
func (*Workflow) Descriptor() ([]byte, []int) { func (*Workflow) Descriptor() ([]byte, []int) {
return fileDescriptor_892c7f566756b0be, []int{9} return fileDescriptor_892c7f566756b0be, []int{11}
} }
func (m *Workflow) XXX_Unmarshal(b []byte) error { func (m *Workflow) XXX_Unmarshal(b []byte) error {
@@ -564,7 +658,7 @@ func (m *WorkflowParameter) Reset() { *m = WorkflowParameter{} }
func (m *WorkflowParameter) String() string { return proto.CompactTextString(m) } func (m *WorkflowParameter) String() string { return proto.CompactTextString(m) }
func (*WorkflowParameter) ProtoMessage() {} func (*WorkflowParameter) ProtoMessage() {}
func (*WorkflowParameter) Descriptor() ([]byte, []int) { func (*WorkflowParameter) Descriptor() ([]byte, []int) {
return fileDescriptor_892c7f566756b0be, []int{10} return fileDescriptor_892c7f566756b0be, []int{12}
} }
func (m *WorkflowParameter) XXX_Unmarshal(b []byte) error { func (m *WorkflowParameter) XXX_Unmarshal(b []byte) error {
@@ -606,6 +700,8 @@ func init() {
proto.RegisterType((*ResubmitWorkflowRequest)(nil), "api.ResubmitWorkflowRequest") proto.RegisterType((*ResubmitWorkflowRequest)(nil), "api.ResubmitWorkflowRequest")
proto.RegisterType((*TerminateWorkflowRequest)(nil), "api.TerminateWorkflowRequest") proto.RegisterType((*TerminateWorkflowRequest)(nil), "api.TerminateWorkflowRequest")
proto.RegisterType((*GetWorkflowLogsRequest)(nil), "api.GetWorkflowLogsRequest") proto.RegisterType((*GetWorkflowLogsRequest)(nil), "api.GetWorkflowLogsRequest")
proto.RegisterType((*GetWorkflowMetricsRequest)(nil), "api.GetWorkflowMetricsRequest")
proto.RegisterType((*GetWorkflowMetricsResponse)(nil), "api.GetWorkflowMetricsResponse")
proto.RegisterType((*ListWorkflowsRequest)(nil), "api.ListWorkflowsRequest") proto.RegisterType((*ListWorkflowsRequest)(nil), "api.ListWorkflowsRequest")
proto.RegisterType((*ListWorkflowsResponse)(nil), "api.ListWorkflowsResponse") proto.RegisterType((*ListWorkflowsResponse)(nil), "api.ListWorkflowsResponse")
proto.RegisterType((*LogEntry)(nil), "api.LogEntry") proto.RegisterType((*LogEntry)(nil), "api.LogEntry")
@@ -616,69 +712,73 @@ func init() {
func init() { proto.RegisterFile("workflow.proto", fileDescriptor_892c7f566756b0be) } func init() { proto.RegisterFile("workflow.proto", fileDescriptor_892c7f566756b0be) }
var fileDescriptor_892c7f566756b0be = []byte{ var fileDescriptor_892c7f566756b0be = []byte{
// 988 bytes of a gzipped FileDescriptorProto // 1045 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x5f, 0x6f, 0x13, 0x47, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x96, 0xcf, 0x6f, 0x13, 0x47,
0x10, 0xd7, 0xc6, 0x84, 0x26, 0x83, 0x02, 0xc9, 0x90, 0xc4, 0xee, 0x91, 0xa8, 0xe9, 0x42, 0xa5, 0x14, 0xc7, 0x35, 0x31, 0xa1, 0xc9, 0x43, 0x81, 0xf0, 0x48, 0x62, 0xb3, 0x24, 0x6d, 0x3a, 0x50,
0xa4, 0x20, 0x5f, 0x30, 0x7f, 0x84, 0x02, 0x48, 0x0d, 0x28, 0x50, 0xa9, 0x56, 0x55, 0xb9, 0x50, 0x29, 0x29, 0xc8, 0x1b, 0x0c, 0x44, 0x28, 0x80, 0xd4, 0x10, 0x05, 0x5a, 0xd5, 0xad, 0x2a, 0x17,
0x54, 0xfa, 0x50, 0x36, 0xf6, 0xc6, 0x9c, 0xea, 0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0x31, 0x8a, 0xc0, 0xdf, 0x49, 0xf6, 0x4d, 0x67, 0xb2, 0x09, 0x7c, 0x7f,
0x00, 0x00, 0xff, 0xff, 0x6c, 0xf4, 0xb8, 0xe7, 0xa2, 0x0d, 0x00, 0x00, 0x24, 0x49, 0x02, 0x4b, 0x0f, 0x9b, 0xa2, 0x29, 0xaf, 0x2b, 0xca, 0x2a, 0x4e, 0x74, 0xcc, 0xf1,
0x2f, 0x02, 0xe5, 0xed, 0xb0, 0xf9, 0xd4, 0xe9, 0x0d, 0x6b, 0xce, 0x45, 0x95, 0x75, 0x84, 0xd7,
0xa0, 0x5d, 0x3a, 0x7c, 0x92, 0x86, 0xbb, 0xab, 0xe0, 0x6e, 0x5b, 0x5b, 0x47, 0x58, 0x42, 0x16,
0xc7, 0xde, 0x3b, 0xa9, 0xb4, 0xf6, 0xda, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0x64, 0xe8, 0xfa,
0x01, 0xe6, 0x0e, 0x00, 0x00,
} }
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
@@ -699,6 +799,7 @@ type WorkflowServiceClient interface {
ListWorkflows(ctx context.Context, in *ListWorkflowsRequest, opts ...grpc.CallOption) (*ListWorkflowsResponse, error) ListWorkflows(ctx context.Context, in *ListWorkflowsRequest, opts ...grpc.CallOption) (*ListWorkflowsResponse, error)
WatchWorkflow(ctx context.Context, in *WatchWorkflowRequest, opts ...grpc.CallOption) (WorkflowService_WatchWorkflowClient, error) WatchWorkflow(ctx context.Context, in *WatchWorkflowRequest, opts ...grpc.CallOption) (WorkflowService_WatchWorkflowClient, error)
GetWorkflowLogs(ctx context.Context, in *GetWorkflowLogsRequest, opts ...grpc.CallOption) (WorkflowService_GetWorkflowLogsClient, error) GetWorkflowLogs(ctx context.Context, in *GetWorkflowLogsRequest, opts ...grpc.CallOption) (WorkflowService_GetWorkflowLogsClient, error)
GetWorkflowMetrics(ctx context.Context, in *GetWorkflowMetricsRequest, opts ...grpc.CallOption) (*GetWorkflowMetricsResponse, error)
ResubmitWorkflow(ctx context.Context, in *ResubmitWorkflowRequest, opts ...grpc.CallOption) (*Workflow, error) ResubmitWorkflow(ctx context.Context, in *ResubmitWorkflowRequest, opts ...grpc.CallOption) (*Workflow, error)
TerminateWorkflow(ctx context.Context, in *TerminateWorkflowRequest, opts ...grpc.CallOption) (*empty.Empty, error) TerminateWorkflow(ctx context.Context, in *TerminateWorkflowRequest, opts ...grpc.CallOption) (*empty.Empty, error)
CreateWorkflowTemplate(ctx context.Context, in *CreateWorkflowTemplateRequest, opts ...grpc.CallOption) (*WorkflowTemplate, error) CreateWorkflowTemplate(ctx context.Context, in *CreateWorkflowTemplateRequest, opts ...grpc.CallOption) (*WorkflowTemplate, error)
@@ -809,6 +910,15 @@ func (x *workflowServiceGetWorkflowLogsClient) Recv() (*LogEntry, error) {
return m, nil return m, nil
} }
func (c *workflowServiceClient) GetWorkflowMetrics(ctx context.Context, in *GetWorkflowMetricsRequest, opts ...grpc.CallOption) (*GetWorkflowMetricsResponse, error) {
out := new(GetWorkflowMetricsResponse)
err := c.cc.Invoke(ctx, "/api.WorkflowService/GetWorkflowMetrics", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *workflowServiceClient) ResubmitWorkflow(ctx context.Context, in *ResubmitWorkflowRequest, opts ...grpc.CallOption) (*Workflow, error) { func (c *workflowServiceClient) ResubmitWorkflow(ctx context.Context, in *ResubmitWorkflowRequest, opts ...grpc.CallOption) (*Workflow, error) {
out := new(Workflow) out := new(Workflow)
err := c.cc.Invoke(ctx, "/api.WorkflowService/ResubmitWorkflow", in, out, opts...) err := c.cc.Invoke(ctx, "/api.WorkflowService/ResubmitWorkflow", in, out, opts...)
@@ -898,6 +1008,7 @@ type WorkflowServiceServer interface {
ListWorkflows(context.Context, *ListWorkflowsRequest) (*ListWorkflowsResponse, error) ListWorkflows(context.Context, *ListWorkflowsRequest) (*ListWorkflowsResponse, error)
WatchWorkflow(*WatchWorkflowRequest, WorkflowService_WatchWorkflowServer) error WatchWorkflow(*WatchWorkflowRequest, WorkflowService_WatchWorkflowServer) error
GetWorkflowLogs(*GetWorkflowLogsRequest, WorkflowService_GetWorkflowLogsServer) error GetWorkflowLogs(*GetWorkflowLogsRequest, WorkflowService_GetWorkflowLogsServer) error
GetWorkflowMetrics(context.Context, *GetWorkflowMetricsRequest) (*GetWorkflowMetricsResponse, error)
ResubmitWorkflow(context.Context, *ResubmitWorkflowRequest) (*Workflow, error) ResubmitWorkflow(context.Context, *ResubmitWorkflowRequest) (*Workflow, error)
TerminateWorkflow(context.Context, *TerminateWorkflowRequest) (*empty.Empty, error) TerminateWorkflow(context.Context, *TerminateWorkflowRequest) (*empty.Empty, error)
CreateWorkflowTemplate(context.Context, *CreateWorkflowTemplateRequest) (*WorkflowTemplate, error) CreateWorkflowTemplate(context.Context, *CreateWorkflowTemplateRequest) (*WorkflowTemplate, error)
@@ -928,6 +1039,9 @@ func (*UnimplementedWorkflowServiceServer) WatchWorkflow(req *WatchWorkflowReque
func (*UnimplementedWorkflowServiceServer) GetWorkflowLogs(req *GetWorkflowLogsRequest, srv WorkflowService_GetWorkflowLogsServer) error { func (*UnimplementedWorkflowServiceServer) GetWorkflowLogs(req *GetWorkflowLogsRequest, srv WorkflowService_GetWorkflowLogsServer) error {
return status.Errorf(codes.Unimplemented, "method GetWorkflowLogs not implemented") return status.Errorf(codes.Unimplemented, "method GetWorkflowLogs not implemented")
} }
func (*UnimplementedWorkflowServiceServer) GetWorkflowMetrics(ctx context.Context, req *GetWorkflowMetricsRequest) (*GetWorkflowMetricsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetWorkflowMetrics not implemented")
}
func (*UnimplementedWorkflowServiceServer) ResubmitWorkflow(ctx context.Context, req *ResubmitWorkflowRequest) (*Workflow, error) { func (*UnimplementedWorkflowServiceServer) ResubmitWorkflow(ctx context.Context, req *ResubmitWorkflowRequest) (*Workflow, error) {
return nil, status.Errorf(codes.Unimplemented, "method ResubmitWorkflow not implemented") return nil, status.Errorf(codes.Unimplemented, "method ResubmitWorkflow not implemented")
} }
@@ -1056,6 +1170,24 @@ func (x *workflowServiceGetWorkflowLogsServer) Send(m *LogEntry) error {
return x.ServerStream.SendMsg(m) return x.ServerStream.SendMsg(m)
} }
func _WorkflowService_GetWorkflowMetrics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetWorkflowMetricsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkflowServiceServer).GetWorkflowMetrics(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.WorkflowService/GetWorkflowMetrics",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkflowServiceServer).GetWorkflowMetrics(ctx, req.(*GetWorkflowMetricsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WorkflowService_ResubmitWorkflow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _WorkflowService_ResubmitWorkflow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ResubmitWorkflowRequest) in := new(ResubmitWorkflowRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
@@ -1234,6 +1366,10 @@ var _WorkflowService_serviceDesc = grpc.ServiceDesc{
MethodName: "ListWorkflows", MethodName: "ListWorkflows",
Handler: _WorkflowService_ListWorkflows_Handler, Handler: _WorkflowService_ListWorkflows_Handler,
}, },
{
MethodName: "GetWorkflowMetrics",
Handler: _WorkflowService_GetWorkflowMetrics_Handler,
},
{ {
MethodName: "ResubmitWorkflow", MethodName: "ResubmitWorkflow",
Handler: _WorkflowService_ResubmitWorkflow_Handler, Handler: _WorkflowService_ResubmitWorkflow_Handler,

View File

@@ -360,6 +360,104 @@ func request_WorkflowService_GetWorkflowLogs_0(ctx context.Context, marshaler ru
} }
func request_WorkflowService_GetWorkflowMetrics_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetWorkflowMetricsRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["namespace"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
}
protoReq.Namespace, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
}
val, ok = pathParams["name"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
}
protoReq.Name, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
}
val, ok = pathParams["podName"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "podName")
}
protoReq.PodName, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "podName", err)
}
msg, err := client.GetWorkflowMetrics(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_WorkflowService_GetWorkflowMetrics_0(ctx context.Context, marshaler runtime.Marshaler, server WorkflowServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetWorkflowMetricsRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["namespace"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
}
protoReq.Namespace, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
}
val, ok = pathParams["name"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
}
protoReq.Name, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
}
val, ok = pathParams["podName"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "podName")
}
protoReq.PodName, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "podName", err)
}
msg, err := server.GetWorkflowMetrics(ctx, &protoReq)
return msg, metadata, err
}
func request_WorkflowService_ResubmitWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { func request_WorkflowService_ResubmitWorkflow_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ResubmitWorkflowRequest var protoReq ResubmitWorkflowRequest
var metadata runtime.ServerMetadata var metadata runtime.ServerMetadata
@@ -1262,6 +1360,26 @@ func RegisterWorkflowServiceHandlerServer(ctx context.Context, mux *runtime.Serv
return return
}) })
mux.Handle("GET", pattern_WorkflowService_GetWorkflowMetrics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_WorkflowService_GetWorkflowMetrics_0(rctx, inboundMarshaler, server, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_WorkflowService_GetWorkflowMetrics_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("PUT", pattern_WorkflowService_ResubmitWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { mux.Handle("PUT", pattern_WorkflowService_ResubmitWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
@@ -1603,6 +1721,26 @@ func RegisterWorkflowServiceHandlerClient(ctx context.Context, mux *runtime.Serv
}) })
mux.Handle("GET", pattern_WorkflowService_GetWorkflowMetrics_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_WorkflowService_GetWorkflowMetrics_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_WorkflowService_GetWorkflowMetrics_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("PUT", pattern_WorkflowService_ResubmitWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { mux.Handle("PUT", pattern_WorkflowService_ResubmitWorkflow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
@@ -1817,6 +1955,8 @@ var (
pattern_WorkflowService_GetWorkflowLogs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 8, 2, 9}, []string{"apis", "v1beta1", "namespace", "workflows", "name", "pods", "podName", "containers", "containerName", "logs"}, "", runtime.AssumeColonVerbOpt(true))) pattern_WorkflowService_GetWorkflowLogs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 8, 2, 9}, []string{"apis", "v1beta1", "namespace", "workflows", "name", "pods", "podName", "containers", "containerName", "logs"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowService_GetWorkflowMetrics_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7}, []string{"apis", "v1beta1", "namespace", "workflows", "name", "pods", "podName", "metrics"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowService_ResubmitWorkflow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"apis", "v1beta1", "namespace", "workflows", "name", "resubmit"}, "", runtime.AssumeColonVerbOpt(true))) pattern_WorkflowService_ResubmitWorkflow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"apis", "v1beta1", "namespace", "workflows", "name", "resubmit"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowService_TerminateWorkflow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"apis", "v1beta1", "namespace", "workflows", "name", "terminate"}, "", runtime.AssumeColonVerbOpt(true))) pattern_WorkflowService_TerminateWorkflow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"apis", "v1beta1", "namespace", "workflows", "name", "terminate"}, "", runtime.AssumeColonVerbOpt(true)))
@@ -1849,6 +1989,8 @@ var (
forward_WorkflowService_GetWorkflowLogs_0 = runtime.ForwardResponseStream forward_WorkflowService_GetWorkflowLogs_0 = runtime.ForwardResponseStream
forward_WorkflowService_GetWorkflowMetrics_0 = runtime.ForwardResponseMessage
forward_WorkflowService_ResubmitWorkflow_0 = runtime.ForwardResponseMessage forward_WorkflowService_ResubmitWorkflow_0 = runtime.ForwardResponseMessage
forward_WorkflowService_TerminateWorkflow_0 = runtime.ForwardResponseMessage forward_WorkflowService_TerminateWorkflow_0 = runtime.ForwardResponseMessage

View File

@@ -39,6 +39,12 @@ service WorkflowService {
}; };
} }
rpc GetWorkflowMetrics (GetWorkflowMetricsRequest) returns (GetWorkflowMetricsResponse) {
option (google.api.http) = {
get: "/apis/v1beta1/{namespace}/workflows/{name}/pods/{podName}/metrics"
};
}
rpc ResubmitWorkflow (ResubmitWorkflowRequest) returns (Workflow) { rpc ResubmitWorkflow (ResubmitWorkflowRequest) returns (Workflow) {
option (google.api.http) = { option (google.api.http) = {
put: "/apis/v1beta1/{namespace}/workflows/{name}/resubmit" put: "/apis/v1beta1/{namespace}/workflows/{name}/resubmit"
@@ -132,6 +138,16 @@ message GetWorkflowLogsRequest {
string containerName = 4; string containerName = 4;
} }
message GetWorkflowMetricsRequest {
string namespace = 1;
string name = 2;
string podName = 3;
}
message GetWorkflowMetricsResponse {
string metrics = 1;
}
message ListWorkflowsRequest { message ListWorkflowsRequest {
string namespace = 1; string namespace = 1;
string workflowTemplateUid = 2; string workflowTemplateUid = 2;

View File

@@ -421,6 +421,42 @@
] ]
} }
}, },
"/apis/v1beta1/{namespace}/workflows/{name}/pods/{podName}/metrics": {
"get": {
"operationId": "GetWorkflowMetrics",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/apiGetWorkflowMetricsResponse"
}
}
},
"parameters": [
{
"name": "namespace",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "name",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "podName",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"WorkflowService"
]
}
},
"/apis/v1beta1/{namespace}/workflows/{name}/resubmit": { "/apis/v1beta1/{namespace}/workflows/{name}/resubmit": {
"put": { "put": {
"operationId": "ResubmitWorkflow", "operationId": "ResubmitWorkflow",
@@ -521,6 +557,14 @@
} }
} }
}, },
"apiGetWorkflowMetricsResponse": {
"type": "object",
"properties": {
"metrics": {
"type": "string"
}
}
},
"apiListWorkflowTemplateVersionsResponse": { "apiListWorkflowTemplateVersionsResponse": {
"type": "object", "type": "object",
"properties": { "properties": {

View File

@@ -5,6 +5,7 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"io" "io"
"io/ioutil"
"sort" "sort"
"strconv" "strconv"
"strings" "strings"
@@ -18,6 +19,7 @@ import (
"github.com/onepanelio/core/s3" "github.com/onepanelio/core/s3"
"github.com/onepanelio/core/util" "github.com/onepanelio/core/util"
"github.com/onepanelio/core/util/env" "github.com/onepanelio/core/util/env"
"github.com/onepanelio/core/util/ptr"
"google.golang.org/grpc/codes" "google.golang.org/grpc/codes"
) )
@@ -281,6 +283,43 @@ func (r *ResourceManager) GetWorkflowLogs(namespace, name, podName, containerNam
return logWatcher, err return logWatcher, err
} }
func (r *ResourceManager) GetWorkflowMetrics(namespace, name, podName string) (metrics *string, err error) {
_, err = r.kubeClient.GetWorkflow(namespace, name)
if err != nil {
return nil, util.NewUserError(codes.NotFound, "Workflow not found.")
}
var (
stream io.ReadCloser
s3Client *s3.Client
config map[string]string
)
config, err = r.getNamespaceConfig(namespace)
if err != nil {
return nil, util.NewUserError(codes.PermissionDenied, "Can't get configuration.")
}
s3Client, err = r.getS3Client(namespace, config)
if err != nil {
return nil, util.NewUserError(codes.PermissionDenied, "Can't connect to S3 storage.")
}
opts := s3.GetObjectOptions{}
stream, err = s3Client.GetObject(config[artifactRepositoryBucketKey], "artifacts/"+namespace+"/"+name+"/"+podName+"/metrics.json", opts)
if err != nil {
return nil, util.NewUserError(codes.NotFound, "Metrics do not exist.")
}
content, err := ioutil.ReadAll(stream)
if err != nil {
return nil, util.NewUserError(codes.Unknown, "Unknown error.")
}
metrics = ptr.String(string(content))
return
}
func (r *ResourceManager) ListWorkflows(namespace, workflowTemplateUID, workflowTemplateVersion string) (workflows []*model.Workflow, err error) { func (r *ResourceManager) ListWorkflows(namespace, workflowTemplateUID, workflowTemplateVersion string) (workflows []*model.Workflow, err error) {
opts := &kube.WorkflowOptions{} opts := &kube.WorkflowOptions{}
if workflowTemplateUID != "" { if workflowTemplateUID != "" {

View File

@@ -141,6 +141,15 @@ func (s *WorkflowServer) GetWorkflowLogs(req *api.GetWorkflowLogsRequest, stream
return nil return nil
} }
func (s *WorkflowServer) GetWorkflowMetrics(ctx context.Context, req *api.GetWorkflowMetricsRequest) (*api.GetWorkflowMetricsResponse, error) {
metrics, err := s.resourceManager.GetWorkflowMetrics(req.Namespace, req.Name, req.PodName)
if errors.As(err, &userError) {
return nil, userError.GRPCError()
}
return &api.GetWorkflowMetricsResponse{Metrics: *metrics}, nil
}
func (s *WorkflowServer) ListWorkflows(ctx context.Context, req *api.ListWorkflowsRequest) (*api.ListWorkflowsResponse, error) { func (s *WorkflowServer) ListWorkflows(ctx context.Context, req *api.ListWorkflowsRequest) (*api.ListWorkflowsResponse, error) {
workflows, err := s.resourceManager.ListWorkflows(req.Namespace, req.WorkflowTemplateUid, req.WorkflowTemplateVersion) workflows, err := s.resourceManager.ListWorkflows(req.Namespace, req.WorkflowTemplateUid, req.WorkflowTemplateVersion)
if errors.As(err, &userError) { if errors.As(err, &userError) {