Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrTraceNotFound = errors.New("trace not found")
Functions ¶
func Handler ¶ added in v0.1.83
Handler serves service's traces of source relative to where it is mounted (behind http.StripPrefix): GET / searches with the query parameters ParseRequest reads, and GET /{traceId} opens one trace. An Accept of application/schema+json returns the Request schema instead.
Types ¶
type AttributeCount ¶
AttributeCount is how many traces' root spans carry key=value.
type Detail ¶
type DocumentFormat ¶
type DocumentFormat string
func (DocumentFormat) JSONSchema ¶
func (DocumentFormat) JSONSchema() map[string]any
type Modes ¶
Modes are a filter's values, each included or excluded: a trace passes when it has one of the included values (or none is included) and none of the excluded ones.
func (Modes) JSONSchema ¶
type OperationStats ¶
type OperationStats struct {
Operation string `json:"operation"`
Count int `json:"count"`
// SingleSpan is set when every one of them is a single span.
SingleSpan bool `json:"singleSpan,omitempty"`
P50Ms float64 `json:"p50Ms"`
P95Ms float64 `json:"p95Ms"`
}
OperationStats are the traces of one root operation.
type Request ¶
type Request struct {
Source string `json:"source" clicky:"title=Source,required"`
Run string `json:"run,omitempty" clicky:"title=Run,desc=Optional recorded run ID"`
Index string `json:"index,omitempty" clicky:"title=Index,desc=OpenSearch index pattern (default otel-traces-*)"`
Format DocumentFormat `json:"format,omitempty" clicky:"title=Document format"`
Services Modes `json:"services,omitempty" clicky:"title=Services,desc=Services a trace's spans run in: each included or excluded"`
Operations Modes `json:"operations,omitempty" clicky:"title=Root operations,desc=A trace's root operation: each included or excluded"`
Statuses Modes `json:"statuses,omitempty" clicky:"title=Statuses,desc=error (a span failed) or ok: each included or excluded"`
Attributes Modes `` /* 156-byte string literal not displayed */
MinSpans int `json:"minSpans,omitempty" clicky:"title=Minimum spans,desc=Traces of at least this many spans"`
TraceID string `json:"traceId,omitempty" clicky:"title=Trace ID"`
Lookback string `json:"lookback,omitempty" clicky:"title=Lookback,desc=Duration such as 15m or 24h; used when From is empty"`
From string `json:"from,omitempty" clicky:"title=From,desc=Inclusive RFC3339 timestamp"`
Until string `json:"until,omitempty" clicky:"title=Until,desc=Exclusive RFC3339 timestamp"`
MinDuration string `json:"minDuration,omitempty" clicky:"title=Minimum trace duration,desc=Duration such as 100ms or 2s"`
MaxDuration string `json:"maxDuration,omitempty" clicky:"title=Maximum trace duration,desc=Duration such as 100ms or 2s"`
Limit int `json:"limit,omitempty" clicky:"title=Trace limit,desc=Maximum traces (1 to 1000); spans of a trace stay together"`
Offset int `json:"offset,omitempty" clicky:"title=Trace offset,desc=Matching traces to skip, newest first, before the limit applies"`
}
type SearchResult ¶
type SearchResult struct {
Traces []Summary `json:"traces"`
Total int `json:"total"`
// Services are those of every trace in the window.
Services []string `json:"services"`
// RootOperations count the traces in the window that pass every filter
// but the operation and span-count ones, by root operation.
RootOperations []OperationStats `json:"rootOperations"`
// Attributes suggest values of those traces' root spans, most frequent first.
Attributes []AttributeCount `json:"attributes"`
}
func Search ¶
func Search(spans []Span, r Request) (SearchResult, error)
Search filters whole traces with a span in the window: by their duration, services, status, any span's attributes, root operation and span count.
func SearchOpenSearch ¶ added in v0.1.83
func SearchOpenSearch(queryContext dbcontext.Context, r Request, c *models.Connection) (SearchResult, error)
SearchOpenSearch searches the traces with a span in r's window. Every span the window holds settles which traces those are; the filters the span layout matches exactly then narrow them across whole traces, so a filter met outside the window still counts, and only the traces that may pass are read in full. The services facet still covers every trace in the window.
type Service ¶
type Service struct {
Connections *store.Store
// Resolve is the connection a source names and the context it is read in,
// for a host whose connections Connections does not hold.
Resolve func(context.Context, string) (dbcontext.Context, *models.Connection, error)
// Read replaces the connection read with a host's own spans, which a search
// then filters in memory.
Read func(context.Context, Request, []string) ([]Span, error)
}
Service searches the spans of an OpenSearch or opentelemetry connection, or those Read returns.
func (Service) ReadSpans ¶
ReadSpans reads the spans selected by a host without assembling a search.
type Span ¶
func ReadOpenSearch ¶
func ReadOpenSearch(queryContext dbcontext.Context, r Request, c *models.Connection, ids []string) ([]Span, error)
ReadOpenSearch reads the spans of the traces ids, or of r.TraceID, or else every span in r's window.