Repository navigation
v12 Alert drawer shows child alert events as empty rows (only id and timestamp) - #2978
Merged
Merged
Conversation
✅ AI review — Minor findingsOnly minor (medium/low) issues were found. Consider addressing them.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
backend/modules/alerts/domain/alert.go: changeUtmAlert.Eventsfrom[]AlertEvent(a 2-field{id, timestamp}stub) to[]json.RawMessage, and remove the now-unusedAlertEventtype.backend/modules/alerts/usecase/related_logs.go: read event ids and timestamps from the raw payloads viagjson, matching the pattern already used for the parent alert's own events.Reasoning
The alerts plugin denormalizes the full event document into the
eventscolumn ofutmstack.alerts(ClickHouseArray(JSON)), but the Go domain struct used by the API layer only hadidandtimestampfields, sojson.Unmarshalsilently dropped every other field on the way out. The/echoesand alert-detail endpoints therefore returned hollow events whilelastEvent— kept as raw JSON in the same struct — came through intact. That mismatch is what the alert drawer surfaced: the root alert's events looked complete (they arrived via the raw loganalyzer search endpoint or throughlastEvent), while the events contributed by child alerts appeared as empty rows with only an id and a timestamp.The slice-of-raw-JSON shape keeps the stored array byte-for-byte, so the API now returns exactly what the plugin wrote. The only consumer of the old stub in the backend (
RelatedLogs) needed a one-line adjustment; the rest of the module (mailer, alertscoring, the main table via loganalyzer) does not readEventsand is unaffected.Issue
#2977