fleetobserve

package
v1.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// 14 separates first-observed created-to-deleting inventory convergence from
	// persistent missing ownership. 13 adds bounded GitHub run/request/runner correlation completeness. 12 separates bounded successful-delete convergence from persistent missing
	// runner ownership. 11 separated exact image builder/smoke inventory from orphan job runners.
	// 9 added exact JobStarted runner correlation and symmetric created-without-
	// running identity telemetry. Version 8 added role-correct central exporter
	// health, container admission readiness, phase ages and rollback-compatible
	// WAL progress semantics.
	SchemaVersion = 14
)

Variables

This section is empty.

Functions

func RenderPrometheus

func RenderPrometheus(snapshot Snapshot, now time.Time, maxStaleness time.Duration) string

func ServiceNames

func ServiceNames() []string

Types

type Collector

type Collector struct {
	Config             config.Config
	Host               HostSource
	Journal            JournalSource
	ProviderRetry      ProviderRetrySource
	Queue              QueueIntentSource
	Instances          InstanceSource
	Diagnostics        DiagnosticsSource
	Export             DiagnosticExportSource
	Service            ServiceSource
	DiagnosticMaxBytes int64
	Now                func() time.Time
	CreatedVisibility  *CreatedVisibilityTracker
}

func (Collector) Collect

func (c Collector) Collect(ctx context.Context) Snapshot

func (Collector) Validate

func (c Collector) Validate() error

type CreatedVisibilityTracker

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

CreatedVisibilityTracker remembers when a created lease was first observed absent from Incus. Lease age cannot answer this question: a worker can run for hours before terminal teardown creates a short journal/inventory race.

func NewCreatedVisibilityTracker

func NewCreatedVisibilityTracker() *CreatedVisibilityTracker

type DiagnosticExportSource

type DiagnosticExportSource func() (diagnosticexport.Status, error)

type DiagnosticExportSync

type DiagnosticExportSync struct {
	State                 string `json:"state"`
	GracePeriodSeconds    int64  `json:"grace_period_seconds"`
	GraceRemainingSeconds int64  `json:"grace_remaining_seconds"`
	LocalBundleDelta      int    `json:"local_bundle_delta"`
	LocalByteDelta        int64  `json:"local_byte_delta"`
}

type DiagnosticsSource

type DiagnosticsSource func(time.Time) (workerdiagnostics.SpoolStats, error)

type Handler

type Handler struct {
	State        *State
	MaxStaleness time.Duration
	Now          func() time.Time
}

func (Handler) ServeHTTP

func (h Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request)

type HostSource

type HostSource func(context.Context) (hostprobe.Snapshot, error)

type IncusSummary

type IncusSummary struct {
	VisibleInstances            int   `json:"visible_instances"`
	VisibleMaintenanceInstances int   `json:"visible_maintenance_instances"`
	OrphanInstances             int   `json:"orphan_instances"`
	MissingInstances            int   `json:"missing_instances"`
	MissingDeletingWithinGrace  int   `json:"missing_deleting_within_grace"`
	MissingCreatedWithinGrace   int   `json:"missing_created_within_grace"`
	OldestMissingCreatedAgeSecs int64 `json:"oldest_missing_created_within_grace_age_seconds"`
	MissingMaintenanceInstances int   `json:"missing_maintenance_instances"`
}

type InstanceSource

type InstanceSource func(context.Context) ([]string, error)

type JournalSource

type JournalSource func(context.Context) (providerjournal.Journal, error)

type JournalSummary

type JournalSummary struct {
	SchemaVersion                                 int              `json:"schema_version"`
	Generation                                    uint64           `json:"generation"`
	UpdatedAt                                     time.Time        `json:"updated_at"`
	Leases                                        int              `json:"leases"`
	Claims                                        int              `json:"claims"`
	WarmPreemptions                               int              `json:"warm_preemptions"`
	WarmPreemptionsTotal                          uint64           `json:"warm_preemptions_total"`
	ByState                                       map[string]int   `json:"by_state"`
	OldestStateAgeSeconds                         map[string]int64 `json:"oldest_state_age_seconds"`
	CreatedWithoutRunningIdentity                 int              `json:"created_without_running_identity"`
	OldestCreatedWithoutRunningIdentityAgeSeconds int64            `json:"oldest_created_without_running_identity_age_seconds"`
}

type PoolStatus

type PoolStatus struct {
	Name                    string `json:"name"`
	PilotReady              bool   `json:"pilot_ready"`
	ContainerAdmissionReady bool   `json:"container_admission_ready"`
	Blockers                int    `json:"blockers"`
	Warnings                int    `json:"warnings"`
	Info                    int    `json:"info"`
}

type ProviderRetrySource

type ProviderRetrySource func(time.Time) (providerretry.Snapshot, error)

type QueueIntentSource

type QueueIntentSource func(context.Context) (queueintent.Snapshot, error)

type QueueSummary

type QueueSummary struct {
	Generation                   uint64           `json:"generation"`
	Stored                       int              `json:"stored"`
	Active                       int              `json:"active"`
	Expired                      int              `json:"expired"`
	InFlight                     int              `json:"in_flight"`
	OldestQueueAgeSeconds        int64            `json:"oldest_queue_age_seconds"`
	UncoveredRunning             int              `json:"uncovered_running"`
	RunningWithoutRunnerIdentity int              `json:"running_without_runner_identity"`
	UnboundRepository            int              `json:"unbound_repository"`
	MissingRunnerRequestID       int              `json:"missing_runner_request_id"`
	DirectJITWithoutRequestID    int              `json:"direct_jit_without_runner_request_id"`
	MissingWorkflowRunID         int              `json:"missing_workflow_run_id"`
	RunningMissingGitHubRunnerID int              `json:"running_missing_github_runner_id"`
	ByState                      map[string]int   `json:"by_state"`
	OldestStateAgeSeconds        map[string]int64 `json:"oldest_state_age_seconds"`
	ByPriority                   map[int]int      `json:"by_priority"`
	ByScaleSet                   map[string]int   `json:"by_scale_set"`
}

type ServiceSource

type ServiceSource func(context.Context, string) (string, error)

type ServiceStatus

type ServiceStatus struct {
	Name   string `json:"name"`
	State  string `json:"state"`
	Active bool   `json:"active"`
}

type Snapshot

type Snapshot struct {
	SchemaVersion        int                          `json:"schema_version"`
	CapturedAt           time.Time                    `json:"captured_at"`
	Healthy              bool                         `json:"healthy"`
	Host                 hostprobe.Snapshot           `json:"host"`
	Pools                []PoolStatus                 `json:"pools"`
	Journal              JournalSummary               `json:"journal"`
	ProviderRetry        providerretry.Snapshot       `json:"provider_retry"`
	Queue                QueueSummary                 `json:"queue"`
	Incus                IncusSummary                 `json:"incus"`
	Diagnostics          workerdiagnostics.SpoolStats `json:"diagnostics"`
	DiagnosticExport     diagnosticexport.Status      `json:"diagnostic_export"`
	DiagnosticExportSync DiagnosticExportSync         `json:"diagnostic_export_sync"`
	Services             []ServiceStatus              `json:"services"`
	CollectionErrors     []string                     `json:"collection_errors"`
}

type State

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

func (*State) Latest

func (s *State) Latest() (Snapshot, bool)

func (*State) Set

func (s *State) Set(snapshot Snapshot)

Jump to

Keyboard shortcuts

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