Documentation
¶
Overview ¶
Package trace implements a trace-based storage which consists of trace data. Traces are composed of spans and support querying by trace ID and various tags. TODO: Remove this once trace partitioning is implemented nolint:unused
Index ¶
- Constants
- Variables
- func CreatePartFileReaderFromPath(partPath string, lfs fs.FileSystem) ([]queue.FileInfo, func())
- func CreateTestPartForDump(tmpPath string, fileSystem fs.FileSystem) (string, func())
- func ParsePartMetadata(fileSystem fs.FileSystem, partPath string) (queue.StreamingPartData, error)
- func VisitTracesInTimeRange(tsdbRootPath string, timeRange timestamp.TimeRange, visitor Visitor, ...) ([]string, error)
- type NodeSelector
- type Query
- type SchemaService
- type Service
- type Trace
- type Visitor
Constants ¶
const PartTypeCore = "core"
PartTypeCore is the type of the core part.
Variables ¶
var ( // ErrTraceNotExist denotes a trace doesn't exist in the metadata repo. ErrTraceNotExist = errors.New("trace doesn't exist") )
var ( // ErrTraceNotFound is returned when a trace is not found. ErrTraceNotFound = errors.New("trace not found") )
Functions ¶
func CreatePartFileReaderFromPath ¶ added in v0.10.0
func CreatePartFileReaderFromPath(partPath string, lfs fs.FileSystem) ([]queue.FileInfo, func())
CreatePartFileReaderFromPath opens all files in a part directory and returns their FileInfo and a cleanup function.
func CreateTestPartForDump ¶
func CreateTestPartForDump(tmpPath string, fileSystem fs.FileSystem) (string, func())
CreateTestPartForDump creates a test trace part for testing the dump tool. It returns the part path (directory) and cleanup function.
func ParsePartMetadata ¶ added in v0.10.0
func ParsePartMetadata(fileSystem fs.FileSystem, partPath string) (queue.StreamingPartData, error)
ParsePartMetadata parses the part metadata from the metadata.json file.
func VisitTracesInTimeRange ¶ added in v0.10.0
func VisitTracesInTimeRange(tsdbRootPath string, timeRange timestamp.TimeRange, visitor Visitor, intervalRule storage.IntervalRule) ([]string, error)
VisitTracesInTimeRange traverses trace parts within the specified time range and calls the visitor methods for parts and sidx directories. This function works directly with the filesystem without requiring a database instance. Returns a list of segment suffixes that were visited.
Types ¶
type NodeSelector ¶
type NodeSelector interface {
Locate(group, name string, shardID, replicaID uint32) (string, error)
fmt.Stringer
}
NodeSelector provides functionality to locate nodes for data distribution.
type Query ¶
type Query interface {
LoadGroup(name string) (schema.Group, bool)
Trace(metadata *commonv1.Metadata) (Trace, error)
GetRemovalSegmentsTimeRange(group string) *timestamp.TimeRange
}
Query allows retrieving traces.
type SchemaService ¶
type SchemaService interface {
Query
Close()
}
SchemaService allows querying schema information.
type Service ¶
type Service interface {
run.PreRunner
run.Config
run.Service
Query
CollectDataInfo(context.Context, string) (*databasev1.DataInfo, error)
CollectLiaisonInfo(context.Context, string) (*databasev1.LiaisonInfo, error)
}
Service allows inspecting the trace data.
func LiaisonService ¶
LiaisonService returns a new liaison service (deprecated - use NewLiaison).
func NewLiaison ¶
func NewLiaison(metadata metadata.Repo, pipeline queue.Server, omr observability.MetricsRegistry, pm protector.Memory, dataNodeSelector node.Selector, tire2Client queue.Client, ) (Service, error)
NewLiaison creates a new trace liaison service with the given dependencies.
func NewService ¶
func NewService(metadata metadata.Repo, pipeline queue.Server, omr observability.MetricsRegistry, pm protector.Memory) (Service, error)
NewService returns a new service.
type Trace ¶
type Trace interface {
GetSchema() *databasev1.Trace
GetIndexRules() []*databasev1.IndexRule
Query(ctx context.Context, opts model.TraceQueryOptions) (model.TraceQueryResult, error)
}
Trace allows inspecting trace details.
type Visitor ¶ added in v0.10.0
type Visitor interface {
// VisitSeries visits the series index directory for a segment.
VisitSeries(segmentTR *timestamp.TimeRange, seriesIndexPath string, shardIDs []common.ShardID) error
// VisitShard visits the shard directory for a segment.
VisitShard(segmentTR *timestamp.TimeRange, shardID common.ShardID, segmentPath string) error
}
Visitor defines the interface for visiting trace components.
Source Files
¶
- block.go
- block_metadata.go
- block_reader.go
- block_writer.go
- bloom_filter.go
- constants.go
- flusher.go
- gc.go
- handoff_controller.go
- handoff_storage.go
- introducer.go
- merger.go
- merger_policy.go
- metadata.go
- metrics.go
- part.go
- part_iter.go
- part_metadata.go
- primary_metadata.go
- query.go
- snapshot.go
- streaming_pipeline.go
- svc_liaison.go
- svc_standalone.go
- syncer.go
- tag.go
- tag_metadata.go
- test_helper.go
- trace.go
- traces.go
- tracing.go
- tstable.go
- visitor.go
- wqueue.go
- write_data.go
- write_index.go
- write_liaison.go
- write_standalone.go