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

Enable metrics if monitoring endpoint is configured #5328

Merged
merged 1 commit into from
Mar 31, 2023

Conversation

nflaig
Copy link
Member

@nflaig nflaig commented Mar 31, 2023

Motivation

Improve monitoring UX by not requiring users to also supply --metrics flag. If users only want to use monitoring via remote service and do not have a local prometheus/grafana stack it is not required to start the metrics server.

Description

Monitoring relies on metrics data to work properly and as of now would throw an error if --metrics flag is not supplied. This change implicitly enables metrics if a monitoring endpoint is configured.

Note: metrics server will only be started if metrics are explicitly enabled

@github-actions
Copy link
Contributor

github-actions bot commented Mar 31, 2023

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: a201f5d Previous: a2f749a Ratio
getPubkeys - index2pubkey - req 1000 vs - 250000 vc 602.73 us/op 609.89 us/op 0.99
getPubkeys - validatorsArr - req 1000 vs - 250000 vc 62.653 us/op 65.791 us/op 0.95
BLS verify - blst-native 1.2676 ms/op 1.2657 ms/op 1.00
BLS verifyMultipleSignatures 3 - blst-native 2.6518 ms/op 2.5796 ms/op 1.03
BLS verifyMultipleSignatures 8 - blst-native 5.6562 ms/op 5.4753 ms/op 1.03
BLS verifyMultipleSignatures 32 - blst-native 21.322 ms/op 19.904 ms/op 1.07
BLS aggregatePubkeys 32 - blst-native 28.902 us/op 26.770 us/op 1.08
BLS aggregatePubkeys 128 - blst-native 111.88 us/op 103.07 us/op 1.09
getAttestationsForBlock 68.174 ms/op 73.916 ms/op 0.92
isKnown best case - 1 super set check 269.00 ns/op 261.00 ns/op 1.03
isKnown normal case - 2 super set checks 271.00 ns/op 258.00 ns/op 1.05
isKnown worse case - 16 super set checks 264.00 ns/op 259.00 ns/op 1.02
CheckpointStateCache - add get delete 6.0660 us/op 6.1950 us/op 0.98
validate gossip signedAggregateAndProof - struct 2.9826 ms/op 2.8896 ms/op 1.03
validate gossip attestation - struct 1.4336 ms/op 1.3586 ms/op 1.06
pickEth1Vote - no votes 1.4661 ms/op 1.4176 ms/op 1.03
pickEth1Vote - max votes 13.141 ms/op 12.095 ms/op 1.09
pickEth1Vote - Eth1Data hashTreeRoot value x2048 10.445 ms/op 9.8655 ms/op 1.06
pickEth1Vote - Eth1Data hashTreeRoot tree x2048 18.381 ms/op 16.996 ms/op 1.08
pickEth1Vote - Eth1Data fastSerialize value x2048 825.45 us/op 782.02 us/op 1.06
pickEth1Vote - Eth1Data fastSerialize tree x2048 9.1833 ms/op 6.3958 ms/op 1.44
bytes32 toHexString 731.00 ns/op 833.00 ns/op 0.88
bytes32 Buffer.toString(hex) 450.00 ns/op 480.00 ns/op 0.94
bytes32 Buffer.toString(hex) from Uint8Array 641.00 ns/op 664.00 ns/op 0.97
bytes32 Buffer.toString(hex) + 0x 445.00 ns/op 466.00 ns/op 0.95
Object access 1 prop 0.21000 ns/op 0.21000 ns/op 1.00
Map access 1 prop 0.16900 ns/op 0.16500 ns/op 1.02
Object get x1000 7.0560 ns/op 6.8440 ns/op 1.03
Map get x1000 0.62100 ns/op 0.59700 ns/op 1.04
Object set x1000 72.924 ns/op 75.987 ns/op 0.96
Map set x1000 54.689 ns/op 63.267 ns/op 0.86
Return object 10000 times 0.24730 ns/op 0.25040 ns/op 0.99
Throw Error 10000 times 4.4648 us/op 4.6240 us/op 0.97
fastMsgIdFn sha256 / 200 bytes 3.7510 us/op 3.9390 us/op 0.95
fastMsgIdFn h32 xxhash / 200 bytes 324.00 ns/op 328.00 ns/op 0.99
fastMsgIdFn h64 xxhash / 200 bytes 487.00 ns/op 483.00 ns/op 1.01
fastMsgIdFn sha256 / 1000 bytes 12.341 us/op 12.215 us/op 1.01
fastMsgIdFn h32 xxhash / 1000 bytes 457.00 ns/op 480.00 ns/op 0.95
fastMsgIdFn h64 xxhash / 1000 bytes 574.00 ns/op 606.00 ns/op 0.95
fastMsgIdFn sha256 / 10000 bytes 109.60 us/op 109.08 us/op 1.00
fastMsgIdFn h32 xxhash / 10000 bytes 2.0730 us/op 2.0790 us/op 1.00
fastMsgIdFn h64 xxhash / 10000 bytes 1.4610 us/op 1.5190 us/op 0.96
enrSubnets - fastDeserialize 64 bits 1.7810 us/op 2.0280 us/op 0.88
enrSubnets - ssz BitVector 64 bits 645.00 ns/op 775.00 ns/op 0.83
enrSubnets - fastDeserialize 4 bits 209.00 ns/op 264.00 ns/op 0.79
enrSubnets - ssz BitVector 4 bits 639.00 ns/op 763.00 ns/op 0.84
prioritizePeers score -10:0 att 32-0.1 sync 2-0 124.19 us/op 141.26 us/op 0.88
prioritizePeers score 0:0 att 32-0.25 sync 2-0.25 168.38 us/op 191.52 us/op 0.88
prioritizePeers score 0:0 att 32-0.5 sync 2-0.5 207.46 us/op 233.10 us/op 0.89
prioritizePeers score 0:0 att 64-0.75 sync 4-0.75 389.60 us/op 423.98 us/op 0.92
prioritizePeers score 0:0 att 64-1 sync 4-1 465.00 us/op 504.96 us/op 0.92
array of 16000 items push then shift 1.7945 us/op 1.8613 us/op 0.96
LinkedList of 16000 items push then shift 9.5340 ns/op 13.814 ns/op 0.69
array of 16000 items push then pop 107.81 ns/op 152.91 ns/op 0.71
LinkedList of 16000 items push then pop 10.188 ns/op 11.435 ns/op 0.89
array of 24000 items push then shift 2.5602 us/op 2.5518 us/op 1.00
LinkedList of 24000 items push then shift 10.098 ns/op 12.802 ns/op 0.79
array of 24000 items push then pop 104.92 ns/op 113.57 ns/op 0.92
LinkedList of 24000 items push then pop 10.018 ns/op 10.586 ns/op 0.95
intersect bitArray bitLen 8 15.388 ns/op 15.818 ns/op 0.97
intersect array and set length 8 97.431 ns/op 124.41 ns/op 0.78
intersect bitArray bitLen 128 48.854 ns/op 46.547 ns/op 1.05
intersect array and set length 128 1.3171 us/op 1.7387 us/op 0.76
Buffer.concat 32 items 2.9140 us/op 3.3580 us/op 0.87
Uint8Array.set 32 items 2.7390 us/op 3.0810 us/op 0.89
pass gossip attestations to forkchoice per slot 3.9644 ms/op 4.8663 ms/op 0.81
computeDeltas 3.2412 ms/op 3.6621 ms/op 0.89
computeProposerBoostScoreFromBalances 1.9006 ms/op 2.1424 ms/op 0.89
altair processAttestation - 250000 vs - 7PWei normalcase 3.4061 ms/op 4.4690 ms/op 0.76
altair processAttestation - 250000 vs - 7PWei worstcase 4.3660 ms/op 5.7850 ms/op 0.75
altair processAttestation - setStatus - 1/6 committees join 151.19 us/op 165.03 us/op 0.92
altair processAttestation - setStatus - 1/3 committees join 295.43 us/op 323.21 us/op 0.91
altair processAttestation - setStatus - 1/2 committees join 395.15 us/op 420.23 us/op 0.94
altair processAttestation - setStatus - 2/3 committees join 544.67 us/op 517.16 us/op 1.05
altair processAttestation - setStatus - 4/5 committees join 694.60 us/op 712.07 us/op 0.98
altair processAttestation - setStatus - 100% committees join 835.63 us/op 828.44 us/op 1.01
altair processBlock - 250000 vs - 7PWei normalcase 19.643 ms/op 24.859 ms/op 0.79
altair processBlock - 250000 vs - 7PWei normalcase hashState 28.626 ms/op 33.971 ms/op 0.84
altair processBlock - 250000 vs - 7PWei worstcase 52.869 ms/op 55.430 ms/op 0.95
altair processBlock - 250000 vs - 7PWei worstcase hashState 76.368 ms/op 75.241 ms/op 1.01
phase0 processBlock - 250000 vs - 7PWei normalcase 2.2326 ms/op 2.9262 ms/op 0.76
phase0 processBlock - 250000 vs - 7PWei worstcase 30.925 ms/op 34.721 ms/op 0.89
altair processEth1Data - 250000 vs - 7PWei normalcase 471.62 us/op 610.72 us/op 0.77
vc - 250000 eb 1 eth1 1 we 0 wn 0 - smpl 15 8.1470 us/op 13.350 us/op 0.61
vc - 250000 eb 0.95 eth1 0.1 we 0.05 wn 0 - smpl 219 24.974 us/op 43.474 us/op 0.57
vc - 250000 eb 0.95 eth1 0.3 we 0.05 wn 0 - smpl 42 10.885 us/op 18.259 us/op 0.60
vc - 250000 eb 0.95 eth1 0.7 we 0.05 wn 0 - smpl 18 8.7100 us/op 14.518 us/op 0.60
vc - 250000 eb 0.1 eth1 0.1 we 0 wn 0 - smpl 1020 97.043 us/op 123.90 us/op 0.78
vc - 250000 eb 0.03 eth1 0.03 we 0 wn 0 - smpl 11777 673.23 us/op 783.90 us/op 0.86
vc - 250000 eb 0.01 eth1 0.01 we 0 wn 0 - smpl 16384 1.3339 ms/op 982.65 us/op 1.36
vc - 250000 eb 0 eth1 0 we 0 wn 0 - smpl 16384 915.61 us/op 988.89 us/op 0.93
vc - 250000 eb 0 eth1 0 we 0 wn 0 nocache - smpl 16384 2.5573 ms/op 3.6736 ms/op 0.70
vc - 250000 eb 0 eth1 1 we 0 wn 0 - smpl 16384 1.6949 ms/op 1.5325 ms/op 1.11
vc - 250000 eb 0 eth1 1 we 0 wn 0 nocache - smpl 16384 4.0034 ms/op 5.3874 ms/op 0.74
Tree 40 250000 create 356.50 ms/op 587.96 ms/op 0.61
Tree 40 250000 get(125000) 216.29 ns/op 206.34 ns/op 1.05
Tree 40 250000 set(125000) 1.0923 us/op 1.8263 us/op 0.60
Tree 40 250000 toArray() 20.965 ms/op 25.347 ms/op 0.83
Tree 40 250000 iterate all - toArray() + loop 25.617 ms/op 24.783 ms/op 1.03
Tree 40 250000 iterate all - get(i) 77.454 ms/op 79.325 ms/op 0.98
MutableVector 250000 create 11.401 ms/op 12.800 ms/op 0.89
MutableVector 250000 get(125000) 6.5800 ns/op 7.3560 ns/op 0.89
MutableVector 250000 set(125000) 266.33 ns/op 324.34 ns/op 0.82
MutableVector 250000 toArray() 2.8932 ms/op 3.9687 ms/op 0.73
MutableVector 250000 iterate all - toArray() + loop 3.5648 ms/op 4.3579 ms/op 0.82
MutableVector 250000 iterate all - get(i) 1.5407 ms/op 1.5921 ms/op 0.97
Array 250000 create 2.7783 ms/op 3.8155 ms/op 0.73
Array 250000 clone - spread 1.2556 ms/op 1.3070 ms/op 0.96
Array 250000 get(125000) 0.64500 ns/op 0.61100 ns/op 1.06
Array 250000 set(125000) 0.71700 ns/op 0.67300 ns/op 1.07
Array 250000 iterate all - loop 108.25 us/op 89.188 us/op 1.21
effectiveBalanceIncrements clone Uint8Array 300000 59.822 us/op 49.705 us/op 1.20
effectiveBalanceIncrements clone MutableVector 300000 301.00 ns/op 369.00 ns/op 0.82
effectiveBalanceIncrements rw all Uint8Array 300000 172.99 us/op 174.01 us/op 0.99
effectiveBalanceIncrements rw all MutableVector 300000 77.904 ms/op 90.233 ms/op 0.86
phase0 afterProcessEpoch - 250000 vs - 7PWei 115.15 ms/op 119.64 ms/op 0.96
phase0 beforeProcessEpoch - 250000 vs - 7PWei 34.407 ms/op 48.020 ms/op 0.72
altair processEpoch - mainnet_e81889 339.03 ms/op 319.88 ms/op 1.06
mainnet_e81889 - altair beforeProcessEpoch 65.895 ms/op 60.218 ms/op 1.09
mainnet_e81889 - altair processJustificationAndFinalization 22.069 us/op 25.336 us/op 0.87
mainnet_e81889 - altair processInactivityUpdates 6.2359 ms/op 6.6920 ms/op 0.93
mainnet_e81889 - altair processRewardsAndPenalties 67.479 ms/op 74.872 ms/op 0.90
mainnet_e81889 - altair processRegistryUpdates 2.6320 us/op 4.4340 us/op 0.59
mainnet_e81889 - altair processSlashings 678.00 ns/op 906.00 ns/op 0.75
mainnet_e81889 - altair processEth1DataReset 939.00 ns/op 1.2700 us/op 0.74
mainnet_e81889 - altair processEffectiveBalanceUpdates 1.3206 ms/op 1.2685 ms/op 1.04
mainnet_e81889 - altair processSlashingsReset 9.4830 us/op 5.0220 us/op 1.89
mainnet_e81889 - altair processRandaoMixesReset 8.6000 us/op 6.5400 us/op 1.31
mainnet_e81889 - altair processHistoricalRootsUpdate 1.5370 us/op 970.00 ns/op 1.58
mainnet_e81889 - altair processParticipationFlagUpdates 3.0020 us/op 4.3850 us/op 0.68
mainnet_e81889 - altair processSyncCommitteeUpdates 659.00 ns/op 782.00 ns/op 0.84
mainnet_e81889 - altair afterProcessEpoch 135.84 ms/op 133.68 ms/op 1.02
phase0 processEpoch - mainnet_e58758 373.97 ms/op 380.02 ms/op 0.98
mainnet_e58758 - phase0 beforeProcessEpoch 140.21 ms/op 146.25 ms/op 0.96
mainnet_e58758 - phase0 processJustificationAndFinalization 18.914 us/op 17.184 us/op 1.10
mainnet_e58758 - phase0 processRewardsAndPenalties 72.423 ms/op 68.209 ms/op 1.06
mainnet_e58758 - phase0 processRegistryUpdates 9.4770 us/op 8.4440 us/op 1.12
mainnet_e58758 - phase0 processSlashings 714.00 ns/op 655.00 ns/op 1.09
mainnet_e58758 - phase0 processEth1DataReset 963.00 ns/op 606.00 ns/op 1.59
mainnet_e58758 - phase0 processEffectiveBalanceUpdates 1.4249 ms/op 1.0136 ms/op 1.41
mainnet_e58758 - phase0 processSlashingsReset 4.3990 us/op 3.8130 us/op 1.15
mainnet_e58758 - phase0 processRandaoMixesReset 5.8620 us/op 4.7970 us/op 1.22
mainnet_e58758 - phase0 processHistoricalRootsUpdate 1.3130 us/op 1.4610 us/op 0.90
mainnet_e58758 - phase0 processParticipationRecordUpdates 4.8730 us/op 6.4940 us/op 0.75
mainnet_e58758 - phase0 afterProcessEpoch 112.43 ms/op 101.33 ms/op 1.11
phase0 processEffectiveBalanceUpdates - 250000 normalcase 2.3509 ms/op 1.4874 ms/op 1.58
phase0 processEffectiveBalanceUpdates - 250000 worstcase 0.5 2.5223 ms/op 1.6297 ms/op 1.55
altair processInactivityUpdates - 250000 normalcase 43.594 ms/op 26.497 ms/op 1.65
altair processInactivityUpdates - 250000 worstcase 29.060 ms/op 20.712 ms/op 1.40
phase0 processRegistryUpdates - 250000 normalcase 6.4540 us/op 9.8780 us/op 0.65
phase0 processRegistryUpdates - 250000 badcase_full_deposits 288.38 us/op 443.20 us/op 0.65
phase0 processRegistryUpdates - 250000 worstcase 0.5 137.63 ms/op 148.37 ms/op 0.93
altair processRewardsAndPenalties - 250000 normalcase 66.078 ms/op 73.679 ms/op 0.90
altair processRewardsAndPenalties - 250000 worstcase 71.861 ms/op 80.678 ms/op 0.89
phase0 getAttestationDeltas - 250000 normalcase 6.6444 ms/op 9.2991 ms/op 0.71
phase0 getAttestationDeltas - 250000 worstcase 6.6113 ms/op 10.773 ms/op 0.61
phase0 processSlashings - 250000 worstcase 3.4458 ms/op 4.4023 ms/op 0.78
altair processSyncCommitteeUpdates - 250000 175.31 ms/op 206.31 ms/op 0.85
BeaconState.hashTreeRoot - No change 260.00 ns/op 297.00 ns/op 0.88
BeaconState.hashTreeRoot - 1 full validator 52.789 us/op 58.932 us/op 0.90
BeaconState.hashTreeRoot - 32 full validator 531.67 us/op 619.71 us/op 0.86
BeaconState.hashTreeRoot - 512 full validator 5.6501 ms/op 6.9054 ms/op 0.82
BeaconState.hashTreeRoot - 1 validator.effectiveBalance 75.577 us/op 75.270 us/op 1.00
BeaconState.hashTreeRoot - 32 validator.effectiveBalance 899.07 us/op 992.17 us/op 0.91
BeaconState.hashTreeRoot - 512 validator.effectiveBalance 11.433 ms/op 14.913 ms/op 0.77
BeaconState.hashTreeRoot - 1 balances 49.640 us/op 56.920 us/op 0.87
BeaconState.hashTreeRoot - 32 balances 453.42 us/op 473.05 us/op 0.96
BeaconState.hashTreeRoot - 512 balances 4.3835 ms/op 5.4281 ms/op 0.81
BeaconState.hashTreeRoot - 250000 balances 69.469 ms/op 76.512 ms/op 0.91
aggregationBits - 2048 els - zipIndexesInBitList 16.834 us/op 23.424 us/op 0.72
regular array get 100000 times 33.050 us/op 34.669 us/op 0.95
wrappedArray get 100000 times 33.040 us/op 34.876 us/op 0.95
arrayWithProxy get 100000 times 15.670 ms/op 17.337 ms/op 0.90
ssz.Root.equals 543.00 ns/op 606.00 ns/op 0.90
byteArrayEquals 543.00 ns/op 607.00 ns/op 0.89
shuffle list - 16384 els 7.0523 ms/op 7.1247 ms/op 0.99
shuffle list - 250000 els 104.03 ms/op 104.83 ms/op 0.99
processSlot - 1 slots 9.2040 us/op 9.9060 us/op 0.93
processSlot - 32 slots 1.4278 ms/op 1.4766 ms/op 0.97
getEffectiveBalanceIncrementsZeroInactive - 250000 vs - 7PWei 37.506 ms/op 37.872 ms/op 0.99
getCommitteeAssignments - req 1 vs - 250000 vc 2.9076 ms/op 3.0550 ms/op 0.95
getCommitteeAssignments - req 100 vs - 250000 vc 4.1440 ms/op 4.2795 ms/op 0.97
getCommitteeAssignments - req 1000 vs - 250000 vc 4.6550 ms/op 4.6248 ms/op 1.01
RootCache.getBlockRootAtSlot - 250000 vs - 7PWei 4.8100 ns/op 5.2700 ns/op 0.91
state getBlockRootAtSlot - 250000 vs - 7PWei 629.48 ns/op 660.27 ns/op 0.95
computeProposers - vc 250000 10.764 ms/op 10.938 ms/op 0.98
computeEpochShuffling - vc 250000 105.63 ms/op 106.69 ms/op 0.99
getNextSyncCommittee - vc 250000 175.80 ms/op 195.97 ms/op 0.90

by benchmarkbot/action

@nflaig nflaig force-pushed the nflaig/improve-monitoring-ux branch from 0f3c58f to ba404c8 Compare March 31, 2023 09:44
Monitoring relies on metrics data to work properly and as of now would
throw an error if `--metrics` flag is not supplied. This change implicitly
enables metrics if a monitoring endpoint is configured.

Note: metrics server will only be started if metrics are explicitly enabled
@nflaig nflaig force-pushed the nflaig/improve-monitoring-ux branch from ba404c8 to 6787bbe Compare March 31, 2023 09:50
@nflaig nflaig marked this pull request as draft March 31, 2023 10:45
@nflaig nflaig force-pushed the nflaig/improve-monitoring-ux branch 2 times, most recently from a220f36 to 6787bbe Compare March 31, 2023 11:31
@nflaig nflaig marked this pull request as ready for review March 31, 2023 11:32
Copy link
Member

@wemeetagain wemeetagain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Good job not starting the metrics server unless actually required.

@wemeetagain wemeetagain merged commit 8eb8dce into unstable Mar 31, 2023
@wemeetagain wemeetagain deleted the nflaig/improve-monitoring-ux branch March 31, 2023 15:42
@wemeetagain
Copy link
Member

🎉 This PR is included in v1.8.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants