소스 검색

improve: add launched_at to routine.Submit

Yeuoly 7 달 전
부모
커밋
0b6d97cd51
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      internal/utils/routine/pool.go

+ 4 - 1
internal/utils/routine/pool.go

@@ -5,6 +5,7 @@ import (
 	"runtime/pprof"
 	"sync"
 	"sync/atomic"
+	"time"
 
 	"github.com/getsentry/sentry-go"
 	"github.com/langgenius/dify-plugin-daemon/internal/utils/log"
@@ -44,7 +45,9 @@ func Submit(labels map[string]string, f func()) {
 	}
 
 	p.Submit(func() {
-		label := []string{}
+		label := []string{
+			"LaunchedAt", time.Now().Format(time.RFC3339),
+		}
 		if len(labels) > 0 {
 			for k, v := range labels {
 				label = append(label, k, v)