observability

package
v0.0.5-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTTPRequestsMetricName = "stackdome_http_server_requests_total"
	HTTPDurationMetricName = "stackdome_http_server_request_duration_seconds"
	HTTPInFlightMetricName = "stackdome_http_server_in_flight_requests"

	LabelMethod      = "method"
	LabelRoute       = "route"
	LabelStatus      = "status"
	LabelStatusClass = "status_class"
	LabelWorker      = "worker"
	LabelResult      = "result"

	UnmatchedRoute = "unmatched"
	UnknownMethod  = "UNKNOWN"

	WorkerResultSuccess = "success"
	WorkerResultError   = "error"
	WorkerResultRequeue = "requeue"
	WorkerResultPanic   = "panic"
)
View Source
const (
	StacksMetricName               = "stackdome_stacks"
	StackResourcesMetricName       = "stackdome_stack_resources"
	StackFailuresMetricName        = "stackdome_stack_failures"
	StackSnapshotSuccessMetricName = "stackdome_stack_snapshot_collection_success"

	LabelState = "state"
	LabelType  = "type"

	UnknownState = "Unknown"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

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

func NewMetrics

func NewMetrics() *Metrics

func (*Metrics) DecHTTPInFlight

func (m *Metrics) DecHTTPInFlight(method string)

func (*Metrics) Gatherer

func (m *Metrics) Gatherer() prometheus.Gatherer

func (*Metrics) Handler

func (m *Metrics) Handler() http.Handler

func (*Metrics) IncHTTPInFlight

func (m *Metrics) IncHTTPInFlight(method string)

func (*Metrics) ObserveHTTPRequest

func (m *Metrics) ObserveHTTPRequest(method, route string, status int, elapsed time.Duration)

func (*Metrics) ObserveWorkerExecution

func (m *Metrics) ObserveWorkerExecution(worker, result string)

func (*Metrics) RegisterStackCollector

func (m *Metrics) RegisterStackCollector(source StackSnapshotSource)

type StackMetricSnapshot

type StackMetricSnapshot struct {
	StackStates    map[string]int64
	ResourceStates map[string]int64
	FailureTypes   map[string]int64
}

type StackSnapshotSource

type StackSnapshotSource interface {
	Snapshot(context.Context) (StackMetricSnapshot, error)
}

func NewDatabaseStackSnapshotSource

func NewDatabaseStackSnapshotSource(session db.SessionFactory) StackSnapshotSource

type StackSnapshotSourceFunc

type StackSnapshotSourceFunc func(context.Context) (StackMetricSnapshot, error)

func (StackSnapshotSourceFunc) Snapshot

Jump to

Keyboard shortcuts

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