From 1eed224fdb7d96e8c5a979cde6e4f00dc7347c6c Mon Sep 17 00:00:00 2001 From: Peter Kieltyka Date: Sat, 30 Mar 2024 12:27:06 -0400 Subject: [PATCH] pass subscribe labels --- ethgas/ethgas.go | 4 ++-- ethreceipts/ethreceipts.go | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ethgas/ethgas.go b/ethgas/ethgas.go index b25ac9e5..ab3a1193 100644 --- a/ethgas/ethgas.go +++ b/ethgas/ethgas.go @@ -125,11 +125,11 @@ func (g *GasGauge) SuggestedPaidGasPrice() SuggestedGasPrice { } func (g *GasGauge) Subscribe() ethmonitor.Subscription { - return g.monitor.Subscribe() + return g.monitor.Subscribe("ethgas") } func (g *GasGauge) run() error { - sub := g.monitor.Subscribe() + sub := g.monitor.Subscribe("ethgas:run") defer sub.Unsubscribe() bidEMA := newEMAs(0.5) diff --git a/ethreceipts/ethreceipts.go b/ethreceipts/ethreceipts.go index c8f19cae..e0d740a5 100644 --- a/ethreceipts/ethreceipts.go +++ b/ethreceipts/ethreceipts.go @@ -197,6 +197,7 @@ func (l *ReceiptsListener) Subscribe(filterQueries ...FilterQuery) Subscription ch: channel.NewUnboundedChan[Receipt](2, 5000, channel.Options{ Logger: l.log, Alerter: l.alert, + Label: "ethreceipts:subscriber", }), done: make(chan struct{}), finalizer: &finalizer{ @@ -458,7 +459,7 @@ func (l *ReceiptsListener) fetchTransactionReceipt(ctx context.Context, txnHash } func (l *ReceiptsListener) listener() error { - monitor := l.monitor.Subscribe() + monitor := l.monitor.Subscribe("ethreceipts") defer monitor.Unsubscribe() latestBlockNum := l.latestBlockNum().Uint64()