lrdb

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LogSortVersionUnknown indicates the file's sort order is unknown or unsorted (legacy files)
	LogSortVersionUnknown = 0
	// LogSortVersionTimestamp indicates the file is sorted by [timestamp] only (legacy)
	LogSortVersionTimestamp = 1
	// LogSortVersionServiceTimestamp indicates the file is sorted by
	// [resource_customer_domain OR resource_service_name, timestamp]
	LogSortVersionServiceTimestamp = 2
)

Sort version constants for log segments

View Source
const (
	// MetricSortVersionUnknown indicates the file's sort order is unknown or unsorted (legacy files)
	MetricSortVersionUnknown = 0
	// MetricSortVersionNameTidTimestamp indicates the file is sorted by [metric_name, tid, timestamp] (old TID calculation)
	MetricSortVersionNameTidTimestamp = 1
	// MetricSortVersionNameTidTimestampV2 indicates the file is sorted by [metric_name, tid, timestamp] (new TID calculation)
	MetricSortVersionNameTidTimestampV2 = 2
	// due to a bug, we will move everyone to 3, same key though...
	MetricSortVersionNameTidTimestampV3 = 3
)

Sort version constants for metric segments

View Source
const (
	MetricTypeUnknown              int16 = 0
	MetricTypeGauge                int16 = 1
	MetricTypeSum                  int16 = 2
	MetricTypeHistogram            int16 = 3
	MetricTypeExponentialHistogram int16 = 4
	MetricTypeSummary              int16 = 5
)

MetricType constants matching OTEL metric data types

View Source
const (
	// CurrentLogSortVersion is the sort version used for all newly created log segments
	CurrentLogSortVersion = LogSortVersionServiceTimestamp
)

Current log sort configuration - single source of truth for all log sorting

View Source
const (
	// CurrentMetricSortVersion is the sort version used for all newly created metric segments
	CurrentMetricSortVersion = MetricSortVersionNameTidTimestampV3
)

Current metric sort configuration - single source of truth for all metric sorting

Variables

View Source
var (
	ErrBatchAlreadyClosed = errors.New("batch already closed")
)

Functions

func ConnectTolrdb added in v1.4.0

func ConnectTolrdb(ctx context.Context, opts ...dbopen.Options) (*pgxpool.Pool, error)

func MetricTypeFromString added in v1.7.0

func MetricTypeFromString(s string) int16

MetricTypeFromString converts a string metric type to its int16 constant

func MetricTypeToString added in v1.7.0

func MetricTypeToString(t int16) string

MetricTypeToString converts an int16 metric type constant to its string representation

Types

type ActionEnum

type ActionEnum string
const (
	ActionEnumCompact ActionEnum = "compact"
	ActionEnumRollup  ActionEnum = "rollup"
)

func (*ActionEnum) Scan

func (e *ActionEnum) Scan(src interface{}) error

type BatchDeleteMetricSegsBatchResults

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

func (*BatchDeleteMetricSegsBatchResults) Close

func (*BatchDeleteMetricSegsBatchResults) Exec

func (b *BatchDeleteMetricSegsBatchResults) Exec(f func(int, error))

type BatchDeleteMetricSegsParams

type BatchDeleteMetricSegsParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	FrequencyMs    int32     `json:"frequency_ms"`
	SegmentID      int64     `json:"segment_id"`
	InstanceNum    int16     `json:"instance_num"`
}

type BatchMarkMetricSegsRolledupBatchResults

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

func (*BatchMarkMetricSegsRolledupBatchResults) Close

func (*BatchMarkMetricSegsRolledupBatchResults) Exec

type BatchMarkMetricSegsRolledupParams

type BatchMarkMetricSegsRolledupParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	FrequencyMs    int32     `json:"frequency_ms"`
	SegmentID      int64     `json:"segment_id"`
	InstanceNum    int16     `json:"instance_num"`
}

type CallExpirePublishedByIngestCutoffParams added in v1.4.1

type CallExpirePublishedByIngestCutoffParams struct {
	PartitionName  interface{} `json:"partition_name"`
	OrganizationID uuid.UUID   `json:"organization_id"`
	CutoffDateint  int32       `json:"cutoff_dateint"`
	BatchSize      int32       `json:"batch_size"`
}

type CallFindOrgPartitionParams added in v1.4.1

type CallFindOrgPartitionParams struct {
	TableName      interface{} `json:"table_name"`
	OrganizationID uuid.UUID   `json:"organization_id"`
}

type CleanupKafkaOffsetsParams added in v1.3.6

type CleanupKafkaOffsetsParams struct {
	ConsumerGroup string `json:"consumer_group"`
	Topic         string `json:"topic"`
	PartitionID   int32  `json:"partition_id"`
	MaxOffset     int64  `json:"max_offset"`
}

type CompactLogSegsNew added in v1.3.4

type CompactLogSegsNew struct {
	SegmentID     int64
	StartTs       int64
	EndTs         int64
	RecordCount   int64
	FileSize      int64
	Fingerprints  []int64
	LabelNameMap  []byte
	StreamIds     []string
	StreamIdField *string
	SortVersion   int16
	AggFields     []string
}

CompactLogSegsNew represents a new compacted log segment to be inserted

type CompactLogSegsOld added in v1.3.4

type CompactLogSegsOld struct {
	SegmentID int64
}

CompactLogSegsOld represents an old log segment to be marked as compacted

type CompactLogSegsParams added in v1.3.4

type CompactLogSegsParams struct {
	OrganizationID uuid.UUID
	Dateint        int32
	IngestDateint  int32
	InstanceNum    int16
	NewRecords     []CompactLogSegsNew
	OldRecords     []CompactLogSegsOld
	CreatedBy      CreatedBy
}

CompactLogSegsParams defines the parameters for log segment compaction with Kafka offsets

type CompactMetricSegsNew added in v1.3.0

type CompactMetricSegsNew struct {
	SegmentID    int64
	StartTs      int64
	EndTs        int64
	RecordCount  int64
	FileSize     int64
	Fingerprints []int64
	MetricNames  []string
	MetricTypes  []int16
}

type CompactMetricSegsOld added in v1.3.0

type CompactMetricSegsOld struct {
	SegmentID int64
}

type CompactMetricSegsParams added in v1.3.0

type CompactMetricSegsParams struct {
	// OrganizationID is the ID of the organization to which the metric segments belong.
	OrganizationID uuid.UUID
	// Dateint is the date in YYYYMMDD format for which the metric segments are being replaced.
	Dateint int32
	// InstanceNum is the instance number for which the segments are being replaced.
	InstanceNum int16
	// IngestDateint is the date in YYYYMMDD format when the segments were ingested.
	IngestDateint int32
	// FrequencyMs is the frequency in milliseconds at which the metrics are collected.
	FrequencyMs int32
	// OldRecords contains the segments to be deleted.
	OldRecords []CompactMetricSegsOld
	// NewRecords contains the segments to be inserted.
	NewRecords []CompactMetricSegsNew
	CreatedBy  CreatedBy
}

type CompactTraceSegsNew added in v1.3.4

type CompactTraceSegsNew struct {
	SegmentID    int64
	StartTs      int64
	EndTs        int64
	RecordCount  int64
	FileSize     int64
	Fingerprints []int64
	LabelNameMap []byte
}

CompactTraceSegsNew represents a new compacted trace segment to be inserted

type CompactTraceSegsOld added in v1.3.4

type CompactTraceSegsOld struct {
	SegmentID int64
}

CompactTraceSegsOld represents an old trace segment to be marked as compacted

type CompactTraceSegsParams added in v1.3.4

type CompactTraceSegsParams struct {
	OrganizationID uuid.UUID
	Dateint        int32
	IngestDateint  int32
	InstanceNum    int16
	NewRecords     []CompactTraceSegsNew
	OldRecords     []CompactTraceSegsOld
	CreatedBy      CreatedBy
}

CompactTraceSegsParams defines the parameters for trace segment compaction with Kafka offsets

type CreatedBy

type CreatedBy int16
const (
	CreatedByUnknown CreatedBy = iota
	CreatedByIngest
	CreatedByCompact
	CreatedByRollup
)

func (CreatedBy) String added in v1.3.6

func (c CreatedBy) String() string

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
	SendBatch(context.Context, *pgx.Batch) pgx.BatchResults
}

type GetAllBySignalRow added in v1.3.4

type GetAllBySignalRow struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	FrequencyMs    int32     `json:"frequency_ms"`
	TargetRecords  *int64    `json:"target_records"`
	UpdatedAt      time.Time `json:"updated_at"`
}

type GetAllPackEstimatesRow added in v1.3.4

type GetAllPackEstimatesRow struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	FrequencyMs    int32     `json:"frequency_ms"`
	Signal         string    `json:"signal"`
	TargetRecords  *int64    `json:"target_records"`
	UpdatedAt      time.Time `json:"updated_at"`
}

type GetLabelNameMapsParams added in v1.4.6

type GetLabelNameMapsParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	SegmentIds     []int64   `json:"segment_ids"`
}

type GetLabelNameMapsRow added in v1.4.6

type GetLabelNameMapsRow struct {
	SegmentID    int64  `json:"segment_id"`
	LabelNameMap []byte `json:"label_name_map"`
}

type GetLogSegParams added in v1.3.4

type GetLogSegParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	SegmentID      int64     `json:"segment_id"`
	InstanceNum    int16     `json:"instance_num"`
}

type GetLogSegmentsForDownloadParams added in v1.3.6

type GetLogSegmentsForDownloadParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	StartDateint   int32     `json:"start_dateint"`
	EndDateint     int32     `json:"end_dateint"`
	StartTime      int64     `json:"start_time"`
	EndTime        int64     `json:"end_time"`
}

type GetLogStreamIdValuesParams added in v1.6.4

type GetLogStreamIdValuesParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	StartDateint   int32     `json:"start_dateint"`
	EndDateint     int32     `json:"end_dateint"`
	StartTs        int64     `json:"start_ts"`
	EndTs          int64     `json:"end_ts"`
	TagName        *string   `json:"tag_name"`
}

type GetMetricLabelNameMapsParams added in v1.4.7

type GetMetricLabelNameMapsParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	FrequencyMs    int32     `json:"frequency_ms"`
	SegmentIds     []int64   `json:"segment_ids"`
}

type GetMetricLabelNameMapsRow added in v1.4.7

type GetMetricLabelNameMapsRow struct {
	SegmentID    int64  `json:"segment_id"`
	LabelNameMap []byte `json:"label_name_map"`
}

type GetMetricPackEstimatesRow added in v1.3.4

type GetMetricPackEstimatesRow struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	FrequencyMs    int32     `json:"frequency_ms"`
	TargetRecords  *int64    `json:"target_records"`
	UpdatedAt      time.Time `json:"updated_at"`
}

type GetMetricSegParams added in v1.3.4

type GetMetricSegParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	FrequencyMs    int32     `json:"frequency_ms"`
	SegmentID      int64     `json:"segment_id"`
	InstanceNum    int16     `json:"instance_num"`
}

type GetMetricSegmentsForDownloadParams added in v1.3.6

type GetMetricSegmentsForDownloadParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	StartDateint   int32     `json:"start_dateint"`
	EndDateint     int32     `json:"end_dateint"`
	StartTime      int64     `json:"start_time"`
	EndTime        int64     `json:"end_time"`
	FrequencyMs    int32     `json:"frequency_ms"`
}

type GetMetricSegsByIdsParams added in v1.3.0

type GetMetricSegsByIdsParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	FrequencyMs    int32     `json:"frequency_ms"`
	InstanceNum    int16     `json:"instance_num"`
	SegmentIds     []int64   `json:"segment_ids"`
}

type GetMetricTypeParams added in v1.3.0

type GetMetricTypeParams struct {
	MetricName     interface{} `json:"metric_name"`
	OrganizationID uuid.UUID   `json:"organization_id"`
	StartDateint   int32       `json:"start_dateint"`
	EndDateint     int32       `json:"end_dateint"`
}

type GetTraceLabelNameMapsParams added in v1.4.7

type GetTraceLabelNameMapsParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	SegmentIds     []int64   `json:"segment_ids"`
}

type GetTraceLabelNameMapsRow added in v1.4.7

type GetTraceLabelNameMapsRow struct {
	SegmentID    int64  `json:"segment_id"`
	LabelNameMap []byte `json:"label_name_map"`
}

type GetTraceSegParams added in v1.3.4

type GetTraceSegParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	SegmentID      int64     `json:"segment_id"`
	InstanceNum    int16     `json:"instance_num"`
}

type GetTraceSegmentsForDownloadParams added in v1.3.6

type GetTraceSegmentsForDownloadParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	StartDateint   int32     `json:"start_dateint"`
	EndDateint     int32     `json:"end_dateint"`
	StartTime      int64     `json:"start_time"`
	EndTime        int64     `json:"end_time"`
}

type InsertKafkaOffsetsParams added in v1.3.6

type InsertKafkaOffsetsParams struct {
	ConsumerGroup string     `json:"consumer_group"`
	Topic         string     `json:"topic"`
	PartitionID   int32      `json:"partition_id"`
	Offsets       []int64    `json:"offsets"`
	CreatedAt     *time.Time `json:"created_at"`
}

type InsertLogSegmentParams

type InsertLogSegmentParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	SegmentID      int64     `json:"segment_id"`
	InstanceNum    int16     `json:"instance_num"`
	StartTs        int64     `json:"start_ts"`
	EndTs          int64     `json:"end_ts"`
	RecordCount    int64     `json:"record_count"`
	FileSize       int64     `json:"file_size"`
	CreatedBy      CreatedBy `json:"created_by"`
	Fingerprints   []int64   `json:"fingerprints"`
	Published      bool      `json:"published"`
	Compacted      bool      `json:"compacted"`
	LabelNameMap   []byte    `json:"label_name_map"`
	StreamIds      []string  `json:"stream_ids"`
	StreamIDField  *string   `json:"stream_id_field"`
	SortVersion    int16     `json:"sort_version"`
	AggFields      []string  `json:"agg_fields"`
}

type InsertMetricSegmentParams

type InsertMetricSegmentParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	FrequencyMs    int32     `json:"frequency_ms"`
	SegmentID      int64     `json:"segment_id"`
	InstanceNum    int16     `json:"instance_num"`
	StartTs        int64     `json:"start_ts"`
	EndTs          int64     `json:"end_ts"`
	RecordCount    int64     `json:"record_count"`
	FileSize       int64     `json:"file_size"`
	CreatedBy      CreatedBy `json:"created_by"`
	Published      bool      `json:"published"`
	Rolledup       bool      `json:"rolledup"`
	Fingerprints   []int64   `json:"fingerprints"`
	SortVersion    int16     `json:"sort_version"`
	Compacted      bool      `json:"compacted"`
	LabelNameMap   []byte    `json:"label_name_map"`
	MetricNames    []string  `json:"metric_names"`
	MetricTypes    []int16   `json:"metric_types"`
}

type InsertMetricSegsParams added in v1.3.4

type InsertMetricSegsParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	FrequencyMs    int32     `json:"frequency_ms"`
	SegmentID      int64     `json:"segment_id"`
	InstanceNum    int16     `json:"instance_num"`
	StartTs        int64     `json:"start_ts"`
	EndTs          int64     `json:"end_ts"`
	RecordCount    int64     `json:"record_count"`
	FileSize       int64     `json:"file_size"`
	Published      bool      `json:"published"`
	CreatedBy      CreatedBy `json:"created_by"`
	Rolledup       bool      `json:"rolledup"`
	Fingerprints   []int64   `json:"fingerprints"`
	SortVersion    int16     `json:"sort_version"`
	Compacted      bool      `json:"compacted"`
	LabelNameMap   []byte    `json:"label_name_map"`
	MetricNames    []string  `json:"metric_names"`
	MetricTypes    []int16   `json:"metric_types"`
}

type InsertTraceSegmentParams added in v1.3.4

type InsertTraceSegmentParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	SegmentID      int64     `json:"segment_id"`
	InstanceNum    int16     `json:"instance_num"`
	StartTs        int64     `json:"start_ts"`
	EndTs          int64     `json:"end_ts"`
	RecordCount    int64     `json:"record_count"`
	FileSize       int64     `json:"file_size"`
	CreatedBy      CreatedBy `json:"created_by"`
	Fingerprints   []int64   `json:"fingerprints"`
	Published      bool      `json:"published"`
	Compacted      bool      `json:"compacted"`
	LabelNameMap   []byte    `json:"label_name_map"`
}

type KafkaOffsetInfo added in v1.3.6

type KafkaOffsetInfo struct {
	ConsumerGroup string
	Topic         string
	PartitionID   int32
	Offsets       []int64
}

KafkaOffsetInfo represents simplified kafka offset tracking information

type KafkaOffsetTracker added in v1.3.6

type KafkaOffsetTracker struct {
	ID            int64     `json:"id"`
	ConsumerGroup string    `json:"consumer_group"`
	Topic         string    `json:"topic"`
	PartitionID   int32     `json:"partition_id"`
	MinOffset     int64     `json:"min_offset"`
	MaxOffset     int64     `json:"max_offset"`
	Offsets       []int64   `json:"offsets"`
	CreatedAt     time.Time `json:"created_at"`
}

type KafkaOffsetsAfterParams added in v1.3.6

type KafkaOffsetsAfterParams struct {
	ConsumerGroup string `json:"consumer_group"`
	Topic         string `json:"topic"`
	PartitionID   int32  `json:"partition_id"`
	MinOffset     int64  `json:"min_offset"`
}

type ListLogQLTagsParams added in v1.4.7

type ListLogQLTagsParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	StartDateint   int32     `json:"start_dateint"`
	EndDateint     int32     `json:"end_dateint"`
}

type ListLogSegmentsForQueryParams added in v1.3.0

type ListLogSegmentsForQueryParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	Fingerprints   []int64   `json:"fingerprints"`
	S              int64     `json:"s"`
	E              int64     `json:"e"`
}

type ListLogSegmentsForQueryRow added in v1.3.0

type ListLogSegmentsForQueryRow struct {
	Fingerprint int64    `json:"fingerprint"`
	InstanceNum int16    `json:"instance_num"`
	SegmentID   int64    `json:"segment_id"`
	StartTs     int64    `json:"start_ts"`
	EndTs       int64    `json:"end_ts"`
	AggFields   []string `json:"agg_fields"`
}

type ListLogSegsForRecompactParams added in v1.8.0

type ListLogSegsForRecompactParams struct {
	OrganizationID      uuid.UUID   `json:"organization_id"`
	StartDateint        int32       `json:"start_dateint"`
	EndDateint          int32       `json:"end_dateint"`
	FilterAggFieldsNull interface{} `json:"filter_agg_fields_null"`
	FilterSortVersion   interface{} `json:"filter_sort_version"`
	MinSortVersion      int16       `json:"min_sort_version"`
}

type ListLogStreamsParams added in v1.6.3

type ListLogStreamsParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	StartDateint   int32     `json:"start_dateint"`
	EndDateint     int32     `json:"end_dateint"`
	StartTs        int64     `json:"start_ts"`
	EndTs          int64     `json:"end_ts"`
}

type ListLogStreamsRow added in v1.6.3

type ListLogStreamsRow struct {
	FieldName   *string `json:"field_name"`
	StreamValue string  `json:"stream_value"`
}

type ListMetricNamesParams added in v1.7.0

type ListMetricNamesParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	StartDateint   int32     `json:"start_dateint"`
	EndDateint     int32     `json:"end_dateint"`
	StartTs        int64     `json:"start_ts"`
	EndTs          int64     `json:"end_ts"`
}

type ListMetricNamesWithTypesParams added in v1.7.0

type ListMetricNamesWithTypesParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	StartDateint   int32     `json:"start_dateint"`
	EndDateint     int32     `json:"end_dateint"`
	StartTs        int64     `json:"start_ts"`
	EndTs          int64     `json:"end_ts"`
}

type ListMetricNamesWithTypesRow added in v1.7.0

type ListMetricNamesWithTypesRow struct {
	MetricName string `json:"metric_name"`
	MetricType int16  `json:"metric_type"`
}

type ListMetricSegmentsForQueryParams added in v1.3.0

type ListMetricSegmentsForQueryParams struct {
	StartTs        int64     `json:"start_ts"`
	EndTs          int64     `json:"end_ts"`
	Dateint        int32     `json:"dateint"`
	FrequencyMs    int32     `json:"frequency_ms"`
	OrganizationID uuid.UUID `json:"organization_id"`
	Fingerprints   []int64   `json:"fingerprints"`
}

type ListMetricSegmentsForQueryRow added in v1.3.0

type ListMetricSegmentsForQueryRow struct {
	InstanceNum int16 `json:"instance_num"`
	SegmentID   int64 `json:"segment_id"`
	StartTs     int64 `json:"start_ts"`
	EndTs       int64 `json:"end_ts"`
}

type ListPromMetricTagsParams added in v1.3.0

type ListPromMetricTagsParams struct {
	OrganizationID    uuid.UUID `json:"organization_id"`
	StartDateint      int32     `json:"start_dateint"`
	EndDateint        int32     `json:"end_dateint"`
	MetricFingerprint int64     `json:"metric_fingerprint"`
}

type ListSpanTagsParams added in v1.4.7

type ListSpanTagsParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	StartDateint   int32     `json:"start_dateint"`
	EndDateint     int32     `json:"end_dateint"`
}

type ListTraceSegmentsForQueryParams added in v1.4.0

type ListTraceSegmentsForQueryParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	Fingerprints   []int64   `json:"fingerprints"`
	S              int64     `json:"s"`
	E              int64     `json:"e"`
}

type ListTraceSegmentsForQueryRow added in v1.4.0

type ListTraceSegmentsForQueryRow struct {
	Fingerprint int64 `json:"fingerprint"`
	InstanceNum int16 `json:"instance_num"`
	SegmentID   int64 `json:"segment_id"`
	StartTs     int64 `json:"start_ts"`
	EndTs       int64 `json:"end_ts"`
}

type LogSeg

type LogSeg struct {
	OrganizationID uuid.UUID                 `json:"organization_id"`
	Dateint        int32                     `json:"dateint"`
	SegmentID      int64                     `json:"segment_id"`
	InstanceNum    int16                     `json:"instance_num"`
	Fingerprints   []int64                   `json:"fingerprints"`
	RecordCount    int64                     `json:"record_count"`
	FileSize       int64                     `json:"file_size"`
	IngestDateint  int32                     `json:"ingest_dateint"`
	TsRange        pgtype.Range[pgtype.Int8] `json:"ts_range"`
	CreatedBy      CreatedBy                 `json:"created_by"`
	CreatedAt      time.Time                 `json:"created_at"`
	Compacted      bool                      `json:"compacted"`
	Published      bool                      `json:"published"`
	LabelNameMap   []byte                    `json:"label_name_map"`
	StreamIds      []string                  `json:"stream_ids"`
	SortVersion    int16                     `json:"sort_version"`
	StreamIDField  *string                   `json:"stream_id_field"`
	AggFields      []string                  `json:"agg_fields"`
}

type LogSegEstimatorParams

type LogSegEstimatorParams struct {
	TargetBytes float64 `json:"target_bytes"`
	DateintLow  int32   `json:"dateint_low"`
	DateintHigh int32   `json:"dateint_high"`
	MsLow       int64   `json:"ms_low"`
	MsHigh      int64   `json:"ms_high"`
}

type LogSegEstimatorRow

type LogSegEstimatorRow struct {
	OrganizationID   uuid.UUID `json:"organization_id"`
	EstimatedRecords int64     `json:"estimated_records"`
}

type LogSegmentCleanupBatchDeleteBatchResults added in v1.3.5

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

func (*LogSegmentCleanupBatchDeleteBatchResults) Close added in v1.3.5

func (*LogSegmentCleanupBatchDeleteBatchResults) Exec added in v1.3.5

type LogSegmentCleanupBatchDeleteParams added in v1.3.5

type LogSegmentCleanupBatchDeleteParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	SegmentID      int64     `json:"segment_id"`
	InstanceNum    int16     `json:"instance_num"`
}

type LogSegmentCleanupDeleteParams added in v1.3.5

type LogSegmentCleanupDeleteParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	SegmentID      int64     `json:"segment_id"`
	InstanceNum    int16     `json:"instance_num"`
}

type LogSegmentCleanupGetParams added in v1.3.5

type LogSegmentCleanupGetParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	AgeThreshold   time.Time `json:"age_threshold"`
	MaxRows        int32     `json:"max_rows"`
}

type LogSegmentCleanupGetRow added in v1.3.5

type LogSegmentCleanupGetRow struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	SegmentID      int64     `json:"segment_id"`
	InstanceNum    int16     `json:"instance_num"`
	FileSize       int64     `json:"file_size"`
	TsRangeLower   int64     `json:"ts_range_lower"`
	AggFields      []string  `json:"agg_fields"`
}

type LogSegmentUpserter

type LogSegmentUpserter interface {
	InsertLogSegment(ctx context.Context, params InsertLogSegmentParams) error
	InsertLogSegmentsBatch(ctx context.Context, segments []InsertLogSegmentParams) error
	CompactLogSegments(ctx context.Context, params CompactLogSegsParams) error
}

type LrdbServiceIdentifier added in v1.3.0

type LrdbServiceIdentifier struct {
	ID             uuid.UUID   `json:"id"`
	CreatedAt      time.Time   `json:"created_at"`
	UpdatedAt      time.Time   `json:"updated_at"`
	OrganizationID pgtype.UUID `json:"organization_id"`
	ServiceName    *string     `json:"service_name"`
	ClusterName    *string     `json:"cluster_name"`
	Namespace      *string     `json:"namespace"`
}

type MarkLogSegsCompactedByKeysParams added in v1.3.4

type MarkLogSegsCompactedByKeysParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	InstanceNum    int16     `json:"instance_num"`
	SegmentIds     []int64   `json:"segment_ids"`
}

type MarkMetricSegsCompactedByKeysParams added in v1.3.0

type MarkMetricSegsCompactedByKeysParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	FrequencyMs    int32     `json:"frequency_ms"`
	InstanceNum    int16     `json:"instance_num"`
	SegmentIds     []int64   `json:"segment_ids"`
}

type MarkMetricSegsRolledupByKeysParams added in v1.3.0

type MarkMetricSegsRolledupByKeysParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	FrequencyMs    int32     `json:"frequency_ms"`
	InstanceNum    int16     `json:"instance_num"`
	SegmentIds     []int64   `json:"segment_ids"`
}

type MarkTraceSegsCompactedByKeysParams added in v1.3.4

type MarkTraceSegsCompactedByKeysParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	InstanceNum    int16     `json:"instance_num"`
	SegmentIds     []int64   `json:"segment_ids"`
}

type MetricSeg

type MetricSeg struct {
	OrganizationID uuid.UUID                 `json:"organization_id"`
	Dateint        int32                     `json:"dateint"`
	FrequencyMs    int32                     `json:"frequency_ms"`
	SegmentID      int64                     `json:"segment_id"`
	InstanceNum    int16                     `json:"instance_num"`
	TsRange        pgtype.Range[pgtype.Int8] `json:"ts_range"`
	RecordCount    int64                     `json:"record_count"`
	FileSize       int64                     `json:"file_size"`
	IngestDateint  int32                     `json:"ingest_dateint"`
	Published      bool                      `json:"published"`
	Rolledup       bool                      `json:"rolledup"`
	CreatedAt      time.Time                 `json:"created_at"`
	CreatedBy      CreatedBy                 `json:"created_by"`
	Fingerprints   []int64                   `json:"fingerprints"`
	SortVersion    int16                     `json:"sort_version"`
	Compacted      bool                      `json:"compacted"`
	LabelNameMap   []byte                    `json:"label_name_map"`
	MetricNames    []string                  `json:"metric_names"`
	MetricTypes    []int16                   `json:"metric_types"`
}

type MetricSegEstimatorParams

type MetricSegEstimatorParams struct {
	TargetBytes float64 `json:"target_bytes"`
	DateintLow  int32   `json:"dateint_low"`
	DateintHigh int32   `json:"dateint_high"`
	MsLow       int64   `json:"ms_low"`
	MsHigh      int64   `json:"ms_high"`
}

type MetricSegEstimatorRow

type MetricSegEstimatorRow struct {
	OrganizationID   uuid.UUID `json:"organization_id"`
	FrequencyMs      int32     `json:"frequency_ms"`
	EstimatedRecords int64     `json:"estimated_records"`
}

type MetricSegmentCleanupBatchDeleteBatchResults added in v1.3.5

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

func (*MetricSegmentCleanupBatchDeleteBatchResults) Close added in v1.3.5

func (*MetricSegmentCleanupBatchDeleteBatchResults) Exec added in v1.3.5

type MetricSegmentCleanupBatchDeleteParams added in v1.3.5

type MetricSegmentCleanupBatchDeleteParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	FrequencyMs    int32     `json:"frequency_ms"`
	SegmentID      int64     `json:"segment_id"`
	InstanceNum    int16     `json:"instance_num"`
}

type MetricSegmentCleanupDeleteParams added in v1.3.5

type MetricSegmentCleanupDeleteParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	FrequencyMs    int32     `json:"frequency_ms"`
	SegmentID      int64     `json:"segment_id"`
	InstanceNum    int16     `json:"instance_num"`
}

type MetricSegmentCleanupGetParams added in v1.3.5

type MetricSegmentCleanupGetParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	AgeThreshold   time.Time `json:"age_threshold"`
	MaxRows        int32     `json:"max_rows"`
}

type MetricSegmentCleanupGetRow added in v1.3.5

type MetricSegmentCleanupGetRow struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	FrequencyMs    int32     `json:"frequency_ms"`
	SegmentID      int64     `json:"segment_id"`
	InstanceNum    int16     `json:"instance_num"`
	FileSize       int64     `json:"file_size"`
	TsRangeLower   int64     `json:"ts_range_lower"`
}

type MetricSegmentInserter

type MetricSegmentInserter interface {
	InsertMetricSegment(ctx context.Context, params InsertMetricSegmentParams) error
	InsertMetricSegmentsBatch(ctx context.Context, segments []InsertMetricSegmentParams) error
	CompactMetricSegs(ctx context.Context, args CompactMetricSegsParams) error
	CompactMetricSegments(ctx context.Context, params CompactMetricSegsParams) error
	RollupMetricSegments(ctx context.Context, sourceParams RollupSourceParams, targetParams RollupTargetParams, sourceSegmentIDs []int64, newRecords []RollupNewRecord) error
}

type NullActionEnum

type NullActionEnum struct {
	ActionEnum ActionEnum `json:"action_enum"`
	Valid      bool       `json:"valid"` // Valid is true if ActionEnum is not NULL
}

func (*NullActionEnum) Scan

func (ns *NullActionEnum) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullActionEnum) Value

func (ns NullActionEnum) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullSignalEnum

type NullSignalEnum struct {
	SignalEnum SignalEnum `json:"signal_enum"`
	Valid      bool       `json:"valid"` // Valid is true if SignalEnum is not NULL
}

func (*NullSignalEnum) Scan

func (ns *NullSignalEnum) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullSignalEnum) Value

func (ns NullSignalEnum) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type OrgDateintInfo added in v1.3.5

type OrgDateintInfo struct {
	OrganizationID uuid.UUID
	Dateint        int32
}

type PackEstimate added in v1.3.4

type PackEstimate struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	FrequencyMs    int32     `json:"frequency_ms"`
	TargetRecords  *int64    `json:"target_records"`
	UpdatedAt      time.Time `json:"updated_at"`
	Signal         string    `json:"signal"`
}

type PartitionInfo added in v1.3.5

type PartitionInfo struct {
	PartitionName string
	Bounds        string
	Level         int
}

type PubSubMessageHistoryCleanupParams added in v1.4.0

type PubSubMessageHistoryCleanupParams struct {
	AgeThreshold time.Time `json:"age_threshold"`
	BatchSize    int32     `json:"batch_size"`
}

type PubSubMessageHistoryGetRecentForBucketParams added in v1.4.6

type PubSubMessageHistoryGetRecentForBucketParams struct {
	Bucket     string `json:"bucket"`
	LimitCount int32  `json:"limit_count"`
}

type PubSubMessageHistoryInsertBatchParams added in v1.9.0

type PubSubMessageHistoryInsertBatchParams struct {
	Buckets   []string `json:"buckets"`
	ObjectIds []string `json:"object_ids"`
	Sources   []string `json:"sources"`
}

type PubSubMessageHistoryInsertBatchRow added in v1.9.0

type PubSubMessageHistoryInsertBatchRow struct {
	Bucket   string `json:"bucket"`
	ObjectID string `json:"object_id"`
}

type PubSubMessageHistoryInsertParams added in v1.4.0

type PubSubMessageHistoryInsertParams struct {
	Bucket   string `json:"bucket"`
	ObjectID string `json:"object_id"`
	Source   string `json:"source"`
}

type PubsubMessageHistory added in v1.4.0

type PubsubMessageHistory struct {
	Bucket     string    `json:"bucket"`
	ObjectID   string    `json:"object_id"`
	Source     string    `json:"source"`
	ReceivedAt time.Time `json:"received_at"`
}

type Querier

type Querier interface {
	BatchDeleteMetricSegs(ctx context.Context, arg []BatchDeleteMetricSegsParams) *BatchDeleteMetricSegsBatchResults
	BatchMarkMetricSegsRolledup(ctx context.Context, arg []BatchMarkMetricSegsRolledupParams) *BatchMarkMetricSegsRolledupBatchResults
	CallExpirePublishedByIngestCutoff(ctx context.Context, arg CallExpirePublishedByIngestCutoffParams) (int64, error)
	CallFindOrgPartition(ctx context.Context, arg CallFindOrgPartitionParams) (string, error)
	CleanupKafkaOffsets(ctx context.Context, arg CleanupKafkaOffsetsParams) (int64, error)
	CleanupKafkaOffsetsByAge(ctx context.Context, createdBefore time.Time) (int64, error)
	// Retrieves all pack estimates for a specific signal type
	GetAllBySignal(ctx context.Context, signal string) ([]GetAllBySignalRow, error)
	// Retrieves all existing pack estimates for EWMA calculations across all signals
	GetAllPackEstimates(ctx context.Context) ([]GetAllPackEstimatesRow, error)
	GetLabelNameMaps(ctx context.Context, arg GetLabelNameMapsParams) ([]GetLabelNameMapsRow, error)
	GetLogSeg(ctx context.Context, arg GetLogSegParams) (LogSeg, error)
	GetLogSegmentsForDownload(ctx context.Context, arg GetLogSegmentsForDownloadParams) ([]LogSeg, error)
	// Fast path for getting tag values when the requested tag matches stream_id_field.
	// Returns distinct stream_ids values directly from segment metadata, avoiding
	// expensive parquet file fetches. Returns empty if no segments have this tag
	// as their stream_id_field (caller should fall back to query workers).
	// Uses ts_range for accurate time filtering within the dateint range.
	GetLogStreamIdValues(ctx context.Context, arg GetLogStreamIdValuesParams) ([]string, error)
	GetMetricLabelNameMaps(ctx context.Context, arg GetMetricLabelNameMapsParams) ([]GetMetricLabelNameMapsRow, error)
	// Retrieves metric pack estimates for EWMA calculations (backward compatibility)
	GetMetricPackEstimates(ctx context.Context) ([]GetMetricPackEstimatesRow, error)
	GetMetricSeg(ctx context.Context, arg GetMetricSegParams) (MetricSeg, error)
	GetMetricSegmentsForDownload(ctx context.Context, arg GetMetricSegmentsForDownloadParams) ([]MetricSeg, error)
	GetMetricSegsByIds(ctx context.Context, arg GetMetricSegsByIdsParams) ([]MetricSeg, error)
	// Returns the metric type for a specific metric name from segment metadata
	// Uses array_position to find the metric name index and get corresponding type
	GetMetricType(ctx context.Context, arg GetMetricTypeParams) (int16, error)
	GetTraceLabelNameMaps(ctx context.Context, arg GetTraceLabelNameMapsParams) ([]GetTraceLabelNameMapsRow, error)
	GetTraceSeg(ctx context.Context, arg GetTraceSegParams) (TraceSeg, error)
	GetTraceSegmentsForDownload(ctx context.Context, arg GetTraceSegmentsForDownloadParams) ([]TraceSeg, error)
	InsertKafkaOffsets(ctx context.Context, arg InsertKafkaOffsetsParams) error
	KafkaOffsetsAfter(ctx context.Context, arg KafkaOffsetsAfterParams) ([]int64, error)
	// Extract tag keys from label_name_map in log_seg table
	// Returns all keys from label_name_map (for v2 APIs)
	// Handler code can filter by non-empty values for v1 legacy API support
	// Includes today's and yesterday's dateint for partition pruning
	ListLogQLTags(ctx context.Context, arg ListLogQLTagsParams) ([]string, error)
	ListLogSegmentsForQuery(ctx context.Context, arg ListLogSegmentsForQueryParams) ([]ListLogSegmentsForQueryRow, error)
	// Returns log segments that need recompaction based on filter criteria.
	// Used by lakectl logs recompact command to queue segments for reprocessing.
	// Segments are returned in reverse timestamp order (newest first) so that
	// recompaction benefits the most recent data first.
	ListLogSegsForRecompact(ctx context.Context, arg ListLogSegsForRecompactParams) ([]LogSeg, error)
	// Returns distinct stream values with their source field for an organization within a time range.
	// Used by /api/v1/logs/series endpoint (Loki-compatible).
	// Returns both the field name (resource_customer_domain, resource_service_name, or stream_id for legacy)
	// and the distinct values for that field.
	ListLogStreams(ctx context.Context, arg ListLogStreamsParams) ([]ListLogStreamsRow, error)
	// Returns distinct metric names for an organization within a time range
	ListMetricNames(ctx context.Context, arg ListMetricNamesParams) ([]string, error)
	// Returns distinct (metric_name, metric_type) pairs for an organization within a time range
	// Uses WITH ORDINALITY to properly join parallel arrays
	ListMetricNamesWithTypes(ctx context.Context, arg ListMetricNamesWithTypesParams) ([]ListMetricNamesWithTypesRow, error)
	ListMetricSegmentsForQuery(ctx context.Context, arg ListMetricSegmentsForQueryParams) ([]ListMetricSegmentsForQueryRow, error)
	// Extract tag keys from label_name_map in metric_seg table for a specific metric
	// Filters by metric fingerprint to return tags only for the requested metric
	// Returns underscored tag keys (for v2 APIs)
	// Legacy API uses denormalizer to convert to dotted names
	// Includes today's and yesterday's dateint for partition pruning
	ListPromMetricTags(ctx context.Context, arg ListPromMetricTagsParams) ([]string, error)
	ListServiceNames(ctx context.Context, organizationID uuid.UUID) ([]string, error)
	// Extract tag keys from label_name_map in trace_seg table
	// Returns all keys from label_name_map (for v2 APIs)
	// Handler code can filter by non-empty values for v1 legacy API support
	// Includes today's and yesterday's dateint for partition pruning
	ListSpanTags(ctx context.Context, arg ListSpanTagsParams) ([]string, error)
	ListTraceSegmentsForQuery(ctx context.Context, arg ListTraceSegmentsForQueryParams) ([]ListTraceSegmentsForQueryRow, error)
	// Returns an estimate of the number of log segments, accounting for per-file overhead.
	LogSegEstimator(ctx context.Context, arg LogSegEstimatorParams) ([]LogSegEstimatorRow, error)
	LogSegmentCleanupBatchDelete(ctx context.Context, arg []LogSegmentCleanupBatchDeleteParams) *LogSegmentCleanupBatchDeleteBatchResults
	LogSegmentCleanupDelete(ctx context.Context, arg LogSegmentCleanupDeleteParams) error
	LogSegmentCleanupGet(ctx context.Context, arg LogSegmentCleanupGetParams) ([]LogSegmentCleanupGetRow, error)
	MarkLogSegsCompactedByKeys(ctx context.Context, arg MarkLogSegsCompactedByKeysParams) error
	MarkMetricSegsCompactedByKeys(ctx context.Context, arg MarkMetricSegsCompactedByKeysParams) error
	MarkMetricSegsRolledupByKeys(ctx context.Context, arg MarkMetricSegsRolledupByKeysParams) error
	MarkTraceSegsCompactedByKeys(ctx context.Context, arg MarkTraceSegsCompactedByKeysParams) error
	// Returns an estimate of the number of metric segments, accounting for per-file overhead.
	// Uses frequency_ms to provide more accurate estimates based on collection frequency.
	MetricSegEstimator(ctx context.Context, arg MetricSegEstimatorParams) ([]MetricSegEstimatorRow, error)
	MetricSegmentCleanupBatchDelete(ctx context.Context, arg []MetricSegmentCleanupBatchDeleteParams) *MetricSegmentCleanupBatchDeleteBatchResults
	MetricSegmentCleanupDelete(ctx context.Context, arg MetricSegmentCleanupDeleteParams) error
	MetricSegmentCleanupGet(ctx context.Context, arg MetricSegmentCleanupGetParams) ([]MetricSegmentCleanupGetRow, error)
	PubSubMessageHistoryCleanup(ctx context.Context, arg PubSubMessageHistoryCleanupParams) (pgconn.CommandTag, error)
	PubSubMessageHistoryCount(ctx context.Context) (int64, error)
	PubSubMessageHistoryGetRecentForBucket(ctx context.Context, arg PubSubMessageHistoryGetRecentForBucketParams) ([]PubsubMessageHistory, error)
	PubSubMessageHistoryInsert(ctx context.Context, arg PubSubMessageHistoryInsertParams) (pgconn.CommandTag, error)
	PubSubMessageHistoryInsertBatch(ctx context.Context, arg PubSubMessageHistoryInsertBatchParams) ([]PubSubMessageHistoryInsertBatchRow, error)
	// Returns an estimate of the number of trace segments, accounting for per-file overhead.
	TraceSegEstimator(ctx context.Context, arg TraceSegEstimatorParams) ([]TraceSegEstimatorRow, error)
	TraceSegmentCleanupBatchDelete(ctx context.Context, arg []TraceSegmentCleanupBatchDeleteParams) *TraceSegmentCleanupBatchDeleteBatchResults
	TraceSegmentCleanupDelete(ctx context.Context, arg TraceSegmentCleanupDeleteParams) error
	TraceSegmentCleanupGet(ctx context.Context, arg TraceSegmentCleanupGetParams) ([]TraceSegmentCleanupGetRow, error)
	// Updates or inserts a single metric pack estimate (backward compatibility)
	UpsertMetricPackEstimate(ctx context.Context, arg UpsertMetricPackEstimateParams) error
	// Updates or inserts a single pack estimate for any signal type
	UpsertPackEstimate(ctx context.Context, arg UpsertPackEstimateParams) error
	UpsertServiceIdentifier(ctx context.Context, arg UpsertServiceIdentifierParams) (UpsertServiceIdentifierRow, error)
	// Marks all log segments in the given date range as unpublished.
	// Used by debug wipe command to remove data from visibility.
	WipeLogSegsByDateRange(ctx context.Context, arg WipeLogSegsByDateRangeParams) (int64, error)
	WorkQueueAdd(ctx context.Context, arg WorkQueueAddParams) (WorkQueue, error)
	WorkQueueClaim(ctx context.Context, arg WorkQueueClaimParams) (WorkQueue, error)
	WorkQueueCleanup(ctx context.Context, heartbeatTimeout time.Duration) error
	WorkQueueComplete(ctx context.Context, arg WorkQueueCompleteParams) error
	WorkQueueDepth(ctx context.Context, taskName string) (int64, error)
	WorkQueueDepthAll(ctx context.Context) ([]WorkQueueDepthAllRow, error)
	WorkQueueFail(ctx context.Context, arg WorkQueueFailParams) (int32, error)
	WorkQueueHeartbeat(ctx context.Context, arg WorkQueueHeartbeatParams) error
	WorkQueueStatus(ctx context.Context) ([]WorkQueueStatusRow, error)
	// contains filtered or unexported methods
}

type QuerierFull

type QuerierFull interface {
	Querier
	ParseMetricPartitions(ctx context.Context) ([]OrgDateintInfo, error)
	ParseLogPartitions(ctx context.Context) ([]OrgDateintInfo, error)
	ParseTracePartitions(ctx context.Context) ([]OrgDateintInfo, error)
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CallExpirePublishedByIngestCutoff added in v1.4.1

func (q *Queries) CallExpirePublishedByIngestCutoff(ctx context.Context, arg CallExpirePublishedByIngestCutoffParams) (int64, error)

func (*Queries) CallFindOrgPartition added in v1.4.1

func (q *Queries) CallFindOrgPartition(ctx context.Context, arg CallFindOrgPartitionParams) (string, error)

func (*Queries) CleanupKafkaOffsets added in v1.3.6

func (q *Queries) CleanupKafkaOffsets(ctx context.Context, arg CleanupKafkaOffsetsParams) (int64, error)

func (*Queries) CleanupKafkaOffsetsByAge added in v1.3.6

func (q *Queries) CleanupKafkaOffsetsByAge(ctx context.Context, createdBefore time.Time) (int64, error)

func (*Queries) GetAllBySignal added in v1.3.4

func (q *Queries) GetAllBySignal(ctx context.Context, signal string) ([]GetAllBySignalRow, error)

Retrieves all pack estimates for a specific signal type

func (*Queries) GetAllPackEstimates added in v1.3.4

func (q *Queries) GetAllPackEstimates(ctx context.Context) ([]GetAllPackEstimatesRow, error)

Retrieves all existing pack estimates for EWMA calculations across all signals

func (*Queries) GetLabelNameMaps added in v1.4.6

func (q *Queries) GetLabelNameMaps(ctx context.Context, arg GetLabelNameMapsParams) ([]GetLabelNameMapsRow, error)

func (*Queries) GetLogSeg added in v1.3.4

func (q *Queries) GetLogSeg(ctx context.Context, arg GetLogSegParams) (LogSeg, error)

func (*Queries) GetLogSegmentsForDownload added in v1.3.6

func (q *Queries) GetLogSegmentsForDownload(ctx context.Context, arg GetLogSegmentsForDownloadParams) ([]LogSeg, error)

func (*Queries) GetLogStreamIdValues added in v1.6.4

func (q *Queries) GetLogStreamIdValues(ctx context.Context, arg GetLogStreamIdValuesParams) ([]string, error)

Fast path for getting tag values when the requested tag matches stream_id_field. Returns distinct stream_ids values directly from segment metadata, avoiding expensive parquet file fetches. Returns empty if no segments have this tag as their stream_id_field (caller should fall back to query workers). Uses ts_range for accurate time filtering within the dateint range.

func (*Queries) GetMetricLabelNameMaps added in v1.4.7

func (q *Queries) GetMetricLabelNameMaps(ctx context.Context, arg GetMetricLabelNameMapsParams) ([]GetMetricLabelNameMapsRow, error)

func (*Queries) GetMetricPackEstimates added in v1.3.4

func (q *Queries) GetMetricPackEstimates(ctx context.Context) ([]GetMetricPackEstimatesRow, error)

Retrieves metric pack estimates for EWMA calculations (backward compatibility)

func (*Queries) GetMetricSeg added in v1.3.4

func (q *Queries) GetMetricSeg(ctx context.Context, arg GetMetricSegParams) (MetricSeg, error)

func (*Queries) GetMetricSegmentsForDownload added in v1.3.6

func (q *Queries) GetMetricSegmentsForDownload(ctx context.Context, arg GetMetricSegmentsForDownloadParams) ([]MetricSeg, error)

func (*Queries) GetMetricSegsByIds added in v1.3.0

func (q *Queries) GetMetricSegsByIds(ctx context.Context, arg GetMetricSegsByIdsParams) ([]MetricSeg, error)

func (*Queries) GetMetricType added in v1.3.0

func (q *Queries) GetMetricType(ctx context.Context, arg GetMetricTypeParams) (int16, error)

Returns the metric type for a specific metric name from segment metadata Uses array_position to find the metric name index and get corresponding type

func (*Queries) GetPartitions added in v1.3.5

func (q *Queries) GetPartitions(ctx context.Context, tableName string) ([]PartitionInfo, error)

GetPartitions retrieves all partitions for a given table

func (*Queries) GetTraceLabelNameMaps added in v1.4.7

func (q *Queries) GetTraceLabelNameMaps(ctx context.Context, arg GetTraceLabelNameMapsParams) ([]GetTraceLabelNameMapsRow, error)

func (*Queries) GetTraceSeg added in v1.3.4

func (q *Queries) GetTraceSeg(ctx context.Context, arg GetTraceSegParams) (TraceSeg, error)

func (*Queries) GetTraceSegmentsForDownload added in v1.3.6

func (q *Queries) GetTraceSegmentsForDownload(ctx context.Context, arg GetTraceSegmentsForDownloadParams) ([]TraceSeg, error)

func (*Queries) InsertKafkaOffsets added in v1.3.6

func (q *Queries) InsertKafkaOffsets(ctx context.Context, arg InsertKafkaOffsetsParams) error

func (*Queries) KafkaOffsetsAfter added in v1.3.6

func (q *Queries) KafkaOffsetsAfter(ctx context.Context, arg KafkaOffsetsAfterParams) ([]int64, error)

func (*Queries) ListLogQLTags added in v1.3.0

func (q *Queries) ListLogQLTags(ctx context.Context, arg ListLogQLTagsParams) ([]string, error)

Extract tag keys from label_name_map in log_seg table Returns all keys from label_name_map (for v2 APIs) Handler code can filter by non-empty values for v1 legacy API support Includes today's and yesterday's dateint for partition pruning

func (*Queries) ListLogSegmentsForQuery added in v1.3.0

func (q *Queries) ListLogSegmentsForQuery(ctx context.Context, arg ListLogSegmentsForQueryParams) ([]ListLogSegmentsForQueryRow, error)

func (*Queries) ListLogSegsForRecompact added in v1.8.0

func (q *Queries) ListLogSegsForRecompact(ctx context.Context, arg ListLogSegsForRecompactParams) ([]LogSeg, error)

Returns log segments that need recompaction based on filter criteria. Used by lakectl logs recompact command to queue segments for reprocessing. Segments are returned in reverse timestamp order (newest first) so that recompaction benefits the most recent data first.

func (*Queries) ListLogStreams added in v1.6.3

func (q *Queries) ListLogStreams(ctx context.Context, arg ListLogStreamsParams) ([]ListLogStreamsRow, error)

Returns distinct stream values with their source field for an organization within a time range. Used by /api/v1/logs/series endpoint (Loki-compatible). Returns both the field name (resource_customer_domain, resource_service_name, or stream_id for legacy) and the distinct values for that field.

func (*Queries) ListMetricNames added in v1.7.0

func (q *Queries) ListMetricNames(ctx context.Context, arg ListMetricNamesParams) ([]string, error)

Returns distinct metric names for an organization within a time range

func (*Queries) ListMetricNamesWithTypes added in v1.7.0

func (q *Queries) ListMetricNamesWithTypes(ctx context.Context, arg ListMetricNamesWithTypesParams) ([]ListMetricNamesWithTypesRow, error)

Returns distinct (metric_name, metric_type) pairs for an organization within a time range Uses WITH ORDINALITY to properly join parallel arrays

func (*Queries) ListMetricSegmentsForQuery added in v1.3.0

func (q *Queries) ListMetricSegmentsForQuery(ctx context.Context, arg ListMetricSegmentsForQueryParams) ([]ListMetricSegmentsForQueryRow, error)

func (*Queries) ListPromMetricTags added in v1.3.0

func (q *Queries) ListPromMetricTags(ctx context.Context, arg ListPromMetricTagsParams) ([]string, error)

Extract tag keys from label_name_map in metric_seg table for a specific metric Filters by metric fingerprint to return tags only for the requested metric Returns underscored tag keys (for v2 APIs) Legacy API uses denormalizer to convert to dotted names Includes today's and yesterday's dateint for partition pruning

func (*Queries) ListServiceNames added in v1.4.4

func (q *Queries) ListServiceNames(ctx context.Context, organizationID uuid.UUID) ([]string, error)

func (*Queries) ListSpanTags added in v1.4.1

func (q *Queries) ListSpanTags(ctx context.Context, arg ListSpanTagsParams) ([]string, error)

Extract tag keys from label_name_map in trace_seg table Returns all keys from label_name_map (for v2 APIs) Handler code can filter by non-empty values for v1 legacy API support Includes today's and yesterday's dateint for partition pruning

func (*Queries) ListTraceSegmentsForQuery added in v1.4.0

func (q *Queries) ListTraceSegmentsForQuery(ctx context.Context, arg ListTraceSegmentsForQueryParams) ([]ListTraceSegmentsForQueryRow, error)

func (*Queries) LogSegEstimator

func (q *Queries) LogSegEstimator(ctx context.Context, arg LogSegEstimatorParams) ([]LogSegEstimatorRow, error)

Returns an estimate of the number of log segments, accounting for per-file overhead.

func (*Queries) LogSegmentCleanupBatchDelete added in v1.3.5

func (*Queries) LogSegmentCleanupDelete added in v1.3.5

func (q *Queries) LogSegmentCleanupDelete(ctx context.Context, arg LogSegmentCleanupDeleteParams) error

func (*Queries) LogSegmentCleanupGet added in v1.3.5

func (q *Queries) LogSegmentCleanupGet(ctx context.Context, arg LogSegmentCleanupGetParams) ([]LogSegmentCleanupGetRow, error)

func (*Queries) MarkLogSegsCompactedByKeys added in v1.3.4

func (q *Queries) MarkLogSegsCompactedByKeys(ctx context.Context, arg MarkLogSegsCompactedByKeysParams) error

func (*Queries) MarkMetricSegsCompactedByKeys added in v1.3.0

func (q *Queries) MarkMetricSegsCompactedByKeys(ctx context.Context, arg MarkMetricSegsCompactedByKeysParams) error

func (*Queries) MarkMetricSegsRolledupByKeys added in v1.3.0

func (q *Queries) MarkMetricSegsRolledupByKeys(ctx context.Context, arg MarkMetricSegsRolledupByKeysParams) error

func (*Queries) MarkTraceSegsCompactedByKeys added in v1.3.4

func (q *Queries) MarkTraceSegsCompactedByKeys(ctx context.Context, arg MarkTraceSegsCompactedByKeysParams) error

func (*Queries) MetricSegEstimator

func (q *Queries) MetricSegEstimator(ctx context.Context, arg MetricSegEstimatorParams) ([]MetricSegEstimatorRow, error)

Returns an estimate of the number of metric segments, accounting for per-file overhead. Uses frequency_ms to provide more accurate estimates based on collection frequency.

func (*Queries) MetricSegmentCleanupBatchDelete added in v1.3.5

func (*Queries) MetricSegmentCleanupDelete added in v1.3.5

func (q *Queries) MetricSegmentCleanupDelete(ctx context.Context, arg MetricSegmentCleanupDeleteParams) error

func (*Queries) MetricSegmentCleanupGet added in v1.3.5

func (q *Queries) MetricSegmentCleanupGet(ctx context.Context, arg MetricSegmentCleanupGetParams) ([]MetricSegmentCleanupGetRow, error)

func (*Queries) ParseLogPartitions added in v1.3.5

func (q *Queries) ParseLogPartitions(ctx context.Context) ([]OrgDateintInfo, error)

ParseLogPartitions extracts organization IDs and dateints from log_seg partitions

func (*Queries) ParseMetricPartitions added in v1.3.5

func (q *Queries) ParseMetricPartitions(ctx context.Context) ([]OrgDateintInfo, error)

ParseMetricPartitions extracts organization IDs and dateints from metric_seg partitions

func (*Queries) ParseTracePartitions added in v1.3.5

func (q *Queries) ParseTracePartitions(ctx context.Context) ([]OrgDateintInfo, error)

ParseTracePartitions extracts organization IDs and dateints from trace_seg partitions

func (*Queries) PubSubMessageHistoryCleanup added in v1.4.0

func (q *Queries) PubSubMessageHistoryCleanup(ctx context.Context, arg PubSubMessageHistoryCleanupParams) (pgconn.CommandTag, error)

func (*Queries) PubSubMessageHistoryCount added in v1.4.0

func (q *Queries) PubSubMessageHistoryCount(ctx context.Context) (int64, error)

func (*Queries) PubSubMessageHistoryGetRecentForBucket added in v1.4.6

func (q *Queries) PubSubMessageHistoryGetRecentForBucket(ctx context.Context, arg PubSubMessageHistoryGetRecentForBucketParams) ([]PubsubMessageHistory, error)

func (*Queries) PubSubMessageHistoryInsert added in v1.4.0

func (q *Queries) PubSubMessageHistoryInsert(ctx context.Context, arg PubSubMessageHistoryInsertParams) (pgconn.CommandTag, error)

func (*Queries) PubSubMessageHistoryInsertBatch added in v1.9.0

func (*Queries) TraceSegEstimator added in v1.3.0

func (q *Queries) TraceSegEstimator(ctx context.Context, arg TraceSegEstimatorParams) ([]TraceSegEstimatorRow, error)

Returns an estimate of the number of trace segments, accounting for per-file overhead.

func (*Queries) TraceSegmentCleanupBatchDelete added in v1.3.5

func (*Queries) TraceSegmentCleanupDelete added in v1.3.5

func (q *Queries) TraceSegmentCleanupDelete(ctx context.Context, arg TraceSegmentCleanupDeleteParams) error

func (*Queries) TraceSegmentCleanupGet added in v1.3.5

func (q *Queries) TraceSegmentCleanupGet(ctx context.Context, arg TraceSegmentCleanupGetParams) ([]TraceSegmentCleanupGetRow, error)

func (*Queries) UpsertMetricPackEstimate added in v1.3.0

func (q *Queries) UpsertMetricPackEstimate(ctx context.Context, arg UpsertMetricPackEstimateParams) error

Updates or inserts a single metric pack estimate (backward compatibility)

func (*Queries) UpsertPackEstimate added in v1.3.4

func (q *Queries) UpsertPackEstimate(ctx context.Context, arg UpsertPackEstimateParams) error

Updates or inserts a single pack estimate for any signal type

func (*Queries) UpsertServiceIdentifier

func (q *Queries) UpsertServiceIdentifier(ctx context.Context, arg UpsertServiceIdentifierParams) (UpsertServiceIdentifierRow, error)

func (*Queries) WipeLogSegsByDateRange added in v1.10.5

func (q *Queries) WipeLogSegsByDateRange(ctx context.Context, arg WipeLogSegsByDateRangeParams) (int64, error)

Marks all log segments in the given date range as unpublished. Used by debug wipe command to remove data from visibility.

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

func (*Queries) WorkQueueAdd added in v1.6.0

func (q *Queries) WorkQueueAdd(ctx context.Context, arg WorkQueueAddParams) (WorkQueue, error)

func (*Queries) WorkQueueClaim added in v1.6.0

func (q *Queries) WorkQueueClaim(ctx context.Context, arg WorkQueueClaimParams) (WorkQueue, error)

func (*Queries) WorkQueueCleanup added in v1.6.0

func (q *Queries) WorkQueueCleanup(ctx context.Context, heartbeatTimeout time.Duration) error

func (*Queries) WorkQueueComplete added in v1.6.0

func (q *Queries) WorkQueueComplete(ctx context.Context, arg WorkQueueCompleteParams) error

func (*Queries) WorkQueueDepth added in v1.6.0

func (q *Queries) WorkQueueDepth(ctx context.Context, taskName string) (int64, error)

func (*Queries) WorkQueueDepthAll added in v1.6.0

func (q *Queries) WorkQueueDepthAll(ctx context.Context) ([]WorkQueueDepthAllRow, error)

func (*Queries) WorkQueueFail added in v1.6.0

func (q *Queries) WorkQueueFail(ctx context.Context, arg WorkQueueFailParams) (int32, error)

func (*Queries) WorkQueueHeartbeat added in v1.6.0

func (q *Queries) WorkQueueHeartbeat(ctx context.Context, arg WorkQueueHeartbeatParams) error

func (*Queries) WorkQueueStatus added in v1.7.0

func (q *Queries) WorkQueueStatus(ctx context.Context) ([]WorkQueueStatusRow, error)

type RollupNewRecord added in v1.3.0

type RollupNewRecord struct {
	SegmentID    int64
	StartTs      int64
	EndTs        int64
	RecordCount  int64
	FileSize     int64
	Fingerprints []int64
	MetricNames  []string
	MetricTypes  []int16
	LabelNameMap []byte
}

type RollupSourceParams added in v1.3.0

type RollupSourceParams struct {
	OrganizationID uuid.UUID
	Dateint        int32
	FrequencyMs    int32
	InstanceNum    int16
}

type RollupTargetParams added in v1.3.0

type RollupTargetParams struct {
	OrganizationID uuid.UUID
	Dateint        int32
	FrequencyMs    int32
	InstanceNum    int16
	IngestDateint  int32
	SortVersion    int16
}

type SignalEnum

type SignalEnum string
const (
	SignalEnumLogs    SignalEnum = "logs"
	SignalEnumMetrics SignalEnum = "metrics"
	SignalEnumTraces  SignalEnum = "traces"
)

func (*SignalEnum) Scan

func (e *SignalEnum) Scan(src interface{}) error

type Store

type Store struct {
	*Queries
	// contains filtered or unexported fields
}

Store provides all functions to execute db queries and transactions

func LRDBStore added in v1.4.0

func LRDBStore(ctx context.Context) (*Store, error)

func LRDBStoreForAdmin added in v1.4.0

func LRDBStoreForAdmin(ctx context.Context) (*Store, error)

LRDBStoreForAdmin connects to LRDB with admin-friendly migration checking that warns and continues instead of failing on migration mismatches

func NewStore

func NewStore(connPool *pgxpool.Pool) *Store

NewStore creates a new Store

func (*Store) Close added in v1.3.0

func (store *Store) Close()

Close stops the background goroutines, closes the connection pool, and cleans up resources.

func (*Store) CompactLogSegments added in v1.3.6

func (q *Store) CompactLogSegments(
	ctx context.Context,
	params CompactLogSegsParams,
) error

CompactLogSegments marks old log segments as compacted and inserts new compacted segments

func (*Store) CompactMetricSegments added in v1.3.6

func (q *Store) CompactMetricSegments(
	ctx context.Context,
	params CompactMetricSegsParams,
) error

CompactMetricSegments marks old segments as compacted and inserts new compacted segments

func (*Store) CompactMetricSegs added in v1.3.0

func (q *Store) CompactMetricSegs(ctx context.Context, args CompactMetricSegsParams) error

func (*Store) CompactTraceSegments added in v1.3.6

func (q *Store) CompactTraceSegments(
	ctx context.Context,
	params CompactTraceSegsParams,
) error

CompactTraceSegments marks old trace segments as compacted and inserts new compacted segments

func (*Store) GetLogEstimate added in v1.3.4

func (store *Store) GetLogEstimate(ctx context.Context, orgID uuid.UUID) int64

GetLogEstimate returns the estimated target records for an organization for logs. If no estimate is found, it returns a default value, so this value can be used directly.

func (*Store) GetMetricEstimate added in v1.3.0

func (store *Store) GetMetricEstimate(ctx context.Context, orgID uuid.UUID, frequencyMs int32) int64

GetMetricEstimate returns the estimated target records for an organization and frequency. If no estimate is found, it returns a default value, so this value can be used directly.

func (*Store) GetTraceEstimate added in v1.3.4

func (store *Store) GetTraceEstimate(ctx context.Context, orgID uuid.UUID) int64

func (*Store) InsertLogSegment

func (q *Store) InsertLogSegment(ctx context.Context, params InsertLogSegmentParams) error

func (*Store) InsertLogSegmentsBatch added in v1.3.6

func (q *Store) InsertLogSegmentsBatch(
	ctx context.Context,
	segments []InsertLogSegmentParams,
) error

InsertLogSegmentsBatch inserts multiple log segments

func (*Store) InsertMetricSegment

func (q *Store) InsertMetricSegment(ctx context.Context, params InsertMetricSegmentParams) error

func (*Store) InsertMetricSegmentsBatch added in v1.3.6

func (q *Store) InsertMetricSegmentsBatch(
	ctx context.Context,
	segments []InsertMetricSegmentParams,
) error

InsertMetricSegmentsBatch inserts multiple metric segments

func (*Store) InsertTraceSegment added in v1.2.1

func (q *Store) InsertTraceSegment(ctx context.Context, params InsertTraceSegmentParams) error

func (*Store) InsertTraceSegmentsBatch added in v1.3.6

func (q *Store) InsertTraceSegmentsBatch(
	ctx context.Context,
	segments []InsertTraceSegmentParams,
) error

InsertTraceSegmentsBatch inserts multiple trace segments

func (*Store) Pool

func (store *Store) Pool() *pgxpool.Pool

func (*Store) RollupMetricSegments added in v1.3.6

func (q *Store) RollupMetricSegments(
	ctx context.Context,
	sourceParams RollupSourceParams,
	targetParams RollupTargetParams,
	sourceSegmentIDs []int64,
	newRecords []RollupNewRecord,
) error

RollupMetricSegments marks source segments as rolled up and inserts new rollup segments

type TraceSeg added in v1.2.1

type TraceSeg struct {
	OrganizationID uuid.UUID                 `json:"organization_id"`
	Dateint        int32                     `json:"dateint"`
	SegmentID      int64                     `json:"segment_id"`
	InstanceNum    int16                     `json:"instance_num"`
	Fingerprints   []int64                   `json:"fingerprints"`
	RecordCount    int64                     `json:"record_count"`
	FileSize       int64                     `json:"file_size"`
	IngestDateint  int32                     `json:"ingest_dateint"`
	TsRange        pgtype.Range[pgtype.Int8] `json:"ts_range"`
	CreatedBy      CreatedBy                 `json:"created_by"`
	CreatedAt      time.Time                 `json:"created_at"`
	Compacted      bool                      `json:"compacted"`
	Published      bool                      `json:"published"`
	LabelNameMap   []byte                    `json:"label_name_map"`
}

type TraceSegEstimatorParams added in v1.3.0

type TraceSegEstimatorParams struct {
	TargetBytes float64 `json:"target_bytes"`
	DateintLow  int32   `json:"dateint_low"`
	DateintHigh int32   `json:"dateint_high"`
	MsLow       int64   `json:"ms_low"`
	MsHigh      int64   `json:"ms_high"`
}

type TraceSegEstimatorRow added in v1.3.0

type TraceSegEstimatorRow struct {
	OrganizationID   uuid.UUID `json:"organization_id"`
	EstimatedRecords int64     `json:"estimated_records"`
}

type TraceSegmentCleanupBatchDeleteBatchResults added in v1.3.5

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

func (*TraceSegmentCleanupBatchDeleteBatchResults) Close added in v1.3.5

func (*TraceSegmentCleanupBatchDeleteBatchResults) Exec added in v1.3.5

type TraceSegmentCleanupBatchDeleteParams added in v1.3.5

type TraceSegmentCleanupBatchDeleteParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	SegmentID      int64     `json:"segment_id"`
	InstanceNum    int16     `json:"instance_num"`
}

type TraceSegmentCleanupDeleteParams added in v1.3.5

type TraceSegmentCleanupDeleteParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	SegmentID      int64     `json:"segment_id"`
	InstanceNum    int16     `json:"instance_num"`
}

type TraceSegmentCleanupGetParams added in v1.3.5

type TraceSegmentCleanupGetParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	AgeThreshold   time.Time `json:"age_threshold"`
	MaxRows        int32     `json:"max_rows"`
}

type TraceSegmentCleanupGetRow added in v1.3.5

type TraceSegmentCleanupGetRow struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	Dateint        int32     `json:"dateint"`
	SegmentID      int64     `json:"segment_id"`
	InstanceNum    int16     `json:"instance_num"`
	FileSize       int64     `json:"file_size"`
	TsRangeLower   int64     `json:"ts_range_lower"`
}

type TraceSegmentInserter added in v1.2.1

type TraceSegmentInserter interface {
	InsertTraceSegment(ctx context.Context, params InsertTraceSegmentParams) error
	InsertTraceSegmentsBatch(ctx context.Context, segments []InsertTraceSegmentParams) error
	CompactTraceSegments(ctx context.Context, params CompactTraceSegsParams) error
}

type UpsertMetricPackEstimateParams added in v1.3.0

type UpsertMetricPackEstimateParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	FrequencyMs    int32     `json:"frequency_ms"`
	TargetRecords  *int64    `json:"target_records"`
}

type UpsertPackEstimateParams added in v1.3.4

type UpsertPackEstimateParams struct {
	OrganizationID uuid.UUID `json:"organization_id"`
	FrequencyMs    int32     `json:"frequency_ms"`
	Signal         string    `json:"signal"`
	TargetRecords  *int64    `json:"target_records"`
}

type UpsertServiceIdentifierParams

type UpsertServiceIdentifierParams struct {
	OrganizationID pgtype.UUID `json:"organization_id"`
	ServiceName    *string     `json:"service_name"`
	ClusterName    *string     `json:"cluster_name"`
	Namespace      *string     `json:"namespace"`
}

type UpsertServiceIdentifierRow

type UpsertServiceIdentifierRow struct {
	ID        uuid.UUID `json:"id"`
	CreatedAt time.Time `json:"created_at"`
}

type WipeLogSegsByDateRangeParams added in v1.10.5

type WipeLogSegsByDateRangeParams struct {
	StartDateint int32 `json:"start_dateint"`
	EndDateint   int32 `json:"end_dateint"`
}

type WorkQueue

type WorkQueue struct {
	ID             int64           `json:"id"`
	TaskName       string          `json:"task_name"`
	OrganizationID uuid.UUID       `json:"organization_id"`
	InstanceNum    int16           `json:"instance_num"`
	Spec           json.RawMessage `json:"spec"`
	Tries          int32           `json:"tries"`
	ClaimedBy      int64           `json:"claimed_by"`
	ClaimedAt      *time.Time      `json:"claimed_at"`
	HeartbeatedAt  *time.Time      `json:"heartbeated_at"`
	Failed         bool            `json:"failed"`
	FailedReason   *string         `json:"failed_reason"`
	CreatedAt      time.Time       `json:"created_at"`
	Priority       int32           `json:"priority"`
}

type WorkQueueAddParams

type WorkQueueAddParams struct {
	TaskName       string          `json:"task_name"`
	OrganizationID uuid.UUID       `json:"organization_id"`
	InstanceNum    int16           `json:"instance_num"`
	Spec           json.RawMessage `json:"spec"`
	Priority       int32           `json:"priority"`
}

type WorkQueueClaimParams

type WorkQueueClaimParams struct {
	WorkerID int64  `json:"worker_id"`
	TaskName string `json:"task_name"`
}

type WorkQueueCompleteParams

type WorkQueueCompleteParams struct {
	ID       int64 `json:"id"`
	WorkerID int64 `json:"worker_id"`
}

type WorkQueueDepthAllRow added in v1.6.0

type WorkQueueDepthAllRow struct {
	TaskName string `json:"task_name"`
	Priority int32  `json:"priority"`
	Depth    int64  `json:"depth"`
}

type WorkQueueFailParams

type WorkQueueFailParams struct {
	MaxRetries   int32   `json:"max_retries"`
	FailedReason *string `json:"failed_reason"`
	ID           int64   `json:"id"`
	WorkerID     int64   `json:"worker_id"`
}

type WorkQueueHeartbeatParams

type WorkQueueHeartbeatParams struct {
	Ids      []int64 `json:"ids"`
	WorkerID int64   `json:"worker_id"`
}

type WorkQueueStatusRow added in v1.7.0

type WorkQueueStatusRow struct {
	TaskName   string `json:"task_name"`
	Priority   int32  `json:"priority"`
	Pending    int64  `json:"pending"`
	InProgress int64  `json:"in_progress"`
	Failed     int64  `json:"failed"`
	Workers    int64  `json:"workers"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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