Comments (8)
SASL is a necessary dependency in fuse.
The reason is fuse includes a fuse_monitor
module which keeps track of broken fuses in your system. When a fuse is tripped, the alarm_handler
is told about this. When the fuse repairs, the alarm is cleared. The alarm handler is part of the SASL package.
It is useful because you can then subscribe to events in the alarm handler and have your system react to broken fuses in a natural way. It allows you to have a loosely decoupled error handling between processes, since you don't have to "define" stuff inside fuse for this: just subscribe to the alarm handler and you are up and running.
To fix your immediate problem, you can configure the SASL application to avoid logging on the console. If memory serves, the knob is sasl_error_logger
you need to set to false
, but do check it yourself with erl -man sasl
where it is documented. Alternatively, the usual Erlang solution is that the lager
application can take over logging from SASL, but this is slightly more involved.
from fuse.
Terrific. Thanks for the color. I will take your first approach and set sasl_error_logger
to false
in my config: config :sasl, sasl_error_logger: :false
from fuse.
Nice it solves your problem!
To add: one problem with circuit breakers are that they make your system survive. Hence, attach a worker to the alarm_handler which forwards any broken fuse to the operations/devops console/office of your production system. This way, you know what internal fuses have triggered and this is often enough to know what subsystem is in trouble. I've had really good operational experience with this, as you often know a subsystem is in trouble right away, and you don't have to go analyzing what system is currently in a bad state: you get told.
from fuse.
This is something I'd be interested in using. My current experience with Fuse is via these two blog articles which just discuss the basic functionality. I'll need to look into how I'd use alarm_handler
with Elixir. Right now I'm just logging when a Fuse is blown manually.
https://blog.mojotech.com/safeguard-web-service-failures-in-elixir-with-fuse/
http://www.rokkincat.com/blog/2015/09/24/circuit-breakers-in-elixir
from fuse.
Is the alarm handler fuse_event:add_handler/2
? I'm looking at https://hexdocs.pm/fuse/. I see alarm_handler
is in Erlang but am not sure how to utilize this feature 😬 . It's just what I'm looking for though.
from fuse.
See http://erlang.org/doc/man/alarm_handler.html
The alarm handler process is a
gen_event
event manager process that receives alarms in the system. This process is not intended to be a complete alarm handler. It defines a place to which alarms can be sent. One simple event handler is installed in the alarm handler at startup, but users are encouraged to write and install their own handlers.
[...]
The default simple handler is calledalarm_handler
and it can be exchanged by callinggen_event:swap_handler/3 as gen_event:swap_handler(alarm_handler, {alarm_handler, swap}, {NewHandler, Args}).
NewHandler:init({Args, {alarm_handler, Alarms}})
is called. For more details, seegen_event(3)
in STDLIB.
from fuse.
Just to make it clear: the fuse event handler is different from the alarm handler. Your systems might want to hook into events and react accordingly, so they are to use the fuse_event system. Whereas your deployed VM might want to watch and handle alarms of a higher kind, which is the purpose of the alarm_handler.
Both have their use cases. You also have stats collections inside fuse so you have a chance at seeing what is going on when things starts going bad. This is meant for exporting into e.g., Grafana.
from fuse.
So, for example, if I want to be notified when a fuse is blown I should create a custom event handler and add it using fuse_event:add_handler/2
. Am I correct?
from fuse.
Related Issues (20)
- Add release 16 and 17 support HOT 2
- tags not synced HOT 2
- Is sasl needed in the application? HOT 2
- update readme - users HOT 4
- Progress reports are output to console HOT 2
- Model failure: when resetting a fuse the timer reference is not reset HOT 1
- Model failure: Unexpected cancel timer HOT 3
- Reinstall failures.
- Some invariants which is needed to move forward: HOT 1
- What is a circuit breaker..? HOT 1
- Fault Injection Fuses lead to errors HOT 3
- gulp build issue with html files HOT 1
- Relax the circuit name? HOT 3
- Bump version and update hex.pm package HOT 6
- Move from Travis CI to GitHub Actions? HOT 1
- Broken spec for the name of a fuse
- telemetry implementation of fuse_stats_plugin? HOT 1
- Generalized support for statistics export to monitoring systems. HOT 6
- Control the service restart after blown HOT 35
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fuse.