/
githubmirror
/
GoFrame
Обзор
Документация
Войти
/
githubmirror
/
GoFrame
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
net/gtrace/gtrace_span.go
26 строк
675 B
John Guo
comment update for package gtrace
22 сен 2021, 14:12
22 сен 2021, 14:12
b2629b9
Код
Авторство
О чём код?
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved. // // This Source Code Form is subject to the terms of the MIT License. // If a copy of the MIT was not distributed with this file, // You can obtain one at https://github.com/gogf/gf. package gtrace import ( "context" "go.opentelemetry.io/otel/trace" ) // Span warps trace.Span for compatibility and extension. type Span struct { trace.Span } // NewSpan creates a span using default tracer. func NewSpan(ctx context.Context, spanName string, opts ...trace.SpanStartOption) (context.Context, *Span) { ctx, span := NewTracer().Start(ctx, spanName, opts...) return ctx, &Span{ Span: span, } }