Documentation
¶
Index ¶
- Constants
- Variables
- func DeDupe(strSlice []string) []string
- func EnsureDir(dirName string, clean bool) error
- func ExecSLOTmpl(tmplName string, slo SLOv1Alpha, outDir string) error
- func FileFromTmpl(name string, path string, data interface{}) error
- func GenFoldersTF(srvList []string, conf GenConf) error
- func GenGlobalOverviewTF(s map[string]*SLOv1Alpha, c GenConf) error
- func GenMainTF(path string, conf GenConf) error
- func GenOverviewTF(s map[string]*SLOv1Alpha, c GenConf) error
- func GenSLOFoldersTF(srvList []string, conf GenConf) error
- func GenServiceOverviewDashboard(sloPathMap map[string]*SLOv1Alpha, outDir string) error
- func GenTerraform(slosMv map[string]*SLOMultiVerse, c GenConf) (string, error)
- func GetStartOfMonth() time.Time
- func GiveKeys(m map[string]bool) []string
- func GiveScheduleViewName(s SLOv1Alpha) string
- func GiveStrFromTmpl(tmplStr string, data interface{}) (string, error)
- func GiveStructCompare(a, b interface{}) bool
- func Log() *zap.SugaredLogger
- func ParseDir(path string, ignoreErrors bool, slos map[string]*SLOMultiVerse) error
- func SetupOutDir(c GenConf) error
- func TFExec(wdPath string, action TFAction) error
- func UploadSLOLookup(id, url, filename string) error
- type Alerts
- type BurnAlertTmplParams
- type BurnRate
- type GenConf
- type InfoLogger
- type LayoutItem
- type MonitorConnections
- type Notification
- type PanelKey
- type Results
- type SLODashboard
- type SLOMap
- type SLOMonitorConfig
- type SLOMultiVerse
- type SLOObjective
- type SLOOverviewDashConf
- type SLOv1Alpha
- type ScheduledView
- type SearchPanel
- type ServiceOverviewDashboard
- type ServiceOverviewRow
- type TFAction
- type TFModules
- type ViewSpec
- type ViewTemplateValues
- type VisualSetting
Constants ¶
View Source
const ( BuildFolder = "build" ViewsFolder = "views" MonitorsFolder = "monitors" DashboardsFolder = "dashboards" NativeSLOFolder = "slos" )
View Source
const ( VarNameMonRootFolder = "slo_mon_root_folder_id" VarNameDashRootFolder = "slo_dash_root_folder_id" VarNameNativeSLORootFolder = "slo_root_folder_id" VarNameSLOMonitorRootFolder = "slo_monitor_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" EnvKeyHTTPProxy = "HTTP_PROXY" EnvKeyHTTPSProxy = "HTTPS_PROXY" )
View Source
const ( BudgetingMethodNameTimeSlices = "Timeslices" BudgetingMethodNameOccurrences = "Occurrences" )
View Source
const DefaultScheduledViewRetention = 100
View Source
const LookupTableIdKey = "lookupTableId"
View Source
const MultiWindowMultiBurnTmpl = `` /* 878-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 NameModuleTmpl = "module_interface.tf.gotf"
View Source
const NameMonitorFolderTmpl = "monitor-folders.tf.gotf"
View Source
const NameMonitorTmpl = "monitor.tf.gotf"
View Source
const NameSLOFolderTmpl = "slo-folders.tf.gotf"
View Source
const NameServiceTrackerTmpl = "service-overview.tf.gotf"
View Source
const NameViewTmpl = "sched-view.tf.gotf"
View Source
const ScheduledViewQueryTemp = `` /* 396-byte string literal not displayed */
View Source
const TimeSliceMultiWindowMultiBurnTmpl = `` /* 1095-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 ExecSLOTmpl ¶
func ExecSLOTmpl(tmplName string, slo SLOv1Alpha, outDir string) error
func FileFromTmpl ¶
func GenFoldersTF ¶
func GenGlobalOverviewTF ¶
func GenGlobalOverviewTF(s map[string]*SLOv1Alpha, c GenConf) error
func GenOverviewTF ¶
func GenOverviewTF(s map[string]*SLOv1Alpha, c GenConf) error
func GenSLOFoldersTF ¶
func GenServiceOverviewDashboard ¶
func GenServiceOverviewDashboard(sloPathMap map[string]*SLOv1Alpha, outDir string) error
func GenTerraform ¶
func GenTerraform(slosMv map[string]*SLOMultiVerse, c GenConf) (string, error)
GenTerraform for all openslo files in the path
func GetStartOfMonth ¶
func GiveScheduleViewName ¶
func GiveScheduleViewName(s SLOv1Alpha) string
func GiveStrFromTmpl ¶
func GiveStructCompare ¶
func GiveStructCompare(a, b interface{}) bool
func Log ¶
func Log() *zap.SugaredLogger
func SetupOutDir ¶
func UploadSLOLookup ¶
Types ¶
type BurnAlertTmplParams ¶
type BurnAlertTmplParams struct { BurnRate Target float64 // SLO goal i.e. the slo percent age in [0.0,1.0] decimal form TimesliceRatioTarget float64 // only applicable for timeslice based budgeting }
func ConvertToBurnRateTmplParams ¶
func ConvertToBurnRateTmplParams(alerts []BurnRate, target, timesliceTarget float64) []BurnAlertTmplParams
type BurnRate ¶
type BurnRate struct { View string `yaml:"view,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 InfoLogger ¶
type InfoLogger struct { }
func (InfoLogger) Printf ¶
func (t InfoLogger) Printf(format string, vals ...interface{})
type LayoutItem ¶
type MonitorConnections ¶
type MonitorConnections struct { Type string `json:"type,omitempty"` Name string `json:"name,omitempty"` ID string `json:"id,omitempty"` Desc string `json:"description,omitempty"` CreatedAt string `json:"createdAt,omitempty"` CreatedBy string `json:"createdBy,omitempty"` ModifiedAt string `json:"modifiedAt,omitempty"` ModifiedBy string `json:"modifiedBy,omitempty"` URL string `json:"url,omitempty"` UserName string `json:"username,omitempty"` }
func GiveConnectionIDS ¶
func GiveConnectionIDS(token string) ([]MonitorConnections, error)
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"` PayloadOverride string `yaml:"payload_override,omitempty"` ResolutionPayloadOverride string `yaml:"resolution_payload_override,omitempty"` }
type PanelKey ¶
type PanelKey string
const ( KeyGaugeToday PanelKey = "gauge-today" KeyGaugeWeek PanelKey = "gauge-week" KeyGaugeMonth PanelKey = "gauge-month" KeyPanelHourlyBurn PanelKey = "hourly-burn-rate" KeyPanelBurnTrend PanelKey = "burn-trend" KeyPanelBudgetLeft PanelKey = "budget-left" KeyPanelBreakDown PanelKey = "breakdown" )
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 Fields []string ViewName string }
func DashConfigFromSLO ¶
func DashConfigFromSLO(sloConf SLOv1Alpha) (*SLODashboard, error)
type SLOMap ¶
type SLOMap map[string]*SLOv1Alpha
type SLOMonitorConfig ¶
type SLOMonitorConfig struct { Name string Desc string Service string Objectives []SLOObjective }
func MonitorConfigFromOpenSLO ¶
func MonitorConfigFromOpenSLO(sloConf SLOv1Alpha) (*SLOMonitorConfig, error)
type SLOMultiVerse ¶
type SLOMultiVerse struct { ConfigPath string SLOAlpha *SLOv1Alpha SLO *specs.OpenSLOSpec AlertPolicy *oslo.AlertPolicy AlertCondition *oslo.AlertCondition AlertNotificationTarget *oslo.AlertNotificationTarget }
func Parse ¶
func Parse(filename string) (*SLOMultiVerse, error)
func ParseFile ¶
func ParseFile(path string) (*SLOMultiVerse, error)
type SLOObjective ¶
type SLOOverviewDashConf ¶
type SLOv1Alpha ¶
type SLOv1Alpha struct { *v1alpha.SLO `yaml:",inline"` Labels map[string]string `yaml:"labels,omitempty"` Fields map[string]string `yaml:"fields,omitempty"` Alerts Alerts `yaml:"alerts,omitempty"` BurnRateAlerts []BurnRate `yaml:"burnRateAlerts,omitempty"` // deprecated }
func (SLOv1Alpha) Name ¶
func (s SLOv1Alpha) Name() string
func (SLOv1Alpha) Target ¶
func (s SLOv1Alpha) Target() float64
func (SLOv1Alpha) TimesliceTarget ¶
func (s SLOv1Alpha) TimesliceTarget() float64
func (SLOv1Alpha) ViewID ¶
func (s SLOv1Alpha) ViewID() string
ViewID return the short sha1 hash for view query to ensure old view data is not reused
func (SLOv1Alpha) ViewName ¶
func (s SLOv1Alpha) ViewName() string
func (SLOv1Alpha) ViewQuery ¶
func (s SLOv1Alpha) ViewQuery() (string, error)
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 SLOv1Alpha) (*ScheduledView, error)
type SearchPanel ¶
type ServiceOverviewDashboard ¶
type ServiceOverviewDashboard struct { Service string Rows []ServiceOverviewRow Layout []LayoutItem Vars []string }
type ServiceOverviewRow ¶
type ServiceOverviewRow struct { SLOName string Panels []SearchPanel SLOConf SLOv1Alpha }
type ViewTemplateValues ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.