jaeger修改读取config字段名

This commit is contained in:
2025-12-02 18:25:48 +08:00
parent 62d47ebde7
commit ff8257c605

View File

@@ -3,6 +3,7 @@ package jaeger
import ( import (
"context" "context"
"encoding/json" "encoding/json"
"gitee.com/red-future---jilin-g/common/http"
"github.com/gogf/gf/contrib/trace/otlphttp/v2" "github.com/gogf/gf/contrib/trace/otlphttp/v2"
"github.com/gogf/gf/v2/frame/g" "github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/net/ghttp" "github.com/gogf/gf/v2/net/ghttp"
@@ -15,8 +16,7 @@ var ShutDown func(ctx context.Context)
func init() { func init() {
jaegerAgent := g.Cfg().MustGet(context.Background(), "jaeger.addr").String() jaegerAgent := g.Cfg().MustGet(context.Background(), "jaeger.addr").String()
serverName := g.Cfg().MustGet(context.Background(), "server.Name").String() shutdown, err := otlphttp.Init(http.Httpserver.GetName(), jaegerAgent, "/v1/traces")
shutdown, err := otlphttp.Init(serverName, jaegerAgent, "/v1/traces")
if err != nil { if err != nil {
panic(err) panic(err)
} }