Skip to content
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

Continously emit version metrics #638

Merged
merged 2 commits into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ type App struct {

// batchVerifier *ante.SR25519BatchVerifier
txDecoder sdk.TxDecoder

versionInfo version.Info
}

// New returns a reference to an initialized blockchain app
Expand Down Expand Up @@ -399,7 +401,8 @@ func New(
Tracer: &tr,
TracerContext: context.Background(),
},
txDecoder: encodingConfig.TxConfig.TxDecoder(),
txDecoder: encodingConfig.TxConfig.TxDecoder(),
versionInfo: version.NewInfo(),
}

app.ParamsKeeper = initParamsKeeper(appCodec, cdc, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey])
Expand Down Expand Up @@ -895,15 +898,7 @@ func (app App) GetBaseApp() *baseapp.BaseApp { return app.BaseApp }

// BeginBlocker application updates every begin block
func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock {
// newCtx := ctx.WithContext(
// context.WithValue(ctx.Context(), dexcache.GOCTX_KEY, dexcache.NewOrders()),
// )
// app.Logger().Info(fmt.Sprintf("BeginBlocker context %s", newCtx.Context().Value(dexcache.GOCTX_KEY).(dexcache.Orders)))
if !EmittedSeidVersionMetric {
verInfo := version.NewInfo()
metrics.GaugeSeidVersionAndCommit(verInfo.Version, verInfo.GitCommit)
EmittedSeidVersionMetric = true
}
metrics.GaugeSeidVersionAndCommit(app.versionInfo.Version, app.versionInfo.GitCommit)
return app.mm.BeginBlock(ctx, req)
}

Expand Down
2 changes: 1 addition & 1 deletion x/oracle/keeper/test_utils.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// nolint
//nolint
package keeper

import (
Expand Down
4 changes: 2 additions & 2 deletions x/oracle/simulation/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func WeightedOperations(
}

// SimulateMsgAggregateExchangeRateVote generates a MsgAggregateExchangeRateVote with random values.
// nolint: funlen
//nolint: funlen
func SimulateMsgAggregateExchangeRateVote(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper) simtypes.Operation {
return func(
r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string,
Expand Down Expand Up @@ -122,7 +122,7 @@ func SimulateMsgAggregateExchangeRateVote(ak types.AccountKeeper, bk types.BankK
}

// SimulateMsgDelegateFeedConsent generates a MsgDelegateFeedConsent with random values.
// nolint: funlen
//nolint: funlen
func SimulateMsgDelegateFeedConsent(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper) simtypes.Operation {
return func(
r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string,
Expand Down