Observing Elixir in Production

Elixir, Erlang, and really just the BEAM has a feature called “Observer”. It’s fun showing it to people new to Elixir because it’s just so cool! It’s a WxWidgets graphical interface that connects in realtime to a running Erlang node and lets you “obs

Mark Ericksen
5 min readbeginner
--
View Original

Overview

The article discusses how to use Observer, a graphical interface for monitoring Elixir applications, in a production environment. It highlights the benefits of connecting to production servers via a WireGuard VPN, allowing developers to inspect and manage processes in real-time.

What You'll Learn

1

How to set up a WireGuard VPN to connect to production Elixir nodes

2

Why using Observer can help diagnose issues in production applications

3

How to explore and manage processes in a clustered Elixir application

4

When to use chaos testing to improve system resilience

Prerequisites & Requirements

  • Basic understanding of Elixir and BEAM architecture
  • Familiarity with WireGuard and VPN concepts(optional)

Key Questions Answered

How can I connect to my Elixir application in production using Observer?
You can connect to your Elixir application in production by setting up a WireGuard VPN, which allows you to create a secure tunnel from your local machine to the production network. This enables you to run Observer locally and monitor remote Elixir nodes in real-time.
What is the purpose of using Observer in Elixir applications?
Observer provides a graphical interface to monitor and manage processes in Elixir applications. It allows developers to inspect process states, visualize the process tree, and even terminate misbehaving processes, which is essential for diagnosing issues in production environments.
What are the benefits of multi-region support for Elixir nodes?
Multi-region support allows Observer to connect to any node in a clustered Elixir application running across different regions. This enhances the monitoring capabilities and ensures that developers can manage and troubleshoot applications that are geographically distributed.
How does killing a process in Observer affect the application?
Killing a process in Observer allows developers to test the system's resilience and recovery capabilities. When a game server process is terminated, a new process is automatically started, demonstrating how the system isolates damage and maintains overall application availability.

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

Backend
Elixir
Used for building resilient applications that can be monitored using Observer.
Networking
Wireguard
Provides a secure VPN connection to access production Elixir nodes.

Key Actionable Insights

1
Set up a WireGuard VPN to securely connect to your production Elixir application. This will allow you to run Observer locally and monitor your application in real-time, which is crucial for diagnosing issues quickly.
Using a VPN simplifies the connection process and enhances security, making it easier to manage production applications without exposing sensitive data.
2
Utilize Observer to inspect and manage processes within your Elixir application. By understanding the process tree and states, you can identify bottlenecks and optimize performance.
This hands-on approach helps in recognizing issues that may not be apparent through logs alone, leading to more effective troubleshooting.
3
Experiment with chaos testing by intentionally killing processes in your application using Observer. This will help you understand how your system behaves under failure conditions and improve its resilience.
Testing recovery from failures is essential for building robust applications, and using Observer makes this process straightforward.

Common Pitfalls

1
Failing to properly configure the WireGuard VPN can lead to connectivity issues when trying to access production nodes.
Ensure that the VPN settings are correctly applied and that your local machine has the necessary permissions to establish a connection to the production network.
2
Over-relying on Observer for monitoring without implementing additional logging can result in missing critical information during failures.
While Observer is powerful, it should complement a robust logging strategy to provide a comprehensive view of application health.

Related Concepts

Observer Usage In Elixir Applications
Wireguard Vpn Setup
Process Management In Beam
Chaos Engineering Principles