Documentation ¶
Overview ¶
Package perfetto contains libraries for displaying trace information in the Perfetto UI.
Index ¶
- type DB
- func (d *DB) Close() error
- func (d *DB) FetchSpans(ctx context.Context, traceID string) ([]*protos.Span, error)
- func (d *DB) QueryTraces(ctx context.Context, app, version string, startTime, endTime time.Time, ...) ([]TraceSummary, error)
- func (d *DB) Store(ctx context.Context, app, version string, spans *protos.TraceSpans) error
- type ReadSpan
- func (s *ReadSpan) Attributes() []attribute.KeyValue
- func (s *ReadSpan) ChildSpanCount() int
- func (s *ReadSpan) DroppedAttributes() int
- func (s *ReadSpan) DroppedEvents() int
- func (s *ReadSpan) DroppedLinks() int
- func (s *ReadSpan) EndTime() time.Time
- func (s *ReadSpan) Events() []sdk.Event
- func (s *ReadSpan) InstrumentationLibrary() instrumentation.Scope
- func (s *ReadSpan) InstrumentationScope() instrumentation.Scope
- func (s *ReadSpan) Links() []sdk.Link
- func (s *ReadSpan) Name() string
- func (s *ReadSpan) Parent() trace.SpanContext
- func (s *ReadSpan) Resource() *resource.Resource
- func (s *ReadSpan) SpanContext() trace.SpanContext
- func (s *ReadSpan) SpanKind() trace.SpanKind
- func (s *ReadSpan) StartTime() time.Time
- func (s *ReadSpan) Status() sdk.Status
- type TraceSummary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB is a trace database that stores traces on the local file system.
func OpenDB ¶
OpenDB opens the trace database persisted in the provided file. If the file doesn't exist, this call creates it.
func (*DB) FetchSpans ¶
FetchSpans returns all of the spans that have a given trace id.
func (*DB) QueryTraces ¶
func (d *DB) QueryTraces(ctx context.Context, app, version string, startTime, endTime time.Time, durationLower, durationUpper time.Duration, onlyErrors bool, limit int64) ([]TraceSummary, error)
QueryTraces returns the summaries of the traces that match the given query arguments, namely:
- That have been generated by the given application version.
- That fit entirely in the given [startTime, endTime] time interval.
- Whose duration is in the given [durationLower, durationUpper) range.
- Who have an error status.
- Who are in the most recent limit of trace spans.
Any query argument that has a zero value (e.g., empty app or version, zero endTime) is ignored, i.e., it matches all spans.
type ReadSpan ¶
type ReadSpan struct { sdk.ReadOnlySpan Span *protos.Span }
ReadSpan is a wrapper around *protos.Span that implements the Open Telemetry ReadOnlySpan interface.
func (*ReadSpan) Attributes ¶
Attributes implements the ReadOnlySpan interface.
func (*ReadSpan) ChildSpanCount ¶
ChildSpanCount implements the ReadOnlySpan interface.
func (*ReadSpan) DroppedAttributes ¶
DroppedAttributes implements the ReadOnlySpan interface.
func (*ReadSpan) DroppedEvents ¶
DroppedEvents implements the ReadOnlySpan interface.
func (*ReadSpan) DroppedLinks ¶
DroppedLinks implements the ReadOnlySpan interface.
func (*ReadSpan) InstrumentationLibrary ¶
func (s *ReadSpan) InstrumentationLibrary() instrumentation.Scope
InstrumentationLibrary implements the ReadOnlySpan interface.
func (*ReadSpan) InstrumentationScope ¶
func (s *ReadSpan) InstrumentationScope() instrumentation.Scope
InstrumentationScope implements the ReadOnlySpan interface.
func (*ReadSpan) Parent ¶
func (s *ReadSpan) Parent() trace.SpanContext
Parent implements the ReadOnlySpan interface.
func (*ReadSpan) SpanContext ¶
func (s *ReadSpan) SpanContext() trace.SpanContext
SpanContext implements the ReadOnlySpan interface.