Documentation
¶
Index ¶
- Variables
- func NewLoaderContext(ctx context.Context, client PrometheusAlertsClient, log logrus.FieldLogger) context.Context
- func QueryHash(query string) string
- type Alert
- type AlertConnection
- type AlertEdge
- type AlertOrder
- type AlertOrderField
- type AlertState
- type AlertType
- type BaseAlert
- type PrometheusAlarm
- type PrometheusAlert
- type PrometheusAlertConnection
- type PrometheusAlertEdge
- type PrometheusAlertsClient
- type TeamAlertsFilter
Constants ¶
This section is empty.
Variables ¶
View Source
var AllAlertOrderField = []AlertOrderField{ AlertOrderFieldName, AlertOrderFieldState, AlertOrderFieldEnvironment, }
View Source
var AllAlertState = []AlertState{ AlertStateFiring, AlertStateInactive, AlertStatePending, }
View Source
var SortFilter = sortfilter.New[Alert, AlertOrderField, *TeamAlertsFilter]()
Functions ¶
func NewLoaderContext ¶
func NewLoaderContext(ctx context.Context, client PrometheusAlertsClient, log logrus.FieldLogger) context.Context
Types ¶
type Alert ¶
type Alert interface {
model.Node
GetName() string
GetEnvironmentName() string
GetTeamSlug() slug.Slug
GetState() AlertState
IsNode()
IsAlert()
}
type AlertConnection ¶
type AlertConnection = pagination.Connection[Alert]
type AlertEdge ¶
type AlertEdge = pagination.Edge[Alert]
type AlertOrder ¶
type AlertOrder struct {
Field AlertOrderField `json:"field"`
Direction model.OrderDirection `json:"direction"`
}
type AlertOrderField ¶
type AlertOrderField string
const ( AlertOrderFieldName AlertOrderField = "NAME" AlertOrderFieldState AlertOrderField = "STATE" AlertOrderFieldEnvironment AlertOrderField = "ENVIRONMENT" )
func (AlertOrderField) IsValid ¶
func (e AlertOrderField) IsValid() bool
func (AlertOrderField) MarshalGQL ¶
func (e AlertOrderField) MarshalGQL(w io.Writer)
func (AlertOrderField) String ¶
func (e AlertOrderField) String() string
func (*AlertOrderField) UnmarshalGQL ¶
func (e *AlertOrderField) UnmarshalGQL(v any) error
type AlertState ¶
type AlertState string
const ( AlertStateFiring AlertState = "FIRING" AlertStateInactive AlertState = "INACTIVE" AlertStatePending AlertState = "PENDING" )
func (AlertState) IsValid ¶
func (e AlertState) IsValid() bool
func (AlertState) MarshalGQL ¶
func (e AlertState) MarshalGQL(w io.Writer)
func (AlertState) String ¶
func (e AlertState) String() string
func (*AlertState) UnmarshalGQL ¶
func (e *AlertState) UnmarshalGQL(v any) error
type AlertType ¶
type AlertType int
func AlertTypeFromString ¶
AlertTypeFromString returns the AlertType for the given string. If the string does not match any known type, -1 is returned.
type BaseAlert ¶
type BaseAlert struct {
Name string `json:"name"`
State AlertState `json:"state"`
Query string `json:"query"`
Duration float64 `json:"duration"`
TeamSlug slug.Slug `json:"-"`
EnvironmentName string `json:"-"`
}
func (BaseAlert) GetEnvironmentName ¶
func (BaseAlert) GetState ¶
func (b BaseAlert) GetState() AlertState
func (BaseAlert) GetTeamSlug ¶
type PrometheusAlarm ¶
type PrometheusAlert ¶
type PrometheusAlert struct {
BaseAlert
Alarms []*PrometheusAlarm `json:"alarms"`
RuleGroup string `json:"ruleGroup"`
}
func (PrometheusAlert) ID ¶
func (e PrometheusAlert) ID() ident.Ident
func (PrometheusAlert) IsAlert ¶
func (PrometheusAlert) IsAlert()
func (PrometheusAlert) IsNode ¶
func (PrometheusAlert) IsNode()
type PrometheusAlertConnection ¶
type PrometheusAlertConnection = pagination.Connection[*PrometheusAlert]
type PrometheusAlertEdge ¶
type PrometheusAlertEdge = pagination.Edge[*PrometheusAlert]
type PrometheusAlertsClient ¶
type TeamAlertsFilter ¶
type TeamAlertsFilter struct {
Name string `json:"name"`
Environments []string `json:"environments"`
States []AlertState `json:"states,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.