-
Notifications
You must be signed in to change notification settings - Fork 70
feat: Add ABCIMethodLatency
histogram [BLO-791]
#26
Conversation
}), | ||
Name: "abci_method_latency", | ||
Help: "The time it took for an ABCI method to execute slinky specific logic (in seconds)", | ||
Buckets: []float64{.0001, .0004, .002, .009, .02, .1, .65, 2, 6, 25}, |
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.
buckets chosen are in seconds, these are the same buckets used by cometBFTs, abci_method_latency histogram
d628a89
to
0fc81c7
Compare
@@ -77,7 +77,7 @@ func DefaultOracleConfig(node *cosmos.ChainNode) ( | |||
|
|||
// Create the metrics config | |||
metricsConfig := oracleconfig.MetricsConfig{ | |||
PrometheusServerAddress: fmt.Sprintf("%s:%s", oracle.HostName(), "8081"), | |||
PrometheusServerAddress: fmt.Sprintf("%s:%s", "0.0.0.0", "8081"), |
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.
expose app-metrics to docker-host, as opposed to oracle-host in docker-network
36e3ec6
to
68883c3
Compare
@@ -1,2 +1 @@ | |||
go.work* |
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.
un ignore go.sum so dockerfiles can build
abci/proposals/proposals.go
Outdated
// record time spent in slinky-specific ProcesssProposal | ||
processDuration := time.Since(start) | ||
|
||
// call the wrapped process-proposal | ||
resp, err := h.processProposalHandler(ctx, req) | ||
if err == nil { | ||
// record time spent in slinky-specific ProcesssProposal on successful process-proposals | ||
h.logger.Info( | ||
"recording process proposal time", | ||
"duration (seconds)", processDuration.Seconds(), | ||
) | ||
h.metrics.ObserveABCIMethodLatency(servicemetrics.ProcessProposal, processDuration) | ||
} | ||
return resp, err |
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.
The reason I had metrics observation in a defer was to guarantee that we reported a metric no matter what our response was.
The way you have it above will only report in the happy path and not any other result. I think we want to report metrics no matter whether the response is Accept or Reject.
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.
Ya, I intentionally wanted to only collect latencies for successful requests.
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.
You'd prefer to report in all cases?
68883c3
to
9294abc
Compare
19c2e36
to
26cf8ac
Compare
// ObserveProcessProposalTime records the time it took for the oracle-specific parts of process proposal | ||
ObserveProcessProposalTime(duration time.Duration) | ||
|
||
// ObservePrepareProposalTime records the time it took for the oracle-specific parts of prepare proposal | ||
ObservePrepareProposalTime(duration time.Duration) | ||
// ObserveABCIMethodLatency reports the given latency (as a duration), for the given ABCIMethod, and updates the ABCIMethodLatency histogram w/ that value. | ||
ObserveABCIMethodLatency(method ABCIMethod, duration time.Duration) |
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.
Nice 👍
In This PR
ABCIMethodLatency
histogram inservice/metrics/metrics.go
, see the RFCREADME
section for metrics, and a README forservice/metrics
Example output