-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: telemetry in msg handlers runs multiple times leading to unexpected metric values #21614
Comments
I am not sure how best we can fix it. |
In general it's the telemetry system's job to report what is happening, so if the same code path is being executed multiple times during execution telemetry should log it. Maybe a discriminator label can be attached for execution mode? In particular though, this metric name seems off, it's incorrect to assume a new account is created every time coins are sent to it and it doesn't already exist (if I read that right). cosmos-sdk/x/bank/keeper/send.go Line 231 in 8bfcf55
|
I somewhat agree with @kocubinski above. Still not convinced about adding a round-trip to the tx service, however. |
Apologies for the late reply! Thanks for your consideration 🙏 |
Is there an existing issue for this?
What happened?
Message logic is executed at least twice, once in
checkTx
and once during block finalization. Telemetry logic does not distinguish between these two modes and runs regardless, meaning that counters are incremented at least twice.One example of this is the
new_account
counter which is incremented when we send tokens to a new account. The result is that this counter actually increments by 2 with each new account.I suppose it could increment even more times if we run in other modes, such as to simulate a transaction, but I haven't experimented with this.
Cosmos SDK Version
0.50.9
How to reproduce?
new_account
metric at:1317/metrics?format=prometheus
The text was updated successfully, but these errors were encountered: