Documentation ¶
Index ¶
- func DeleteDashboard(options *DeleteOptions) error
- func NewAlertRule(options *AlertOptions) *alerting.RuleBuilder
- func NewContactPoint(options *ContactPointOptions) *alerting.ContactPointBuilder
- func NewCustomVariable(options *CustomVariableOptions) *dashboard.CustomVariableBuilder
- func NewIntervalVariable(options *IntervalVariableOptions) *dashboard.IntervalVariableBuilder
- func NewNotificationPolicy(options *NotificationPolicyOptions) *alerting.NotificationPolicyBuilder
- func NewNotificationTemplatesFromFile(filepath string) (map[string]alerting.NotificationTemplate, error)
- func NewQueryVariable(options *QueryVariableOptions) *dashboard.QueryVariableBuilder
- func Pointer[T any](d T) *T
- type AlertOptions
- type Builder
- func (b *Builder) AddAlert(alerts ...*alerting.RuleBuilder)
- func (b *Builder) AddContactPoint(contactPoints ...*alerting.ContactPointBuilder)
- func (b *Builder) AddNotificationPolicy(notificationPolicies ...*alerting.NotificationPolicyBuilder)
- func (b *Builder) AddPanel(panel ...*Panel)
- func (b *Builder) AddRow(title string)
- func (b *Builder) AddVars(items ...cog.Builder[dashboard.VariableModel])
- func (b *Builder) Build() (*Dashboard, error)
- type BuilderOptions
- type ConditionQuery
- type ContactPointOptions
- type CustomVariableOptions
- type Dashboard
- type DataSource
- type DeleteOptions
- type DeployOptions
- type GaugePanelOptions
- type HeatmapPanelOptions
- type IntervalVariableOptions
- type LegendOptions
- type LogPanelOptions
- type MathExpression
- type NotificationPolicyOptions
- type Panel
- func NewGaugePanel(options *GaugePanelOptions) *Panel
- func NewHeatmapPanel(options *HeatmapPanelOptions) *Panel
- func NewLogPanel(options *LogPanelOptions) *Panel
- func NewStatPanel(options *StatPanelOptions) *Panel
- func NewTablePanel(options *TablePanelOptions) *Panel
- func NewTimeSeriesPanel(options *TimeSeriesPanelOptions) *Panel
- type PanelOptions
- type Query
- type QueryVariableOptions
- type ReduceExpression
- type ResampleExpression
- type RuleQuery
- type StatPanelOptions
- type TablePanelOptions
- type ThresholdConditionsOption
- type ThresholdExpression
- type ThresholdOptions
- type TimeSeriesPanelOptions
- type TransformOptions
- type TypePlatform
- type TypeThresholdType
- type VariableOption
- type VariableOptionValues
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteDashboard ¶
func DeleteDashboard(options *DeleteOptions) error
func NewAlertRule ¶
func NewAlertRule(options *AlertOptions) *alerting.RuleBuilder
func NewContactPoint ¶
func NewContactPoint(options *ContactPointOptions) *alerting.ContactPointBuilder
func NewCustomVariable ¶
func NewCustomVariable(options *CustomVariableOptions) *dashboard.CustomVariableBuilder
func NewIntervalVariable ¶
func NewIntervalVariable(options *IntervalVariableOptions) *dashboard.IntervalVariableBuilder
func NewNotificationPolicy ¶
func NewNotificationPolicy(options *NotificationPolicyOptions) *alerting.NotificationPolicyBuilder
func NewNotificationTemplatesFromFile ¶
func NewNotificationTemplatesFromFile(filepath string) (map[string]alerting.NotificationTemplate, error)
func NewQueryVariable ¶
func NewQueryVariable(options *QueryVariableOptions) *dashboard.QueryVariableBuilder
Types ¶
type AlertOptions ¶
type AlertOptions struct { Name string Summary string Description string RunbookURL string For string NoDataState alerting.RuleNoDataState RuleExecErrState alerting.RuleExecErrState Tags map[string]string Query []RuleQuery QueryRefCondition string Condition []ConditionQuery }
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
func NewBuilder(options *BuilderOptions) *Builder
func (*Builder) AddAlert ¶
func (b *Builder) AddAlert(alerts ...*alerting.RuleBuilder)
func (*Builder) AddContactPoint ¶
func (b *Builder) AddContactPoint(contactPoints ...*alerting.ContactPointBuilder)
func (*Builder) AddNotificationPolicy ¶
func (b *Builder) AddNotificationPolicy(notificationPolicies ...*alerting.NotificationPolicyBuilder)
type BuilderOptions ¶
type ConditionQuery ¶
type ConditionQuery struct { RefID string IntervalMs *float64 MaxDataPoints *int64 ReduceExpression *ReduceExpression MathExpression *MathExpression ResampleExpression *ResampleExpression ThresholdExpression *ThresholdExpression }
type ContactPointOptions ¶
type ContactPointOptions struct { Name string Type alerting.ContactPointType Settings map[string]interface{} }
type CustomVariableOptions ¶
type CustomVariableOptions struct { *VariableOption Values map[string]any }
type Dashboard ¶
type Dashboard struct { Dashboard *dashboard.Dashboard Alerts []alerting.Rule ContactPoints []alerting.ContactPoint NotificationPolicies []alerting.NotificationPolicy }
func (*Dashboard) DeployToGrafana ¶
func (db *Dashboard) DeployToGrafana(options *DeployOptions) error
func (*Dashboard) GenerateJSON ¶
type DataSource ¶
func GetDataSourceFromGrafana ¶
func GetDataSourceFromGrafana(name string, grafanaURL string, grafanaToken string) (*DataSource, error)
func NewDataSource ¶
func NewDataSource(name, uid string) *DataSource
type DeleteOptions ¶
type DeployOptions ¶
type GaugePanelOptions ¶
type GaugePanelOptions struct {
*PanelOptions
}
type HeatmapPanelOptions ¶
type HeatmapPanelOptions struct {
*PanelOptions
}
type IntervalVariableOptions ¶
type IntervalVariableOptions struct { *VariableOption Interval string }
type LegendOptions ¶
type LegendOptions struct { Placement common.LegendPlacement DisplayMode common.LegendDisplayMode Calcs []string }
type LogPanelOptions ¶
type LogPanelOptions struct {
*PanelOptions
}
type MathExpression ¶
type MathExpression struct {
Expression string
}
type NotificationPolicyOptions ¶
type NotificationPolicyOptions struct { Continue *bool GroupBy []string GroupInterval string GroupWait string MuteTimeIntervals []string Receiver string // must match name of ContactPoint Name ObjectMatchers []alerting.ObjectMatcher Provenance *alerting.Provenance RepeatInterval string Routes []*alerting.NotificationPolicyBuilder }
type Panel ¶
type Panel struct {
// contains filtered or unexported fields
}
func NewGaugePanel ¶
func NewGaugePanel(options *GaugePanelOptions) *Panel
func NewHeatmapPanel ¶
func NewHeatmapPanel(options *HeatmapPanelOptions) *Panel
func NewLogPanel ¶
func NewLogPanel(options *LogPanelOptions) *Panel
func NewStatPanel ¶
func NewStatPanel(options *StatPanelOptions) *Panel
func NewTablePanel ¶
func NewTablePanel(options *TablePanelOptions) *Panel
func NewTimeSeriesPanel ¶
func NewTimeSeriesPanel(options *TimeSeriesPanelOptions) *Panel
type PanelOptions ¶
type PanelOptions struct { Datasource string Title string Description string Span uint32 Height uint32 Decimals float64 Unit string NoValue string Min *float64 Max *float64 Query []Query Threshold *ThresholdOptions Transform *TransformOptions ColorScheme dashboard.FieldColorModeId }
type Query ¶
type Query struct { Expr string Legend string Instant bool Min float64 Format prometheus.PromQueryFormat }
type QueryVariableOptions ¶
type QueryVariableOptions struct { *VariableOption Datasource string Query string Multi bool Regex string IncludeAll bool QueryWithType map[string]any Hide *dashboard.VariableHide }
type ReduceExpression ¶
type ReduceExpression struct { Expression string Reducer expr.TypeReduceReducer }
type ResampleExpression ¶
type ResampleExpression struct { Expression string DownSampler expr.TypeResampleDownsampler UpSampler expr.TypeResampleUpsampler }
type StatPanelOptions ¶
type StatPanelOptions struct { *PanelOptions TextSize float64 ValueSize float64 JustifyMode common.BigValueJustifyMode ColorMode common.BigValueColorMode GraphMode common.BigValueGraphMode TextMode common.BigValueTextMode Orientation common.VizOrientation Mappings []dashboard.ValueMapping }
type TablePanelOptions ¶
type TablePanelOptions struct {
*PanelOptions
}
type ThresholdConditionsOption ¶
type ThresholdConditionsOption struct { Params []float64 Type TypeThresholdType }
type ThresholdExpression ¶
type ThresholdExpression struct { Expression string ThresholdConditionsOptions ThresholdConditionsOption }
type ThresholdOptions ¶
type ThresholdOptions struct { Mode dashboard.ThresholdsMode Steps []dashboard.Threshold }
type TimeSeriesPanelOptions ¶
type TimeSeriesPanelOptions struct { *PanelOptions AlertOptions *AlertOptions FillOpacity float64 ScaleDistribution common.ScaleDistribution LegendOptions *LegendOptions ThresholdStyle common.GraphThresholdsStyleMode }
type TransformOptions ¶
type TypePlatform ¶
type TypePlatform string
const ( TypePlatformKubernetes TypePlatform = "kubernetes" TypePlatformDocker TypePlatform = "docker" )
type TypeThresholdType ¶
type TypeThresholdType string
const ( TypeThresholdTypeGt TypeThresholdType = "gt" TypeThresholdTypeLt TypeThresholdType = "lt" TypeThresholdTypeWithinRange TypeThresholdType = "within_range" TypeThresholdTypeOutsideRange TypeThresholdType = "outside_range" )
type VariableOption ¶
type VariableOptionValues ¶
type VariableOptionValues struct { }
Click to show internal directories.
Click to hide internal directories.