You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm wondering if there is an easy way to track the various signals for metrics / counts / errors, etc. the policies use and generate for the on_____(..) methods across each of the policy types.
Specifically, I was using opossum for circuit breaker, and was looking to remove some custom logic for retry, bulkhead, etc, by replacing that use with cockatiel. However, the event tracking appears to wiring up a function for each listener / event name, E.G, onTimeout, onReset, onSuccess, onHalfOpen, etc. It seems one must know and attach to every listener, and continue to maintain those signals as the library features evolve.
for(const key of breaker.eventNames()) {
breaker.on(key, () => incrementApiMetric(key));
}
NOTE: incrementApiMetric would send stats to DataDog, NewRelic, or other metrics collection library.
I tried looking through the source but nothing jumped out as being as trivial / easy at capturing existing and future event signals. Any suggestions or is this something that could be added as the features evolve? Will it require just unrolling the loop and adding one metric callback per each on____() method?
The text was updated successfully, but these errors were encountered:
Love the power and flexibility of this library.
I'm wondering if there is an easy way to track the various signals for metrics / counts / errors, etc. the policies use and generate for the on_____(..) methods across each of the policy types.
Specifically, I was using opossum for circuit breaker, and was looking to remove some custom logic for retry, bulkhead, etc, by replacing that use with cockatiel. However, the event tracking appears to wiring up a function for each listener / event name, E.G, onTimeout, onReset, onSuccess, onHalfOpen, etc. It seems one must know and attach to every listener, and continue to maintain those signals as the library features evolve.
In contrast, the metrics that I had added in opossum was just this (ref: https://nodejs.org/api/events.html#emittereventnames):
NOTE: incrementApiMetric would send stats to DataDog, NewRelic, or other metrics collection library.
I tried looking through the source but nothing jumped out as being as trivial / easy at capturing existing and future event signals. Any suggestions or is this something that could be added as the features evolve? Will it require just unrolling the loop and adding one metric callback per each on____() method?
The text was updated successfully, but these errors were encountered: