Documentation
¶
Index ¶
- Constants
- func Dump(ctx context.Context, root, clientID, selection string, out io.Writer) error
- func LogsToPB(dbLog []Log) []*otlplogsv1.ResourceLogs
- func MarshalProtoJSONs[T proto.Message](protos []T) ([]byte, error)
- func MetricsToPB(dbMetrics []Metric) []*otlpmetricsv1.ResourceMetrics
- func UnmarshalProtoJSONs[T proto.Message](pb []byte, base T, out *[]T) error
- type AppendStats
- type DB
- func (s *DB) AppendLogs(rows []Log) (AppendStats, error)
- func (s *DB) AppendMetrics(rows []Metric) (AppendStats, error)
- func (s *DB) AppendSpans(rows []Span) (AppendStats, error)
- func (s *DB) Close() error
- func (s *DB) Read() *DB
- func (s *DB) SelectLogsBeneathSpan(ctx context.Context, arg SelectLogsBeneathSpanParams) ([]Log, error)
- func (s *DB) SelectLogsSince(ctx context.Context, arg SelectLogsSinceParams) ([]Log, error)
- func (s *DB) SelectMetricsSince(ctx context.Context, arg SelectMetricsSinceParams) ([]Metric, error)
- func (s *DB) SelectSpan(ctx context.Context, arg SelectSpanParams) (Span, error)
- func (s *DB) SelectSpansSince(ctx context.Context, arg SelectSpansSinceParams) ([]Span, error)
- type DBs
- type Log
- type Metric
- type SelectLogsBeneathSpanParams
- type SelectLogsSinceParams
- type SelectMetricsSinceParams
- type SelectSpanParams
- type SelectSpansSinceParams
- type Span
Constants ¶
const ( DumpAll = "all" DumpSpans = "spans" DumpLogs = "logs" DumpMetrics = "metrics" )
const CollectGarbageAfter = time.Hour
CollectGarbageAfter is the time after which a store is considered garbage.
Variables ¶
This section is empty.
Functions ¶
func Dump ¶
Dump writes the selected persisted stream rows as JSON lines. It opens files read-only and is intended for a closed store, whose tails have been flushed.
func LogsToPB ¶ added in v0.13.1
func LogsToPB(dbLog []Log) []*otlplogsv1.ResourceLogs
func MarshalProtoJSONs ¶ added in v0.13.1
func MetricsToPB ¶ added in v0.13.6
func MetricsToPB(dbMetrics []Metric) []*otlpmetricsv1.ResourceMetrics
Types ¶
type AppendStats ¶
type AppendStats struct {
LastID int64
CapWaitDuration time.Duration
SpillLagRows int
SpillLagBytes int64
}
AppendStats describes the append-side work and the stream backlog visible when an append returns. CapWaitDuration is non-zero only when the hard memory cap applied backpressure to the caller.
type DB ¶ added in v0.19.7
type DB struct {
// contains filtered or unexported fields
}
DB is one client's standalone append-only telemetry store.
func (*DB) AppendLogs ¶
func (s *DB) AppendLogs(rows []Log) (AppendStats, error)
func (*DB) AppendMetrics ¶
func (s *DB) AppendMetrics(rows []Metric) (AppendStats, error)
func (*DB) AppendSpans ¶
func (s *DB) AppendSpans(rows []Span) (AppendStats, error)
func (*DB) Read ¶
Read mirrors the current DB handle seam. The append-only store needs no separate read pool, so selectors are bound to the same immutable streams.
func (*DB) SelectLogsBeneathSpan ¶
func (*DB) SelectLogsSince ¶
func (*DB) SelectMetricsSince ¶
func (*DB) SelectSpan ¶
func (*DB) SelectSpansSince ¶
type DBs ¶
type DBs struct {
Root string
// contains filtered or unexported fields
}
DBs owns the refcounted set of open per-client telemetry stores. Stream files persist after the final Close and are recovered on the next Open, including their ID sequences and span lookup maps.
type SelectLogsBeneathSpanParams ¶ added in v0.19.0
type SelectLogsBeneathSpanParams struct {
SpanID sql.NullString
ID int64
Limit int64
}
type SelectLogsSinceParams ¶
type SelectMetricsSinceParams ¶ added in v0.13.6
type SelectSpanParams ¶ added in v0.19.0
type SelectSpansSinceParams ¶
type Span ¶
type Span struct {
ID int64
TraceID string
SpanID string
TraceState string
ParentSpanID sql.NullString
Flags int64
Name string
Kind string
StartTime int64
EndTime sql.NullInt64
Attributes []byte
DroppedAttributesCount int64
Events []byte
DroppedEventsCount int64
Links []byte
DroppedLinksCount int64
StatusCode int64
StatusMessage string
InstrumentationScope []byte
Resource []byte
ResourceSchemaURL string
}
func (*Span) ReadOnly ¶
func (span *Span) ReadOnly() sdktrace.ReadOnlySpan