-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A more configurable URLNotifier #726
base: main
Are you sure you want to change the base?
Conversation
|
webhook/notifier.go
Outdated
}) | ||
n.urlNotifiers = append(n.urlNotifiers, u) | ||
} | ||
return n | ||
} | ||
|
||
func NewDefaultNotifierByParams(params []URLNotifierParams) QueuedNotifier { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the intent of creating different notifiers underneath?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For more control. With this we can have different configuration per webhook. But the real reason was to avoid long constructors. It was simpler just to pass in a list of URLNotifierParams
.
@@ -49,7 +49,9 @@ message WebhookEvent { | |||
// timestamp in seconds | |||
int64 created_at = 7; | |||
|
|||
int64 dequeued_at = 12; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this field needed? what is it intended to communicate to to the end user?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is useful for identifying issues in webhook logic. I have high latency spikes for webhook events, but I don't know how much it took Livekit from when the event was queued until it's been sent.
APISecret string | ||
Logger logger.Logger | ||
QueueSize int | ||
DropWhenFull bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be exposed at all? what is the behavior when it's set to false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If set to false, events will drop only due to network failures, and not the queue being full. Assume we want to make events more reliabale, i think we should be able to configure this parameter.
* Add a new constructor that accepts 'URLNotifierParams' directly * Add 'DropWhenFull' as parameter * Add 'DeqeuedAt' for better monitoring at hooked backends * Fixes tag name being off by 1 * Sets DequeuedAt
#3) * feat: allow for custom URLNotifier and add batched events protobuf definition * feat: Implement batch sender
* feat: Add include/exclude options * generated protobuf --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Makes URLNotifier more configurable