clickhouse

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HistogramBuckets    = []float64{0, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000, math.Inf(1)}
	HistogramNextBucket = map[float32]float32{}
)

Functions

func RunSpaceManagerForProjects added in v1.13.0

func RunSpaceManagerForProjects(ctx context.Context, cfg config.ClickHouseSpaceManager, projects []*db.Project, globalClickHouse *db.IntegrationClickhouse) error

Types

type Client

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

func NewClient

func NewClient(config *db.IntegrationClickhouse, chInfo ch.ClickHouseInfo, project *db.Project) (*Client, error)

func (*Client) Close added in v1.13.0

func (c *Client) Close() error

func (*Client) GetDiskInfo added in v1.13.0

func (c *Client) GetDiskInfo(ctx context.Context) ([]DiskInfo, error)

func (*Client) GetInboundSpans

func (c *Client) GetInboundSpans(ctx context.Context, q SpanQuery, clients []string, listens []model.Listen) ([]*model.TraceSpan, error)

func (*Client) GetInboundSpansHistogram added in v0.29.4

func (c *Client) GetInboundSpansHistogram(ctx context.Context, q SpanQuery, clients []string, listens []model.Listen) ([]model.HistogramBucket, error)

func (*Client) GetKubernetesEvents added in v1.14.0

func (c *Client) GetKubernetesEvents(ctx context.Context, from, to timeseries.Time, limit int) ([]*model.LogEntry, error)

func (*Client) GetLogFilters added in v1.11.0

func (c *Client) GetLogFilters(ctx context.Context, query LogQuery, name string) ([]string, error)

func (*Client) GetLogs added in v1.11.0

func (c *Client) GetLogs(ctx context.Context, query LogQuery) ([]*model.LogEntry, error)

func (*Client) GetLogsHistogram added in v1.11.0

func (c *Client) GetLogsHistogram(ctx context.Context, query LogQuery) ([]model.LogHistogramBucket, error)

func (*Client) GetParentSpans

func (c *Client) GetParentSpans(ctx context.Context, spans []*model.TraceSpan) ([]*model.TraceSpan, error)

func (*Client) GetProfile

func (c *Client) GetProfile(ctx context.Context, q ProfileQuery) (*model.FlameGraphNode, error)

func (*Client) GetProfileTypes

func (c *Client) GetProfileTypes(ctx context.Context, from timeseries.Time) (map[string][]model.ProfileType, error)

func (*Client) GetRootSpans added in v1.0.0

func (c *Client) GetRootSpans(ctx context.Context, q SpanQuery) ([]*model.TraceSpan, error)

func (*Client) GetRootSpansHistogram added in v1.0.0

func (c *Client) GetRootSpansHistogram(ctx context.Context, q SpanQuery) ([]model.HistogramBucket, error)

func (*Client) GetSelectionAndBaselineTraces added in v1.17.0

func (c *Client) GetSelectionAndBaselineTraces(ctx context.Context, q SpanQuery) ([]*model.Trace, []*model.Trace, error)

func (*Client) GetServicesFromLogs

func (c *Client) GetServicesFromLogs(ctx context.Context, from timeseries.Time) ([]string, error)

func (*Client) GetServicesFromTraces

func (c *Client) GetServicesFromTraces(ctx context.Context, from timeseries.Time) ([]string, error)

func (*Client) GetSpansByServiceName

func (c *Client) GetSpansByServiceName(ctx context.Context, q SpanQuery) ([]*model.TraceSpan, error)

func (*Client) GetSpansByServiceNameHistogram added in v0.29.4

func (c *Client) GetSpansByServiceNameHistogram(ctx context.Context, q SpanQuery) ([]model.HistogramBucket, error)

func (*Client) GetSpansByTraceId

func (c *Client) GetSpansByTraceId(ctx context.Context, traceId string) ([]*model.TraceSpan, error)

func (*Client) GetTableSizes added in v1.13.0

func (c *Client) GetTableSizes(ctx context.Context) ([]TableInfo, error)

func (*Client) GetTraceErrors added in v1.0.0

func (c *Client) GetTraceErrors(ctx context.Context, q SpanQuery) (map[model.TraceSpanKey]*model.TraceErrorsStat, error)

func (*Client) GetTraceSpanStats added in v1.17.0

func (c *Client) GetTraceSpanStats(ctx context.Context, q SpanQuery) (map[model.TraceSpanKey]*model.TraceSpanStats, error)

func (*Client) GetTracesViolatingSLOs added in v1.14.3

func (c *Client) GetTracesViolatingSLOs(ctx context.Context, from, to timeseries.Time, world *model.World, app *model.Application) (*model.Trace, *model.Trace, error)

func (*Client) IsCloud added in v1.15.1

func (c *Client) IsCloud(ctx context.Context) (bool, error)

func (*Client) Ping

func (c *Client) Ping(ctx context.Context) error

func (*Client) Project added in v1.17.0

func (c *Client) Project() *db.Project

func (*Client) Query added in v1.5.2

func (c *Client) Query(ctx context.Context, query string, args ...interface{}) (driver.Rows, error)

func (*Client) QueryRow added in v1.12.3

func (c *Client) QueryRow(ctx context.Context, query string, args ...interface{}) driver.Row

type Clients added in v1.17.1

type Clients struct {
	Clients []*Client
	Error   error
}

func (Clients) Close added in v1.17.1

func (chs Clients) Close()

type ClusterInfo added in v1.13.0

type ClusterInfo struct {
	Topology    []ClusterNode    `json:"topology,omitempty"`
	TableSizes  []TableInfo      `json:"table_sizes,omitempty"`
	ServerDisks []ServerDiskInfo `json:"server_disks,omitempty"`
}

func GetClusterInfo added in v1.13.0

func GetClusterInfo(ctx context.Context, cfg *db.IntegrationClickhouse, info ch.ClickHouseInfo, project *db.Project) (*ClusterInfo, error)

type ClusterNode added in v1.13.0

type ClusterNode struct {
	Cluster    string `json:"cluster"`
	ShardNum   uint32 `json:"shard_num"`
	ReplicaNum uint32 `json:"replica_num"`
	HostName   string `json:"host_name"`
	Port       uint16 `json:"port"`
}

type DiskInfo added in v1.13.0

type DiskInfo struct {
	Name       string `json:"name"`
	Path       string `json:"path"`
	FreeSpace  uint64 `json:"free_space"`
	TotalSpace uint64 `json:"total_space"`
	Type       string `json:"type"`
}

type LogFilter added in v1.11.0

type LogFilter struct {
	Name  string `json:"name"`
	Op    string `json:"op"`
	Value string `json:"value"`
}

func (*LogFilter) Matches added in v1.17.0

func (lf *LogFilter) Matches(value string) bool

type LogQuery added in v1.11.0

type LogQuery struct {
	Ctx      timeseries.Context
	Source   model.LogSource
	Services []string
	Filters  []LogFilter
	Limit    int
	Since    time.Time
}

type PartitionInfo added in v1.13.0

type PartitionInfo struct {
	Database    string
	Table       string
	PartitionId string
}

type ProfileQuery added in v1.6.6

type ProfileQuery struct {
	Type       model.ProfileType
	From       timeseries.Time
	To         timeseries.Time
	Diff       bool
	Services   []string
	Containers []string
	Namespace  string
	Pod        string
}

type ServerDiskInfo added in v1.13.0

type ServerDiskInfo struct {
	Addr  string     `json:"addr"`
	Disks []DiskInfo `json:"disks,omitempty"`
	Error string     `json:"error,omitempty"`
}

type ServerResult added in v1.13.0

type ServerResult struct {
	Addr  string
	Data  interface{}
	Error error
}

type SpaceManager added in v1.13.0

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

func (*SpaceManager) CheckAndCleanup added in v1.13.0

func (sm *SpaceManager) CheckAndCleanup(ctx context.Context, project *db.Project, cluster string) error

type SpanFilter added in v1.0.6

type SpanFilter struct {
	Field string
	Op    string
	Value string
}

type SpanQuery added in v1.0.0

type SpanQuery struct {
	Ctx timeseries.Context

	TsFrom  timeseries.Time
	TsTo    timeseries.Time
	DurFrom time.Duration
	DurTo   time.Duration
	Errors  bool

	Limit int

	Filters          []SpanFilter
	ExcludePeerAddrs []string

	Diff bool
}

func (*SpanQuery) AddFilter added in v1.7.1

func (q *SpanQuery) AddFilter(field, op, value string)

func (*SpanQuery) DurationFilter added in v1.0.0

func (q *SpanQuery) DurationFilter() (string, []any)

func (*SpanQuery) Filter added in v1.7.1

func (q *SpanQuery) Filter() ([]string, []any)

func (*SpanQuery) IsSelectionDefined added in v1.0.0

func (q *SpanQuery) IsSelectionDefined() bool

func (*SpanQuery) RootSpansFilter added in v1.0.0

func (q *SpanQuery) RootSpansFilter() ([]string, []any)

func (*SpanQuery) SpansByServiceNameFilter added in v1.0.0

func (q *SpanQuery) SpansByServiceNameFilter() ([]string, []any)

type TableInfo added in v1.13.0

type TableInfo struct {
	Database              string     `json:"database"`
	Table                 string     `json:"table"`
	BytesOnDisk           uint64     `json:"bytes_on_disk"`
	DataUncompressedBytes uint64     `json:"data_uncompressed_bytes"`
	CompressionRatio      float64    `json:"compression_ratio"`
	TTLInfo               string     `json:"ttl_info,omitempty"`
	TTLSeconds            *uint64    `json:"ttl_seconds,omitempty"`
	DataSince             *time.Time `json:"data_since,omitempty"`
}

Jump to

Keyboard shortcuts

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