-
Notifications
You must be signed in to change notification settings - Fork 118
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
Target metrics #1811
base: main
Are you sure you want to change the base?
Target metrics #1811
Conversation
selectTxsToGossipSum prometheus.Gauge | ||
selectedTxsToGossip prometheus.Counter | ||
targetTxsSum prometheus.Gauge |
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.
Is there a specific reason to use a Gauge? I feel like only Inc/Add method are used to represent the metric.
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.
Hmm was just copying how we had handled durations elsewhere. This will never decrease, so we could use a counter instead.
if err != nil { | ||
return err | ||
} | ||
|
||
numTxsGossipped := 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.
nit: typo
}), | ||
selectedTxsToGossip: prometheus.NewCounter(prometheus.CounterOpts{ | ||
Namespace: namespace, | ||
Name: "selected_txs_to_gossip", |
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.
should we call this select_
to be consistent w/ the other metrics?
}), | ||
selectTxsToGossipSum: prometheus.NewGauge(prometheus.GaugeOpts{ | ||
Namespace: namespace, | ||
Name: "select_txs_to_gossip_sum", |
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.
it's not obvious this + target_txs_sum
are latency metrics from the naming - can we put time
or something in the name to make it more clear?
return nil | ||
} | ||
g.log.Debug("gossiping transactions", zap.Int("txs", len(txs)), zap.Duration("t", time.Since(start))) | ||
g.metrics.txsGossiped.Add(float64(len(txs))) |
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.
Why did we remove this metric?
return err | ||
} | ||
} | ||
t.metrics.txsGossiped.Add(float64(numTxsGossipped)) |
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.
Is this right? This looks like it will re-accumulate previously counted txs into the metric since we're using numTxsGossiped
. Shouldn't we be using something like t.metrics.txsGossiped.Add(float64(len(gossipContainer.Txs))
here?
This PR add target specific metrics into the gossiper and renames
g
tot
as the pointer receiver for*gossiper.Target
.