types

package
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertDetails added in v0.13.0

type AlertDetails struct {
	// Alert information
	AlertName                       string `json:"alertName"`
	AlertTimestamp                  string `json:"alertTimestamp"`
	AlertSeverity                   string `json:"alertSeverity"`
	AlertDescription                string `json:"alertDescription"`
	AlertThreshold                  string `json:"alertThreshold"`
	AlertValue                      string `json:"alertValue"`
	AlertType                       string `json:"alertType"`
	AlertAIRootCauseAnalysisEnabled bool   `json:"alertAIRootCauseAnalysisEnabled"`

	// Component information
	Component     string `json:"component"`
	Project       string `json:"project"`
	Environment   string `json:"environment"`
	ComponentID   string `json:"componentId"`
	ProjectID     string `json:"projectId"`
	EnvironmentID string `json:"environmentId"`

	// Notification channel name
	NotificationChannel string `json:"notificationChannel,omitempty"`
}

AlertDetails represents alert information used for notifications and CEL template rendering

func (*AlertDetails) ToMap added in v0.13.0

func (a *AlertDetails) ToMap() map[string]interface{}

ToMap converts AlertDetails to a map for CEL template rendering. Uses JSON marshaling to automatically convert struct fields to map keys based on JSON tags.

type AlertNotificationResponse

type AlertNotificationResponse struct {
	Status          string   `json:"status"`
	AlertID         string   `json:"alertId,omitempty"`
	EmailRecipients []string `json:"emailRecipients,omitempty"`
}

AlertNotificationResponse represents the outcome of processing an alert notification.

type AlertingRuleCondition

type AlertingRuleCondition struct {
	Enabled   bool    `json:"enabled"`
	Window    string  `json:"window"`
	Interval  string  `json:"interval"`
	Operator  string  `json:"operator"`
	Threshold float64 `json:"threshold"`
}

AlertingRuleCondition defines the condition that triggers the alert

type AlertingRuleMetadata

type AlertingRuleMetadata struct {
	Name                      string `json:"name"`
	Namespace                 string `json:"namespace"`
	ComponentUID              string `json:"component-uid"`
	ProjectUID                string `json:"project-uid"`
	EnvironmentUID            string `json:"environment-uid"`
	Severity                  string `json:"severity"`
	NotificationChannel       string `json:"notificationChannel"`
	EnableAiRootCauseAnalysis bool   `json:"enableAiRootCauseAnalysis"`
}

AlertingRuleMetadata contains metadata about an alerting rule

type AlertingRuleRequest

type AlertingRuleRequest struct {
	Metadata  AlertingRuleMetadata  `json:"metadata"`
	Source    AlertingRuleSource    `json:"source"`
	Condition AlertingRuleCondition `json:"condition"`
}

AlertingRuleRequest represents the request body for PUT /api/alerting/rule/{sourceType}/{ruleName}

type AlertingRuleSource

type AlertingRuleSource struct {
	Type   string `json:"type"`
	Query  string `json:"query"`  // For log-based alert rules
	Metric string `json:"metric"` // For metric-based alert rules (e.g., "cpu_usage", "memory_usage")
}

AlertingRuleSource defines the source of data for the alerting rule

type AlertingRuleSyncResponse

type AlertingRuleSyncResponse struct {
	Status     string `json:"status"`
	LogicalID  string `json:"logicalId"`
	BackendID  string `json:"backendId"`
	Action     string `json:"action"`
	LastSynced string `json:"lastSynced"`
}

AlertingRuleSyncResponse captures the result of an alert rule upsert.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL