Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetServiceNameList ¶
func GetServiceNameList(ctx context.Context, cp *CommonParams) ([]string, error)
GetServiceNameList returns all unique service names within *traceServiceAndSpanNameLookbehind window. todo: cache of recent result.
func GetSpanNameList ¶
GetSpanNameList returns all unique span names for a service within *traceServiceAndSpanNameLookbehind window. todo: cache of recent result.
Types ¶
type CommonParams ¶
type CommonParams struct {
TenantIDs []logstorage.TenantID
Query *logstorage.Query
// contains filtered or unexported fields
}
CommonParams common query params that shared by all requests.
func GetCommonParams ¶
func GetCommonParams(r *http.Request) (*CommonParams, error)
GetCommonParams get common params from request for all traces query APIs.
func (*CommonParams) NewQueryContext ¶ added in v0.3.0
func (cp *CommonParams) NewQueryContext(ctx context.Context) *logstorage.QueryContext
func (*CommonParams) UpdatePerQueryStatsMetrics ¶ added in v0.3.0
func (cp *CommonParams) UpdatePerQueryStatsMetrics()
type Row ¶
type Row struct {
Timestamp int64
Fields []logstorage.Field
}
Row represent the query result of a trace span.
func GetTrace ¶
GetTrace returns all spans of a trace in []*Row format. It search in the index stream for the approximate timestamp. If found: - search for span in time range [aTimestamp-traceMaxDurationWindow, aTimestamp+traceMaxDurationWindow]. If not found: - search span by step via findSpansByTraceID.
todo in-memory cache of hot traces.
func GetTraceList ¶
func GetTraceList(ctx context.Context, cp *CommonParams, param *TraceQueryParam) ([]string, []*Row, error)
GetTraceList returns multiple traceIDs and spans of them in []*Row format. It search for traceIDs first, and then search for the spans of these traceIDs. To not miss any spans on the edge, it extends both the start time and end time by *traceMaxDurationWindow.
e.g.: 1. input time range: [00:00, 09:00] 2. found 20 trace id, and adjust time range to: [08:00, 09:00] 3. find spans on time range: [08:00-traceMaxDurationWindow, 09:00+traceMaxDurationWindow]