From a09d18d05a2f520e4a8e0cbd4a080d1b842d3368 Mon Sep 17 00:00:00 2001 From: hunshenshi <289517357@qq.com> Date: Fri, 26 Apr 2024 21:07:02 +0800 Subject: [PATCH] feat(metrics): add failed task (#459) --- task/internal/handler/task_state_handler.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/task/internal/handler/task_state_handler.go b/task/internal/handler/task_state_handler.go index 10289731..3cd0c4a9 100644 --- a/task/internal/handler/task_state_handler.go +++ b/task/internal/handler/task_state_handler.go @@ -51,6 +51,8 @@ func (h *TaskStateHandler) Handle(s *types.TaskStateLog, t *types.Task) (finishe return } if s.State == types.TaskStateFailed { + metrics.FailedTaskNumMtc(t.ProjectID, t.ProjectVersion) + metrics.TaskFinalStateMtc(t.ProjectID, t.ID, t.ProjectVersion, types.TaskStateFailed.String()) return true }