Skip to content

Commit

Permalink
try things (in the arena) [goreleaser]
Browse files Browse the repository at this point in the history
  • Loading branch information
trajan0x committed Jun 29, 2024
1 parent 5a49e7b commit dfabfe7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ethergo/submitter/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package submitter
import (
"context"
"fmt"
"github.com/brianvoe/gofakeit/v6"
"github.com/cornelk/hashmap"
"github.com/synapsecns/sanguine/core/metrics"
"github.com/synapsecns/sanguine/ethergo/signer/signer"
Expand All @@ -13,7 +14,7 @@ import (
"time"
)

const meterName = "github.com/synapsecns/sanguine/ethergo/submitter"
const meterName = "ethergo/submitter"

// generate an interface for otelRecorder that exports the public method.
// this allows us to avoid using recordX externally anad makes the package less confusing.
Expand Down Expand Up @@ -63,6 +64,16 @@ func newOtelRecorder(meterHandler metrics.Handler, signerT signer.Signer) (_ iOt
signer: signerT,
}

r, err := or.meter.Int64ObservableGauge("IMARANDOMNUMBER")
if err != nil {
return nil, fmt.Errorf("could not create num pending txes gauge: %w", err)
}

or.meter.RegisterCallback(func(ctx context.Context, observer metric.Observer) error {

Check failure on line 72 in ethergo/submitter/metrics.go

View workflow job for this annotation

GitHub Actions / Lint (ethergo)

Error return value of `or.meter.RegisterCallback` is not checked (errcheck)
observer.ObserveInt64(r, gofakeit.Int64())
return nil
}, r)

or.numPendingGauge, err = or.meter.Int64ObservableGauge("num_pending_txes")
if err != nil {
return nil, fmt.Errorf("could not create num pending txes gauge: %w", err)
Expand Down

0 comments on commit dfabfe7

Please sign in to comment.