orangeCatDeveloper opened a new pull request, #4332:
URL: https://github.com/apache/hertzbeat/pull/4332
Fixes #4212
The alarm center could display alerts but offered no way to export them, so
users had no way to pull alert data out for offline statistics.
Add an "Export Alerts" button to the alarm center that downloads the
matching alerts as an `.xlsx` file. The endpoint reuses the alert list's filter
logic (`status` + fuzzy `search`), extracted into a shared
`buildSingleAlertSpecification`, so the export always matches what the user
currently sees. The matching single alerts are flattened for a tabular sheet —
`labels`/`annotations` maps joined to `k=v; ...` strings, epoch-millis
timestamps formatted to dates — and rendered via easypoi. Default sort is
`activeAt desc` so the ordering column is visible in the sheet.
The export is an unpaged full-result query, same as the existing monitor
export — acceptable for typical alert volumes.
### Verification
End-to-end, three scenarios (3 seeded alerts: 2 firing + 1 resolved):
```
default export -> 3 rows, sorted by activeAt desc:
firing e2e-fp-mem Active At 2024-12-12 20:11:40
firing e2e-fp-cpu Active At 2024-12-12 20:11:17
resolved e2e-fp-disk Active At 2024-12-12 18:40:00
status=resolved -> 1 row (e2e-fp-disk)
search=server-02 -> 1 row (e2e-fp-mem)
output file type: Microsoft OOXML (valid .xlsx / XSSF)
```
https://claude.ai/code/session_01WeCnRmctXtfH4RCrov9WmM
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]