metrics

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetricsScraper

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

MetricsScraper periodically scrapes Prometheus metrics from kamal-proxy

func NewMetricsScraper

func NewMetricsScraper(settings ScraperSettings) *MetricsScraper

func (*MetricsScraper) Fetch

func (s *MetricsScraper) Fetch(service string, n int) []Sample

Fetch returns the last n samples for a service, ordered from newest to oldest. If fewer than n samples exist, only the available samples are returned.

func (*MetricsScraper) LastError

func (s *MetricsScraper) LastError() error

func (*MetricsScraper) Scrape

func (s *MetricsScraper) Scrape(ctx context.Context)

type Sample

type Sample struct {
	Timestamp    time.Time
	Success      int64
	ClientErrors int64
	ServerErrors int64
}

Sample represents request counts for a single scrape interval

type ScraperSettings

type ScraperSettings struct {
	Port       int
	BufferSize int
}

ScraperSettings configures the metrics scraper

Jump to

Keyboard shortcuts

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