Files
PRADEEP KUMARandGitHub 6072a021e2 address feedbacks (#41)
we found huge response for list alerts was issue,
even reducing time duration from 24h default to 5h default was giving
huge data,
now we have structured response which only include essential data

reduce default duration from 24h to 5 hours for all durations

increase apicall context timeout to 600s from 30s(as per signoz)
2025-10-30 17:28:27 +05:30

50 lines
1.3 KiB
Go

package types
// AlertHistoryRequest is the request payload for alert history
type AlertHistoryRequest struct {
Start int64 `json:"start"`
End int64 `json:"end"`
Offset int `json:"offset"`
Limit int `json:"limit"`
Order string `json:"order"`
Filters AlertHistoryFilters `json:"filters"`
}
// AlertHistoryFilters is filters for alert history
type AlertHistoryFilters struct {
Items []interface{} `json:"items"`
Op string `json:"op"`
}
// Alert contains only essential information
type Alert struct {
Alertname string `json:"alertname"`
RuleID string `json:"ruleId"`
Severity string `json:"severity"`
StartsAt string `json:"startsAt"`
EndsAt string `json:"endsAt"`
State string `json:"state"`
}
type APIAlertLabels struct {
Alertname string `json:"alertname"`
RuleID string `json:"ruleId"`
Severity string `json:"severity"`
}
type APIAlertStatus struct {
State string `json:"state"`
}
type APIAlert struct {
Labels APIAlertLabels `json:"labels"`
Status APIAlertStatus `json:"status"`
StartsAt string `json:"startsAt"`
EndsAt string `json:"endsAt"`
}
type APIAlertsResponse struct {
Status string `json:"status"`
Data []APIAlert `json:"data"`
}