chore: necessary updates given the changes in the alert controller
This commit is contained in:
@@ -39,6 +39,7 @@ public static class DataLakeEventParser
|
||||
AlertType : GetString(d, "alertType"),
|
||||
Severity : GetString(d, "severity"),
|
||||
Details : GetString(d, "details"),
|
||||
ExplanationJson: GetJsonObjectString(d, "explanation"),
|
||||
TriggeredAt : GetTimestampString(d, "triggeredAt"),
|
||||
KafkaPartition : partition,
|
||||
KafkaOffset : offset);
|
||||
@@ -78,6 +79,13 @@ public static class DataLakeEventParser
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetJsonObjectString(JsonElement d, string name)
|
||||
{
|
||||
if (!TryGetProperty(d, name, out var prop) || prop.ValueKind != JsonValueKind.Object)
|
||||
return "";
|
||||
return prop.GetRawText();
|
||||
}
|
||||
|
||||
private static string GetString(JsonElement d, string primary, string? alternate = null)
|
||||
{
|
||||
if (TryGetProperty(d, primary, out var prop))
|
||||
|
||||
Reference in New Issue
Block a user