Documentation
¶
Overview ¶
Package tel carries the correlation attributes, spans and log records of the node daemon.
Index ¶
- Constants
- func Finish(span trace.Span, err error)
- func Tracer() trace.Tracer
- func WithCalls(ctx context.Context, c *CallStats) context.Context
- func WithTraceparent(ctx context.Context, traceparent string) context.Context
- type CallStats
- type CallWindow
- type Correlation
- type Health
- type OpTrace
- type Telemetry
Constants ¶
const ( DefaultSlowOp = 50 * time.Millisecond DefaultStatsEvery = 30 * time.Second )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CallStats ¶ added in v0.17.0
type CallStats struct {
// contains filtered or unexported fields
}
CallStats counts calls by kind between two reads, and since it was made. Each call is counted, never sampled.
func NewCallStats ¶ added in v0.17.0
NewCallStats returns a recorder that reads time from clk; nil is the real clock.
func (*CallStats) Begin ¶ added in v0.17.0
Begin starts timing a call of kind. The returned function ends it. A nil receiver records nothing.
func (*CallStats) Take ¶ added in v0.17.0
func (c *CallStats) Take() []CallWindow
Take returns the windows of the kinds that had calls, sorted by kind, and resets them.
func (*CallStats) Totals ¶ added in v0.25.0
func (c *CallStats) Totals() []CallWindow
Totals returns what the calls of each kind did since the recorder was made, sorted by kind. Take does not reset them, so a caller can read them before and after one command and subtract.
type CallWindow ¶ added in v0.17.0
CallWindow is what the calls of one kind did since the last Take.
type Correlation ¶
Correlation names the workspace and the mount in every span and log record of the daemon.
func (Correlation) LogAttrs ¶
func (c Correlation) LogAttrs() []any
func (Correlation) SpanAttrs ¶
func (c Correlation) SpanAttrs() []attribute.KeyValue
type Health ¶
type Health struct {
Logger *slog.Logger
Node string
// Mounts returns the number of mounts the process serves.
Mounts func() int
// Tier2 returns the bytes in the node blob cache.
Tier2 func() int64
Every time.Duration
Clock clock.Clock
// contains filtered or unexported fields
}
Health logs the vfs.health record of the daemon process: the signal to read when the Go runtime shows up in the hot path of a mount.
type OpTrace ¶
type OpTrace struct {
// contains filtered or unexported fields
}
OpTrace collects the store calls that one FUSE operation waits on, so that a slow-operation span can link to them.
func NewOpTrace ¶
NewOpTrace returns ctx with a new OpTrace that the store calls under ctx report to.
func OpTraceFrom ¶
OpTraceFrom returns the OpTrace of ctx, or nil.
type Telemetry ¶
type Telemetry struct {
Logger *slog.Logger
Corr Correlation
// SlowOp is the latency above which a FUSE operation emits a span; zero is 50 ms.
SlowOp time.Duration
// StatsEvery is the interval of the vfs.stats record; zero is 30 s.
StatsEvery time.Duration
// Tracer starts the spans; nil is the package tracer.
Tracer trace.Tracer
}
Telemetry configures the spans and log records of one mount. The zero value logs nothing and sends spans to the global provider, which exports none unless the process installed a tracer provider.