Commit b792219
committed
improvement(webhooks): add trigger-age instrumentation + guard env decryption
- Add dispatch-latency / trigger-age instrumentation: capture webhook receipt
time + Slack x-slack-request-timestamp at the route and log structured
dispatchLatencyMs + triggerAgeMs before execution, surfacing the pre-execution
latency that per-block timings cannot see (Slack trigger_id expires at 3s).
- Guard the effective-env fetch in verifyProviderAuth: only fetch+decrypt when
the handler verifies auth AND the providerConfig references env vars ({{VAR}}),
avoiding a needless DB read/decrypt on the synchronous pre-ack path. The guard
scope exactly matches resolveProviderConfigEnvVars, so resolution is identical.1 parent d9da544 commit b792219
3 files changed
Lines changed: 72 additions & 11 deletions
File tree
- apps/sim
- app/api/webhooks/trigger/[path]
- background
- lib/webhooks
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
72 | 83 | | |
73 | 84 | | |
74 | 85 | | |
| |||
200 | 211 | | |
201 | 212 | | |
202 | 213 | | |
| 214 | + | |
| 215 | + | |
203 | 216 | | |
204 | 217 | | |
205 | 218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
239 | 243 | | |
240 | 244 | | |
241 | 245 | | |
| |||
564 | 568 | | |
565 | 569 | | |
566 | 570 | | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
567 | 589 | | |
568 | 590 | | |
569 | 591 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
| |||
406 | 410 | | |
407 | 411 | | |
408 | 412 | | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
409 | 423 | | |
410 | 424 | | |
411 | 425 | | |
| |||
432 | 446 | | |
433 | 447 | | |
434 | 448 | | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
435 | 457 | | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
445 | 469 | | |
446 | 470 | | |
447 | | - | |
448 | 471 | | |
449 | 472 | | |
450 | | - | |
451 | 473 | | |
452 | 474 | | |
453 | 475 | | |
| |||
611 | 633 | | |
612 | 634 | | |
613 | 635 | | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
614 | 640 | | |
615 | 641 | | |
616 | 642 | | |
| |||
0 commit comments