Closed roelbondoc closed 5 months ago
This is ready for review. I'll need to write some tests for this, which I'll do either in this PR, or the parent insights-events-instrumentation
branch.
This LGTM. Have you considered adding a
decrement_counter
to pair withincrement_counter
?
Ah yes, let me add that.
I'm going to merge this in so there is only one branch. Feel free to comment here, or https://github.com/honeybadger-io/honeybadger-ruby/pull/539
This adds metrics aggregation.
New Components
Honeybadger::Registry
- This class stores all tracked metrics registered in the gem. The registry ensures that only one instance of each unique metric is stored at any time. A metric is defined as unique by it's type, name, and set of attributes.Honeybadger::RegistryExecution
- This class is injected into theCollectorWorker
and is run on a configurable interval. When called, it iterates over all registered metrics, compiles payloads for each, and sent as an event. The registry is then flushed.Honeybadger::Metric
- A base metric class from which all other metric classes inherit from. These metric classes record data and compute/track values as needed.Shape of the Data
Each metric type's data is shaped differently. Below are examples of what that data looks like for each type.
counter
gauge
timer
Note: This may look the same as a gauge, however, the interface to use the metric provides a timing mechanism.
histogram
Before submitting a pull request, please make sure the following is done:
rake spec
in the repository root.