add metrics

Signed-off-by: LiHui <andrewli@yunify.com>
This commit is contained in:
LiHui
2020-12-22 16:19:25 +08:00
committed by LiHui
parent f2e96bce7f
commit 5c8ac10d26
8 changed files with 180 additions and 2 deletions

View File

@@ -154,7 +154,10 @@ func (c *appTemplateOperator) CreateApp(request *CreateAppRequest) (*CreateAppRe
resp, err := c.opClient.CreateApp(openpitrix.ContextWithUsername(request.Username), createAppRequest)
if err != nil {
klog.Error(err)
appTemplateCreationCounter.WithLabelValues(request.Isv, request.Name, "failed").Inc()
return nil, err
} else {
appTemplateCreationCounter.WithLabelValues(request.Isv, request.Name, "success").Inc()
}
return &CreateAppResponse{
AppID: resp.GetAppId().GetValue(),