|
|
@@ -206,7 +206,7 @@ func runWorker(
|
|
|
close(ackCh)
|
|
|
return
|
|
|
case <-tickCh:
|
|
|
- a := mkAlert("normal", sourceID, dedupePct, dedupeKey, payloadB)
|
|
|
+ a := mkAlert("normal", companyFromKey(apiKey), sourceID, dedupePct, dedupeKey, payloadB)
|
|
|
if err := stream.Send(prodCtx, alertToProto(companyFromKey(apiKey), sourceID, a)); err != nil {
|
|
|
// Check if it's a retriable error.
|
|
|
st, _ := status.FromError(err)
|
|
|
@@ -265,7 +265,7 @@ func companyFromKey(apiKey string) string {
|
|
|
return "acme-001"
|
|
|
}
|
|
|
|
|
|
-func mkAlert(mode, sourceID string, dedupePct int, dedupeKey string, payloadB int) alert.Alert {
|
|
|
+func mkAlert(mode, companyID, sourceID string, dedupePct int, dedupeKey string, payloadB int) alert.Alert {
|
|
|
severity := pickSeverity(mode)
|
|
|
category := pickCategory(severity)
|
|
|
dk := ""
|
|
|
@@ -280,7 +280,7 @@ func mkAlert(mode, sourceID string, dedupePct int, dedupeKey string, payloadB in
|
|
|
"raw_msg": strings.Repeat("x", max(0, payloadB-64)),
|
|
|
}
|
|
|
return alert.Alert{
|
|
|
- CompanyID: "acme-001",
|
|
|
+ CompanyID: companyID,
|
|
|
SourceID: sourceID,
|
|
|
Severity: severity,
|
|
|
Category: category,
|