Documentation ¶
Index ¶
- Constants
- func CleanupFilename(fileName string) string
- func GetClusterName(config *rest.Config) string
- func GetKubeconfig() string
- func NewK8sClient() (*kubernetes.Clientset, error)
- func NewKommonsClient() (*kommons.Client, error)
- func ParseConfig(configfile string, datafile string) ([]v1.Canary, error)
- func ParseSystems(configFile, datafile string) ([]v1.SystemTemplate, error)
- func ToV1Config(config Config) v1.Config
- type Canary
- type Check
- type CheckComponentRelationship
- type CheckResult
- func (result *CheckResult) AddData(data map[string]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) GetDescription() string
- func (result *CheckResult) GetDuration() int64
- 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) GetAsEnvironment() map[string]interface{}
- func (component Component) GetID() string
- func (component Component) GetStatus() ComponentStatus
- func (component Component) IsHealthy() bool
- func (component Component) String() string
- func (component Component) Summarize() v1.Summary
- func (component *Component) UnmarshalJSON(b []byte) error
- type ComponentRelationship
- type ComponentStatus
- type Components
- func (components Components) CreateTreeStructure() Components
- func (components Components) Debug(prefix string) string
- func (components Components) FilterChildByStatus(status ...string) Components
- func (components Components) Find(name string) *Component
- func (components Components) FindByID(id uuid.UUID) *Component
- func (components Components) FindIndexByID(id uuid.UUID) int
- func (components Components) GetIds() []string
- func (components Components) Summarize() v1.Summary
- func (components *Components) UnmarshalJSON(b []byte) error
- func (components Components) Walk() Components
- type Config
- type Configs
- type Endpoint
- type GenericCheck
- type Incident
- type JSONTime
- type Latency
- type Link
- type Metric
- type MetricType
- type Object
- type Owner
- type Properties
- func (p Properties) AsJSON() []byte
- func (p Properties) AsMap() map[string]interface{}
- func (p Properties) Find(name string) *Property
- func (Properties) GormDBDataType(db *gorm.DB, field *schema.Field) string
- func (Properties) GormDataType() string
- func (p Properties) GormValue(ctx context.Context, db *gorm.DB) clause.Expr
- func (p *Properties) Scan(val interface{}) error
- func (p Properties) Value() (driver.Value, error)
- type Property
- type Results
- type SystemResult
- type SystemTemplate
- type Text
- type Timeseries
- type TransformedCheckResult
- type URL
- type Uptime
Constants ¶
View Source
const ComponentType = "component"
Variables ¶
This section is empty.
Functions ¶
func CleanupFilename ¶ added in v0.38.85
func GetClusterName ¶ added in v0.11.3
func GetKubeconfig ¶
func GetKubeconfig() string
func NewK8sClient ¶
func NewK8sClient() (*kubernetes.Clientset, error)
func NewKommonsClient ¶ added in v0.17.0
func ParseConfig ¶
ParseConfig : Read config file
func ParseSystems ¶ added in v0.38.85
func ParseSystems(configFile, datafile string) ([]v1.SystemTemplate, error)
func ToV1Config ¶ added in v0.38.165
Types ¶
type Canary ¶ added in v0.38.85
type Canary struct { ID uuid.UUID `gorm:"default:generate_ulid()"` Spec types.JSON Labels types.JSONStringMap Source string Name string Namespace string Checks types.JSONStringMap `gorm:"-"` Schedule string CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time `json:"deleted_at,omitempty" time_format:"postgres_timestamp"` }
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" gorm:"-"` Labels types.JSONStringMap `json:"labels" gorm:"type:jsonstringmap"` Description string `json:"description,omitempty"` Status string `json:"status,omitempty"` Uptime Uptime `json:"uptime" gorm:"-"` Latency 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:"-"` LastRuntime *time.Time `json:"lastRuntime,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"` Canary *v1.Canary `json:"-" gorm:"-"` }
func FromExternalCheck ¶ added in v0.38.102
func (Check) GetDescription ¶
type CheckComponentRelationship ¶ added in v0.38.151
type CheckComponentRelationship struct { ComponentID uuid.UUID `json:"component_id,omitempty"` CheckID uuid.UUID `json:"check_id,omitempty"` CanaryID uuid.UUID `json:"canary_id,omitempty"` SelectorID string `json:"selector_id,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` DeletedAt *time.Time `json:"deleted_at,omitempty"` }
type CheckResult ¶
type CheckResult struct { Start time.Time Pass bool Invalid bool Detail interface{} Data map[string]interface{} Duration int64 Description string DisplayType string Message string Error string Metrics []Metric // Check is the configuration Check external.Check Canary v1.Canary }
func (*CheckResult) AddData ¶ added in v0.38.4
func (result *CheckResult) AddData(data map[string]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) 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) 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"` Duration int `json:"duration"` Message string `json:"message,omitempty"` Error string `json:"error,omitempty"` Detail interface{} `json:"-"` }
func FromResult ¶ added in v0.36.0
func FromResult(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()"` //nolint Text string `json:"text,omitempty"` Schedule string `json:"schedule,omitempty"` TopologyType string `json:"topology_type,omitempty"` Namespace string `json:"namespace,omitempty"` Labels types.JSONStringMap `json:"labels,omitempty"` Tooltip string `json:"tooltip,omitempty"` Icon string `json:"icon,omitempty"` Owner string `json:"owner,omitempty"` Status ComponentStatus `json:"status,omitempty"` StatusReason string `json:"statusReason,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 v1.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 Properties `json:"properties,omitempty" gorm:"type:properties"` Components Components `json:"components,omitempty" gorm:"-"` ParentId *uuid.UUID `json:"parent_id,omitempty"` //nolint RelationshipID *uuid.UUID `json:"relationship_id,omitempty"` Selectors v1.ResourceSelectors `json:"selectors,omitempty" gorm:"resourceSelectors" swaggerignore:"true"` ComponentChecks v1.ComponentChecks `json:"-" gorm:"componentChecks" swaggerignore:"true"` Checks Checks `json:"checks,omitempty" gorm:"-"` Configs Configs `json:"configs,omitempty" gorm:"type:configs"` SystemTemplateID *uuid.UUID `json:"system_template_id,omitempty"` //nolint 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 []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"` }
func NewComponent ¶ added in v0.38.85
func NewComponent(c v1.ComponentSpec) *Component
func (Component) GetAsEnvironment ¶ added in v0.38.85
func (Component) GetStatus ¶ added in v0.38.146
func (component Component) GetStatus() ComponentStatus
func (*Component) UnmarshalJSON ¶ added in v0.38.85
type ComponentRelationship ¶ added in v0.38.114
type ComponentRelationship struct { ComponentID uuid.UUID `json:"component_id,omitempty"` RelationshipID uuid.UUID `json:"relationship_id,omitempty"` SelectorID string `json:"selector_id,omitempty"` RelationshipPath string `json:"relationship_path,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty"` DeletedAt *time.Time `json:"deleted_at,omitempty"` }
type ComponentStatus ¶ added in v0.38.85
type ComponentStatus string
var ( ComponentPropertyStatusHealthy ComponentStatus = "healthy" ComponentPropertyStatusUnhealthy ComponentStatus = "unhealthy" ComponentPropertyStatusWarning ComponentStatus = "warning" ComponentPropertyStatusError ComponentStatus = "error" ComponentPropertyStatusInfo ComponentStatus = "info" ComponentStatusOrder = map[ComponentStatus]int{ ComponentPropertyStatusInfo: 0, ComponentPropertyStatusHealthy: 1, ComponentPropertyStatusUnhealthy: 2, ComponentPropertyStatusWarning: 3, ComponentPropertyStatusError: 4, } )
func (ComponentStatus) Compare ¶ added in v0.38.171
func (status ComponentStatus) Compare(other ComponentStatus) int
type Components ¶ added in v0.38.85
type Components []*Component
func (Components) CreateTreeStructure ¶ added in v0.38.148
func (components Components) CreateTreeStructure() Components
func (Components) Debug ¶ added in v0.38.85
func (components Components) Debug(prefix string) string
func (Components) FilterChildByStatus ¶ added in v0.38.152
func (components Components) FilterChildByStatus(status ...string) Components
func (Components) Find ¶ added in v0.38.85
func (components Components) Find(name string) *Component
func (Components) FindByID ¶ added in v0.38.85
func (components Components) FindByID(id uuid.UUID) *Component
func (Components) FindIndexByID ¶ added in v0.38.135
func (components Components) FindIndexByID(id uuid.UUID) int
func (Components) GetIds ¶ added in v0.38.85
func (components Components) GetIds() []string
func (Components) Summarize ¶ added in v0.38.85
func (components Components) Summarize() v1.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 Config ¶
type Config struct { ID uuid.UUID `json:"id,omitempty"` ConfigType string `json:"config_type,omitempty"` Name string `json:"name,omitempty"` Namespace string `json:"namespace,omitempty"` Spec *types.JSONMap `json:"spec,omitempty" gorm:"column:config"` Labels map[string]string `json:"labels,omitempty" gorm:"type:jsonstringmap"` ExternalID pq.StringArray `json:"external_id,omitempty" gorm:"type:text[]"` ExternalType string `json:"external_type,omitempty"` }
func (Config) GetSelectorID ¶ added in v0.38.165
type Configs ¶ added in v0.38.165
type Configs []*Config
func NewConfigs ¶ added in v0.38.168
func (Configs) GormDBDataType ¶ added in v0.38.165
func (Configs) GormDataType ¶ added in v0.38.165
GormDataType gorm common data type
type GenericCheck ¶ added in v0.10.0
type GenericCheck struct { v1.Description `yaml:",inline" json:",inline"` Type string Endpoint string }
func (GenericCheck) GetEndpoint ¶ added in v0.38.70
func (generic GenericCheck) GetEndpoint() string
func (GenericCheck) GetType ¶ added in v0.38.70
func (generic GenericCheck) GetType() string
type JSONTime ¶ added in v0.11.0
func (JSONTime) MarshalJSON ¶ added in v0.11.0
func (*JSONTime) UnmarshalJSON ¶ added in v0.11.0
type Latency ¶ added in v0.37.0
type Metric ¶
type Metric struct { Name string Type MetricType Labels map[string]string Value float64 }
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 types.JSONStringMap `json:"labels,omitempty"` }
type Properties ¶ added in v0.38.85
type Properties []*Property
func (Properties) AsJSON ¶ added in v0.38.85
func (p Properties) AsJSON() []byte
func (Properties) AsMap ¶ added in v0.38.85
func (p Properties) AsMap() map[string]interface{}
func (Properties) Find ¶ added in v0.38.85
func (p Properties) Find(name string) *Property
func (Properties) GormDBDataType ¶ added in v0.38.106
func (Properties) GormDataType ¶ added in v0.38.106
func (Properties) GormDataType() string
GormDataType gorm common data type
func (*Properties) Scan ¶ added in v0.38.106
func (p *Properties) Scan(val interface{}) error
Scan scan value into Jsonb, implements sql.Scanner interface
type Property ¶ added in v0.38.85
type Property struct { Label string `json:"label,omitempty"` Name string `json:"name,omitempty"` Tooltip string `json:"tooltip,omitempty"` Icon string `json:"icon,omitempty"` Type string `json:"type,omitempty"` Color string `json:"color,omitempty"` Order int `json:"order,omitempty"` Headline bool `json:"headline,omitempty"` // Either text or value is required, but not both. Text string `json:"text,omitempty"` Value int64 `json:"value,omitempty"` // e.g. milliseconds, bytes, millicores, epoch etc. Unit string `json:"unit,omitempty"` Max *int64 `json:"max,omitempty"` Min int64 `json:"min,omitempty"` Status string `json:"status,omitempty"` LastTransition string `json:"lastTransition,omitempty"` Links []v1.Link `json:"links,omitempty"` }
Property is a realized v1.Property without the lookup definition
func NewProperty ¶ added in v0.38.85
type Results ¶ added in v0.38.75
type Results []*CheckResult
func (Results) ErrorMessage ¶ added in v0.38.75
type SystemResult ¶ added in v0.38.85
type SystemResult struct{}
type SystemTemplate ¶ added in v0.38.106
type SystemTemplate struct { ID uuid.UUID `gorm:"default:generate_ulid()"` Name string Namespace string Labels types.JSONStringMap Spec types.JSON Schedule string 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"` }
func SystemTemplateFromV1 ¶ added in v0.38.106
func SystemTemplateFromV1(systemTemplate *v1.SystemTemplate) *SystemTemplate
func (*SystemTemplate) ToV1 ¶ added in v0.38.106
func (s *SystemTemplate) ToV1() v1.SystemTemplate
type Timeseries ¶ added in v0.38.70
type Timeseries struct { Key string `json:"key,omitempty"` Time string `json:"time,omitempty"` Status bool `json:"status,omitempty"` Message string `json:"message,omitempty"` Error string `json:"error,omitempty"` Duration int `json:"duration"` // Count is the number of times the check has been run in the specified time window Count int `json:"count,omitempty"` }
type TransformedCheckResult ¶ added in v0.38.70
type TransformedCheckResult struct { 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"` 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"` Icon string `json:"icon,omitempty"` Type string `json:"type,omitempty"` Endpoint string `json:"endpoint,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.