Documentation
¶
Index ¶
- Constants
- func EnableBuiltinTracer(threshold time.Duration)
- type EventConfig
- type EventOption
- type TraceAttribute
- type TraceSpan
- func (s *TraceSpan) AddEvent(name string, options ...EventOption)
- func (s *TraceSpan) End()
- func (s *TraceSpan) RecordError(err error, options ...EventOption)
- func (s *TraceSpan) SetAttributeString(key, value string) *TraceSpan
- func (s *TraceSpan) SetName(name string)
- func (s *TraceSpan) SetStatus(code uint32, desc string)
- type TraceValue
- type Tracer
Constants ¶
const ( TraceSpanHTTP = "http" TraceSpanGitRun = "git-run" TraceSpanDatabase = "database" )
const ( TraceAttrFuncCaller = "func.caller" TraceAttrDbSQL = "db.sql" TraceAttrGitCommand = "git.command" TraceAttrHTTPRoute = "http.route" )
const LabelGracefulLifecycle = "graceful_lifecycle"
LabelGracefulLifecycle is a label marking manager lifecycle phase Making it compliant with prometheus key regex https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels would enable someone interested to be able to continuously gather profiles into pyroscope. Other labels for pprof should also follow this rule.
const LabelPid = "pid"
LabelPid is a label set on goroutines that have a process attached
const LabelPpid = "ppid"
LabelPpid is a label set on goroutines that have a process attached
const LabelProcessDescription = "process_description"
LabelProcessDescription is a label set on goroutines that have a process attached
const LabelProcessType = "process_type"
LabelProcessType is a label set on goroutines that have a process attached
Variables ¶
This section is empty.
Functions ¶
func EnableBuiltinTracer ¶
Types ¶
type EventConfig ¶
type EventConfig struct {
// contains filtered or unexported fields
}
type EventOption ¶
type EventOption interface {
// contains filtered or unexported methods
}
func WithAttributes ¶
func WithAttributes(attrs ...*TraceAttribute) EventOption
type TraceAttribute ¶
type TraceAttribute struct { Key string Value TraceValue }
type TraceSpan ¶
type TraceSpan struct {
// contains filtered or unexported fields
}
func GetContextSpan ¶
func (*TraceSpan) AddEvent ¶
func (s *TraceSpan) AddEvent(name string, options ...EventOption)
func (*TraceSpan) RecordError ¶
func (s *TraceSpan) RecordError(err error, options ...EventOption)
func (*TraceSpan) SetAttributeString ¶
type TraceValue ¶
type TraceValue struct {
// contains filtered or unexported fields
}
func (*TraceValue) AsFloat64 ¶
func (t *TraceValue) AsFloat64() float64
func (*TraceValue) AsInt64 ¶
func (t *TraceValue) AsInt64() int64
func (*TraceValue) AsString ¶
func (t *TraceValue) AsString() string
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
func (*Tracer) StartInContext ¶
StartInContext starts a trace span in Gitea's mutable context (usually the web request context). Due to the design limitation of Gitea's web framework, it can't use `context.WithValue` to bind a new span into a new context. So here we use our "reqctx" framework to achieve the same result: web request context could always see the latest "span".