Documentation
¶
Index ¶
- Constants
- Variables
- func AddCheckStatuses(ctx context.Context, ids []string, status models.CheckHealthStatus) error
- func CreateCanary(ctx context.Context, canary *pkg.Canary) error
- func CreateCheck(ctx context.Context, canary pkg.Canary, check *pkg.Check) error
- func DeleteCanary(ctx context.Context, id string) error
- func DeleteCheckComponentRelationshipsForCanary(db *gorm.DB, id string) error
- func DeleteChecksForCanary(db *gorm.DB, id string) ([]string, error)
- func DeleteComponentChildren(db *gorm.DB, componentID string) error
- func DeleteComponentRelationship(db *gorm.DB, componentID string) error
- func DeleteComponentsOfTopology(db *gorm.DB, topologyID string) error
- func DeleteComponentsWithIDs(db *gorm.DB, compIDs []string) error
- func DeleteComponentsWithIDsInBatches(db *gorm.DB, compIDs []string, batchSize int) error
- func DeleteInlineCanariesForComponent(db *gorm.DB, componentID string) error
- func DeleteNonTransformedChecks(db *gorm.DB, id []string) error
- func DeleteTopology(db *gorm.DB, topologyID string) error
- func FindCanariesByWebhook(ctx context.Context, name string) ([]pkg.Canary, error)
- func FindCanary(ctx context.Context, namespace, name string) (*pkg.Canary, error)
- func FindCanaryByID(ctx context.Context, id string) (*pkg.Canary, error)
- func FindCheck(ctx context.Context, canary pkg.Canary, name string) (*pkg.Check, error)
- func FindChecks(ctx context.Context, idOrName, checkType string) ([]models.Check, error)
- func GetActiveComponentsIDsOfTopology(db *gorm.DB, topologyID string) (compIDs []uuid.UUID, err error)
- func GetAllCanariesForSync(ctx context.Context, namespace string) ([]pkg.Canary, error)
- func GetAllValuesForConfigTag(ctx context.Context, tagSelector v1.TopologyTagSelector) ([]string, error)
- func GetCanariesWithAgentSelector(ctx context.Context) ([]pkg.Canary, error)
- func GetCanary(ctx context.Context, id string) (pkg.Canary, error)
- func GetCheck(ctx context.Context, id string) (*pkg.Check, error)
- func GetTopology(ctx context.Context, id string) (*pkg.Topology, error)
- func GetTransformedCheckIDs(ctx context.Context, canaryID string, excludeTypes ...string) ([]string, error)
- func LatestCheckStatus(ctx context.Context, checkID string, before time.Time) (*models.CheckStatus, error)
- func PersistCanary(ctx context.Context, canary v1.Canary, source string) (*pkg.Canary, bool, error)
- func PersistCanaryModel(ctx context.Context, model pkg.Canary) (*pkg.Canary, bool, error)
- func PersistCheck(db *gorm.DB, check pkg.Check, canaryID uuid.UUID) (uuid.UUID, error)
- func PersistComponent(ctx context.Context, component *pkg.Component) ([]uuid.UUID, error)
- func PersistComponents(ctx context.Context, results []*pkg.Component) error
- func PersistTopology(ctx context.Context, model *pkg.Topology) (bool, error)
- func PersistV1Topology(ctx context.Context, t *v1.Topology) (pkg.Topology, bool, error)
- func RemoveTransformedChecks(ctx context.Context, ids []string) error
- func UpdateStatusAndSummaryForComponent(db *gorm.DB, id uuid.UUID, status types.ComponentStatus, summary types.Summary) (int64, error)
Constants ¶
View Source
const CheckStatuses = "check_statuses"
View Source
const (
DefaultTopologySchedule = "@every 10m"
)
Variables ¶
View Source
var AggregateCheckStatues1d = &job.Job{ Name: "AggregateCheckStatuses1h", Singleton: true, JobHistory: true, Retention: job.RetentionBalanced, Schedule: "@every 1h", Fn: func(ctx job.JobRuntime) error { ctx.History.ResourceType = CheckStatuses count, err := job.AggregateCheckStatus1h(ctx.Context) ctx.History.SuccessCount = count return err }, }
View Source
var AggregateCheckStatues1h = &job.Job{ Name: "AggregateCheckStatuses1d", Singleton: true, JobHistory: true, Retention: job.RetentionBalanced, Schedule: "@every 24h", Fn: func(ctx job.JobRuntime) error { ctx.History.ResourceType = CheckStatuses count, err := job.AggregateCheckStatus1d(ctx.Context) ctx.History.SuccessCount = count return err }, }
View Source
var CheckStatusJobs = []*job.Job{ AggregateCheckStatues1d, AggregateCheckStatues1h, DeleteOldCheckStatues, DeleteOldCheckStatues1h, DeleteOldCheckStatues1d, RefreshCheckSizeSummary, RefreshCheckStatusSummary, RefreshCheckStatusSummaryAged, }
View Source
var DeleteOldCheckStatues = &job.Job{ Name: "DeleteOldCheckStatuses", Singleton: true, JobHistory: true, Schedule: "@every 24h", Fn: func(ctx job.JobRuntime) error { ctx.History.ResourceType = CheckStatuses count, err := job.DeleteOldCheckStatuses(ctx.Context, ctx.Properties().Int("check.status.retention.days", 30)) ctx.History.SuccessCount = count return err }, }
View Source
var DeleteOldCheckStatues1d = &job.Job{ Name: "DeleteOldCheckStatuses1d", Singleton: true, JobHistory: true, Retention: job.RetentionBalanced, Schedule: "@every 24h", Fn: func(ctx job.JobRuntime) error { ctx.History.ResourceType = CheckStatuses count, err := job.DeleteOldCheckStatuses1d(ctx.Context, ctx.Properties().Int("check.status.retention.days", 30)*9) ctx.History.SuccessCount = count return err }, }
View Source
var DeleteOldCheckStatues1h = &job.Job{ Name: "DeleteOldCheckStatuses1h", Singleton: true, JobHistory: true, Retention: job.RetentionBalanced, Schedule: "@every 24h", Fn: func(ctx job.JobRuntime) error { ctx.History.ResourceType = CheckStatuses count, err := job.DeleteOldCheckStatuses1h(ctx.Context, ctx.Properties().Int("check.status.retention.days", 30)*3) ctx.History.SuccessCount = count return err }, }
View Source
var PostgresDuplicateKeyError = &pgconn.PgError{Code: "23505"}
View Source
var RefreshCheckSizeSummary = &job.Job{ Name: "RefreshCheckSizeSummary", Singleton: true, Schedule: "@every 24h", JobHistory: true, Retention: job.RetentionFew, Fn: func(ctx job.JobRuntime) error { ctx.History.ResourceType = CheckStatuses return job.RefreshCheckSizeSummary(ctx.Context) }, }
View Source
var RefreshCheckStatusSummary = &job.Job{ Name: "RefreshCheckStatusSummary", Singleton: true, Timeout: 1 * time.Minute, Schedule: "@every 1m", JobHistory: true, Retention: job.Retention{ Success: 1, Failed: 3, }, Fn: func(ctx job.JobRuntime) error { ctx.History.ResourceType = CheckStatuses return job.RefreshCheckStatusSummary(ctx.Context) }, }
View Source
var RefreshCheckStatusSummaryAged = &job.Job{ Name: "RefreshCheckStatusSummaryAged", Timeout: 60 * time.Minute, Schedule: "@every 1h", Retention: job.Retention{ Success: 1, Failed: 3, }, Singleton: true, JobHistory: true, Fn: func(ctx job.JobRuntime) error { ctx.History.ResourceType = CheckStatuses return job.RefreshCheckStatusSummaryAged(ctx.Context) }, }
Functions ¶
func AddCheckStatuses ¶ added in v1.0.10
func CreateCanary ¶ added in v0.38.85
func CreateCheck ¶ added in v0.38.85
func DeleteCheckComponentRelationshipsForCanary ¶ added in v0.38.151
func DeleteChecksForCanary ¶ added in v0.38.151
func DeleteComponentChildren ¶ added in v0.38.210
func DeleteComponentRelationship ¶ added in v0.38.140
func DeleteComponentsOfTopology ¶ added in v0.38.266
DeleteComponents deletes all components associated with a topology
func DeleteComponentsWithIDs ¶ added in v0.38.125
DeleteComponentsWithID deletes all components with specified ids.
func DeleteComponentsWithIDsInBatches ¶ added in v1.1.2
DeleteComponentsWithIDsInBatches deletes all components with specified ids.
func DeleteInlineCanariesForComponent ¶ added in v0.38.151
func DeleteNonTransformedChecks ¶ added in v1.0.10
func FindCanariesByWebhook ¶ added in v1.0.260
func FindCanary ¶ added in v0.38.85
func FindCanaryByID ¶ added in v0.38.257
func FindChecks ¶ added in v1.0.85
func GetActiveComponentsIDsOfTopology ¶ added in v0.38.266
func GetAllCanariesForSync ¶ added in v1.0.6
func GetAllValuesForConfigTag ¶ added in v1.0.260
func GetCanariesWithAgentSelector ¶ added in v1.2.0
func GetTopology ¶ added in v0.38.266
func GetTransformedCheckIDs ¶ added in v0.38.260
func LatestCheckStatus ¶ added in v1.0.124
func LatestCheckStatus(ctx context.Context, checkID string, before time.Time) (*models.CheckStatus, error)
LatestCheckStatus returns the most recent check_statuses row for the given check that was recorded strictly before the given cutoff. The cutoff must predate the current run's persisted status so that the current result is excluded and the returned row reflects the prior state. This is required because SaveResults commits the current run's status before this lookup.
func PersistCanary ¶ added in v0.38.85
func PersistCanaryModel ¶ added in v1.0.26
func PersistCheck ¶ added in v0.38.85
func PersistComponent ¶ added in v0.38.85
TODO: Simplify logic and improve readability
func PersistComponents ¶ added in v0.38.135
func PersistTopology ¶ added in v0.38.266
func PersistV1Topology ¶ added in v1.0.198
func RemoveTransformedChecks ¶ added in v1.0.10
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.