Documentation ¶
Overview ¶
Package tracestorage defines storage structure for trace storage.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToTempoAttrs ¶ added in v0.0.8
func ConvertToTempoAttrs(to *tempoapi.Attributes, from otelstorage.Attrs)
ConvertToTempoAttrs converts otelstorage.Attrs to Tempo API attributes.
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"` Name string `json:"name"` Attrs otelstorage.Attrs `json:"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"` SpanID otelstorage.SpanID `json:"span_id"` TraceState string `json:"trace_state"` Attrs otelstorage.Attrs `json:"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"` SpanID otelstorage.SpanID `json:"span_id"` TraceState string `json:"trace_state"` ParentSpanID otelstorage.SpanID `json:"parent_span_id"` Name string `json:"name"` Kind int32 `json:"kind"` Start otelstorage.Timestamp `json:"start"` End otelstorage.Timestamp `json:"end"` Attrs otelstorage.Attrs `json:"attrs"` StatusCode int32 `json:"status_code"` StatusMessage string `json:"status_message"` BatchID uuid.UUID `json:"batch_id"` ResourceAttrs otelstorage.Attrs `json:"resource_attrs"` ScopeName string `json:"scope_name"` ScopeVersion string `json:"scope_version"` ScopeAttrs otelstorage.Attrs `json:"scope_attrs"` Events []Event `json:"events"` Links []Link `json:"links"` }
Span is a data structure for span.
func NewSpanFromOTEL ¶
func NewSpanFromOTEL( batchID uuid.UUID, 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.
func (Span) ServiceName ¶ added in v0.0.8
ServiceName gets service name from attributes.
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.