feat(awooop): add source provider freshness heartbeat
This commit is contained in:
@@ -85,6 +85,7 @@ def build_inbound_source_envelope(
|
||||
content_sha256 = hashlib.sha256(raw_content.encode()).hexdigest() if raw_content else None
|
||||
text_refs = _INCIDENT_ID_RE.findall(raw_content or "")
|
||||
provider_name = str(provider or "unknown").strip().lower() or "unknown"
|
||||
is_provider_heartbeat = str(stage or "").strip().lower() == "heartbeat"
|
||||
source_refs = {
|
||||
"event_ids": _compact_unique([raw_event_id]),
|
||||
"incident_ids": _compact_unique([incident_id, *text_refs]),
|
||||
@@ -92,10 +93,14 @@ def build_inbound_source_envelope(
|
||||
"alert_ids": _compact_unique([provider_event_id, raw_event_id]),
|
||||
"fingerprints": _compact_unique([fingerprint]),
|
||||
"sentry_issue_ids": _compact_unique(
|
||||
[raw_event_id, provider_event_id] if provider_name == "sentry" else []
|
||||
[raw_event_id, provider_event_id]
|
||||
if provider_name == "sentry" and not is_provider_heartbeat
|
||||
else []
|
||||
),
|
||||
"signoz_alerts": _compact_unique(
|
||||
[raw_event_id, alertname] if provider_name == "signoz" else []
|
||||
[raw_event_id, alertname]
|
||||
if provider_name == "signoz" and not is_provider_heartbeat
|
||||
else []
|
||||
),
|
||||
}
|
||||
envelope: dict[str, Any] = {
|
||||
|
||||
Reference in New Issue
Block a user