集成 otel 记录接口性能数据

This commit is contained in:
2025-12-01 19:31:45 +08:00
parent a024c38375
commit e59c7c96f6
8 changed files with 121 additions and 39 deletions

View File

@@ -7,7 +7,6 @@ import (
func Init(ctx context.Context) error {
errs := make([]error, 0)
errs = append(errs, initBaiyin())
errs = append(errs, initAlipay())
errs = append(errs, initWechatPay())
@@ -18,22 +17,14 @@ func Init(ctx context.Context) error {
errs = append(errs, initAsynq(Redis))
errs = append(errs, initProxy())
errs = append(errs, initSft())
errs = append(errs, initOtel(ctx))
return u.CombineErrors(errs)
}
func Stop() error {
func Close() error {
var errs = make([]error, 0)
err := stopRedis()
if err != nil {
errs = append(errs, err)
}
err = stopOrm()
if err != nil {
errs = append(errs, err)
}
errs = append(errs, closeRedis())
errs = append(errs, closeOrm())
errs = append(errs, closeOtel())
return u.CombineErrors(errs)
}