1 Star 0 Fork 0

GarlicBoris/gozero-utils

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
trace_span.go 450 Bytes
一键复制 编辑 原始数据 按行查看 历史
yanwc 提交于 9个月前 . feat: tracex
package tracex
import (
"context"
"github.com/zeromicro/go-zero/core/trace"
"go.opentelemetry.io/otel"
oteltrace "go.opentelemetry.io/otel/trace"
)
func TraceSpan(serviceName string, spanName string, ctx context.Context) (context.Context, oteltrace.Span) {
tracer := otel.GetTracerProvider().Tracer(trace.TraceName)
spanCtx, span := tracer.Start(
ctx,
"",
oteltrace.WithSpanKind(oteltrace.SpanKindInternal),
)
return spanCtx, span
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/yanwc/gozero-utils.git
git@gitee.com:yanwc/gozero-utils.git
yanwc
gozero-utils
gozero-utils
v1.3.53

搜索帮助