datasources

package
v0.0.0-...-09e306e Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Datasource

type Datasource interface {
	// Initialize the data source, e.g. create database tables.
	Init(context.Context)
	// Download data from the data source.
	Sync(context.Context)
}

Common interface for data sources.

type Monitor

type Monitor struct {
	// A gauge to observe the number of objects synced.
	ObjectsGauge *prometheus.GaugeVec
	// A histogram to measure how long each sync request takes.
	RequestTimer *prometheus.HistogramVec
	// A counter to observe the number of processed sync requests.
	RequestProcessedCounter *prometheus.CounterVec
}

Monitor is a collection of Prometheus metrics for the sync package.

func NewSyncMonitor

func NewSyncMonitor() Monitor

NewSyncMonitor creates a new sync monitor and registers the necessary Prometheus metrics.

func (*Monitor) Collect

func (m *Monitor) Collect(ch chan<- prometheus.Metric)

func (*Monitor) Describe

func (m *Monitor) Describe(ch chan<- *prometheus.Desc)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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