Source File
api.go
Belonging Package
go.opentelemetry.io/otel/api/trace
package trace
import (
)
Tracer(instrumentationName string, opts ...TracerOption) Tracer
}
type TracerConfig struct {
InstrumentationVersion string
}
type TracerOption func(*TracerConfig)
func ( string) TracerOption {
return func( *TracerConfig) {
.InstrumentationVersion =
}
}
type ErrorConfig struct {
Timestamp time.Time
StatusCode codes.Code
}
type ErrorOption func(*ErrorConfig)
func ( time.Time) ErrorOption {
return func( *ErrorConfig) {
.Timestamp =
}
}
func ( codes.Code) ErrorOption {
return func( *ErrorConfig) {
.StatusCode =
}
}
Tracer() Tracer
End(options ...EndOption)
IsRecording() bool
RecordError(ctx context.Context, err error, opts ...ErrorOption)
SpanContext() SpanContext
SetName(name string)
SetAttribute(string, interface{})
}
type StartOption func(*StartConfig)
type Link struct {
SpanContext
Attributes []label.KeyValue
}
SpanKindUnspecified SpanKind = 0
SpanKindInternal SpanKind = 1
SpanKindServer SpanKind = 2
SpanKindClient SpanKind = 3
SpanKindProducer SpanKind = 4
SpanKindConsumer SpanKind = 5
)
func ( SpanKind) SpanKind {
switch {
case SpanKindInternal,
SpanKindServer,
SpanKindClient,
SpanKindProducer,
return
default:
return SpanKindInternal
}
}
func ( SpanKind) () string {
switch {
case SpanKindInternal:
return "internal"
case SpanKindServer:
return "server"
case SpanKindClient:
return "client"
case SpanKindProducer:
return "producer"
case SpanKindConsumer:
return "consumer"
default:
return "unspecified"
}
}
func ( time.Time) StartOption {
return func( *StartConfig) {
.StartTime =
}
}
func ( ...label.KeyValue) StartOption {
return func( *StartConfig) {
.Attributes = append(.Attributes, ...)
}
}
func () StartOption {
return func( *StartConfig) {
.Record = true
}
}
func () StartOption {
return func( *StartConfig) {
.NewRoot = true
}
}
func ( SpanContext, ...label.KeyValue) StartOption {
return func( *StartConfig) {
.Links = append(.Links, Link{, })
}
}
func ( SpanKind) StartOption {
return func( *StartConfig) {
.SpanKind =
}
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |