micronaut-projects / micronaut-core

Micronaut Application Framework
http://micronaut.io
Apache License 2.0
6.07k stars 1.07k forks source link

Feature request: Add CircuitBreaker option to suppress error logging whilst circuit is open #1817

Closed stottpaul closed 4 years ago

stottpaul commented 5 years ago

Thanks for reporting an issue for Micronaut, please review the task list below before submitting the issue. Your issue report will be closed if the issue is incomplete and the below tasks not completed.

NOTE: If you are unsure about something and the issue is more of a question a better place to ask questions is on Stack Overflow (http://stackoverflow.com/tags/micronaut) or Gitter (https://gitter.im/micronautfw/). DO NOT use the issue tracker to ask questions.

Task List

Steps to Reproduce

Add CircuitBreaker annotation to a method

Expected Behaviour

An option on the annotation to only log exception when opening the circuit and not on all subsequent method calls whilst the circuit is open

Tell us what should happen

Actual Behaviour

Performance of app is made worse by thrashing of the logs whilst circuit is open.

Environment Information

ZacharyKlein commented 5 years ago

@stottpaul Could you clarify the behavior you're expecting here? Currently the way to handle logging an exception is for the caller to catch it and decide what to log. So if you wanted to only log the first instance, you could keep that state in your caller and not log subsequent exceptions. There's not really anything within the @CircuitBreaker functionality to manage logging; it's just re-throwing the exception - after that point it's just like any other exception as far as logging goes.

Thoughts?

jameskleeh commented 4 years ago

Closing due to a lack of feedback