18 Commits

Author SHA1 Message Date
David Zhao
8b204ac683 add option to force webhooks to be made over IPv4 (#1296)
* add option to force webhooks to be made over IPv4

* include in test

* changeset
2025-11-09 15:22:14 -08:00
Raja Subramanian
2227c44329 Add prom metrics for webhook dispatch. (#1095)
* Add prom metrics for webhook dispatch.

1. success/failure/drop counter.
2. queue length histogram.
   - doing this only for resource_url_notifier which does a per room
     queue as queue length is easily available. This is the one
     currently in use.
   - worker pool based notifier will need a change in `core` package to
     return a queue length when enqueuing.

* promauto goodness
2025-06-04 13:57:15 -07:00
Benjamin Pracht
9c8b99db90 Allow specifying extra webhooks in egress start requests (#1040) 2025-04-09 15:50:25 -07:00
Raja Subramanian
56615aa7e6 Move WebHookConfig to use location (#1006)
* Move WebHookConfig to use location

* generate

* generated protobuf

* make URLNotifier config

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2025-03-11 12:34:00 +05:30
Raja Subramanian
9b34314a3d Make ResourceURLNotifier configurable. (#1004)
* Make ResourceURLNotifier configurable.

Also change default max age to 10s.

* generated protobuf

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2025-03-11 11:08:00 +05:30
Raja Subramanian
e586a23f4e Support filtering webhook events. (#1001)
* Support filtering webhook events.

* test

* set filter
2025-03-07 23:45:33 +05:30
Raja Subramanian
4102568c88 Per resource webhook queue. (#1000)
* Per resource webhook queue.

With a worker based approach, an event on a resource (like a room) not
being handled could affect other resources (other rooms or ingress or
egress).

To prevent that, do a per resource queue with two kinds of limits
- age of event: when queuing, if the event at the front of the queue
  exceeds a certain limit (default: 5 seconds), the event is dropped
- depth of queue: drop event if the number of queued events exceeds some
  level (default: 200)

To reap the per resource queue, specific end events are tracked and the
resource is added to the reap queue and reaped after a configurable
timeout (default: 5 min). This is to ensure that events happening just
after end event (for example: participant_left happening after
room_finished) are handled without re-creating a new resource.

Also, deprecating `num_dropped` from proto.

Some other bits of notes/challenges:
- Keeping the old URL notifier also. Also, the default notifier is that.
  Can change to the new one before merging this PR if this approach
  looks good.
- Using string compares of event name to detect end. Not great.
- Needs a sweeper to reap the resource queue. I think 5 min default
  timeout to reap should be okay, but maybe there are things that can
  cause re-creation of a resource queue after reaping and those could
  leak? Needs more analysis.
- Storing `context.Context` in resource queue so that it can be used
  during posting to webhook from resource queue go routine. Storing that
  is not great, but we need it for analytics key.

* generated protobuf

* missed files

* generated protobuf

* fix test in data race

* generate

* generated protobuf

* paul feedback

* fixes

* race

* more Paul feedback

* make resource notifier the default

* generated protobuf

* stop

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2025-03-07 22:39:59 +05:30
Raja Subramanian
9b6e5d703f Webhook analytics event. (#979)
* Webhook analytics event.

NOTE: Need a frostbyte73/core PR to merge and tag a release
PR pending: https://github.com/frostbyte73/core/pull/5

* sync submit

* generated protobuf

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-13 10:21:17 +05:30
David Zhao
f8005ea21c Use multiple workers for webhooks, while still ensuring order within a session (#784)
* Use multiple workers for webhooks, while still ensuring order within a session

* changeset
2024-08-08 13:45:44 -07:00
Raja Subramanian
9e23fdbd08 Revert "Update to go/jose/v4 (#756)" (#759)
This reverts commit 73ece66d30.
2024-07-12 13:28:45 +05:30
David Zhao
73ece66d30 Update to go/jose/v4 (#756)
* Update to go/jose/v4

* changeset

* remove unused import

* use longer key for test
2024-07-10 10:12:29 -07:00
David Zhao
c9e9ae555f Add license headers & NOTICE (#429)
* Add license headers & NOTICE

* generated protobuf

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-27 16:43:25 -07:00
Raja Subramanian
c5dc103838 Add sample rate and drift to RTP stats (#378)
* Add sample rate and drift to RTP stats

* make tests a bit more robust

* generated protobuf

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-13 14:38:13 +05:30
David Colburn
cadccd5410 update notifier (#374)
* update notifier

* update drop test

* fix draining

* change webhookCheckInterval back
2023-05-09 17:21:13 -07:00
David Zhao
f54aaadb8c Revamped notifier to avoid out of order delivery (#350)
Moving to a structure where each URL occupies their own delivery goroutine.
This avoids blocking of notifications to other URLs.
2023-04-15 01:04:56 -07:00
David Zhao
54544c489c Helper method to receive WebhookEvent (#109) 2022-03-30 16:14:23 -07:00
David Colburn
4dede7984e Add recording_started webhook, add ctx to notifier (#39)
* add recording_started webhook, add ctx to notifier

* update test
2021-11-08 18:00:12 -06:00
David Zhao
992c4b2da9 webhook support 2021-08-08 22:17:46 -07:00