richardpringle

richardpringle OP

So, I’ve been toying around with the idea of building application monitoring tools with Elixir. I can’t decide whether using the entire BEAM is worth adding just to manage other processes (non-Elixir processes).

I know there are already some great cloud-based tools for monitoring or process managing but I want to build some pretty custom logic depending on exits and stderr messages, etc.

A great tool that I already use is built with Node.js, called PM2, however, I don’t have the ability to add custom logic and even if I did… if I bug finds it’s way into my custom logic, Node.js isn’t fault-tolerant.

I’m not sure if many problems exist like this, but I am essentially trying to monitor blockchain nodes… Downtime is incredibly expensive because the nodes have to “catch-up” for the period in which new blocks were being created. There’s a whole slew of different custom logic triggers depending on the blockchain software’s behaviour. I hate to bring up blockchain because it’s such a buzzword, but I think that the problem could apply to any other log-based distributed system (monitoring kafka nodes for example).

Any thoughts?

First 6 of 6 Posts Switch mode

kokolegorille

kokolegorille

I like Nagios as monitoring tool, but it’s not done in Elixir.

dch

dch

personally, I’d add a simple /health style checkpoint to your app, expose it to something like collectd using its curl plugin for an up/down type check, and funnel the results into http://riemann.io/ I’ve been using this setup for a long time, across multiple customers, and it’s super flexible, and not overly hard to get your head around. You can set up multiple riemann servers that monitor each other if required, and you can get collectd to send data to multiple riemann instances as well. Cool kids these days would probably go for prometheus, but I’ve not tried that myself.

richardpringle

richardpringle OP

Maybe my phrasing can be improved. I need the same functionality as an Elixir supervisor, except I need it for non-elixir applications.

Having different callbacks run on failure (depending on the reason) is critical. Having automatic restarts or triggering the process on a different server is also essential. I know that Elixir does a very good job of this for monitoring a distributed cluster of other Elixir applicarions. I’m trying to figure out if it’s overkill to use that functionality on “external” (external to the BEAM) applications.

The beam has a pretty big memory footprint compared to applications like nagios but I need to do more than just monitor.

OvermindDL1

OvermindDL1

Not at all, it’s well suited to manage Ports too.

dimitarvp

dimitarvp

If using a Port is a bit much you can always try and utilize a wrapper like Porcelain.

richardpringle

richardpringle OP

Haha I’m fairly new to Elixir, but I actually found Port easier to use than Porcelain. It’s quite probable that I just didn’t know what I was doing before getting Port to work. I have a little PoC that works really well, I can kill a node.js process and restart it and the restart works well if the elixir process dies too.

I’m still a little concerned that running the whole BEAM vm is overkill though. For a Node.js process is definitely is as it’s using more memory than my little PoC.

— All posts loaded —

Where Next? Top

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2977 91898 914
New
AstonJ
The obligatory hello world thread! Who are you and where are you from? :stuck_out_tongue:
4616 55835 594
New
byu
@chrismccord : I just saw the Extract AGENTS.md from Phoenix.new into phx.new generator commit to the phoenix project. My initial shotgu...
New
arcanemachine
I was working on an Ecto migration and I needed a timestamp. So, for the nth time, I looked up the different data types for timestamps, a...
New
AstonJ
Just a general thread to post chat/news/info relating to AI/ML stuff that may be relevant for Nx now or in the future. Got anything to sh...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
mudasobwa
While I am working on the Language Agnostic Code Audit SaaS, which uses MetaAST (spoiler: I am expecting it to be in a good shape for ann...
New

We're in Beta

About us Mission Statement