add ExposeLag option, to be able to disable lag exporting
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
@@ -15,7 +15,7 @@ var (
|
||||
DefaultCommitInterval = 5 * time.Second
|
||||
|
||||
// DefaultStatsInterval specifies how fast check consumer lag
|
||||
DefaultStatsInterval = 5 * time.Second
|
||||
DefaultStatsInterval = 30 * time.Second
|
||||
|
||||
// DefaultSubscribeMaxInflight specifies how much messages keep inflight
|
||||
DefaultSubscribeMaxInflight = 100
|
||||
@@ -120,3 +120,10 @@ func PublishPromise(fn func(*kgo.Record, error)) broker.PublishOption {
|
||||
func ClientPublishPromise(fn func(*kgo.Record, error)) client.PublishOption {
|
||||
return client.SetPublishOption(publishPromiseKey{}, fn)
|
||||
}
|
||||
|
||||
type exposeLagKey struct{}
|
||||
|
||||
// ExposeLag enabled subscriber lag via [meter.Meter]
|
||||
func ExposeLag(b bool) broker.Option {
|
||||
return broker.SetOption(exposeLagKey{}, b)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user