Documentation
¶
Overview ¶
Package systemstatus reads the System status (C-19.FR-10): the live replicas with the Leader and their key ids, the recovery state, the delivery queues, the Broken Destinations, the Integrations that need attention, the template errors, the active Storms and the result of the last outgoing heartbeat. Any replica answers it; it changes nothing.
Index ¶
Constants ¶
const ( IssueHeartbeatLost = "heartbeat_lost" IssueSnapshotTruncated = "snapshot_truncated" )
The issues of an Integration that needs attention.
const ( SubjectRoute = "route" SubjectDestination = "destination" )
The kinds of the subject of a template error.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BrokenDestination ¶
BrokenDestination is a Broken Destination with the masked reason.
type Config ¶
type Config struct {
OrgID int64
Queries Queries
// Replicas lists the live replicas, those whose record is younger than replica.live_expiry on the real clock.
Replicas func(ctx context.Context) ([]keyring.Replica, error)
// Business is the business clock: the recovery window, the alive mark and the due Thread replies follow it.
Business clock.Clock
// LeaderAbsence is leader.absence_notice: a Leader whose alive mark is older is not flagged.
LeaderAbsence time.Duration
// Version and Commit are those of the binary.
Version, Commit string
}
Config is what the Service reads.
type IntegrationAttention ¶
IntegrationAttention is an Integration that is Heartbeat lost or has a truncated groupKey.
type OutgoingHeartbeat ¶
type OutgoingHeartbeat struct {
Configured bool
LastAttemptAt *time.Time
LastOK *bool
LastError *string
LastErrorClass string
LastStatus int
}
OutgoingHeartbeat is the result of the last outgoing heartbeat; without a URL nothing else is set. A failed one has the class of its error and the status code of the answer, 0 without one (outgoingheartbeat.FailureOf).
type Queries ¶
type Queries interface {
GetRuntimeState(ctx context.Context) (dbgen.GetRuntimeStateRow, error)
LatestDowntime(ctx context.Context) (dbgen.LatestDowntimeRow, error)
ListDeliveryQueues(ctx context.Context, arg dbgen.ListDeliveryQueuesParams) ([]dbgen.ListDeliveryQueuesRow, error)
ListBrokenDestinations(ctx context.Context, orgID int64) ([]dbgen.ListBrokenDestinationsRow, error)
ListIntegrationsAttention(ctx context.Context, orgID int64) ([]dbgen.ListIntegrationsAttentionRow, error)
ListTemplateErrors(ctx context.Context, orgID int64) ([]dbgen.ListTemplateErrorsRow, error)
ListActiveStorms(ctx context.Context, orgID int64) ([]dbgen.ListActiveStormsRow, error)
GetOutgoingHeartbeatResult(ctx context.Context, orgID int64) (dbgen.GetOutgoingHeartbeatResultRow, error)
}
Queries are the reads of the System status; *dbgen.Queries implements them.
func NewQueries ¶
NewQueries is the Queries over a pool, a connection or a transaction.
type Recovery ¶
Recovery is the recovery state after downtime: Active while the recovery window lasts, Until its end while it is active, and the last downtime, when there was one.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service reads the System status of the Organization.
type Status ¶
type Status struct {
Version string
Commit string
Replicas []Replica
Recovery Recovery
DeliveryQueues []Queue
BrokenDestinations []BrokenDestination
IntegrationsAttention []IntegrationAttention
TemplateErrors []TemplateError
ActiveStorms []Storm
OutgoingHeartbeat OutgoingHeartbeat
}
Status is the System status.