chdump

package
v0.23.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package chdump provides utilities to read ClickHouse data dumps created by oteldb.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadDir

func ReadDir(dir string, opts ReadOptions) error

ReadDir reads dump from unpacked directory.

func ReadTar

func ReadTar(r io.Reader, opts ReadOptions) error

ReadTar reads dump from given tar file.

Types

type Attributes

type Attributes struct {
	// contains filtered or unexported fields
}

func NewAttributes

func NewAttributes() *Attributes

NewAttributes creates a new Attributes.

func (*Attributes) DecodeColumn

func (a *Attributes) DecodeColumn(r *proto.Reader, rows int) error

func (*Attributes) DecodeState

func (a *Attributes) DecodeState(r *proto.Reader) error

func (*Attributes) Reset

func (a *Attributes) Reset()

func (*Attributes) Row

func (a *Attributes) Row(i int) otelstorage.Attrs

func (Attributes) Rows

func (a Attributes) Rows() int

func (Attributes) Type

func (a Attributes) Type() proto.ColumnType

type ExpHistograms

type ExpHistograms struct {
	Name           *proto.ColLowCardinality[string]
	NameNormalized *proto.ColLowCardinality[string]
	Timestamp      *proto.ColDateTime64

	Count                *proto.ColUInt64
	Sum                  *proto.ColNullable[float64]
	Min                  *proto.ColNullable[float64]
	Max                  *proto.ColNullable[float64]
	Scale                *proto.ColInt32
	ZeroCount            *proto.ColUInt64
	PositiveOffset       *proto.ColInt32
	PositiveBucketCounts *proto.ColArr[uint64]
	NegativeOffset       *proto.ColInt32
	NegativeBucketCounts *proto.ColArr[uint64]

	Flags      *proto.ColUInt8
	Attributes *Attributes
	Scope      *Attributes
	Resource   *Attributes
}

ExpHistograms is a parsed dump of metric ExpHistograms.

func NewExpHistograms

func NewExpHistograms() *ExpHistograms

NewExpHistograms creates a new ExpHistograms.

func (*ExpHistograms) Reset

func (c *ExpHistograms) Reset()

Reset resets ExpHistograms data.

func (*ExpHistograms) Result

func (c *ExpHistograms) Result() proto.Results

Result returns a ExpHistograms result.

type Logs

type Logs struct {
	ServiceInstanceID *proto.ColLowCardinality[string]
	ServiceName       *proto.ColLowCardinality[string]
	ServiceNamespace  *proto.ColLowCardinality[string]

	Timestamp *proto.ColDateTime64

	SeverityNumber *proto.ColUInt8
	SeverityText   *proto.ColLowCardinality[string]

	TraceFlags *proto.ColUInt8
	TraceID    *proto.ColRawOf[otelstorage.TraceID]
	SpanID     *proto.ColRawOf[otelstorage.SpanID]

	Body *proto.ColStr

	Attributes *Attributes
	Resource   *Attributes

	Scope        *Attributes
	ScopeName    *proto.ColLowCardinality[string]
	ScopeVersion *proto.ColLowCardinality[string]
}

Logs is a parsed dump of logs.

func NewLogs

func NewLogs() *Logs

NewLogs creates a new Logs.

func (*Logs) Reset

func (c *Logs) Reset()

Reset resets Logs data.

func (*Logs) Result

func (c *Logs) Result() proto.Results

Result returns a Logs result.

type Points

type Points struct {
	Name           *proto.ColLowCardinality[string]
	NameNormalized *proto.ColLowCardinality[string]
	Timestamp      *proto.ColDateTime64

	Mapping *proto.ColEnum8
	Value   *proto.ColFloat64

	Flags      *proto.ColUInt8
	Attributes *Attributes
	Resource   *Attributes
	Scope      *Attributes
}

Points is a parsed dump of metric points.

func NewPoints

func NewPoints() *Points

NewPoints creates a new Points.

func (*Points) Reset

func (c *Points) Reset()

Reset resets Points data.

func (*Points) Result

func (c *Points) Result() proto.Results

Result returns a Points result.

type ReadOptions

type ReadOptions struct {
	OnTraces        func(*Spans) error
	OnPoints        func(*Points) error
	OnExpHistograms func(*ExpHistograms) error
	OnLogs          func(*Logs) error
}

ReadOptions defines options for [Read].

type Spans

type Spans struct {
	ServiceInstanceID *proto.ColLowCardinality[string]
	ServiceName       *proto.ColLowCardinality[string]
	ServiceNamespace  *proto.ColLowCardinality[string]

	TraceID       *proto.ColRawOf[otelstorage.TraceID]
	SpanID        *proto.ColRawOf[otelstorage.SpanID]
	TraceState    *proto.ColStr
	ParentSpanID  *proto.ColRawOf[otelstorage.SpanID]
	Name          *proto.ColLowCardinality[string]
	Kind          *proto.ColEnum8
	Start         *proto.ColDateTime64
	End           *proto.ColDateTime64
	StatusCode    *proto.ColUInt8
	StatusMessage *proto.ColLowCardinality[string]
	BatchID       *proto.ColUUID

	Attributes *Attributes
	Resource   *Attributes

	Scope        *Attributes
	ScopeName    *proto.ColLowCardinality[string]
	ScopeVersion *proto.ColLowCardinality[string]

	EventsNames      *proto.ColArr[string]
	EventsTimestamps *proto.ColArr[time.Time]
	EventsAttributes *proto.ColArr[[]byte]

	LinksTraceIDs    *proto.ColArr[otelstorage.TraceID]
	LinksSpanIDs     *proto.ColArr[otelstorage.SpanID]
	LinksTracestates *proto.ColArr[string]
	LinksAttributes  *proto.ColArr[[]byte]
}

Spans is a parsed dump of traces_spans.

func NewSpans

func NewSpans() *Spans

NewSpans creates a new Spans.

func (*Spans) Reset

func (c *Spans) Reset()

Reset resets Spans data.

func (*Spans) Result

func (c *Spans) Result() proto.Results

Result returns a Spans result.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL