Documentation
¶
Index ¶
- func ColorProfile() termenv.Profile
- func DumpID(out *termenv.Output, id *call.ID) error
- func NewOutput(w io.Writer, opts ...termenv.OutputOption) *termenv.Output
- func WalkSteps(spans []*Span, f func(*TraceRow))
- type DB
- func (db *DB) AllTraces() []*Trace
- func (*DB) Close() error
- func (db *DB) ExportLogs(ctx context.Context, logs []*sdklog.LogData) error
- func (db *DB) ExportSpans(ctx context.Context, spans []sdktrace.ReadOnlySpan) error
- func (db *DB) HighLevelSpan(call *callpbv1.Call) *Span
- func (db *DB) MostInterestingSpan(dig string) *Span
- func (db *DB) MustCall(dig string) *callpbv1.Call
- func (db *DB) PrimarySpanForTrace(traceID trace.TraceID) *Span
- func (db *DB) SetPrimarySpan(span trace.SpanID)
- func (db *DB) Shutdown(ctx context.Context) error
- func (db *DB) Simplify(call *callpbv1.Call) (smallest *callpbv1.Call)
- type Frontend
- type FrontendOpts
- type LogsView
- type Pipeline
- type Span
- func (span *Span) Bar() SpanBar
- func (span *Span) Base() (*callpbv1.Call, bool)
- func (span *Span) Children() []*Span
- func (span *Span) Classes() string
- func (span *Span) Duration() time.Duration
- func (span *Span) EndTime() time.Time
- func (span *Span) Err() error
- func (span *Span) IsBefore(other *Span) bool
- func (span *Span) IsInternal() bool
- func (span *Span) IsRunning() bool
- func (span *Span) Name() string
- type SpanBar
- type Task
- type Trace
- type TraceRow
- type Vterm
- func (term *Vterm) Init() tea.Cmd
- func (term *Vterm) LastLine() string
- func (term *Vterm) Print(w io.Writer) error
- func (term *Vterm) Render(w io.Writer, offset, height int)
- func (term *Vterm) ScrollPercent() float64
- func (term *Vterm) SetHeight(height int)
- func (term *Vterm) SetPrefix(prefix string)
- func (term *Vterm) SetWidth(width int)
- func (term *Vterm) Term() *midterm.Terminal
- func (term *Vterm) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (term *Vterm) UsedHeight() int
- func (term *Vterm) View() string
- func (term *Vterm) Write(p []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ColorProfile ¶ added in v0.11.1
ColorProfile returns Ascii if, and only if, NO_COLOR or similar is set. Otherwise it returns termenv.ANSI, allowing colors to be used.
Note that color profiles beyond simple ANSI are not used by Progrock. 16 colors is all you need. Anything else disrespects the user's color scheme preferences.
func NewOutput ¶ added in v0.11.1
NewOutput returns a termenv.Output that will always use color, regardless of whether w is a TTY, unless NO_COLOR is explicitly set.
Progrock is opinionated here. Termenv disables colors by default if stdout is not a TTY or if the CI env var is set. We don't want that, because folks deserve colorful output in CI too.
To disable colors, set NO_COLOR (https://no-color.org/).
Types ¶
type DB ¶ added in v0.9.9
type DB struct {
PrimarySpan trace.SpanID
PrimaryLogs map[trace.SpanID][]*sdklog.LogData
Traces map[trace.TraceID]*Trace
Spans map[trace.SpanID]*Span
Children map[trace.SpanID]map[trace.SpanID]struct{}
Calls map[string]*callpbv1.Call
Outputs map[string]map[string]struct{}
OutputOf map[string]map[string]struct{}
Intervals map[string]map[time.Time]*Span
}
func (*DB) ExportLogs ¶ added in v0.11.0
func (*DB) ExportSpans ¶ added in v0.11.0
func (*DB) MostInterestingSpan ¶ added in v0.11.0
func (*DB) PrimarySpanForTrace ¶ added in v0.11.0
func (*DB) SetPrimarySpan ¶ added in v0.11.0
SetPrimarySpan allows the primary span to be explicitly set to a particular span. normally we assume the root span is the primary span, but in a nested scenario we never actually see the root span, so the CLI explicitly sets it to the span it created.
type Frontend ¶
type Frontend interface {
// Run starts a frontend, and runs the target function.
Run(ctx context.Context, opts FrontendOpts, f func(context.Context) error) error
// SetPrimary tells the frontend which span should be treated like the focal
// point of the command. Its output will be displayed at the end, and its
// children will be promoted to the "top-level" of the TUI.
SetPrimary(spanID trace.SpanID)
Background(cmd tea.ExecCommand) error
// Can consume otel spans and logs.
sdktrace.SpanExporter
sdklog.LogExporter
// ConnectedToEngine is called when the CLI connects to an engine.
ConnectedToEngine(name string, version string)
// ConnectedToCloud is called when the CLI has started emitting events to The Cloud.
ConnectedToCloud(url string)
}
type FrontendOpts ¶ added in v0.11.5
type LogsView ¶ added in v0.10.0
func CollectLogsView ¶ added in v0.10.0
type Span ¶ added in v0.9.9
type Span struct {
sdktrace.ReadOnlySpan
Digest string
Call *callpbv1.Call
Internal bool
Cached bool
Canceled bool
Inputs []string
Primary bool
Encapsulate bool
Encapsulated bool
Mask bool
Passthrough bool
Ignore bool
// contains filtered or unexported fields
}
func (*Span) IsInternal ¶ added in v0.11.0
type SpanBar ¶ added in v0.11.0
type Trace ¶ added in v0.11.0
type Trace struct {
ID trace.TraceID
Epoch, End time.Time
IsRunning bool
// contains filtered or unexported fields
}
func (*Trace) PrimarySpan ¶ added in v0.11.0
type TraceRow ¶ added in v0.9.9
type TraceRow struct {
Span *Span
Parent *TraceRow
IsRunning bool
Chained bool
Children []*TraceRow
Collapsed bool
}
func CollectRows ¶ added in v0.9.9
type Vterm ¶ added in v0.9.9
type Vterm struct {
Offset int
Height int
Width int
Prefix string
// contains filtered or unexported fields
}
func (*Vterm) LastLine ¶ added in v0.9.9
LastLine returns the last line of visible text, with ANSI formatting, but without any trailing whitespace.
func (*Vterm) Render ¶ added in v0.9.9
Bytes returns the output for the given region of the terminal, with ANSI formatting.