Documentation
¶
Index ¶
- Constants
- func CheckHasTraceID(ctx context.Context) bool
- func ExtractHTTPBaggage(ctx context.Context, header http.Header) context.Context
- func GetTraceId(ctx context.Context) string
- func InjectHTTPBaggage(ctx context.Context, header http.Header)
- func NewPrometheusMeterProvider(config *Config, opts ...otelprom.Option) (_ *sdkmetric.MeterProvider, gErr error)
- func NewTracer(config *Config) *sdktrace.TracerProvider
- func SetIfCtxErr(span oteltrace.Span, ctx context.Context)
- func SetIfErr(span oteltrace.Span, err error)
- func SpanID(span oteltrace.Span) string
- func TraceID(span oteltrace.Span) string
- func TraceIdFromCtx(ctx context.Context) string
- func Tracer() oteltrace.Tracer
- type Config
- type Exporter
- type Provider
- type ServiceInfo
Constants ¶
View Source
const ( Baggage = "baggage" AttributeTraceID = attribute.Key("trace.id") AttributeSpanID = attribute.Key("span.id") AttributeLogID = attribute.Key("log_id") AttributeRequest = attribute.Key("request") AttributeResponse = attribute.Key("response") AttributeGinError = attribute.Key("gin.errors") AttributeRedisError = attribute.Key("redis.cmd.error") AttributeRedisCmdName = attribute.Key("redis.cmd.name") AttributeRedisCmdString = attribute.Key("redis.cmd.string") AttributeRedisCmdArgs = attribute.Key("redis.cmd.args") )
View Source
const (
DefaultStdout = "stdout"
)
View Source
const (
KeyErrMsg = "err_msg"
)
Variables ¶
This section is empty.
Functions ¶
func CheckHasTraceID ¶
func ExtractHTTPBaggage ¶
func NewTracer ¶
func NewTracer(config *Config) *sdktrace.TracerProvider
func SetIfCtxErr ¶
SetIfCtxErr record context error
func TraceIdFromCtx ¶
Types ¶
type Exporter ¶
type Exporter struct {
ExporterEndpoint string
Insecure bool
Creds credentials.TransportCredentials
}
type Provider ¶
type Provider struct {
TracerProvider oteltrace.TracerProvider
Tracer oteltrace.Tracer
MeterProvider otelmetric.MeterProvider
Meter otelmetric.Meter
}
type ServiceInfo ¶
Click to show internal directories.
Click to hide internal directories.