diff --git a/utils/metrics/metrics_util.go b/utils/metrics/metrics_util.go index 499534e768..780238d013 100644 --- a/utils/metrics/metrics_util.go +++ b/utils/metrics/metrics_util.go @@ -149,3 +149,15 @@ func SetThroughputMetric(metricName string, value float32) { "sei", "throughput", metricName, ) } + +// Measures number of times a denom's price is updated +// Metric Name: +// +// sei_oracle_price_update_count +func IncrPriceUpdateDenom(denom string) { + telemetry.IncrCounterWithLabels( + []string{"sei", "oracle", "price", "update"}, + 1, + []metrics.Label{telemetry.NewLabel("denom", denom)}, + ) +} diff --git a/x/oracle/abci.go b/x/oracle/abci.go index 07a285b865..c62a9df493 100755 --- a/x/oracle/abci.go +++ b/x/oracle/abci.go @@ -4,6 +4,7 @@ import ( "sort" "time" + "github.com/sei-protocol/sei-chain/utils/metrics" "github.com/sei-protocol/sei-chain/x/oracle/keeper" "github.com/sei-protocol/sei-chain/x/oracle/types" "github.com/sei-protocol/sei-chain/x/oracle/utils" @@ -90,6 +91,7 @@ func MidBlocker(ctx sdk.Context, k keeper.Keeper) { } // Set the exchange rate, emit ABCI event + metrics.IncrPriceUpdateDenom(denom) k.SetBaseExchangeRateWithEvent(ctx, denom, exchangeRate) } }