mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 04:47:18 +00:00
show full public key in metrics (#4988)
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
This commit is contained in:
parent
4c43616647
commit
c09ae21ab0
@ -48,7 +48,7 @@ func (v *validator) SubmitAggregateAndProof(ctx context.Context, slot uint64, pu
|
||||
defer span.End()
|
||||
|
||||
span.AddAttributes(trace.StringAttribute("validator", fmt.Sprintf("%#x", pubKey)))
|
||||
fmtKey := fmt.Sprintf("%#x", pubKey[:8])
|
||||
fmtKey := fmt.Sprintf("%#x", pubKey[:])
|
||||
|
||||
duty, err := v.duty(pubKey)
|
||||
if err != nil {
|
||||
|
@ -54,7 +54,7 @@ func (v *validator) SubmitAttestation(ctx context.Context, slot uint64, pubKey [
|
||||
defer span.End()
|
||||
span.AddAttributes(trace.StringAttribute("validator", fmt.Sprintf("%#x", pubKey)))
|
||||
|
||||
fmtKey := fmt.Sprintf("%#x", pubKey[:8])
|
||||
fmtKey := fmt.Sprintf("%#x", pubKey[:])
|
||||
log := log.WithField("pubKey", fmt.Sprintf("%#x", bytesutil.Trunc(pubKey[:]))).WithField("slot", slot)
|
||||
duty, err := v.duty(pubKey)
|
||||
if err != nil {
|
||||
|
@ -65,10 +65,11 @@ func (v *validator) LogValidatorGainsAndLosses(ctx context.Context, slot uint64)
|
||||
for _, pkey := range pubKeys {
|
||||
pubKey := fmt.Sprintf("%#x", pkey[:8])
|
||||
log := log.WithField("pubKey", pubKey)
|
||||
fmtKey := fmt.Sprintf("%#x", pkey[:])
|
||||
if missingValidators[bytesutil.ToBytes48(pkey)] {
|
||||
log.Info("Validator not in beacon chain")
|
||||
if v.emitAccountMetrics {
|
||||
validatorBalancesGaugeVec.WithLabelValues(pubKey).Set(0)
|
||||
validatorBalancesGaugeVec.WithLabelValues(fmtKey).Set(0)
|
||||
}
|
||||
continue
|
||||
}
|
||||
@ -92,7 +93,7 @@ func (v *validator) LogValidatorGainsAndLosses(ctx context.Context, slot uint64)
|
||||
"percentChange": fmt.Sprintf("%.5f%%", percentNet*100),
|
||||
}).Info("Previous epoch voting summary")
|
||||
if v.emitAccountMetrics {
|
||||
validatorBalancesGaugeVec.WithLabelValues(pubKey).Set(newBalance)
|
||||
validatorBalancesGaugeVec.WithLabelValues(fmtKey).Set(newBalance)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ func (v *validator) ProposeBlock(ctx context.Context, slot uint64, pubKey [48]by
|
||||
}
|
||||
ctx, span := trace.StartSpan(ctx, "validator.ProposeBlock")
|
||||
defer span.End()
|
||||
fmtKey := fmt.Sprintf("%#x", pubKey[:8])
|
||||
fmtKey := fmt.Sprintf("%#x", pubKey[:])
|
||||
|
||||
span.AddAttributes(trace.StringAttribute("validator", fmt.Sprintf("%#x", pubKey)))
|
||||
log := log.WithField("pubKey", fmt.Sprintf("%#x", bytesutil.Trunc(pubKey[:])))
|
||||
|
Loading…
Reference in New Issue
Block a user