I have a Devise model:
class Account < ActiveRecord::Base
devise ::trackable
I'd like to see the number of times an Account is created and signed in to, in Librato.
I have a Devise model:
class Account < ActiveRecord::Base
devise ::trackable
I'd like to see the number of times an Account is created and signed in to, in Librato.
Using Librato's log stream parsing you can record the events with a
$stdout.puts.I recommend extracting this log to a concern, and using model callbacks to monitor changes.
We can create a file in
lib/librato/account.rb:And then include it in your model, thus: