I want to have a top list for data dog that that counts numbers of times different statuses in my application were given.
I have a simple method that preparing a result for an api call im exposing, and a Result have Status, this is how the method looks like:
def prepareStatus(shouldGiveStatus: Boolean, status: Status): Option[Result] = {
if (shouldGiveStatus) {
// here I want to add counter for statuses
Result(status)
} else {
None
}
}
im using Kamon and scala, I think I need to do it with histogram but I would love to get some direction of how to implement the metric in my code...thanks!!