refactor(x/gov): remove gov vote and proposal based telemetry (backport #17910) (#17915)

Co-authored-by: Marko <marbar3778@yahoo.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
mergify[bot] 2023-09-27 19:37:56 +00:00 committed by GitHub
parent 13bd2264e3
commit 71c9b7675f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 30 deletions

View File

@ -42,6 +42,10 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/gov) [#17873](https://github.com/cosmos/cosmos-sdk/pull/17873) Fail any inactive and active proposals that cannot be decoded.
### Client Breaking Changes
* (x/gov) [#17910](https://github.com/cosmos/cosmos-sdk/pull/17910) Remove telemetry for counting votes and proposals. It was incorrectly counting votes. Use alternatives, such as state streaming.
## [v0.50.0-rc.1](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.0-rc.1) - 2023-09-25
### Features

View File

@ -4,14 +4,10 @@ import (
"context"
"encoding/json"
"fmt"
"strconv"
"github.com/hashicorp/go-metrics"
"cosmossdk.io/errors"
"cosmossdk.io/math"
"github.com/cosmos/cosmos-sdk/telemetry"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
@ -99,8 +95,6 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1.MsgSubmitPropos
"submit proposal",
)
defer telemetry.IncrCounter(1, govtypes.ModuleName, "proposal")
votingStarted, err := k.Keeper.AddDeposit(ctx, proposal.Id, proposer, msg.GetInitialDeposit())
if err != nil {
return nil, err
@ -190,14 +184,6 @@ func (k msgServer) Vote(goCtx context.Context, msg *v1.MsgVote) (*v1.MsgVoteResp
return nil, err
}
defer telemetry.IncrCounterWithLabels(
[]string{govtypes.ModuleName, "vote"},
1,
[]metrics.Label{
telemetry.NewLabel("proposal_id", strconv.FormatUint(msg.ProposalId, 10)),
},
)
return &v1.MsgVoteResponse{}, nil
}
@ -243,14 +229,6 @@ func (k msgServer) VoteWeighted(goCtx context.Context, msg *v1.MsgVoteWeighted)
return nil, err
}
defer telemetry.IncrCounterWithLabels(
[]string{govtypes.ModuleName, "vote"},
1,
[]metrics.Label{
telemetry.NewLabel("proposal_id", strconv.FormatUint(msg.ProposalId, 10)),
},
)
return &v1.MsgVoteWeightedResponse{}, nil
}
@ -271,14 +249,6 @@ func (k msgServer) Deposit(goCtx context.Context, msg *v1.MsgDeposit) (*v1.MsgDe
return nil, err
}
defer telemetry.IncrCounterWithLabels(
[]string{govtypes.ModuleName, "deposit"},
1,
[]metrics.Label{
telemetry.NewLabel("proposal_id", strconv.FormatUint(msg.ProposalId, 10)),
},
)
if votingStarted {
ctx.EventManager().EmitEvent(
sdk.NewEvent(