Skip to content

Commit

Permalink
fix: unbound metrics and remove labels that keep increasing (#1094)
Browse files Browse the repository at this point in the history
* Fix unbound metrics and remove labels that keep increasing

* Add entry to CHANGELOG

* Update docs

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
  • Loading branch information
v-homsi and fedekunze committed Nov 22, 2022
1 parent 694a8cd commit a10d3f6
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 41 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ Ref: https://keepachangelog.com/en/1.0.0/
- (vesting) [\#1087](https://github.com/evmos/evmos/pull/1087) Add new `MsgUpdateVestingFunder` that updates the `Funder` field of a given clawback vesting account
- (docs) [\#1090](https://github.com/evmos/evmos/pull/1090) Add audits page to documentation.

### Bug Fixes

* (analytics) [#1094](https://github.com/evmos/evmos/pull/1094) Fix unbound metrics and remove labels that keep increasing.


## [v9.1.0] - 2022-10-25

Expand Down
2 changes: 0 additions & 2 deletions docs/protocol/telemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ To understand how to use the metrics below, please refer to the [Cosmos SDK tele
| :--------------------------------------------- | :---------------------------------------------------------------------------------- | :---------- | :------ |
| `feemarket_base_fee` | Amount of base fee per EIP-1559 block | token | gauge |
| `feemarket_block_gas` | Amount of gas used in an EIP-1559 block | token | gauge |
| `feesplit_distribute_total` | Amount of fees distributed to registered smart contracts | token | counter |
| `recovery_ibc_on_recv_total` | Total number of recoveries using the ibc `onRecvPacket` callback | recovery | counter |
| `recovery_ibc_on_recv_token_total` | Total amount of tokens recovered using the ibc `onRecvPacket` callback | token | counter |
| `tx_msg_convert_coin_amount_total` | Total amount of converted coins using a `ConvertCoin` msg | token | counter |
Expand All @@ -26,7 +25,6 @@ To understand how to use the metrics below, please refer to the [Cosmos SDK tele
| `tx_msg_ethereum_tx_gas_limit_per_gas_used` | Ratio of gas limit to gas used for a etheruem tx | ratio | gauge |
| `tx_msg_ethereum_tx_incentives_total` | Total number of txs with an incentivized contract processed via the EVM | tx | counter |
| `tx_msg_ethereum_tx_incentives_gas_used_total` | Total amount of gas used by txs with an incentivized contract processed via the EVM | token | counter |
| `incentives_distribute_participant_total` | Total number of participants who received rewards | participant | counter |
| `incentives_distribute_reward_total` | Total amount of rewards that are distributed to all incentives' participants | token | counter |
| `inflation_allocate_total` | Total amount of tokens allocated through inflation | token | counter |
| `inflation_allocate_staking_total` | Total amount of tokens allocated through inflation to staking | token | counter |
Expand Down
8 changes: 0 additions & 8 deletions x/erc20/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ func (k Keeper) convertCoinNativeCoin(
1,
[]metrics.Label{
telemetry.NewLabel("denom", pair.Denom),
telemetry.NewLabel("erc20", pair.Erc20Address),
},
)

Expand All @@ -165,7 +164,6 @@ func (k Keeper) convertCoinNativeCoin(
float32(msg.Coin.Amount.Int64()),
[]metrics.Label{
telemetry.NewLabel("denom", pair.Denom),
telemetry.NewLabel("erc20", pair.Erc20Address),
},
)
}
Expand Down Expand Up @@ -255,7 +253,6 @@ func (k Keeper) convertERC20NativeCoin(
1,
[]metrics.Label{
telemetry.NewLabel("denom", pair.Denom),
telemetry.NewLabel("erc20", pair.Erc20Address),
},
)

Expand All @@ -265,7 +262,6 @@ func (k Keeper) convertERC20NativeCoin(
float32(msg.Amount.Int64()),
[]metrics.Label{
telemetry.NewLabel("denom", pair.Denom),
telemetry.NewLabel("erc20", pair.Erc20Address),
},
)
}
Expand Down Expand Up @@ -383,7 +379,6 @@ func (k Keeper) convertERC20NativeToken(
1,
[]metrics.Label{
telemetry.NewLabel("coin", pair.Denom),
telemetry.NewLabel("erc20", pair.Erc20Address),
},
)

Expand All @@ -393,7 +388,6 @@ func (k Keeper) convertERC20NativeToken(
float32(msg.Amount.Int64()),
[]metrics.Label{
telemetry.NewLabel("denom", pair.Denom),
telemetry.NewLabel("erc20", pair.Erc20Address),
},
)
}
Expand Down Expand Up @@ -493,7 +487,6 @@ func (k Keeper) convertCoinNativeERC20(
1,
[]metrics.Label{
telemetry.NewLabel("denom", pair.Denom),
telemetry.NewLabel("erc20", pair.Erc20Address),
},
)

Expand All @@ -503,7 +496,6 @@ func (k Keeper) convertCoinNativeERC20(
float32(msg.Coin.Amount.Int64()),
[]metrics.Label{
telemetry.NewLabel("denom", pair.Denom),
telemetry.NewLabel("erc20", pair.Erc20Address),
},
)
}
Expand Down
14 changes: 1 addition & 13 deletions x/incentives/keeper/distribution.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (k Keeper) DistributeRewards(ctx sdk.Context) error {
}

k.IterateIncentives(ctx, func(incentive types.Incentive) (stop bool) {
rewards, participants := k.rewardParticipants(ctx, incentive, rewardAllocations)
_, _ = k.rewardParticipants(ctx, incentive, rewardAllocations)

incentive.Epochs--

Expand All @@ -48,18 +48,6 @@ func (k Keeper) DistributeRewards(ctx sdk.Context) error {
)
}

defer func() {
if !rewards.IsZero() {
telemetry.IncrCounterWithLabels(
[]string{types.ModuleName, "distribute", "participant", "total"},
float32(participants),
[]metrics.Label{
telemetry.NewLabel("contract", incentive.Contract),
},
)
}
}()

ctx.EventManager().EmitEvent(
sdk.NewEvent(
types.EventTypeDistributeIncentives,
Expand Down
2 changes: 0 additions & 2 deletions x/recovery/keeper/ibc_callbacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,6 @@ func (k Keeper) OnRecvPacket(
float32(b.Amount.Int64()),
[]metrics.Label{
telemetry.NewLabel("denom", b.Denom),
telemetry.NewLabel("source_channel", packet.SourceChannel),
telemetry.NewLabel("source_port", packet.SourcePort),
},
)
}
Expand Down
16 changes: 0 additions & 16 deletions x/revenue/keeper/evm_hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package keeper

import (
errorsmod "cosmossdk.io/errors"
"github.com/armon/go-metrics"
"github.com/cosmos/cosmos-sdk/telemetry"
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/ethereum/go-ethereum/core"
Expand Down Expand Up @@ -83,20 +81,6 @@ func (k Keeper) PostTxProcessing(
)
}

defer func() {
if developerFee.IsInt64() {
telemetry.IncrCounterWithLabels(
[]string{types.ModuleName, "distribute", "total"},
float32(developerFee.Int64()),
[]metrics.Label{
telemetry.NewLabel("sender", msg.From().String()),
telemetry.NewLabel("withdraw_address", withdrawer.String()),
telemetry.NewLabel("contract", revenue.ContractAddress),
},
)
}
}()

ctx.EventManager().EmitEvents(
sdk.Events{
sdk.NewEvent(
Expand Down

0 comments on commit a10d3f6

Please sign in to comment.