Commit fb88d4d
bgagent
fix(fanout): promote Slack reaction/delete network errors to error logs (aws-samples#79 review aws-samples#5)
The reaction / delete helpers (``addReaction``, ``removeReaction``,
``deleteMessage``) used to log every catch at warn with a single
generic event key, lumping API-level rejections (e.g. ``no_reaction``)
together with infrastructure failures (DNS lookup, TLS handshake,
fetch timeout, JSON parse error from a hostile gateway). Operators
who alarmed on the warn rate saw a flat signal that masked
genuine infra problems.
Split the boundary:
- API-level (``!result.ok`` after a successful HTTP call) stays at
warn with channel-specific event keys
(``fanout.slack.reaction_add_api_error``,
``fanout.slack.reaction_remove_api_error``,
``fanout.slack.message_delete_api_error``). These are per-message
UX problems; operators don't page.
- Network errors (the outer ``catch (err)`` after ``fetch``)
promote to ``logger.error`` with dedicated event keys
(``fanout.slack.reaction_add_network_error``,
``fanout.slack.reaction_remove_network_error``,
``fanout.slack.message_delete_network_error``) and ``error_id``s
(``FANOUT_SLACK_REACTION_NETWORK``,
``FANOUT_SLACK_DELETE_NETWORK``) so each has its own alarmable
signal. User-visible symptoms when these fire silently:
stale emoji reactions (hourglass never swaps to ✅) and
orphaned intermediate messages.
Behaviour unchanged: errors are still swallowed (per-message
reactions and intermediate cleanup are best-effort by design;
they must not fail the batch), but operators now get distinct
metrics for each failure class.1 parent a29c157 commit fb88d4d
1 file changed
Lines changed: 44 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
438 | | - | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
439 | 445 | | |
440 | 446 | | |
441 | | - | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
442 | 455 | | |
| 456 | + | |
443 | 457 | | |
444 | 458 | | |
445 | 459 | | |
| |||
457 | 471 | | |
458 | 472 | | |
459 | 473 | | |
460 | | - | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
461 | 479 | | |
462 | 480 | | |
463 | | - | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
464 | 487 | | |
| 488 | + | |
465 | 489 | | |
466 | 490 | | |
467 | 491 | | |
| |||
490 | 514 | | |
491 | 515 | | |
492 | 516 | | |
493 | | - | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
494 | 525 | | |
495 | 526 | | |
496 | | - | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
497 | 535 | | |
498 | 536 | | |
499 | 537 | | |
| |||
0 commit comments