Skip to content

Commit

Permalink
add domain, err handling, default config
Browse files Browse the repository at this point in the history
  • Loading branch information
eduard-cl committed Dec 19, 2024
1 parent 88af258 commit 6bcf225
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions core/chains/evm/txm/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ func (m *txmMetrics) EmitTxMessage(ctx context.Context, tx common.Hash, fromAddr
err = beholder.GetEmitter().Emit(
ctx,
messageBytes,
"beholder_domain", "beholder_test",
"beholder_domain", "svr",
"beholder_entity", "TxMessage",
"beholder_data_schema", "transaction_schema",
"beholder_data_schema", "/beholder-tx-message/versions/1",
)

return err
Expand Down
6 changes: 5 additions & 1 deletion core/chains/evm/txm/txm.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,11 @@ func (t *Txm) sendTransactionWithError(ctx context.Context, tx *types.Transactio
}

t.metrics.IncrementNumBroadcastedTxs(ctx)
t.metrics.EmitTxMessage(ctx, attempt.Hash, address, tx.ToAddress, *tx.Nonce)
err = t.metrics.EmitTxMessage(ctx, attempt.Hash, address, tx.ToAddress, *tx.Nonce)
if err != nil {
t.lggr.Errorw("Beholder error emitting tx message", "err", err)
}

return t.txStore.UpdateTransactionBroadcast(ctx, attempt.TxID, *tx.Nonce, attempt.Hash, address)
}

Expand Down
6 changes: 2 additions & 4 deletions core/cmd/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ func initGlobals(cfgProm config.Prometheus, cfgTracing config.Tracing, cfgTeleme
attributes = append(attributes, attribute.String(k, v))
}

clientCfg := beholder.TestDefaultConfig()

/*clientCfg := beholder.Config{
clientCfg := beholder.Config{
InsecureConnection: cfgTelemetry.InsecureConnection(),
CACertFile: cfgTelemetry.CACertFile(),
OtelExporterGRPCEndpoint: cfgTelemetry.OtelExporterGRPCEndpoint(),
Expand All @@ -113,7 +111,7 @@ func initGlobals(cfgProm config.Prometheus, cfgTracing config.Tracing, cfgTeleme
EmitterExportTimeout: cfgTelemetry.EmitterExportTimeout(),
AuthPublicKeyHex: csaPubKeyHex,
AuthHeaders: beholderAuthHeaders,
}*/
}

// note: due to the OTEL specification, all histogram buckets
// must be defined when the beholder client is created
Expand Down

0 comments on commit 6bcf225

Please sign in to comment.