observability

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package observability provides observability utilities

Index

Constants

This section is empty.

Variables

View Source
var (
	// TasksTotal tracks the total number of tasks processed
	TasksTotal = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: "cbt_tasks_total",
			Help: "Total number of tasks processed",
		},
		[]string{"model", "status"},
	)

	// TaskDuration measures task execution duration in seconds
	TaskDuration = promauto.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    "cbt_task_duration_seconds",
			Help:    "Task execution duration in seconds",
			Buckets: prometheus.ExponentialBuckets(0.1, 2, 10),
		},
		[]string{"model", "status"},
	)

	// TasksRunning tracks the number of currently running tasks
	TasksRunning = promauto.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "cbt_tasks_running",
			Help: "Number of currently running tasks",
		},
		[]string{"model", "worker"},
	)

	// DependencyValidationTotal counts total dependency validation attempts
	DependencyValidationTotal = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: "cbt_dependency_validation_total",
			Help: "Total dependency validation attempts",
		},
		[]string{"model", "result"},
	)

	// DependencyValidationDuration measures time taken to validate dependencies
	DependencyValidationDuration = promauto.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    "cbt_dependency_validation_duration_seconds",
			Help:    "Time taken to validate dependencies",
			Buckets: prometheus.ExponentialBuckets(0.001, 2, 10),
		},
		[]string{"model"},
	)

	// TasksEnqueued counts total number of tasks enqueued
	TasksEnqueued = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: "cbt_tasks_enqueued_total",
			Help: "Total number of tasks enqueued",
		},
		[]string{"model"},
	)

	// ErrorsTotal counts total number of errors
	ErrorsTotal = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: "cbt_errors_total",
			Help: "Total number of errors",
		},
		[]string{"component", "error_type"},
	)

	// ExternalCacheMisses tracks cache misses for external model bounds
	ExternalCacheMisses = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: "cbt_external_cache_misses_total",
			Help: "Total number of cache misses for external model bounds",
		},
		[]string{"model"},
	)

	// ScheduledTasksRegistered tracks registered scheduled tasks
	ScheduledTasksRegistered = promauto.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "cbt_scheduled_tasks_registered",
			Help: "Number of scheduled tasks currently registered",
		},
		[]string{"model", "operation"},
	)

	// ScheduledTaskExecutions tracks scheduled task executions
	ScheduledTaskExecutions = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: "cbt_scheduled_task_executions_total",
			Help: "Total number of scheduled task executions",
		},
		[]string{"model", "operation", "status"},
	)

	// ArchivedTasksDeleted tracks tasks deleted from archive
	ArchivedTasksDeleted = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: "cbt_archived_tasks_deleted_total",
			Help: "Total number of archived tasks deleted",
		},
		[]string{"queue", "model"},
	)

	// ModelBounds tracks the min and max bounds for all models (external and transformations)
	ModelBounds = promauto.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "cbt_model_bounds",
			Help: "Current bounds (min/max positions) for all models",
		},
		[]string{"model", "bound_type"},
	)

	// BackfillGapsAnalyzed tracks gaps found and analyzed during backfill scans
	BackfillGapsAnalyzed = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: "cbt_backfill_gaps_analyzed_total",
			Help: "Total number of gaps analyzed during backfill scans",
		},
		[]string{"model", "result"},
	)

	// BackfillGapCheckLimit tracks when gap check limit is reached
	BackfillGapCheckLimit = promauto.NewCounterVec(
		prometheus.CounterOpts{
			Name: "cbt_backfill_gap_check_limit_reached_total",
			Help: "Total number of times the gap check limit was reached",
		},
		[]string{"model"},
	)
)

Functions

func RecordArchivedTaskDeleted added in v0.0.2

func RecordArchivedTaskDeleted(queue, model string)

RecordArchivedTaskDeleted records an archived task being deleted

func RecordBackfillGapAnalysis added in v0.0.36

func RecordBackfillGapAnalysis(model, result string)

RecordBackfillGapAnalysis records gap analysis results during backfill

func RecordBackfillGapCheckLimitReached added in v0.0.36

func RecordBackfillGapCheckLimitReached(model string)

RecordBackfillGapCheckLimitReached records when gap check limit is reached

func RecordDependencyValidation

func RecordDependencyValidation(model, result string, duration float64)

RecordDependencyValidation records dependency validation metrics

func RecordError

func RecordError(component, errorType string)

RecordError records an error

func RecordExternalCacheMiss

func RecordExternalCacheMiss(model string)

RecordExternalCacheMiss records a cache miss for external model bounds

func RecordModelBounds added in v0.0.3

func RecordModelBounds(model string, minBound, maxBound uint64)

RecordModelBounds records the min and max bounds for a model

func RecordScheduledTaskExecution added in v0.0.3

func RecordScheduledTaskExecution(model, operation, status string)

RecordScheduledTaskExecution records when a scheduled task is executed

func RecordScheduledTaskRegistered added in v0.0.3

func RecordScheduledTaskRegistered(model, operation string)

RecordScheduledTaskRegistered records when a scheduled task is registered.

func RecordScheduledTaskUnregistered added in v0.0.48

func RecordScheduledTaskUnregistered(model, operation string)

RecordScheduledTaskUnregistered records when a scheduled task is unregistered.

func RecordTaskComplete

func RecordTaskComplete(model, worker, status string, duration float64)

RecordTaskComplete records task completion

func RecordTaskEnqueued

func RecordTaskEnqueued(model string)

RecordTaskEnqueued records task enqueue

func RecordTaskStart

func RecordTaskStart(model, worker string)

RecordTaskStart records the start of a task

func StartMetricsServer

func StartMetricsServer(addr string)

StartMetricsServer starts a Prometheus metrics server if it hasn't been started already.

Types

This section is empty.

Jump to

Keyboard shortcuts

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