Documentation
¶
Index ¶
- Variables
- func AddFlushFunction(f flushFunction)
- func FlushCaches()
- func IsPartitionTableRemembered(tableName string) bool
- func NewConnectionPool(ctx context.Context, url string) (*pgxpool.Pool, error)
- func RememberPartitionTable(tableName string)
- type ActionEnum
- type BatchDeleteMetricSegsBatchResults
- type BatchDeleteMetricSegsParams
- type BatchInsertMetricSegsBatchResults
- type BatchInsertMetricSegsParams
- type BatchMarkMetricSegsRolledupBatchResults
- type BatchMarkMetricSegsRolledupParams
- type BatchUpsertExemplarLogsBatchResults
- type BatchUpsertExemplarLogsParams
- type BatchUpsertExemplarMetricsBatchResults
- type BatchUpsertExemplarMetricsParams
- type BatchUpsertExemplarTracesBatchResults
- type BatchUpsertExemplarTracesParams
- type ClaimInqueueWorkParams
- type CompactLogSegmentsParams
- type CreatedBy
- type DBTX
- type DeleteInqueueWorkParams
- type ExemplarLog
- type ExemplarMetric
- type ExemplarTrace
- type GetExemplarLogsByFingerprintParams
- type GetExemplarLogsByServiceParams
- type GetExemplarMetricsByServiceParams
- type GetExemplarTracesByFingerprintParams
- type GetExemplarTracesByServiceParams
- type GetLogSegmentsForCompactionParams
- type GetLogSegmentsForCompactionRow
- type GetMetricSegsForCompactionParams
- type GetMetricSegsForRollupParams
- type GetSpanInfoByFingerprintParams
- type GetSpanInfoByFingerprintRow
- type Inqueue
- type InqueueJournal
- type InqueueJournalDeleteParams
- type InqueueJournalUpsertParams
- type InsertLogSegmentParams
- type InsertMetricSegmentParams
- type ListSegmentsForQueryParams
- type ListSegmentsForQueryRow
- type LogSeg
- type LogSegEstimatorParams
- type LogSegEstimatorRow
- type LogSegmentUpserter
- type MetricSeg
- type MetricSegEstimatorParams
- type MetricSegEstimatorRow
- type MetricSegmentInserter
- type NullActionEnum
- type NullSignalEnum
- type ObjCleanup
- type ObjectCleanupAddParams
- type ObjectCleanupGetRow
- type PutInqueueWorkParams
- type Querier
- type QuerierFull
- type Queries
- func (q *Queries) BatchDeleteMetricSegs(ctx context.Context, arg []BatchDeleteMetricSegsParams) *BatchDeleteMetricSegsBatchResults
- func (q *Queries) BatchInsertMetricSegs(ctx context.Context, arg []BatchInsertMetricSegsParams) *BatchInsertMetricSegsBatchResults
- func (q *Queries) BatchMarkMetricSegsRolledup(ctx context.Context, arg []BatchMarkMetricSegsRolledupParams) *BatchMarkMetricSegsRolledupBatchResults
- func (q *Queries) BatchUpsertExemplarLogs(ctx context.Context, arg []BatchUpsertExemplarLogsParams) *BatchUpsertExemplarLogsBatchResults
- func (q *Queries) BatchUpsertExemplarMetrics(ctx context.Context, arg []BatchUpsertExemplarMetricsParams) *BatchUpsertExemplarMetricsBatchResults
- func (q *Queries) BatchUpsertExemplarTraces(ctx context.Context, arg []BatchUpsertExemplarTracesParams) *BatchUpsertExemplarTracesBatchResults
- func (q *Queries) ClaimInqueueWork(ctx context.Context, arg ClaimInqueueWorkParams) (Inqueue, error)
- func (q *Queries) CleanupInqueueWork(ctx context.Context) error
- func (q *Queries) CompactLogSegments(ctx context.Context, arg CompactLogSegmentsParams) error
- func (q *Queries) DeleteInqueueWork(ctx context.Context, arg DeleteInqueueWorkParams) error
- func (q *Queries) GetExemplarLogsByFingerprint(ctx context.Context, arg GetExemplarLogsByFingerprintParams) (ExemplarLog, error)
- func (q *Queries) GetExemplarLogsByService(ctx context.Context, arg GetExemplarLogsByServiceParams) ([]ExemplarLog, error)
- func (q *Queries) GetExemplarLogsCreatedAfter(ctx context.Context, ts time.Time) ([]ExemplarLog, error)
- func (q *Queries) GetExemplarMetricsByService(ctx context.Context, arg GetExemplarMetricsByServiceParams) ([]ExemplarMetric, error)
- func (q *Queries) GetExemplarMetricsCreatedAfter(ctx context.Context, ts time.Time) ([]ExemplarMetric, error)
- func (q *Queries) GetExemplarTracesByFingerprint(ctx context.Context, arg GetExemplarTracesByFingerprintParams) (ExemplarTrace, error)
- func (q *Queries) GetExemplarTracesByService(ctx context.Context, arg GetExemplarTracesByServiceParams) ([]ExemplarTrace, error)
- func (q *Queries) GetExemplarTracesCreatedAfter(ctx context.Context, ts time.Time) ([]ExemplarTrace, error)
- func (q *Queries) GetLogSegmentsForCompaction(ctx context.Context, arg GetLogSegmentsForCompactionParams) ([]GetLogSegmentsForCompactionRow, error)
- func (q *Queries) GetMetricSegsForCompaction(ctx context.Context, arg GetMetricSegsForCompactionParams) ([]MetricSeg, error)
- func (q *Queries) GetMetricSegsForRollup(ctx context.Context, arg GetMetricSegsForRollupParams) ([]MetricSeg, error)
- func (q *Queries) GetSpanInfoByFingerprint(ctx context.Context, arg GetSpanInfoByFingerprintParams) (GetSpanInfoByFingerprintRow, error)
- func (q *Queries) InqueueJournalDelete(ctx context.Context, arg InqueueJournalDeleteParams) error
- func (q *Queries) InqueueJournalUpsert(ctx context.Context, arg InqueueJournalUpsertParams) (bool, error)
- func (q *Queries) InsertLogSegmentDirect(ctx context.Context, arg InsertLogSegmentParams) error
- func (q *Queries) InsertMetricSegmentDirect(ctx context.Context, arg InsertMetricSegmentParams) error
- func (q *Queries) ListSegmentsForQuery(ctx context.Context, arg ListSegmentsForQueryParams) ([]ListSegmentsForQueryRow, error)
- func (q *Queries) LogSegEstimator(ctx context.Context, arg LogSegEstimatorParams) ([]LogSegEstimatorRow, error)
- func (q *Queries) MetricSegEstimator(ctx context.Context, arg MetricSegEstimatorParams) ([]MetricSegEstimatorRow, error)
- func (q *Queries) ObjectCleanupAdd(ctx context.Context, arg ObjectCleanupAddParams) error
- func (q *Queries) ObjectCleanupComplete(ctx context.Context, id uuid.UUID) error
- func (q *Queries) ObjectCleanupFail(ctx context.Context, id uuid.UUID) error
- func (q *Queries) ObjectCleanupGet(ctx context.Context, maxrows int32) ([]ObjectCleanupGetRow, error)
- func (q *Queries) PutInqueueWork(ctx context.Context, arg PutInqueueWorkParams) error
- func (q *Queries) ReleaseInqueueWork(ctx context.Context, arg ReleaseInqueueWorkParams) error
- func (q *Queries) SignalLockCleanup(ctx context.Context) (int32, error)
- func (q *Queries) TouchInqueueWork(ctx context.Context, arg TouchInqueueWorkParams) error
- func (q *Queries) UpsertServiceIdentifier(ctx context.Context, arg UpsertServiceIdentifierParams) (UpsertServiceIdentifierRow, error)
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- func (q *Queries) WorkQueueAddDirect(ctx context.Context, arg WorkQueueAddParams) error
- func (q *Queries) WorkQueueClaimDirect(ctx context.Context, arg WorkQueueClaimParams) (WorkQueueClaimRow, error)
- func (q *Queries) WorkQueueCleanupDirect(ctx context.Context) ([]WorkQueueCleanupRow, error)
- func (q *Queries) WorkQueueCompleteDirect(ctx context.Context, arg WorkQueueCompleteParams) error
- func (q *Queries) WorkQueueFailDirect(ctx context.Context, arg WorkQueueFailParams) error
- func (q *Queries) WorkQueueGC(ctx context.Context, arg WorkQueueGCParams) (int32, error)
- func (q *Queries) WorkQueueGlobalLock(ctx context.Context) error
- func (q *Queries) WorkQueueHeartbeatDirect(ctx context.Context, arg WorkQueueHeartbeatParams) error
- type ReleaseInqueueWorkParams
- type ReplaceMetricSegsNew
- type ReplaceMetricSegsOld
- type ReplaceMetricSegsParams
- type ServiceIdentifier
- type Setting
- type SignalEnum
- type SignalLock
- type Store
- func (q *Store) InsertLogSegment(ctx context.Context, params InsertLogSegmentParams) error
- func (q *Store) InsertMetricSegment(ctx context.Context, params InsertMetricSegmentParams) error
- func (store *Store) Pool() *pgxpool.Pool
- func (q *Store) ReplaceMetricSegs(ctx context.Context, args ReplaceMetricSegsParams) error
- func (q *Store) WorkQueueAdd(ctx context.Context, params WorkQueueAddParams) error
- func (q *Store) WorkQueueClaim(ctx context.Context, params WorkQueueClaimParams) (WorkQueueClaimRow, error)
- func (q *Store) WorkQueueCleanup(ctx context.Context) ([]WorkQueueCleanupRow, error)
- func (q *Store) WorkQueueComplete(ctx context.Context, params WorkQueueCompleteParams) error
- func (q *Store) WorkQueueFail(ctx context.Context, params WorkQueueFailParams) error
- func (q *Store) WorkQueueHeartbeat(ctx context.Context, params WorkQueueHeartbeatParams) error
- type StoreFull
- type TouchInqueueWorkParams
- type UpsertServiceIdentifierParams
- type UpsertServiceIdentifierRow
- type WorkQueue
- type WorkQueueAddParams
- type WorkQueueClaimParams
- type WorkQueueClaimRow
- type WorkQueueCleanupRow
- type WorkQueueCompleteParams
- type WorkQueueFailParams
- type WorkQueueGCParams
- type WorkQueueHeartbeatParams
- type WorkQueueQuerier
Constants ¶
This section is empty.
Variables ¶
var (
ErrBatchAlreadyClosed = errors.New("batch already closed")
)
Functions ¶
func AddFlushFunction ¶
func AddFlushFunction(f flushFunction)
func FlushCaches ¶
func FlushCaches()
func NewConnectionPool ¶
NewMetadataConnectionPool creates a new connection pool using the PostgreSQL connection string provided, and using pgx v5.
func RememberPartitionTable ¶
func RememberPartitionTable(tableName string)
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 BatchInsertMetricSegsBatchResults ¶
type BatchInsertMetricSegsBatchResults struct {
// contains filtered or unexported fields
}
func (*BatchInsertMetricSegsBatchResults) Close ¶
func (b *BatchInsertMetricSegsBatchResults) Close() error
func (*BatchInsertMetricSegsBatchResults) Exec ¶
func (b *BatchInsertMetricSegsBatchResults) Exec(f func(int, error))
type BatchInsertMetricSegsParams ¶
type BatchInsertMetricSegsParams struct { OrganizationID uuid.UUID `json:"organization_id"` Dateint int32 `json:"dateint"` IngestDateint int32 `json:"ingest_dateint"` FrequencyMs int32 `json:"frequency_ms"` SegmentID int64 `json:"segment_id"` InstanceNum int16 `json:"instance_num"` TidPartition int16 `json:"tid_partition"` StartTs int64 `json:"start_ts"` EndTs int64 `json:"end_ts"` RecordCount int64 `json:"record_count"` FileSize int64 `json:"file_size"` TidCount int32 `json:"tid_count"` Published bool `json:"published"` CreatedBy CreatedBy `json:"created_by"` Rolledup bool `json:"rolledup"` }
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 BatchUpsertExemplarLogsBatchResults ¶
type BatchUpsertExemplarLogsBatchResults struct {
// contains filtered or unexported fields
}
func (*BatchUpsertExemplarLogsBatchResults) Close ¶
func (b *BatchUpsertExemplarLogsBatchResults) Close() error
type BatchUpsertExemplarLogsParams ¶
type BatchUpsertExemplarLogsParams struct { OrganizationID uuid.UUID `json:"organization_id"` ServiceIdentifierID uuid.UUID `json:"service_identifier_id"` Fingerprint int64 `json:"fingerprint"` Attributes map[string]any `json:"attributes"` Exemplar map[string]any `json:"exemplar"` OldFingerprint int64 `json:"old_fingerprint"` }
type BatchUpsertExemplarMetricsBatchResults ¶
type BatchUpsertExemplarMetricsBatchResults struct {
// contains filtered or unexported fields
}
func (*BatchUpsertExemplarMetricsBatchResults) Close ¶
func (b *BatchUpsertExemplarMetricsBatchResults) Close() error
type BatchUpsertExemplarMetricsParams ¶
type BatchUpsertExemplarMetricsParams struct { OrganizationID uuid.UUID `json:"organization_id"` ServiceIdentifierID uuid.UUID `json:"service_identifier_id"` MetricName string `json:"metric_name"` MetricType string `json:"metric_type"` Attributes map[string]any `json:"attributes"` Exemplar map[string]any `json:"exemplar"` }
type BatchUpsertExemplarTracesBatchResults ¶
type BatchUpsertExemplarTracesBatchResults struct {
// contains filtered or unexported fields
}
func (*BatchUpsertExemplarTracesBatchResults) Close ¶
func (b *BatchUpsertExemplarTracesBatchResults) Close() error
type BatchUpsertExemplarTracesParams ¶
type BatchUpsertExemplarTracesParams struct { OrganizationID uuid.UUID `json:"organization_id"` ServiceIdentifierID uuid.UUID `json:"service_identifier_id"` Fingerprint int64 `json:"fingerprint"` Attributes map[string]any `json:"attributes"` Exemplar map[string]any `json:"exemplar"` SpanName string `json:"span_name"` SpanKind int32 `json:"span_kind"` }
type ClaimInqueueWorkParams ¶
type CompactLogSegmentsParams ¶
type CompactLogSegmentsParams struct { OrganizationID uuid.UUID `json:"organization_id"` Dateint int32 `json:"dateint"` IngestDateint int32 `json:"ingest_dateint"` NewSegmentID int64 `json:"new_segment_id"` InstanceNum int16 `json:"instance_num"` NewRecordCount int64 `json:"new_record_count"` NewFileSize int64 `json:"new_file_size"` NewStartTs int64 `json:"new_start_ts"` NewEndTs int64 `json:"new_end_ts"` CreatedBy CreatedBy `json:"created_by"` OldSegmentIds []int64 `json:"old_segment_ids"` }
type DeleteInqueueWorkParams ¶
type ExemplarLog ¶
type ExemplarLog struct { CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` OrganizationID uuid.UUID `json:"organization_id"` ServiceIdentifierID uuid.UUID `json:"service_identifier_id"` Attributes map[string]any `json:"attributes"` Exemplar map[string]any `json:"exemplar"` Fingerprint int64 `json:"fingerprint"` RelatedFingerprints []int64 `json:"related_fingerprints"` }
type ExemplarMetric ¶
type ExemplarMetric struct { CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` OrganizationID uuid.UUID `json:"organization_id"` ServiceIdentifierID uuid.UUID `json:"service_identifier_id"` Attributes map[string]any `json:"attributes"` Exemplar map[string]any `json:"exemplar"` MetricName string `json:"metric_name"` MetricType string `json:"metric_type"` }
type ExemplarTrace ¶
type ExemplarTrace struct { CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` OrganizationID uuid.UUID `json:"organization_id"` ServiceIdentifierID uuid.UUID `json:"service_identifier_id"` Attributes map[string]any `json:"attributes"` Exemplar map[string]any `json:"exemplar"` Fingerprint int64 `json:"fingerprint"` SpanName string `json:"span_name"` SpanKind int32 `json:"span_kind"` }
type GetLogSegmentsForCompactionParams ¶
type GetLogSegmentsForCompactionParams struct { OrganizationID uuid.UUID `json:"organization_id"` Dateint int32 `json:"dateint"` InstanceNum int16 `json:"instance_num"` MaxFileSize int64 `json:"max_file_size"` CursorCreatedAt time.Time `json:"cursor_created_at"` CursorSegmentID int64 `json:"cursor_segment_id"` Maxrows int32 `json:"maxrows"` }
type GetLogSegmentsForCompactionRow ¶
type GetLogSegmentsForCompactionRow struct { SegmentID int64 `json:"segment_id"` StartTs int64 `json:"start_ts"` EndTs int64 `json:"end_ts"` FileSize int64 `json:"file_size"` RecordCount int64 `json:"record_count"` IngestDateint int32 `json:"ingest_dateint"` CreatedAt time.Time `json:"created_at"` }
type GetMetricSegsForCompactionParams ¶
type GetMetricSegsForCompactionParams struct { OrganizationID uuid.UUID `json:"organization_id"` Dateint int32 `json:"dateint"` FrequencyMs int32 `json:"frequency_ms"` InstanceNum int16 `json:"instance_num"` StartTs int64 `json:"start_ts"` EndTs int64 `json:"end_ts"` MaxFileSize int64 `json:"max_file_size"` CursorCreatedAt time.Time `json:"cursor_created_at"` CursorSegmentID int64 `json:"cursor_segment_id"` Maxrows int32 `json:"maxrows"` }
type Inqueue ¶
type Inqueue struct { ID uuid.UUID `json:"id"` QueueTs time.Time `json:"queue_ts"` Priority int32 `json:"priority"` OrganizationID uuid.UUID `json:"organization_id"` CollectorName string `json:"collector_name"` InstanceNum int16 `json:"instance_num"` Bucket string `json:"bucket"` ObjectID string `json:"object_id"` TelemetryType string `json:"telemetry_type"` Tries int32 `json:"tries"` ClaimedBy int64 `json:"claimed_by"` ClaimedAt *time.Time `json:"claimed_at"` }
type InqueueJournal ¶
type InsertLogSegmentParams ¶
type InsertLogSegmentParams struct { OrganizationID uuid.UUID `json:"organization_id"` Dateint int32 `json:"dateint"` IngestDateint int32 `json:"ingest_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"` }
type InsertMetricSegmentParams ¶
type InsertMetricSegmentParams struct { OrganizationID uuid.UUID `json:"organization_id"` Dateint int32 `json:"dateint"` IngestDateint int32 `json:"ingest_dateint"` FrequencyMs int32 `json:"frequency_ms"` SegmentID int64 `json:"segment_id"` InstanceNum int16 `json:"instance_num"` TidPartition int16 `json:"tid_partition"` StartTs int64 `json:"start_ts"` EndTs int64 `json:"end_ts"` RecordCount int64 `json:"record_count"` FileSize int64 `json:"file_size"` TidCount int32 `json:"tid_count"` CreatedBy CreatedBy `json:"created_by"` Published bool `json:"published"` }
type ListSegmentsForQueryRow ¶
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"` }
type LogSegEstimatorParams ¶
type LogSegEstimatorRow ¶
type LogSegmentUpserter ¶
type LogSegmentUpserter interface { //InsertLogFingerprints(ctx context.Context, params InsertLogFingerprintsParams) error InsertLogSegment(ctx context.Context, params InsertLogSegmentParams) error }
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"` TidPartition int16 `json:"tid_partition"` TsRange pgtype.Range[pgtype.Int8] `json:"ts_range"` RecordCount int64 `json:"record_count"` FileSize int64 `json:"file_size"` TidCount int32 `json:"tid_count"` IngestDateint int32 `json:"ingest_dateint"` Published bool `json:"published"` Rolledup bool `json:"rolledup"` CreatedAt time.Time `json:"created_at"` CreatedBy CreatedBy `json:"created_by"` }
type MetricSegEstimatorRow ¶
type MetricSegmentInserter ¶
type MetricSegmentInserter interface {
InsertMetricSegment(ctx context.Context, params InsertMetricSegmentParams) 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 ObjCleanup ¶
type ObjectCleanupAddParams ¶
type ObjectCleanupGetRow ¶
type PutInqueueWorkParams ¶
type PutInqueueWorkParams struct { OrganizationID uuid.UUID `json:"organization_id"` CollectorName string `json:"collector_name"` InstanceNum int16 `json:"instance_num"` Bucket string `json:"bucket"` ObjectID string `json:"object_id"` TelemetryType string `json:"telemetry_type"` Priority int32 `json:"priority"` }
type Querier ¶
type Querier interface { BatchDeleteMetricSegs(ctx context.Context, arg []BatchDeleteMetricSegsParams) *BatchDeleteMetricSegsBatchResults BatchInsertMetricSegs(ctx context.Context, arg []BatchInsertMetricSegsParams) *BatchInsertMetricSegsBatchResults BatchMarkMetricSegsRolledup(ctx context.Context, arg []BatchMarkMetricSegsRolledupParams) *BatchMarkMetricSegsRolledupBatchResults // This will upsert a new log exemplar. Attributes, exemplar, and updated_at are always updated // to the provided values. If old_fingerprint is not 0, it is added to the list of related // fingerprints. This means the "old" fingerprint should be fingerprint, so it always updates // an existing record, not changing it to the new one. // The return value is a boolean indicating if the record is new. BatchUpsertExemplarLogs(ctx context.Context, arg []BatchUpsertExemplarLogsParams) *BatchUpsertExemplarLogsBatchResults BatchUpsertExemplarMetrics(ctx context.Context, arg []BatchUpsertExemplarMetricsParams) *BatchUpsertExemplarMetricsBatchResults BatchUpsertExemplarTraces(ctx context.Context, arg []BatchUpsertExemplarTracesParams) *BatchUpsertExemplarTracesBatchResults ClaimInqueueWork(ctx context.Context, arg ClaimInqueueWorkParams) (Inqueue, error) CleanupInqueueWork(ctx context.Context) error CompactLogSegments(ctx context.Context, arg CompactLogSegmentsParams) error DeleteInqueueWork(ctx context.Context, arg DeleteInqueueWorkParams) error GetExemplarLogsByFingerprint(ctx context.Context, arg GetExemplarLogsByFingerprintParams) (ExemplarLog, error) GetExemplarLogsByService(ctx context.Context, arg GetExemplarLogsByServiceParams) ([]ExemplarLog, error) GetExemplarLogsCreatedAfter(ctx context.Context, ts time.Time) ([]ExemplarLog, error) GetExemplarMetricsByService(ctx context.Context, arg GetExemplarMetricsByServiceParams) ([]ExemplarMetric, error) GetExemplarMetricsCreatedAfter(ctx context.Context, ts time.Time) ([]ExemplarMetric, error) GetExemplarTracesByFingerprint(ctx context.Context, arg GetExemplarTracesByFingerprintParams) (ExemplarTrace, error) GetExemplarTracesByService(ctx context.Context, arg GetExemplarTracesByServiceParams) ([]ExemplarTrace, error) GetExemplarTracesCreatedAfter(ctx context.Context, ts time.Time) ([]ExemplarTrace, error) GetLogSegmentsForCompaction(ctx context.Context, arg GetLogSegmentsForCompactionParams) ([]GetLogSegmentsForCompactionRow, error) GetMetricSegsForCompaction(ctx context.Context, arg GetMetricSegsForCompactionParams) ([]MetricSeg, error) GetMetricSegsForRollup(ctx context.Context, arg GetMetricSegsForRollupParams) ([]MetricSeg, error) GetSpanInfoByFingerprint(ctx context.Context, arg GetSpanInfoByFingerprintParams) (GetSpanInfoByFingerprintRow, error) InqueueJournalDelete(ctx context.Context, arg InqueueJournalDeleteParams) error InqueueJournalUpsert(ctx context.Context, arg InqueueJournalUpsertParams) (bool, error) InsertLogSegmentDirect(ctx context.Context, arg InsertLogSegmentParams) error InsertMetricSegmentDirect(ctx context.Context, arg InsertMetricSegmentParams) error ListSegmentsForQuery(ctx context.Context, arg ListSegmentsForQueryParams) ([]ListSegmentsForQueryRow, error) // Returns an estimate of the number of log segments, average bytes, average records, // and average bytes per record for log segments in the last hour per organization and instance. // This query is basically identical to the MetricSegEstimator, but for log segments. LogSegEstimator(ctx context.Context, arg LogSegEstimatorParams) ([]LogSegEstimatorRow, error) // Returns an estimate of the number of metric segments, average bytes, average records, // and average bytes per record for metric segments in the last hour per organization and instance. // This query is basically identical to the LogSegEstimator, but for metric segments. MetricSegEstimator(ctx context.Context, arg MetricSegEstimatorParams) ([]MetricSegEstimatorRow, error) ObjectCleanupAdd(ctx context.Context, arg ObjectCleanupAddParams) error ObjectCleanupComplete(ctx context.Context, id uuid.UUID) error ObjectCleanupFail(ctx context.Context, id uuid.UUID) error ObjectCleanupGet(ctx context.Context, maxrows int32) ([]ObjectCleanupGetRow, error) PutInqueueWork(ctx context.Context, arg PutInqueueWorkParams) error ReleaseInqueueWork(ctx context.Context, arg ReleaseInqueueWorkParams) error SignalLockCleanup(ctx context.Context) (int32, error) TouchInqueueWork(ctx context.Context, arg TouchInqueueWorkParams) error UpsertServiceIdentifier(ctx context.Context, arg UpsertServiceIdentifierParams) (UpsertServiceIdentifierRow, error) WorkQueueAddDirect(ctx context.Context, arg WorkQueueAddParams) error WorkQueueClaimDirect(ctx context.Context, arg WorkQueueClaimParams) (WorkQueueClaimRow, error) WorkQueueCleanupDirect(ctx context.Context) ([]WorkQueueCleanupRow, error) WorkQueueCompleteDirect(ctx context.Context, arg WorkQueueCompleteParams) error WorkQueueFailDirect(ctx context.Context, arg WorkQueueFailParams) error WorkQueueGC(ctx context.Context, arg WorkQueueGCParams) (int32, error) WorkQueueGlobalLock(ctx context.Context) error // 1) heart-beat the work_queue WorkQueueHeartbeatDirect(ctx context.Context, arg WorkQueueHeartbeatParams) error }
type QuerierFull ¶
type QuerierFull interface { Querier ReplaceMetricSegs(ctx context.Context, args ReplaceMetricSegsParams) 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) BatchInsertMetricSegs ¶
func (q *Queries) BatchInsertMetricSegs(ctx context.Context, arg []BatchInsertMetricSegsParams) *BatchInsertMetricSegsBatchResults
func (*Queries) BatchMarkMetricSegsRolledup ¶
func (q *Queries) BatchMarkMetricSegsRolledup(ctx context.Context, arg []BatchMarkMetricSegsRolledupParams) *BatchMarkMetricSegsRolledupBatchResults
func (*Queries) BatchUpsertExemplarLogs ¶
func (q *Queries) BatchUpsertExemplarLogs(ctx context.Context, arg []BatchUpsertExemplarLogsParams) *BatchUpsertExemplarLogsBatchResults
This will upsert a new log exemplar. Attributes, exemplar, and updated_at are always updated to the provided values. If old_fingerprint is not 0, it is added to the list of related fingerprints. This means the "old" fingerprint should be fingerprint, so it always updates an existing record, not changing it to the new one. The return value is a boolean indicating if the record is new.
func (*Queries) BatchUpsertExemplarMetrics ¶
func (q *Queries) BatchUpsertExemplarMetrics(ctx context.Context, arg []BatchUpsertExemplarMetricsParams) *BatchUpsertExemplarMetricsBatchResults
func (*Queries) BatchUpsertExemplarTraces ¶
func (q *Queries) BatchUpsertExemplarTraces(ctx context.Context, arg []BatchUpsertExemplarTracesParams) *BatchUpsertExemplarTracesBatchResults
func (*Queries) ClaimInqueueWork ¶
func (*Queries) CleanupInqueueWork ¶
func (*Queries) CompactLogSegments ¶
func (q *Queries) CompactLogSegments(ctx context.Context, arg CompactLogSegmentsParams) error
func (*Queries) DeleteInqueueWork ¶
func (q *Queries) DeleteInqueueWork(ctx context.Context, arg DeleteInqueueWorkParams) error
func (*Queries) GetExemplarLogsByFingerprint ¶
func (q *Queries) GetExemplarLogsByFingerprint(ctx context.Context, arg GetExemplarLogsByFingerprintParams) (ExemplarLog, error)
func (*Queries) GetExemplarLogsByService ¶
func (q *Queries) GetExemplarLogsByService(ctx context.Context, arg GetExemplarLogsByServiceParams) ([]ExemplarLog, error)
func (*Queries) GetExemplarLogsCreatedAfter ¶
func (*Queries) GetExemplarMetricsByService ¶
func (q *Queries) GetExemplarMetricsByService(ctx context.Context, arg GetExemplarMetricsByServiceParams) ([]ExemplarMetric, error)
func (*Queries) GetExemplarMetricsCreatedAfter ¶
func (*Queries) GetExemplarTracesByFingerprint ¶
func (q *Queries) GetExemplarTracesByFingerprint(ctx context.Context, arg GetExemplarTracesByFingerprintParams) (ExemplarTrace, error)
func (*Queries) GetExemplarTracesByService ¶
func (q *Queries) GetExemplarTracesByService(ctx context.Context, arg GetExemplarTracesByServiceParams) ([]ExemplarTrace, error)
func (*Queries) GetExemplarTracesCreatedAfter ¶
func (*Queries) GetLogSegmentsForCompaction ¶
func (q *Queries) GetLogSegmentsForCompaction(ctx context.Context, arg GetLogSegmentsForCompactionParams) ([]GetLogSegmentsForCompactionRow, error)
func (*Queries) GetMetricSegsForCompaction ¶
func (*Queries) GetMetricSegsForRollup ¶
func (*Queries) GetSpanInfoByFingerprint ¶
func (q *Queries) GetSpanInfoByFingerprint(ctx context.Context, arg GetSpanInfoByFingerprintParams) (GetSpanInfoByFingerprintRow, error)
func (*Queries) InqueueJournalDelete ¶
func (q *Queries) InqueueJournalDelete(ctx context.Context, arg InqueueJournalDeleteParams) error
func (*Queries) InqueueJournalUpsert ¶
func (*Queries) InsertLogSegmentDirect ¶
func (q *Queries) InsertLogSegmentDirect(ctx context.Context, arg InsertLogSegmentParams) error
func (*Queries) InsertMetricSegmentDirect ¶
func (q *Queries) InsertMetricSegmentDirect(ctx context.Context, arg InsertMetricSegmentParams) error
func (*Queries) ListSegmentsForQuery ¶
func (q *Queries) ListSegmentsForQuery(ctx context.Context, arg ListSegmentsForQueryParams) ([]ListSegmentsForQueryRow, error)
func (*Queries) LogSegEstimator ¶
func (q *Queries) LogSegEstimator(ctx context.Context, arg LogSegEstimatorParams) ([]LogSegEstimatorRow, error)
Returns an estimate of the number of log segments, average bytes, average records, and average bytes per record for log segments in the last hour per organization and instance. This query is basically identical to the MetricSegEstimator, but for log segments.
func (*Queries) MetricSegEstimator ¶
func (q *Queries) MetricSegEstimator(ctx context.Context, arg MetricSegEstimatorParams) ([]MetricSegEstimatorRow, error)
Returns an estimate of the number of metric segments, average bytes, average records, and average bytes per record for metric segments in the last hour per organization and instance. This query is basically identical to the LogSegEstimator, but for metric segments.
func (*Queries) ObjectCleanupAdd ¶
func (q *Queries) ObjectCleanupAdd(ctx context.Context, arg ObjectCleanupAddParams) error
func (*Queries) ObjectCleanupComplete ¶
func (*Queries) ObjectCleanupFail ¶
func (*Queries) ObjectCleanupGet ¶
func (*Queries) PutInqueueWork ¶
func (q *Queries) PutInqueueWork(ctx context.Context, arg PutInqueueWorkParams) error
func (*Queries) ReleaseInqueueWork ¶
func (q *Queries) ReleaseInqueueWork(ctx context.Context, arg ReleaseInqueueWorkParams) error
func (*Queries) SignalLockCleanup ¶
func (*Queries) TouchInqueueWork ¶
func (q *Queries) TouchInqueueWork(ctx context.Context, arg TouchInqueueWorkParams) error
func (*Queries) UpsertServiceIdentifier ¶
func (q *Queries) UpsertServiceIdentifier(ctx context.Context, arg UpsertServiceIdentifierParams) (UpsertServiceIdentifierRow, error)
func (*Queries) WorkQueueAddDirect ¶
func (q *Queries) WorkQueueAddDirect(ctx context.Context, arg WorkQueueAddParams) error
func (*Queries) WorkQueueClaimDirect ¶
func (q *Queries) WorkQueueClaimDirect(ctx context.Context, arg WorkQueueClaimParams) (WorkQueueClaimRow, error)
func (*Queries) WorkQueueCleanupDirect ¶
func (q *Queries) WorkQueueCleanupDirect(ctx context.Context) ([]WorkQueueCleanupRow, error)
func (*Queries) WorkQueueCompleteDirect ¶
func (q *Queries) WorkQueueCompleteDirect(ctx context.Context, arg WorkQueueCompleteParams) error
func (*Queries) WorkQueueFailDirect ¶
func (q *Queries) WorkQueueFailDirect(ctx context.Context, arg WorkQueueFailParams) error
func (*Queries) WorkQueueGC ¶
func (*Queries) WorkQueueGlobalLock ¶
func (*Queries) WorkQueueHeartbeatDirect ¶
func (q *Queries) WorkQueueHeartbeatDirect(ctx context.Context, arg WorkQueueHeartbeatParams) error
1) heart-beat the work_queue
type ReplaceMetricSegsNew ¶
type ReplaceMetricSegsOld ¶
type ReplaceMetricSegsParams ¶
type ReplaceMetricSegsParams 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 // IngestDateint is the date in YYYYMMDD format when the segments were ingested. IngestDateint int32 // InstanceNum is the collector instance number, gotta keep it separated. InstanceNum int16 // FrequencyMs is the frequency in milliseconds at which the metrics are collected. FrequencyMs int32 // Published indicates whether the new segments are marked as published. Published bool // Rolledup indicates whether the new segments are marked as rolledup. Rolledup bool // OldRecords contains the segments to be deleted. OldRecords []ReplaceMetricSegsOld // NewRecords contains the segments to be inserted. NewRecords []ReplaceMetricSegsNew CreatedBy CreatedBy }
type ServiceIdentifier ¶
type ServiceIdentifier 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 pgtype.Text `json:"service_name"` ClusterName pgtype.Text `json:"cluster_name"` Namespace pgtype.Text `json:"namespace"` }
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 SignalLock ¶
type SignalLock struct { ID int64 `json:"id"` WorkID *int64 `json:"work_id"` OrganizationID uuid.UUID `json:"organization_id"` InstanceNum int16 `json:"instance_num"` Dateint int32 `json:"dateint"` FrequencyMs int32 `json:"frequency_ms"` Signal SignalEnum `json:"signal"` TsRange pgtype.Range[pgtype.Timestamptz] `json:"ts_range"` ClaimedBy int64 `json:"claimed_by"` ClaimedAt *time.Time `json:"claimed_at"` HeartbeatedAt time.Time `json:"heartbeated_at"` SlotID int32 `json:"slot_id"` }
type Store ¶
type Store struct { *Queries // contains filtered or unexported fields }
Store provides all functions to execute db queries and transactions
func (*Store) InsertLogSegment ¶
func (q *Store) InsertLogSegment(ctx context.Context, params InsertLogSegmentParams) error
func (*Store) InsertMetricSegment ¶
func (q *Store) InsertMetricSegment(ctx context.Context, params InsertMetricSegmentParams) error
func (*Store) ReplaceMetricSegs ¶
func (q *Store) ReplaceMetricSegs(ctx context.Context, args ReplaceMetricSegsParams) error
ReplaceMetricSegs replaces old metric segments with new ones for a given organization, date, and instance. The change is made atomically.
func (*Store) WorkQueueAdd ¶
func (q *Store) WorkQueueAdd(ctx context.Context, params WorkQueueAddParams) error
func (*Store) WorkQueueClaim ¶
func (q *Store) WorkQueueClaim(ctx context.Context, params WorkQueueClaimParams) (WorkQueueClaimRow, error)
func (*Store) WorkQueueCleanup ¶
func (q *Store) WorkQueueCleanup(ctx context.Context) ([]WorkQueueCleanupRow, error)
func (*Store) WorkQueueComplete ¶
func (q *Store) WorkQueueComplete(ctx context.Context, params WorkQueueCompleteParams) error
func (*Store) WorkQueueFail ¶
func (q *Store) WorkQueueFail(ctx context.Context, params WorkQueueFailParams) error
func (*Store) WorkQueueHeartbeat ¶
func (q *Store) WorkQueueHeartbeat(ctx context.Context, params WorkQueueHeartbeatParams) error
type StoreFull ¶
type StoreFull interface { QuerierFull LogSegmentUpserter MetricSegmentInserter WorkQueueQuerier }
type TouchInqueueWorkParams ¶
type WorkQueue ¶
type WorkQueue struct { ID int64 `json:"id"` Priority int32 `json:"priority"` RunnableAt time.Time `json:"runnable_at"` OrganizationID uuid.UUID `json:"organization_id"` InstanceNum int16 `json:"instance_num"` Dateint int32 `json:"dateint"` FrequencyMs int32 `json:"frequency_ms"` Signal SignalEnum `json:"signal"` Action ActionEnum `json:"action"` NeedsRun bool `json:"needs_run"` Tries int32 `json:"tries"` TsRange pgtype.Range[pgtype.Timestamptz] `json:"ts_range"` ClaimedBy int64 `json:"claimed_by"` ClaimedAt *time.Time `json:"claimed_at"` HeartbeatedAt time.Time `json:"heartbeated_at"` SlotID int32 `json:"slot_id"` }
type WorkQueueAddParams ¶
type WorkQueueAddParams struct { OrgID uuid.UUID `json:"org_id"` Instance int16 `json:"instance"` Dateint int32 `json:"dateint"` Frequency int32 `json:"frequency"` Signal SignalEnum `json:"signal"` Action ActionEnum `json:"action"` TsRange pgtype.Range[pgtype.Timestamptz] `json:"ts_range"` RunnableAt time.Time `json:"runnable_at"` Priority int32 `json:"priority"` SlotID int32 `json:"slot_id"` }
type WorkQueueClaimParams ¶
type WorkQueueClaimParams struct { TargetFreqs []int32 `json:"target_freqs"` Signal SignalEnum `json:"signal"` SlotID int32 `json:"slot_id"` Action ActionEnum `json:"action"` MinPriority int32 `json:"min_priority"` WorkerID int64 `json:"worker_id"` }
type WorkQueueClaimRow ¶
type WorkQueueClaimRow struct { ID int64 `json:"id"` Priority int32 `json:"priority"` RunnableAt time.Time `json:"runnable_at"` OrganizationID uuid.UUID `json:"organization_id"` InstanceNum int16 `json:"instance_num"` Dateint int32 `json:"dateint"` FrequencyMs int32 `json:"frequency_ms"` Signal SignalEnum `json:"signal"` Action ActionEnum `json:"action"` NeedsRun bool `json:"needs_run"` Tries int32 `json:"tries"` TsRange pgtype.Range[pgtype.Timestamptz] `json:"ts_range"` ClaimedBy int64 `json:"claimed_by"` ClaimedAt *time.Time `json:"claimed_at"` HeartbeatedAt time.Time `json:"heartbeated_at"` SlotID int32 `json:"slot_id"` }
type WorkQueueCleanupRow ¶
type WorkQueueCleanupRow struct { ID int64 `json:"id"` Priority int32 `json:"priority"` RunnableAt time.Time `json:"runnable_at"` OrganizationID uuid.UUID `json:"organization_id"` InstanceNum int16 `json:"instance_num"` Dateint int32 `json:"dateint"` FrequencyMs int32 `json:"frequency_ms"` Signal SignalEnum `json:"signal"` Action ActionEnum `json:"action"` NeedsRun bool `json:"needs_run"` Tries int32 `json:"tries"` TsRange pgtype.Range[pgtype.Timestamptz] `json:"ts_range"` ClaimedBy int64 `json:"claimed_by"` ClaimedAt *time.Time `json:"claimed_at"` HeartbeatedAt time.Time `json:"heartbeated_at"` SlotID int32 `json:"slot_id"` LocksRemoved int64 `json:"locks_removed"` }
type WorkQueueCompleteParams ¶
type WorkQueueFailParams ¶
type WorkQueueGCParams ¶
type WorkQueueQuerier ¶
type WorkQueueQuerier interface { WorkQueueAdd(ctx context.Context, params WorkQueueAddParams) error WorkQueueFail(ctx context.Context, params WorkQueueFailParams) error WorkQueueComplete(ctx context.Context, params WorkQueueCompleteParams) error WorkQueueHeartbeat(ctx context.Context, params WorkQueueHeartbeatParams) error WorkQueueCleanup(ctx context.Context) ([]WorkQueueCleanupRow, error) WorkQueueClaim(ctx context.Context, params WorkQueueClaimParams) (WorkQueueClaimRow, error) }
Source Files
¶
- batch.go
- created_by.go
- db.go
- doc.go
- exemplar_logs.sql.go
- exemplar_metrics.sql.go
- exemplar_traces.sql.go
- inqueue.sql.go
- inqueue_journal.sql.go
- log_seg.sql.go
- log_seq.go
- metric_seg.go
- metric_seg.sql.go
- models.go
- obj_cleanup.sql.go
- parquet_estimator.sql.go
- partition_cache.go
- partitioning.go
- pool.go
- querier.go
- querier_upscale.go
- service_identifiers.sql.go
- signal_locks.sql.go
- store.go
- work_queue.go
- work_queue.sql.go
- work_queue_claim.sql.go