Documentation
¶
Overview ¶
Package tracestorage defines storage structure for trace storage.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
Consumer consumes given traces and inserts them using given Inserter.
type Event ¶
type Event struct {
Timestamp otelstorage.Timestamp `json:"timestamp" yson:"timestamp"`
Name string `json:"name" yson:"name"`
Attrs otelstorage.Attrs `json:"attrs" yson:"attrs"`
}
Event is a Span event.
type Inserter ¶
type Inserter interface {
// InsertSpans inserts given spans.
//
// FIXME(tdakkota): probably, it's better to return some kind of batch writer.
InsertSpans(ctx context.Context, spans []Span) error
// InsertTags insert given set of tags to the storage.
//
// FIXME(tdakkota): probably, storage should do tag extraction by itself.
InsertTags(ctx context.Context, tags map[Tag]struct{}) error
}
Inserter is a trace storage insert interface.
type Link ¶
type Link struct {
TraceID otelstorage.TraceID `json:"trace_id" yson:"trace_id"`
SpanID otelstorage.SpanID `json:"span_id" yson:"span_id"`
TraceState string `json:"trace_state" yson:"trace_state"`
Attrs otelstorage.Attrs `json:"attrs" yson:"attrs"`
}
Link is a Span link.
type Querier ¶
type Querier interface {
// SearchTags performs search by given tags.
SearchTags(ctx context.Context, tags map[string]string, opts SearchTagsOptions) (iterators.Iterator[Span], error)
// TagNames returns all available tag names.
TagNames(ctx context.Context) ([]string, error)
// TagValues returns all available tag values for given tag.
TagValues(ctx context.Context, tagName string) (iterators.Iterator[Tag], error)
// TraceByID returns spans of given trace.
TraceByID(ctx context.Context, id otelstorage.TraceID, opts TraceByIDOptions) (iterators.Iterator[Span], error)
}
Querier is a trace storage query interface.
type SearchTagsOptions ¶
type SearchTagsOptions struct {
MinDuration time.Duration
MaxDuration time.Duration
// Start defines time range for search.
//
// Querier ignores parameter, if it is zero.
Start otelstorage.Timestamp
// End defines time range for search.
//
// Querier ignores parameter, if it is zero.
End otelstorage.Timestamp
}
SearchTagsOptions defines options for SearchTags method.
type Span ¶
type Span struct {
TraceID otelstorage.TraceID `json:"trace_id" yson:"trace_id"`
SpanID otelstorage.SpanID `json:"span_id" yson:"span_id"`
TraceState string `json:"trace_state" yson:"trace_state"`
ParentSpanID otelstorage.SpanID `json:"parent_span_id" yson:"parent_span_id"`
Name string `json:"name" yson:"name"`
Kind int32 `json:"kind" yson:"kind"`
Start otelstorage.Timestamp `json:"start" yson:"start"`
End otelstorage.Timestamp `json:"end" yson:"end"`
Attrs otelstorage.Attrs `json:"attrs" yson:"attrs"`
StatusCode int32 `json:"status_code" yson:"status_code"`
StatusMessage string `json:"status_message" yson:"status_message"`
BatchID string `json:"batch_id" yson:"batch_id"`
ResourceAttrs otelstorage.Attrs `json:"resource_attrs" yson:"resource_attrs"`
ScopeName string `json:"scope_name" yson:"scope_name"`
ScopeVersion string `json:"scope_version" yson:"scope_version"`
ScopeAttrs otelstorage.Attrs `json:"scope_attrs" yson:"scope_attrs"`
Events []Event `json:"events" yson:"events"`
Links []Link `json:"links" yson:"links"`
}
Span is a data structure for span.
func NewSpanFromOTEL ¶
func NewSpanFromOTEL( batchID string, res pcommon.Resource, scope pcommon.InstrumentationScope, span ptrace.Span, ) (s Span)
NewSpanFromOTEL creates new Span.
func (Span) AsTempoSpan ¶
AsTempoSpan converts span to TempoSpan.
func (Span) FillOTELSpan ¶
FillOTELSpan fills given OpenTelemetry span using span fields.
func (Span) FillTraceMetadata ¶
func (span Span) FillTraceMetadata(m *tempoapi.TraceSearchMetadata)
FillTraceMetadata files TraceSearchMetadata fields using span.
The span should be a parent span.
type Tag ¶
type Tag struct {
Name string `json:"name" yson:"name"`
Value string `json:"value" yson:"value"`
Type int32 `json:"type" yson:"type"`
}
Tag is a data structure for tag.
type TraceByIDOptions ¶
type TraceByIDOptions struct {
// Start defines time range for search.
//
// Querier ignores parameter, if it is zero.
Start otelstorage.Timestamp
// End defines time range for search.
//
// Querier ignores parameter, if it is zero.
End otelstorage.Timestamp
}
TraceByIDOptions defines options for TraceByID method.