prometheus

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExporterOptions

type ExporterOptions struct {
	DurationBuckets []float64
}

ExporterOptions controls collector configuration.

type MetricsExporter

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

MetricsExporter adapts core.Metrics to Prometheus collectors.

func NewMetricsExporter

func NewMetricsExporter(namespace string, reg prom.Registerer, opts ExporterOptions) (*MetricsExporter, error)

NewMetricsExporter creates and registers Prometheus collectors for core.Metrics.

func (*MetricsExporter) RecordQueueDepth

func (m *MetricsExporter) RecordQueueDepth(runnerName string, depth int)

RecordQueueDepth records queue depth.

func (*MetricsExporter) RecordTaskDuration

func (m *MetricsExporter) RecordTaskDuration(runnerName string, priority core.TaskPriority, duration time.Duration)

RecordTaskDuration records task execution duration.

func (*MetricsExporter) RecordTaskPanic

func (m *MetricsExporter) RecordTaskPanic(runnerName string, panicInfo any)

RecordTaskPanic records task panic events.

func (*MetricsExporter) RecordTaskRejected

func (m *MetricsExporter) RecordTaskRejected(runnerName string, reason string)

RecordTaskRejected records task rejection events.

type PoolSnapshotProvider

type PoolSnapshotProvider interface {
	Stats() core.PoolStats
}

PoolSnapshotProvider provides current pool stats snapshots.

type RunnerSnapshotProvider

type RunnerSnapshotProvider interface {
	Stats() core.RunnerStats
}

RunnerSnapshotProvider provides current runner stats snapshots.

type SnapshotPoller

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

SnapshotPoller periodically exports runner/pool Stats() snapshots into Prometheus gauges.

func NewSnapshotPoller

func NewSnapshotPoller(reg prom.Registerer, interval time.Duration) (*SnapshotPoller, error)

NewSnapshotPoller creates a snapshot poller and registers its collectors.

func (*SnapshotPoller) AddPool

func (p *SnapshotPoller) AddPool(name string, provider PoolSnapshotProvider)

AddPool adds or replaces a pool snapshot provider by name.

func (*SnapshotPoller) AddRunner

func (p *SnapshotPoller) AddRunner(name string, provider RunnerSnapshotProvider)

AddRunner adds or replaces a runner snapshot provider by name.

func (*SnapshotPoller) Start

func (p *SnapshotPoller) Start(ctx context.Context)

Start begins periodic polling; repeated calls are no-ops.

func (*SnapshotPoller) Stop

func (p *SnapshotPoller) Stop()

Stop stops periodic polling; repeated calls are safe.

Jump to

Keyboard shortcuts

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