Documentation
¶
Index ¶
- func APILabelSetToModelLabelSet(apiLabelSet open_api_models.LabelSet) prometheus_model.LabelSet
- func AlertToOpenAPIAlert(source *alert.Alert, status alert.AlertStatus, receivers, mutedBy []string) *open_api_models.GettableAlert
- func CheckSilenceMatchesFilterLabels(s *silencepb.Silence, matchers []*labels.Matcher) bool
- func GettableSilenceFromProto(s *silencepb.Silence) (open_api_models.GettableSilence, error)
- func ModelLabelSetToAPILabelSet(modelLabelSet prometheus_model.LabelSet) open_api_models.LabelSet
- func OpenAPIAlertsToAlerts(ctx context.Context, apiAlerts open_api_models.PostableAlerts) []prometheus_model.Alert
- func PostableSilenceToProto(s *open_api_models.PostableSilence) (*silencepb.Silence, error)
- func SortSilences(sils open_api_models.GettableSilences)
- type API
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APILabelSetToModelLabelSet ¶ added in v0.22.0
func APILabelSetToModelLabelSet(apiLabelSet open_api_models.LabelSet) prometheus_model.LabelSet
APILabelSetToModelLabelSet converts open_api_models.LabelSet to prometheus_model.LabelSet.
func AlertToOpenAPIAlert ¶ added in v0.22.0
func AlertToOpenAPIAlert(source *alert.Alert, status alert.AlertStatus, receivers, mutedBy []string) *open_api_models.GettableAlert
AlertToOpenAPIAlert converts internal alerts, alert types, and receivers to *open_api_models.GettableAlert.
func CheckSilenceMatchesFilterLabels ¶ added in v0.22.0
CheckSilenceMatchesFilterLabels reports whether one matcher set in s contains every requested matcher with the same name, type, and value. A silence with no matcher sets does not match.
func GettableSilenceFromProto ¶ added in v0.22.0
func GettableSilenceFromProto(s *silencepb.Silence) (open_api_models.GettableSilence, error)
GettableSilenceFromProto converts *silencepb.Silence to open_api_models.GettableSilence.
func ModelLabelSetToAPILabelSet ¶ added in v0.22.0
func ModelLabelSetToAPILabelSet(modelLabelSet prometheus_model.LabelSet) open_api_models.LabelSet
ModelLabelSetToAPILabelSet converts prometheus_model.LabelSet to open_api_models.LabelSet.
func OpenAPIAlertsToAlerts ¶ added in v0.22.0
func OpenAPIAlertsToAlerts(ctx context.Context, apiAlerts open_api_models.PostableAlerts) []prometheus_model.Alert
OpenAPIAlertsToAlerts converts open_api_models.PostableAlerts to []prometheus_model.Alert. The result still has to be normalized and validated before being turned into internal alerts with alert.New, which then copies each alert into its own memory space.
func PostableSilenceToProto ¶ added in v0.22.0
func PostableSilenceToProto(s *open_api_models.PostableSilence) (*silencepb.Silence, error)
PostableSilenceToProto converts *open_api_models.PostableSilenc to *silencepb.Silence.
func SortSilences ¶ added in v0.22.0
func SortSilences(sils open_api_models.GettableSilences)
SortSilences sorts first according to the state "active, pending, expired" then by end time or start time depending on the state. Active silences should show the next to expire first pending silences are ordered based on which one starts next expired are ordered based on which one expired most recently.