Documentation
¶
Overview ¶
Copyright 2022 Molecula Corp. (DBA FeatureBase). SPDX-License-Identifier: Apache-2.0
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Profile ¶
type Profile struct {
Name string
Begin, End time.Time `json:"-"`
Duration time.Duration
Children []ProfiledSpan `json:",omitempty"`
KV map[string]interface{} `json:",omitempty"`
// contains filtered or unexported fields
}
Profile represents the profiling data for a span. It also handles the bookkeeping for the underlying span, but this is unexported so it doesn't get unmarshaled.
func (*Profile) AddChild ¶
func (p *Profile) AddChild(child ProfiledSpan)
type ProfiledSpan ¶
type ProfiledSpan interface {
Span
Dump() interface{} // suitable for marshaling
AddChild(ProfiledSpan)
}
ProfiledSpan represents a span which profiles itself and its children.
func StartProfiledSpanFromContext ¶
func StartProfiledSpanFromContext(ctx context.Context, operationName string) (ProfiledSpan, context.Context)
StartProfiledSpanFromContext returns a new child span and context from a given context using the global tracer.
type Span ¶
type Span interface {
// Sets the end timestamp and finalizes Span state.
Finish()
// Adds key/value pairs to the span.
LogKV(alternatingKeyValues ...interface{})
}
Span represents a single span in a distributed trace.
type Tracer ¶
type Tracer interface {
// Returns a new child span and context from a given context.
StartSpanFromContext(ctx context.Context, operationName string) (Span, context.Context)
// Adds the required HTTP headers to pass context between nodes.
InjectHTTPHeaders(r *http.Request)
// Reads the HTTP headers to derive incoming context.
ExtractHTTPHeaders(r *http.Request) (Span, context.Context)
}
Tracer implements a generic distributed tracing interface.
Click to show internal directories.
Click to hide internal directories.