-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
feat: emit more data in prom metrics #15657
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thank you!
(Edit: I'll try it out with simd in a bit)
telemetry/metrics.go
Outdated
} | ||
|
||
type plan struct { | ||
Name string `json:"name,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we only use the height, we do not need to parse the rest.
Do we want this information as global label actually @tac0turtle? |
hmm we shouldnt have it as a global but instead have a single metric |
6eb1f32
to
8a5bf4f
Compare
server/start.go
Outdated
uk := upgradekeeper.NewKeeper(nil, nil, nil, homePath, nil, "") | ||
if upgradeInfo, err := uk.ReadUpgradeInfoFromDisk(); err == nil { | ||
ls = append(ls, telemetry.NewLabel("update_height", strconv.FormatInt(upgradeInfo.Height, 10))) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can go in the upgrade module. helps avoid the upgrade dep in server
8a5bf4f
to
1daaeaa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: I have tried to check the upgrade height, have you @dhanusaputra?
x/upgrade/module.go
Outdated
@@ -223,6 +226,10 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { | |||
m := NewAppModule(k, in.AddressCodec) | |||
gh := govv1beta1.HandlerRoute{RouteKey: types.RouterKey, Handler: NewSoftwareUpgradeProposalHandler(k)} | |||
|
|||
if upgradePlan, err := k.ReadUpgradeInfoFromDisk(); err == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not tried if it works, but if it does it will only work for app wiring app (app_v2). Could you add this additionally to the app.go?
x/upgrade/module.go
Outdated
@@ -223,6 +226,10 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { | |||
m := NewAppModule(k, in.AddressCodec) | |||
gh := govv1beta1.HandlerRoute{RouteKey: types.RouterKey, Handler: NewSoftwareUpgradeProposalHandler(k)} | |||
|
|||
if upgradePlan, err := k.ReadUpgradeInfoFromDisk(); err == nil { | |||
telemetry.SetGaugeWithLabels([]string{"server", "info"}, 1, []metrics.Label{telemetry.NewLabel("upgrade_height", strconv.FormatInt(upgradePlan.Height, 10))}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
telemetry.SetGaugeWithLabels([]string{"server", "info"}, 1, []metrics.Label{telemetry.NewLabel("upgrade_height", strconv.FormatInt(upgradePlan.Height, 10))}) | |
if upgradePlan.Height > 0 { | |
telemetry.SetGaugeWithLabels([]string{"server", "info"}, 1, []metrics.Label{telemetry.NewLabel("upgrade_height", strconv.FormatInt(upgradePlan.Height, 10))}) | |
} |
Prob need this because the app is instantiated the first time with a temporary directory, for getting the application encoding (
cosmos-sdk/simapp/simd/cmd/root.go
Line 47 in c1ea84d
tempApp := simapp.NewSimApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, simtestutil.NewAppOptionsWithFlagHome(tempDir())) |
not yet, will try run the simapp with better PC soon |
9c5f858
to
97cca91
Compare
x/upgrade/module.go
Outdated
@@ -223,6 +226,10 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { | |||
m := NewAppModule(k, in.AddressCodec) | |||
gh := govv1beta1.HandlerRoute{RouteKey: types.RouterKey, Handler: NewSoftwareUpgradeProposalHandler(k)} | |||
|
|||
if upgradePlan, err := k.ReadUpgradeInfoFromDisk(); err == nil && upgradePlan.Height > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will only set it on startup, we should set it where its called the plan is set. also this assumes the application is using depinject which isnt the case yet.
cosmos-sdk/x/upgrade/keeper/keeper.go
Line 194 in 92738c0
func (k Keeper) ScheduleUpgrade(ctx sdk.Context, plan types.Plan) error { |
no luck testing the upgrade height |
This reverts commit 899aa26.
4f2dfcf
to
603e96c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
Description
Closes: #15593
Workscope
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change