ari
ari copied to clipboard
Prometheus metrics
Add prometheus metrics to the various parts of the ARI codebase.
A big thing is tracking when timeouts occur for #29
For the metrics that are simply counters of "how many times we did this", and that have the ability to fail or succeed, let's treat them as CounterVecs using labels for Success vs Fail.
To keep the code clean, I'd like to move as much of the metric decision-making out of the ari work function. A simple Success/Fail would work this way:
At the point we want to record the metric, call a function that'll handle the decision-making for us
metricYesNo( "metricName", err )
The metricsYesNo() function then does any testing to determine the appropriate labeling, and logs the metric event:
if ( err != nil )
increment "metricName" using label "Fail"
else
increment "metricName" using label "Success"
Note to myself - need to look into mapping the destination metric to string.
And, since I'm using a string rather than hard-coded metric name like before, if it's trying to update a metric that doesn't exist, should we report it or simply debug or ?