Documentation ¶
Overview ¶
Package vtrace implements the Trace and Span interfaces in v.io/v23/vtrace. We also provide internal utilities for migrating trace information across RPC calls.
Index ¶
- func GetVTraceLevel(ctx *context.T) int
- func Init(ctx *context.T, opts flags.VtraceFlags) (*context.T, error)
- func NewSpan(trace, parent uniqueid.Id, name string, store vtrace.Store) (vtrace.Span, error)
- func NewStore(opts flags.VtraceFlags) (vtrace.Store, error)
- type Logger
- type Store
- func (s *Store) Annotate(traceid uniqueid.Id, span vtrace.SpanRecord, annotation vtrace.Annotation)
- func (s *Store) AnnotateMetadata(traceid uniqueid.Id, span vtrace.SpanRecord, key string, value interface{}, ...) error
- func (s *Store) Finish(traceid uniqueid.Id, span vtrace.SpanRecord, timestamp time.Time)
- func (s *Store) Flags(id uniqueid.Id) vtrace.TraceFlags
- func (s *Store) ForceCollect(id uniqueid.Id, level int)
- func (s *Store) LogLevel(id uniqueid.Id) int
- func (s *Store) Merge(t vtrace.Response)
- func (s *Store) Start(traceid uniqueid.Id, span vtrace.SpanRecord)
- func (s *Store) TraceRecord(id uniqueid.Id) *vtrace.TraceRecord
- func (s *Store) TraceRecords() []vtrace.TraceRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetVTraceLevel ¶
SetVTraceLevel returns the vtrace level This value is used to determine which log messages are sent as part of the vtrace output.
func Init ¶
Init initializes vtrace and attaches some state to the context. This should be called by the runtimes initialization function.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements a store for traces. The idea is to keep all the information we have about some subset of traces that pass through the server. For now we just implement an LRU cache, so the least recently started/finished/annotated traces expire after some maximum trace count is reached. TODO(mattr): LRU is the wrong policy in the long term, we should try to keep some diverse set of traces and allow users to specifically tell us to capture a specific trace. LRU will work OK for many testing scenarios and low volume applications.
func (*Store) Annotate ¶
func (s *Store) Annotate(traceid uniqueid.Id, span vtrace.SpanRecord, annotation vtrace.Annotation)
func (*Store) AnnotateMetadata ¶
func (*Store) Flags ¶
func (s *Store) Flags(id uniqueid.Id) vtrace.TraceFlags
method returns the collection method for the given trace.
func (*Store) TraceRecord ¶
func (s *Store) TraceRecord(id uniqueid.Id) *vtrace.TraceRecord
TraceRecord returns a TraceRecord for a given Id. Returns nil if the given id is not present.
func (*Store) TraceRecords ¶
func (s *Store) TraceRecords() []vtrace.TraceRecord
TraceRecords returns TraceRecords for all traces saved in the store.