Documentation ¶
Index ¶
- Constants
- Variables
- func DeDupe(strSlice []string) []string
- func EnsureDir(dirName string, clean bool) error
- func ExecSLOTmpl(tmplName string, slo SLO, outDir string) error
- func FileFromTmpl(name string, path string, data interface{}) error
- func GenFoldersTF(srvList []string, outDir string) error
- func GenOverviewTF(s map[string]*SLO, c GenConf) error
- func GenTerraform(slos map[string]*SLO, c GenConf) (string, error)
- func GetStartOfMonth() time.Time
- func GiveKeys(m map[string]bool) []string
- func GiveScheduleViewName(s SLO) string
- func GiveStrFromTmpl(tmplStr string, data interface{}) (string, error)
- func Log() *zap.SugaredLogger
- func ParseDir(path string, ignoreErrors bool) (map[string]*SLO, error)
- func SetupOutDir(c GenConf) error
- func TFExec(wdPath string, action TFAction) error
- func UploadSLOLookup(id, url, filename string) error
- type BurnRate
- type GenConf
- type LayoutItem
- type Notification
- type PanelKey
- type Results
- type SLO
- type SLODashboard
- type SLOMap
- type SLOMonitorConfig
- type SLOObjective
- type SLOOverviewDashConf
- type ScheduledView
- type SearchPanel
- type TFAction
- type TFModules
- type ViewSpec
- type ViewTemplateValues
- type VisualSetting
Constants ¶
View Source
const ( BuildFolder = "build" ViewsFolder = "views" MonitorsFolder = "monitors" DashboardsFolder = "dashboards" )
View Source
const ( VarNameMonRootFolder = "slo_mon_root_folder_id" VarNameDashRootFolder = "slo_dash_root_folder_id" )
View Source
const ( TriggerNameCritical = "Critical" TriggerNameResolveCritical = "ResolvedCritical" TriggerNameWarning = "Warning" TriggerNameResolveWarning = "ResolvedWarning" )
View Source
const ( EnvKeySumoAccessID = "SUMOLOGIC_ACCESSID" EnvKeySumoAccessKey = "SUMOLOGIC_ACCESSKEY" EnvKeySumoEnvironment = "SUMOLOGIC_ENVIRONMENT" )
View Source
const LookupTableIdKey = "lookupTableId"
View Source
const MultiWindowMultiBurnTmpl = `` /* 763-byte string literal not displayed */
View Source
const NameDashFolderTmpl = "dash-folders.tf.gotf"
View Source
const NameDashboardTmpl = "dashboard.tf.gotf"
View Source
const NameGlobalTrackerTmpl = "global-tracker.tf.gotf"
View Source
const NameMainTmpl = "main.tf.gotf"
View Source
const NameModuleTmpl = "module_interface.tf.gotf"
View Source
const NameMonitorFolderTmpl = "monitor-folders.tf.gotf"
View Source
const NameMonitorTmpl = "monitor.tf.gotf"
View Source
const NameViewTmpl = "sched-view.tf.gotf"
View Source
const ScheduledViewQueryTemp = `` /* 396-byte string literal not displayed */
View Source
const ViewPrefix = "slogen_tf"
Variables ¶
View Source
var ( GoodResult = color.New(color.FgHiGreen).Add(color.Bold).Printf GoodUResult = color.New(color.FgHiGreen).Add(color.Bold, color.Underline).Printf BadResult = color.New(color.FgHiRed).Add(color.Bold).Printf BadUResult = color.New(color.FgHiRed).Add(color.Bold, color.Underline).Printf BadInfo = color.New(color.FgHiRed).Add(color.BlinkSlow).Printf GoodInfo = color.New(color.FgGreen).Printf WarnInfo = color.New(color.FgHiMagenta).Add(color.Italic, color.Faint).Printf WarnUInfo = color.New(color.FgHiMagenta).Add(color.Underline, color.Faint).Printf OkInfo = color.New(color.FgHiMagenta).Printf )
Functions ¶
func FileFromTmpl ¶
func GenFoldersTF ¶
func GenTerraform ¶
GenTerraform for all openslo files in the path
func GetStartOfMonth ¶
func GiveScheduleViewName ¶
func GiveStrFromTmpl ¶ added in v0.5.1
func Log ¶
func Log() *zap.SugaredLogger
func SetupOutDir ¶
func UploadSLOLookup ¶ added in v0.2.4
Types ¶
type BurnRate ¶
type BurnRate struct { View string `yaml:"view,omitempty"` Budget float64 `yaml:"budget,omitempty"` ShortWindow string `yaml:"shortWindow"` ShortLimit float64 `yaml:"shortLimit"` LongWindow string `yaml:"longWindow"` LongLimit float64 `yaml:"longLimit"` Notifications []Notification `yaml:"notifications,omitempty"` }
BurnRate only supports 2 window with first one having
type LayoutItem ¶
type Notification ¶
type Notification struct { TriggerFor []string `yaml:"triggerFor,omitempty"` ConnectionType string `yaml:"connectionType"` ConnectionID string `yaml:"connectionID,omitempty"` Subject string `yaml:"subject,omitempty"` Recipients []string `yaml:"recipients,omitempty"` MessageBody string `yaml:"messageBody,omitempty"` TimeZone string `yaml:"timeZone,omitempty"` }
type SLO ¶
type SLODashboard ¶
type SLODashboard struct { Service string SLOName string Title string Desc string Theme string Target float64 RefreshFreq int SearchPanels []SearchPanel Layout []LayoutItem Viz VisualSetting StrYAMLConfig string Labels map[string]string }
func DashConfigFromSLO ¶
func DashConfigFromSLO(sloConf SLO) (*SLODashboard, error)
type SLOMonitorConfig ¶
type SLOMonitorConfig struct { Name string Desc string Service string Objectives []SLOObjective }
func MonitorConfigFromOpenSLO ¶
func MonitorConfigFromOpenSLO(sloConf SLO) (*SLOMonitorConfig, error)
type SLOObjective ¶
type SLOOverviewDashConf ¶
type ScheduledView ¶
type ScheduledView struct { SLOName string `yaml:"sloName"` Service string `yaml:"service"` Index string `yaml:"index"` Query string `yaml:"query"` StartTime string `yaml:"startTime"` /// e.g. "2019-09-01T00:00:00Z" Retention int `yaml:"retention"` // unit: days PreventDestroy bool `yaml:"preventDestroy,omitempty"` }
ScheduledView implicit
func ViewConfigFromSLO ¶
func ViewConfigFromSLO(sloConf SLO) (*ScheduledView, error)
type SearchPanel ¶
type ViewTemplateValues ¶
Click to show internal directories.
Click to hide internal directories.