Documentation
¶
Index ¶
- Constants
- func CleanupFilename(fileName string) string
- func NewProperty(property v1.Property) *dutyTypes.Property
- func ParseConfig(configfile string, datafile string) ([]v1.Canary, error)
- func TruncateError(s string) string
- func TruncateMessage(s string) string
- type ArtifactResult
- type Canary
- type Check
- type CheckResult
- func (result *CheckResult) AddData(data map[string]interface{}) *CheckResult
- func (result *CheckResult) AddDataStruct(data interface{}) *CheckResult
- func (result *CheckResult) AddDetails(detail interface{}) *CheckResult
- func (result *CheckResult) AddMetric(metric Metric) *CheckResult
- func (result *CheckResult) ErrorMessage(err error) *CheckResult
- func (result *CheckResult) Failf(message string, args ...interface{}) *CheckResult
- func (result CheckResult) GetContext() map[string]any
- func (result CheckResult) GetDescription() string
- func (result *CheckResult) GetDuration() int64
- func (result CheckResult) GetName() string
- func (result *CheckResult) Invalidf(message string, args ...interface{}) Results
- func (result CheckResult) LoggerName() string
- func (result *CheckResult) ResultDescription(description string) *CheckResult
- func (result *CheckResult) ResultMessage(message string, args ...interface{}) *CheckResult
- func (result *CheckResult) StartTime(start time.Time) *CheckResult
- func (result CheckResult) String() string
- func (result *CheckResult) TextResults(textResults bool) *CheckResult
- func (result *CheckResult) ToSlice() Results
- func (result *CheckResult) UpdateCheck(check external.Check) *CheckResult
- type CheckStatus
- type Checker
- type Checks
- type Component
- func (component *Component) Clone() Component
- func (component *Component) FindExisting(ctx context.Context) (*models.Component, error)
- func (component Component) GetAsEnvironment() map[string]interface{}
- func (component *Component) GetChecks(db *gorm.DB) (relationships []models.CheckComponentRelationship, err error)
- func (component *Component) GetChildren(db *gorm.DB) (relationships []models.ComponentRelationship, err error)
- func (component *Component) GetConfigs(ctx context.Context) (relationships []models.ConfigComponentRelationship, err error)
- func (component Component) GetID() string
- func (component *Component) GetParents(db *gorm.DB) (relationships []models.CheckComponentRelationship, err error)
- func (component Component) GetStatus() dutyTypes.ComponentStatus
- func (component Component) IsHealthy() bool
- func (component Component) String() string
- func (component Component) Summarize() dutyTypes.Summary
- func (component *Component) UnmarshalJSON(b []byte) error
- type Components
- type Endpoint
- type GenericCheck
- type JSONTime
- type Metric
- type MetricType
- type Object
- type Results
- type SystemResult
- type Topology
- type TransformedCheckResult
- type URL
Constants ¶
View Source
const ComponentType = "component"
Variables ¶
This section is empty.
Functions ¶
func CleanupFilename ¶ added in v0.38.85
func ParseConfig ¶
ParseConfig : Read config file
func TruncateError ¶ added in v1.0.260
func TruncateMessage ¶ added in v1.0.260
Types ¶
type ArtifactResult ¶ added in v1.0.123
type ArtifactResult struct {
ContentType string
Path string
Content io.ReadCloser
Connection string
}
type Canary ¶ added in v0.38.85
type Canary struct {
ID uuid.UUID `gorm:"default:generate_ulid()"`
AgentID uuid.UUID
Spec types.JSON `json:"spec"`
Labels types.JSONStringMap `json:"labels"`
Source string
Name string
Namespace string
Checks types.JSONStringMap `gorm:"-"`
Annotations types.JSONStringMap `json:"annotations,omitempty"`
CreatedAt time.Time
UpdatedAt time.Time `json:"updated_at"`
DeletedAt *time.Time `json:"deleted_at,omitempty" time_format:"postgres_timestamp"`
}
func (Canary) FindChecks ¶ added in v1.0.152
func (Canary) GetCheckID ¶ added in v0.38.168
type Check ¶
type Check struct {
ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"`
CanaryID uuid.UUID `json:"canary_id"`
Spec types.JSON `json:"-"`
Type string `json:"type"`
Name string `json:"name"`
CanaryName string `json:"canary_name" gorm:"-"`
Namespace string `json:"namespace"`
Labels types.JSONStringMap `json:"labels" gorm:"type:jsonstringmap"`
Description string `json:"description,omitempty"`
Status models.CheckHealthStatus `json:"status,omitempty"`
Uptime types.Uptime `json:"uptime" gorm:"-"`
Latency types.Latency `json:"latency" gorm:"-"`
Statuses []CheckStatus `json:"checkStatuses" gorm:"-"`
Owner string `json:"owner,omitempty"`
Severity string `json:"severity,omitempty"`
Icon string `json:"icon,omitempty"`
DisplayType string `json:"displayType,omitempty" gorm:"-"`
Transformed bool `json:"transformed,omitempty"`
LastRuntime *time.Time `json:"lastRuntime,omitempty"`
LastTransitionTime *time.Time `json:"lastTransitionTime,omitempty"`
NextRuntime *time.Time `json:"nextRuntime,omitempty"`
UpdatedAt *time.Time `json:"updatedAt,omitempty"`
CreatedAt *time.Time `json:"createdAt,omitempty"`
DeletedAt *time.Time `json:"deletedAt,omitempty"`
SilencedAt *time.Time `json:"silencedAt,omitempty"`
Canary *v1.Canary `json:"-" gorm:"-"`
// These are calculated for the selected date range
EarliestRuntime *time.Time `json:"earliestRuntime,omitempty" gorm:"-"`
LatestRuntime *time.Time `json:"latestRuntime,omitempty" gorm:"-"`
TotalRuns int `json:"totalRuns,omitempty" gorm:"-"`
}
func FromExternalCheck ¶ added in v0.38.102
func (Check) GetDescription ¶
func (Check) GetNamespace ¶ added in v0.16.0
type CheckResult ¶
type CheckResult struct {
Name string `json:"name,omitempty"`
Start time.Time `json:"start,omitempty"`
Pass bool `json:"pass,omitempty"`
Invalid bool `json:"invalid,omitempty"`
Detail interface{} `json:"detail,omitempty"`
Data map[string]interface{} `json:"data,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Duration int64 `json:"duration,omitempty"`
Description string `json:"description,omitempty"`
DisplayType string `json:"display_type,omitempty"`
Message string `json:"message,omitempty"`
Namespace string `json:"namespace,omitempty"`
Error string `json:"error,omitempty"`
Metrics []Metric `json:"metrics,omitempty"`
Transformed bool `json:"transformed,omitempty"`
// Artifacts is the generated artifacts
Artifacts []artifacts.Artifact `json:"artifacts,omitempty"`
// Check is the configuration
Check external.Check `json:"-"`
Canary v1.Canary `json:"-"`
// ParentCheck is the parent check of a transformed check
ParentCheck external.Check `json:"-"`
ErrorObject error `json:"-"`
InternalError bool `json:"-"`
}
func (*CheckResult) AddData ¶ added in v0.38.4
func (result *CheckResult) AddData(data map[string]interface{}) *CheckResult
func (*CheckResult) AddDataStruct ¶ added in v1.1.2
func (result *CheckResult) AddDataStruct(data interface{}) *CheckResult
func (*CheckResult) AddDetails ¶ added in v0.38.0
func (result *CheckResult) AddDetails(detail interface{}) *CheckResult
func (*CheckResult) AddMetric ¶ added in v0.38.4
func (result *CheckResult) AddMetric(metric Metric) *CheckResult
func (*CheckResult) ErrorMessage ¶ added in v0.32.1
func (result *CheckResult) ErrorMessage(err error) *CheckResult
func (*CheckResult) Failf ¶ added in v0.38.4
func (result *CheckResult) Failf(message string, args ...interface{}) *CheckResult
func (CheckResult) GetContext ¶ added in v1.0.260
func (result CheckResult) GetContext() map[string]any
func (CheckResult) GetDescription ¶ added in v0.11.4
func (result CheckResult) GetDescription() string
func (*CheckResult) GetDuration ¶ added in v0.38.19
func (result *CheckResult) GetDuration() int64
func (CheckResult) GetName ¶ added in v1.0.197
func (result CheckResult) GetName() string
func (*CheckResult) Invalidf ¶ added in v1.0.99
func (result *CheckResult) Invalidf(message string, args ...interface{}) Results
func (CheckResult) LoggerName ¶ added in v1.0.260
func (result CheckResult) LoggerName() string
func (*CheckResult) ResultDescription ¶ added in v0.32.1
func (result *CheckResult) ResultDescription(description string) *CheckResult
func (*CheckResult) ResultMessage ¶ added in v0.32.1
func (result *CheckResult) ResultMessage(message string, args ...interface{}) *CheckResult
func (*CheckResult) StartTime ¶ added in v0.32.1
func (result *CheckResult) StartTime(start time.Time) *CheckResult
func (CheckResult) String ¶
func (result CheckResult) String() string
func (*CheckResult) TextResults ¶ added in v0.32.1
func (result *CheckResult) TextResults(textResults bool) *CheckResult
func (*CheckResult) ToSlice ¶ added in v0.38.85
func (result *CheckResult) ToSlice() Results
func (*CheckResult) UpdateCheck ¶ added in v0.38.151
func (result *CheckResult) UpdateCheck(check external.Check) *CheckResult
type CheckStatus ¶ added in v0.11.0
type CheckStatus struct {
Status bool `json:"status"`
Invalid bool `json:"invalid,omitempty"`
Time string `json:"time"`
DurationMs int32 `json:"duration"`
Message string `json:"message,omitempty"`
Error string `json:"error,omitempty"`
Detail interface{} `json:"-"`
Check *external.Check `json:"check,omitempty"`
}
func CheckStatusFromResult ¶ added in v1.0.85
func CheckStatusFromResult(result CheckResult) CheckStatus
type Checker ¶
type Checker interface {
CheckArgs(args map[string]interface{}) *CheckResult
}
type Component ¶ added in v0.38.85
type Component struct {
Name string `json:"name,omitempty"`
ID uuid.UUID `json:"id,omitempty" gorm:"default:generate_ulid()"`
AgentID uuid.UUID `json:"agent_id,omitempty"`
Text string `json:"text,omitempty"`
Schedule string `json:"schedule,omitempty"`
TopologyType string `json:"topology_type,omitempty"`
Namespace string `json:"namespace,omitempty"`
Labels dutyTypes.JSONStringMap `json:"labels,omitempty"`
Tooltip string `json:"tooltip,omitempty"`
Icon string `json:"icon,omitempty"`
Owner string `json:"owner,omitempty"`
// If set to true, do not display in UI
Hidden bool `json:"hidden,omitempty"`
Status dutyTypes.ComponentStatus `json:"status,omitempty"`
Health *models.Health `json:"health,omitempty"`
StatusReason dutyTypes.NullString `json:"status_reason,omitempty"`
Path string `json:"path,omitempty"`
Order int `json:"order,omitempty" gorm:"-"`
// The type of component, e.g. service, API, website, library, database, etc.
Type string `json:"type,omitempty"`
Summary dutyTypes.Summary `json:"summary,omitempty" gorm:"type:summary"`
// The lifecycle state of the component e.g. production, staging, dev, etc.
Lifecycle string `json:"lifecycle,omitempty"`
Properties dutyTypes.Properties `json:"properties,omitempty" gorm:"type:properties"`
Components Components `json:"components,omitempty" gorm:"-"`
ParentId *uuid.UUID `json:"parent_id,omitempty"` //nolint
Selectors dutyTypes.ResourceSelectors `json:"selectors,omitempty" swaggerignore:"true"`
ComponentChecks v1.ComponentChecks `json:"component_checks" swaggerignore:"true"`
Checks Checks `json:"checks,omitempty" gorm:"-"`
Configs dutyTypes.ConfigQueries `json:"configs,omitempty" gorm:"type:configs"`
TopologyID uuid.UUID `json:"topology_id,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty" time_format:"postgres_timestamp"`
UpdatedAt time.Time `json:"updated_at,omitempty" time_format:"postgres_timestamp"`
DeletedAt *time.Time `json:"deleted_at,omitempty" time_format:"postgres_timestamp" swaggerignore:"true"`
ExternalId string `json:"external_id,omitempty"` //nolint
IsLeaf bool `json:"is_leaf"`
SelectorID string `json:"-" gorm:"-"`
Incidents []dutyTypes.Incident `json:"incidents,omitempty" gorm:"-"`
ConfigInsights []map[string]interface{} `json:"insights,omitempty" gorm:"-"`
CostPerMinute float64 `json:"cost_per_minute,omitempty" gorm:"column:cost_per_minute"`
CostTotal1d float64 `json:"cost_total_1d,omitempty" gorm:"column:cost_total_1d"`
CostTotal7d float64 `json:"cost_total_7d,omitempty" gorm:"column:cost_total_7d"`
CostTotal30d float64 `json:"cost_total_30d,omitempty" gorm:"column:cost_total_30d"`
LogSelectors dutyTypes.LogSelectors `json:"logs,omitempty" gorm:"column:log_selectors"`
StatusExpr string `json:"status_expr,omitempty" gorm:"column:status_expr;default:null"`
HealthExpr string `json:"health_expr,omitempty" gorm:"column:health_expr;default:null"`
// ConfigID is the id of the config from which this component is derived
ConfigID *uuid.UUID `json:"config_id,omitempty"`
ParentLookup *v1.ParentLookup `json:"parentLookup,omitempty" gorm:"-"`
}
Component mirrors the models.Component struct except that instead of raw JSON serialized to the DB, it has the full CRD based spec.
func NewComponent ¶ added in v0.38.85
func NewComponent(c v1.ComponentSpec) *Component
func (*Component) FindExisting ¶ added in v1.0.152
func (Component) GetAsEnvironment ¶ added in v0.38.85
func (*Component) GetChildren ¶ added in v1.0.152
func (*Component) GetConfigs ¶ added in v1.0.152
func (*Component) GetParents ¶ added in v1.0.152
func (Component) GetStatus ¶ added in v0.38.146
func (component Component) GetStatus() dutyTypes.ComponentStatus
func (*Component) UnmarshalJSON ¶ added in v0.38.85
type Components ¶ added in v0.38.85
type Components []*Component
func (Components) Debug ¶ added in v0.38.85
func (components Components) Debug(properties bool, prefix string) string
func (Components) Find ¶ added in v0.38.85
func (components Components) Find(name string) *Component
func (Components) Summarize ¶ added in v0.38.85
func (components Components) Summarize() dutyTypes.Summary
func (*Components) UnmarshalJSON ¶ added in v0.38.85
func (components *Components) UnmarshalJSON(b []byte) error
func (Components) Walk ¶ added in v0.38.146
func (components Components) Walk() Components
type GenericCheck ¶ added in v0.10.0
type GenericCheck struct {
v1.Description `yaml:",inline" json:",inline"`
Type string
Endpoint string
CustomID uuid.UUID
}
func (GenericCheck) GetCustomUUID ¶ added in v1.1.2
func (generic GenericCheck) GetCustomUUID() uuid.UUID
func (GenericCheck) GetEndpoint ¶ added in v0.38.70
func (generic GenericCheck) GetEndpoint() string
func (GenericCheck) GetHash ¶ added in v1.1.2
func (generic GenericCheck) GetHash() string
func (GenericCheck) GetType ¶ added in v0.38.70
func (generic GenericCheck) GetType() string
func (GenericCheck) ShouldMarkFailOnEmpty ¶ added in v1.1.2
func (generic GenericCheck) ShouldMarkFailOnEmpty() bool
type JSONTime ¶ added in v0.11.0
func (JSONTime) MarshalJSON ¶ added in v0.11.0
func (*JSONTime) UnmarshalJSON ¶ added in v0.11.0
type Metric ¶
type Metric struct {
Name string `json:"name,omitempty"`
Type MetricType `json:"type,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Value float64 `json:"value,omitempty"`
}
func (Metric) LabelNames ¶ added in v1.0.64
type MetricType ¶
type MetricType string
type Object ¶ added in v0.38.85
type Object struct {
Name string `json:"name,omitempty"`
Namespace string `json:"namespace,omitempty"`
Labels dutyTypes.JSONStringMap `json:"labels,omitempty"`
}
type Results ¶ added in v0.38.75
type Results []*CheckResult
func (Results) ErrorMessage ¶ added in v0.38.75
func (Results) TotalArtifacts ¶ added in v1.0.123
type SystemResult ¶ added in v0.38.85
type SystemResult struct{}
type Topology ¶ added in v0.38.266
type Topology struct {
ID uuid.UUID `gorm:"default:generate_ulid()"`
AgentID uuid.UUID `gorm:"default:00000000-0000-0000-0000-000000000000"`
Name string
Namespace string
Labels dutyTypes.JSONStringMap
Spec dutyTypes.JSON
Schedule string
Source string `gorm:"default:UI"`
CreatedAt time.Time `json:"created_at,omitempty" time_format:"postgres_timestamp"`
UpdatedAt time.Time `json:"updated_at,omitempty" time_format:"postgres_timestamp"`
DeletedAt *time.Time `json:"deleted_at,omitempty" time_format:"postgres_timestamp"`
}
Topology mirrors the models.Topology struct except that instead of raw JSON serialized to the DB, it has the full CRD based spec.
func ParseTopology ¶ added in v1.0.198
func TopologyFromV1 ¶ added in v0.38.266
type TransformedCheckResult ¶ added in v0.38.70
type TransformedCheckResult struct {
ID uuid.UUID `json:"id,omitempty"`
Start *time.Time `json:"start,omitempty"`
Pass *bool `json:"pass,omitempty"`
Invalid *bool `json:"invalid,omitempty"`
Detail interface{} `json:"detail,omitempty"`
Data map[string]interface{} `json:"data,omitempty"`
DeletedAt *time.Time `json:"deletedAt,omitempty"`
Duration *int64 `json:"duration,omitempty"`
Description string `json:"description,omitempty"`
DisplayType string `json:"displayType,omitempty"`
Message string `json:"message,omitempty"`
Error string `json:"error,omitempty"`
Name string `json:"name,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Namespace string `json:"namespace,omitempty"`
Metrics []Metric `json:"metrics,omitempty"`
Icon string `json:"icon,omitempty"`
Type string `json:"type,omitempty"`
Endpoint string `json:"endpoint,omitempty"`
TransformDeleteStrategy string `json:"transformDeleteStrategy,omitempty"`
}
func (TransformedCheckResult) GetDescription ¶ added in v0.38.70
func (t TransformedCheckResult) GetDescription() string
func (TransformedCheckResult) ToCheckResult ¶ added in v0.38.70
func (t TransformedCheckResult) ToCheckResult() CheckResult
Click to show internal directories.
Click to hide internal directories.