mirror of
https://github.com/hanzoai/o11y-mcp.git
synced 2026-10-30 18:26:37 +00:00
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)
50 lines
1.3 KiB
Go
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"`
|
|
}
|