浏览代码

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)