Documentation
¶
Index ¶
- Constants
- Variables
- func ConnectTolrdb(ctx context.Context, opts ...dbopen.Options) (*pgxpool.Pool, error)
- func MetricTypeFromString(s string) int16
- func MetricTypeToString(t int16) string
- type ActionEnum
- type BatchDeleteMetricSegsBatchResults
- type BatchDeleteMetricSegsParams
- type BatchMarkMetricSegsRolledupBatchResults
- type BatchMarkMetricSegsRolledupParams
- type CallExpirePublishedByIngestCutoffParams
- type CallFindOrgPartitionParams
- type CleanupKafkaOffsetsParams
- type CompactLogSegsNew
- type CompactLogSegsOld
- type CompactLogSegsParams
- type CompactMetricSegsNew
- type CompactMetricSegsOld
- type CompactMetricSegsParams
- type CompactTraceSegsNew
- type CompactTraceSegsOld
- type CompactTraceSegsParams
- type CreatedBy
- type DBTX
- type GetAllBySignalRow
- type GetAllPackEstimatesRow
- type GetLabelNameMapsParams
- type GetLabelNameMapsRow
- type GetLogSegParams
- type GetLogSegmentsForDownloadParams
- type GetLogStreamIdValuesParams
- type GetMetricLabelNameMapsParams
- type GetMetricLabelNameMapsRow
- type GetMetricPackEstimatesRow
- type GetMetricSegParams
- type GetMetricSegmentsForDownloadParams
- type GetMetricSegsByIdsParams
- type GetMetricTypeParams
- type GetTraceLabelNameMapsParams
- type GetTraceLabelNameMapsRow
- type GetTraceSegParams
- type GetTraceSegmentsForDownloadParams
- type InsertKafkaOffsetsParams
- type InsertLogSegmentParams
- type InsertMetricSegmentParams
- type InsertMetricSegsParams
- type InsertTraceSegmentParams
- type KafkaOffsetInfo
- type KafkaOffsetTracker
- type KafkaOffsetsAfterParams
- type ListLogQLTagsParams
- type ListLogSegmentsForQueryParams
- type ListLogSegmentsForQueryRow
- type ListLogSegsForRecompactParams
- type ListLogStreamsParams
- type ListLogStreamsRow
- type ListMetricNamesParams
- type ListMetricNamesWithTypesParams
- type ListMetricNamesWithTypesRow
- type ListMetricSegmentsForQueryParams
- type ListMetricSegmentsForQueryRow
- type ListPromMetricTagsParams
- type ListSpanTagsParams
- type ListTraceSegmentsForQueryParams
- type ListTraceSegmentsForQueryRow
- type LogSeg
- type LogSegEstimatorParams
- type LogSegEstimatorRow
- type LogSegmentCleanupBatchDeleteBatchResults
- type LogSegmentCleanupBatchDeleteParams
- type LogSegmentCleanupDeleteParams
- type LogSegmentCleanupGetParams
- type LogSegmentCleanupGetRow
- type LogSegmentUpserter
- type LrdbServiceIdentifier
- type MarkLogSegsCompactedByKeysParams
- type MarkMetricSegsCompactedByKeysParams
- type MarkMetricSegsRolledupByKeysParams
- type MarkTraceSegsCompactedByKeysParams
- type MetricSeg
- type MetricSegEstimatorParams
- type MetricSegEstimatorRow
- type MetricSegmentCleanupBatchDeleteBatchResults
- type MetricSegmentCleanupBatchDeleteParams
- type MetricSegmentCleanupDeleteParams
- type MetricSegmentCleanupGetParams
- type MetricSegmentCleanupGetRow
- type MetricSegmentInserter
- type NullActionEnum
- type NullSignalEnum
- type OrgDateintInfo
- type PackEstimate
- type PartitionInfo
- type PubSubMessageHistoryCleanupParams
- type PubSubMessageHistoryGetRecentForBucketParams
- type PubSubMessageHistoryInsertBatchParams
- type PubSubMessageHistoryInsertBatchRow
- type PubSubMessageHistoryInsertParams
- type PubsubMessageHistory
- type Querier
- type QuerierFull
- type Queries
- func (q *Queries) BatchDeleteMetricSegs(ctx context.Context, arg []BatchDeleteMetricSegsParams) *BatchDeleteMetricSegsBatchResults
- func (q *Queries) BatchMarkMetricSegsRolledup(ctx context.Context, arg []BatchMarkMetricSegsRolledupParams) *BatchMarkMetricSegsRolledupBatchResults
- func (q *Queries) CallExpirePublishedByIngestCutoff(ctx context.Context, arg CallExpirePublishedByIngestCutoffParams) (int64, error)
- func (q *Queries) CallFindOrgPartition(ctx context.Context, arg CallFindOrgPartitionParams) (string, error)
- func (q *Queries) CleanupKafkaOffsets(ctx context.Context, arg CleanupKafkaOffsetsParams) (int64, error)
- func (q *Queries) CleanupKafkaOffsetsByAge(ctx context.Context, createdBefore time.Time) (int64, error)
- func (q *Queries) GetAllBySignal(ctx context.Context, signal string) ([]GetAllBySignalRow, error)
- func (q *Queries) GetAllPackEstimates(ctx context.Context) ([]GetAllPackEstimatesRow, error)
- func (q *Queries) GetLabelNameMaps(ctx context.Context, arg GetLabelNameMapsParams) ([]GetLabelNameMapsRow, error)
- func (q *Queries) GetLogSeg(ctx context.Context, arg GetLogSegParams) (LogSeg, error)
- func (q *Queries) GetLogSegmentsForDownload(ctx context.Context, arg GetLogSegmentsForDownloadParams) ([]LogSeg, error)
- func (q *Queries) GetLogStreamIdValues(ctx context.Context, arg GetLogStreamIdValuesParams) ([]string, error)
- func (q *Queries) GetMetricLabelNameMaps(ctx context.Context, arg GetMetricLabelNameMapsParams) ([]GetMetricLabelNameMapsRow, error)
- func (q *Queries) GetMetricPackEstimates(ctx context.Context) ([]GetMetricPackEstimatesRow, error)
- func (q *Queries) GetMetricSeg(ctx context.Context, arg GetMetricSegParams) (MetricSeg, error)
- func (q *Queries) GetMetricSegmentsForDownload(ctx context.Context, arg GetMetricSegmentsForDownloadParams) ([]MetricSeg, error)
- func (q *Queries) GetMetricSegsByIds(ctx context.Context, arg GetMetricSegsByIdsParams) ([]MetricSeg, error)
- func (q *Queries) GetMetricType(ctx context.Context, arg GetMetricTypeParams) (int16, error)
- func (q *Queries) GetPartitions(ctx context.Context, tableName string) ([]PartitionInfo, error)
- func (q *Queries) GetTraceLabelNameMaps(ctx context.Context, arg GetTraceLabelNameMapsParams) ([]GetTraceLabelNameMapsRow, error)
- func (q *Queries) GetTraceSeg(ctx context.Context, arg GetTraceSegParams) (TraceSeg, error)
- func (q *Queries) GetTraceSegmentsForDownload(ctx context.Context, arg GetTraceSegmentsForDownloadParams) ([]TraceSeg, error)
- func (q *Queries) InsertKafkaOffsets(ctx context.Context, arg InsertKafkaOffsetsParams) error
- func (q *Queries) KafkaOffsetsAfter(ctx context.Context, arg KafkaOffsetsAfterParams) ([]int64, error)
- func (q *Queries) ListLogQLTags(ctx context.Context, arg ListLogQLTagsParams) ([]string, error)
- func (q *Queries) ListLogSegmentsForQuery(ctx context.Context, arg ListLogSegmentsForQueryParams) ([]ListLogSegmentsForQueryRow, error)
- func (q *Queries) ListLogSegsForRecompact(ctx context.Context, arg ListLogSegsForRecompactParams) ([]LogSeg, error)
- func (q *Queries) ListLogStreams(ctx context.Context, arg ListLogStreamsParams) ([]ListLogStreamsRow, error)
- func (q *Queries) ListMetricNames(ctx context.Context, arg ListMetricNamesParams) ([]string, error)
- func (q *Queries) ListMetricNamesWithTypes(ctx context.Context, arg ListMetricNamesWithTypesParams) ([]ListMetricNamesWithTypesRow, error)
- func (q *Queries) ListMetricSegmentsForQuery(ctx context.Context, arg ListMetricSegmentsForQueryParams) ([]ListMetricSegmentsForQueryRow, error)
- func (q *Queries) ListPromMetricTags(ctx context.Context, arg ListPromMetricTagsParams) ([]string, error)
- func (q *Queries) ListServiceNames(ctx context.Context, organizationID uuid.UUID) ([]string, error)
- func (q *Queries) ListSpanTags(ctx context.Context, arg ListSpanTagsParams) ([]string, error)
- func (q *Queries) ListTraceSegmentsForQuery(ctx context.Context, arg ListTraceSegmentsForQueryParams) ([]ListTraceSegmentsForQueryRow, error)
- func (q *Queries) LogSegEstimator(ctx context.Context, arg LogSegEstimatorParams) ([]LogSegEstimatorRow, error)
- func (q *Queries) LogSegmentCleanupBatchDelete(ctx context.Context, arg []LogSegmentCleanupBatchDeleteParams) *LogSegmentCleanupBatchDeleteBatchResults
- func (q *Queries) LogSegmentCleanupDelete(ctx context.Context, arg LogSegmentCleanupDeleteParams) error
- func (q *Queries) LogSegmentCleanupGet(ctx context.Context, arg LogSegmentCleanupGetParams) ([]LogSegmentCleanupGetRow, error)
- func (q *Queries) MarkLogSegsCompactedByKeys(ctx context.Context, arg MarkLogSegsCompactedByKeysParams) error
- func (q *Queries) MarkMetricSegsCompactedByKeys(ctx context.Context, arg MarkMetricSegsCompactedByKeysParams) error
- func (q *Queries) MarkMetricSegsRolledupByKeys(ctx context.Context, arg MarkMetricSegsRolledupByKeysParams) error
- func (q *Queries) MarkTraceSegsCompactedByKeys(ctx context.Context, arg MarkTraceSegsCompactedByKeysParams) error
- func (q *Queries) MetricSegEstimator(ctx context.Context, arg MetricSegEstimatorParams) ([]MetricSegEstimatorRow, error)
- func (q *Queries) MetricSegmentCleanupBatchDelete(ctx context.Context, arg []MetricSegmentCleanupBatchDeleteParams) *MetricSegmentCleanupBatchDeleteBatchResults
- func (q *Queries) MetricSegmentCleanupDelete(ctx context.Context, arg MetricSegmentCleanupDeleteParams) error
- func (q *Queries) MetricSegmentCleanupGet(ctx context.Context, arg MetricSegmentCleanupGetParams) ([]MetricSegmentCleanupGetRow, error)
- func (q *Queries) ParseLogPartitions(ctx context.Context) ([]OrgDateintInfo, error)
- func (q *Queries) ParseMetricPartitions(ctx context.Context) ([]OrgDateintInfo, error)
- func (q *Queries) ParseTracePartitions(ctx context.Context) ([]OrgDateintInfo, error)
- func (q *Queries) PubSubMessageHistoryCleanup(ctx context.Context, arg PubSubMessageHistoryCleanupParams) (pgconn.CommandTag, error)
- func (q *Queries) PubSubMessageHistoryCount(ctx context.Context) (int64, error)
- func (q *Queries) PubSubMessageHistoryGetRecentForBucket(ctx context.Context, arg PubSubMessageHistoryGetRecentForBucketParams) ([]PubsubMessageHistory, error)
- func (q *Queries) PubSubMessageHistoryInsert(ctx context.Context, arg PubSubMessageHistoryInsertParams) (pgconn.CommandTag, error)
- func (q *Queries) PubSubMessageHistoryInsertBatch(ctx context.Context, arg PubSubMessageHistoryInsertBatchParams) ([]PubSubMessageHistoryInsertBatchRow, error)
- func (q *Queries) TraceSegEstimator(ctx context.Context, arg TraceSegEstimatorParams) ([]TraceSegEstimatorRow, error)
- func (q *Queries) TraceSegmentCleanupBatchDelete(ctx context.Context, arg []TraceSegmentCleanupBatchDeleteParams) *TraceSegmentCleanupBatchDeleteBatchResults
- func (q *Queries) TraceSegmentCleanupDelete(ctx context.Context, arg TraceSegmentCleanupDeleteParams) error
- func (q *Queries) TraceSegmentCleanupGet(ctx context.Context, arg TraceSegmentCleanupGetParams) ([]TraceSegmentCleanupGetRow, error)
- func (q *Queries) UpsertMetricPackEstimate(ctx context.Context, arg UpsertMetricPackEstimateParams) error
- func (q *Queries) UpsertPackEstimate(ctx context.Context, arg UpsertPackEstimateParams) error
- func (q *Queries) UpsertServiceIdentifier(ctx context.Context, arg UpsertServiceIdentifierParams) (UpsertServiceIdentifierRow, error)
- func (q *Queries) WipeLogSegsByDateRange(ctx context.Context, arg WipeLogSegsByDateRangeParams) (int64, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- func (q *Queries) WorkQueueAdd(ctx context.Context, arg WorkQueueAddParams) (WorkQueue, error)
- func (q *Queries) WorkQueueClaim(ctx context.Context, arg WorkQueueClaimParams) (WorkQueue, error)
- func (q *Queries) WorkQueueCleanup(ctx context.Context, heartbeatTimeout time.Duration) error
- func (q *Queries) WorkQueueComplete(ctx context.Context, arg WorkQueueCompleteParams) error
- func (q *Queries) WorkQueueDepth(ctx context.Context, taskName string) (int64, error)
- func (q *Queries) WorkQueueDepthAll(ctx context.Context) ([]WorkQueueDepthAllRow, error)
- func (q *Queries) WorkQueueFail(ctx context.Context, arg WorkQueueFailParams) (int32, error)
- func (q *Queries) WorkQueueHeartbeat(ctx context.Context, arg WorkQueueHeartbeatParams) error
- func (q *Queries) WorkQueueStatus(ctx context.Context) ([]WorkQueueStatusRow, error)
- type RollupNewRecord
- type RollupSourceParams
- type RollupTargetParams
- type SignalEnum
- type Store
- func (store *Store) Close()
- func (q *Store) CompactLogSegments(ctx context.Context, params CompactLogSegsParams) error
- func (q *Store) CompactMetricSegments(ctx context.Context, params CompactMetricSegsParams) error
- func (q *Store) CompactMetricSegs(ctx context.Context, args CompactMetricSegsParams) error
- func (q *Store) CompactTraceSegments(ctx context.Context, params CompactTraceSegsParams) error
- func (store *Store) GetLogEstimate(ctx context.Context, orgID uuid.UUID) int64
- func (store *Store) GetMetricEstimate(ctx context.Context, orgID uuid.UUID, frequencyMs int32) int64
- func (store *Store) GetTraceEstimate(ctx context.Context, orgID uuid.UUID) int64
- func (q *Store) InsertLogSegment(ctx context.Context, params InsertLogSegmentParams) error
- func (q *Store) InsertLogSegmentsBatch(ctx context.Context, segments []InsertLogSegmentParams) error
- func (q *Store) InsertMetricSegment(ctx context.Context, params InsertMetricSegmentParams) error
- func (q *Store) InsertMetricSegmentsBatch(ctx context.Context, segments []InsertMetricSegmentParams) error
- func (q *Store) InsertTraceSegment(ctx context.Context, params InsertTraceSegmentParams) error
- func (q *Store) InsertTraceSegmentsBatch(ctx context.Context, segments []InsertTraceSegmentParams) error
- func (store *Store) Pool() *pgxpool.Pool
- func (q *Store) RollupMetricSegments(ctx context.Context, sourceParams RollupSourceParams, ...) error
- type StoreFull
- type TraceSeg
- type TraceSegEstimatorParams
- type TraceSegEstimatorRow
- type TraceSegmentCleanupBatchDeleteBatchResults
- type TraceSegmentCleanupBatchDeleteParams
- type TraceSegmentCleanupDeleteParams
- type TraceSegmentCleanupGetParams
- type TraceSegmentCleanupGetRow
- type TraceSegmentInserter
- type UpsertMetricPackEstimateParams
- type UpsertPackEstimateParams
- type UpsertServiceIdentifierParams
- type UpsertServiceIdentifierRow
- type WipeLogSegsByDateRangeParams
- type WorkQueue
- type WorkQueueAddParams
- type WorkQueueClaimParams
- type WorkQueueCompleteParams
- type WorkQueueDepthAllRow
- type WorkQueueFailParams
- type WorkQueueHeartbeatParams
- type WorkQueueStatusRow
Constants ¶
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
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
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
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
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 ¶
var (
ErrBatchAlreadyClosed = errors.New("batch already closed")
)
Functions ¶
func ConnectTolrdb ¶ added in v1.4.0
func MetricTypeFromString ¶ added in v1.7.0
MetricTypeFromString converts a string metric type to its int16 constant
func MetricTypeToString ¶ added in v1.7.0
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 (b *BatchDeleteMetricSegsBatchResults) Close() error
func (*BatchDeleteMetricSegsBatchResults) Exec ¶
func (b *BatchDeleteMetricSegsBatchResults) Exec(f func(int, error))
type BatchMarkMetricSegsRolledupBatchResults ¶
type BatchMarkMetricSegsRolledupBatchResults struct {
// contains filtered or unexported fields
}
func (*BatchMarkMetricSegsRolledupBatchResults) Close ¶
func (b *BatchMarkMetricSegsRolledupBatchResults) Close() error
func (*BatchMarkMetricSegsRolledupBatchResults) Exec ¶
func (b *BatchMarkMetricSegsRolledupBatchResults) Exec(f func(int, error))
type CallExpirePublishedByIngestCutoffParams ¶ added in v1.4.1
type CallFindOrgPartitionParams ¶ added in v1.4.1
type CleanupKafkaOffsetsParams ¶ added in v1.3.6
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 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 GetAllBySignalRow ¶ added in v1.3.4
type GetAllPackEstimatesRow ¶ added in v1.3.4
type GetLabelNameMapsParams ¶ added in v1.4.6
type GetLabelNameMapsRow ¶ added in v1.4.6
type GetLogSegParams ¶ added in v1.3.4
type GetLogSegmentsForDownloadParams ¶ added in v1.3.6
type GetLogStreamIdValuesParams ¶ added in v1.6.4
type GetMetricLabelNameMapsParams ¶ added in v1.4.7
type GetMetricLabelNameMapsRow ¶ added in v1.4.7
type GetMetricPackEstimatesRow ¶ added in v1.3.4
type GetMetricSegParams ¶ added in v1.3.4
type GetMetricSegmentsForDownloadParams ¶ added in v1.3.6
type GetMetricSegsByIdsParams ¶ added in v1.3.0
type GetMetricTypeParams ¶ added in v1.3.0
type GetTraceLabelNameMapsParams ¶ added in v1.4.7
type GetTraceLabelNameMapsRow ¶ added in v1.4.7
type GetTraceSegParams ¶ added in v1.3.4
type GetTraceSegmentsForDownloadParams ¶ added in v1.3.6
type InsertKafkaOffsetsParams ¶ added in v1.3.6
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
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 ListLogQLTagsParams ¶ added in v1.4.7
type ListLogSegmentsForQueryParams ¶ added in v1.3.0
type ListLogSegmentsForQueryRow ¶ added in v1.3.0
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 ListLogStreamsRow ¶ added in v1.6.3
type ListMetricNamesParams ¶ added in v1.7.0
type ListMetricNamesWithTypesParams ¶ added in v1.7.0
type ListMetricNamesWithTypesRow ¶ added in v1.7.0
type ListMetricSegmentsForQueryParams ¶ added in v1.3.0
type ListMetricSegmentsForQueryRow ¶ added in v1.3.0
type ListPromMetricTagsParams ¶ added in v1.3.0
type ListSpanTagsParams ¶ added in v1.4.7
type ListTraceSegmentsForQueryParams ¶ added in v1.4.0
type ListTraceSegmentsForQueryRow ¶ added in v1.4.0
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 LogSegEstimatorRow ¶
type LogSegmentCleanupBatchDeleteBatchResults ¶ added in v1.3.5
type LogSegmentCleanupBatchDeleteBatchResults struct {
// contains filtered or unexported fields
}
func (*LogSegmentCleanupBatchDeleteBatchResults) Close ¶ added in v1.3.5
func (b *LogSegmentCleanupBatchDeleteBatchResults) Close() error
func (*LogSegmentCleanupBatchDeleteBatchResults) Exec ¶ added in v1.3.5
func (b *LogSegmentCleanupBatchDeleteBatchResults) Exec(f func(int, error))
type LogSegmentCleanupBatchDeleteParams ¶ added in v1.3.5
type LogSegmentCleanupDeleteParams ¶ added in v1.3.5
type LogSegmentCleanupGetParams ¶ added in v1.3.5
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 MarkMetricSegsCompactedByKeysParams ¶ added in v1.3.0
type MarkMetricSegsRolledupByKeysParams ¶ added in v1.3.0
type MarkTraceSegsCompactedByKeysParams ¶ added in v1.3.4
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 MetricSegEstimatorRow ¶
type MetricSegmentCleanupBatchDeleteBatchResults ¶ added in v1.3.5
type MetricSegmentCleanupBatchDeleteBatchResults struct {
// contains filtered or unexported fields
}
func (*MetricSegmentCleanupBatchDeleteBatchResults) Close ¶ added in v1.3.5
func (b *MetricSegmentCleanupBatchDeleteBatchResults) Close() error
func (*MetricSegmentCleanupBatchDeleteBatchResults) Exec ¶ added in v1.3.5
func (b *MetricSegmentCleanupBatchDeleteBatchResults) Exec(f func(int, error))
type MetricSegmentCleanupBatchDeleteParams ¶ added in v1.3.5
type MetricSegmentCleanupDeleteParams ¶ added in v1.3.5
type MetricSegmentCleanupGetParams ¶ added in v1.3.5
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.
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.
type OrgDateintInfo ¶ added in v1.3.5
type PackEstimate ¶ added in v1.3.4
type PartitionInfo ¶ added in v1.3.5
type PubSubMessageHistoryCleanupParams ¶ added in v1.4.0
type PubSubMessageHistoryGetRecentForBucketParams ¶ added in v1.4.6
type PubSubMessageHistoryInsertBatchParams ¶ added in v1.9.0
type PubSubMessageHistoryInsertBatchRow ¶ added in v1.9.0
type PubSubMessageHistoryInsertParams ¶ added in v1.4.0
type PubsubMessageHistory ¶ added in v1.4.0
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 (*Queries) BatchDeleteMetricSegs ¶
func (q *Queries) BatchDeleteMetricSegs(ctx context.Context, arg []BatchDeleteMetricSegsParams) *BatchDeleteMetricSegsBatchResults
func (*Queries) BatchMarkMetricSegsRolledup ¶
func (q *Queries) BatchMarkMetricSegsRolledup(ctx context.Context, arg []BatchMarkMetricSegsRolledupParams) *BatchMarkMetricSegsRolledupBatchResults
func (*Queries) CallExpirePublishedByIngestCutoff ¶ added in v1.4.1
func (*Queries) CallFindOrgPartition ¶ added in v1.4.1
func (*Queries) CleanupKafkaOffsets ¶ added in v1.3.6
func (*Queries) CleanupKafkaOffsetsByAge ¶ added in v1.3.6
func (*Queries) GetAllBySignal ¶ added in v1.3.4
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) GetLogSegmentsForDownload ¶ added in v1.3.6
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 (*Queries) GetMetricSegmentsForDownload ¶ added in v1.3.6
func (*Queries) GetMetricSegsByIds ¶ added in v1.3.0
func (*Queries) GetMetricType ¶ added in v1.3.0
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
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 (*Queries) GetTraceSegmentsForDownload ¶ added in v1.3.6
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 (*Queries) ListLogQLTags ¶ added in v1.3.0
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
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 (*Queries) ListSpanTags ¶ added in v1.4.1
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 (q *Queries) LogSegmentCleanupBatchDelete(ctx context.Context, arg []LogSegmentCleanupBatchDeleteParams) *LogSegmentCleanupBatchDeleteBatchResults
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 (q *Queries) MetricSegmentCleanupBatchDelete(ctx context.Context, arg []MetricSegmentCleanupBatchDeleteParams) *MetricSegmentCleanupBatchDeleteBatchResults
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 (*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 (q *Queries) PubSubMessageHistoryInsertBatch(ctx context.Context, arg PubSubMessageHistoryInsertBatchParams) ([]PubSubMessageHistoryInsertBatchRow, error)
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 (q *Queries) TraceSegmentCleanupBatchDelete(ctx context.Context, arg []TraceSegmentCleanupBatchDeleteParams) *TraceSegmentCleanupBatchDeleteBatchResults
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) WorkQueueAdd ¶ added in v1.6.0
func (*Queries) WorkQueueClaim ¶ added in v1.6.0
func (*Queries) WorkQueueCleanup ¶ added in v1.6.0
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 (*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 (*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 RollupSourceParams ¶ added in v1.3.0
type RollupTargetParams ¶ added in v1.3.0
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 LRDBStoreForAdmin ¶ added in v1.4.0
LRDBStoreForAdmin connects to LRDB with admin-friendly migration checking that warns and continues instead of failing on migration mismatches
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
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) 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) 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 StoreFull ¶
type StoreFull interface {
QuerierFull
LogSegmentUpserter
MetricSegmentInserter
TraceSegmentInserter
}
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 TraceSegEstimatorRow ¶ added in v1.3.0
type TraceSegmentCleanupBatchDeleteBatchResults ¶ added in v1.3.5
type TraceSegmentCleanupBatchDeleteBatchResults struct {
// contains filtered or unexported fields
}
func (*TraceSegmentCleanupBatchDeleteBatchResults) Close ¶ added in v1.3.5
func (b *TraceSegmentCleanupBatchDeleteBatchResults) Close() error
func (*TraceSegmentCleanupBatchDeleteBatchResults) Exec ¶ added in v1.3.5
func (b *TraceSegmentCleanupBatchDeleteBatchResults) Exec(f func(int, error))
type TraceSegmentCleanupBatchDeleteParams ¶ added in v1.3.5
type TraceSegmentCleanupDeleteParams ¶ added in v1.3.5
type TraceSegmentCleanupGetParams ¶ added in v1.3.5
type TraceSegmentCleanupGetRow ¶ added in v1.3.5
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 UpsertPackEstimateParams ¶ added in v1.3.4
type WipeLogSegsByDateRangeParams ¶ added in v1.10.5
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 WorkQueueClaimParams ¶
type WorkQueueCompleteParams ¶
type WorkQueueDepthAllRow ¶ added in v1.6.0
type WorkQueueFailParams ¶
Source Files
¶
- batch.go
- connect.go
- created_by.go
- db.go
- debug_download.sql.go
- doc.go
- estimator.go
- expiry.sql.go
- kafka_offset_tracker.sql.go
- log_seg.go
- log_seg.sql.go
- log_seg_batch.go
- log_seg_cleanup.sql.go
- log_seq.go
- logql_tags.sql.go
- lrdb_service_identifiers.sql.go
- mcq_replace_compacted.go
- metric_pack_estimate.sql.go
- metric_seg.go
- metric_seg.sql.go
- metric_seg_batch.go
- metric_seg_cleanup.sql.go
- models.go
- parquet_estimator.sql.go
- partition_cache.go
- partition_discovery.go
- partitioning.go
- pool.go
- promql_tags.sql.go
- pubsub_dedup.sql.go
- querier.go
- querier_upscale.go
- span_tags.sql.go
- store.go
- trace_seg.sql.go
- trace_seg_batch.go
- trace_seg_cleanup.sql.go
- trace_seq.go
- work_queue.sql.go