Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Remove unbound labels from added custom tendermint metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
v-homsi committed Nov 14, 2022
1 parent 4837b8b commit 705de71
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions x/evm/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ var _ types.MsgServer = &Keeper{}
// so that it can implements and call the StateDB methods without receiving it as a function
// parameter.
func (k *Keeper) EthereumTx(goCtx context.Context, msg *types.MsgEthereumTx) (*types.MsgEthereumTxResponse, error) {

println("IMMM HEREEEEEEEE")

ctx := sdk.UnwrapSDKContext(goCtx)

sender := msg.From
Expand All @@ -32,15 +35,11 @@ func (k *Keeper) EthereumTx(goCtx context.Context, msg *types.MsgEthereumTx) (*t

labels := []metrics.Label{
telemetry.NewLabel("tx_type", fmt.Sprintf("%d", tx.Type())),
telemetry.NewLabel("from", sender),
}
if tx.To() == nil {
labels = []metrics.Label{telemetry.NewLabel("execution", "create")}
labels = append(labels, telemetry.NewLabel("execution", "create"))
} else {
labels = []metrics.Label{
telemetry.NewLabel("execution", "call"),
telemetry.NewLabel("to", tx.To().Hex()), // recipient address (contract or account)
}
labels = append(labels, telemetry.NewLabel("execution", "call"))
}

response, err := k.ApplyTransaction(ctx, tx)
Expand All @@ -49,6 +48,8 @@ func (k *Keeper) EthereumTx(goCtx context.Context, msg *types.MsgEthereumTx) (*t
}

defer func() {
println("IMMM HEREEEEEEEE2222")

telemetry.IncrCounterWithLabels(
[]string{"tx", "msg", "ethereum_tx", "total"},
1,
Expand Down

0 comments on commit 705de71

Please sign in to comment.