plug_checkup alternatives and similar packages
Based on the "Framework Components" category.
Alternatively, view plug_checkup alternatives based on common mentions on social networks and blogs.
-
ex_admin
ExAdmin is an auto administration package for Elixir and the Phoenix Framework -
phoenix_html
Phoenix.HTML functions for working with HTML strings and templates -
phoenix_ecto
Phoenix and Ecto integration with support for concurrent acceptance testing -
react_phoenix
Make rendering React.js components in Phoenix easy -
absinthe_plug
Plug support for Absinthe, the GraphQL toolkit for Elixir -
phoenix_live_reload
Provides live-reload functionality for Phoenix -
params
Easy parameters validation/casting with Ecto.Schema, akin to Rails' strong parameters. -
phoenix_pubsub_redis
The Redis PubSub adapter for the Phoenix framework -
dayron
A repository `similar` to Ecto.Repo that maps to an underlying http client, sending requests to an external rest api instead of a database -
rummage_phoenix
Full Phoenix Support for Rummage. It can be used for searching, sorting and paginating collections in phoenix. -
phoenix_token_auth
Token authentication solution for Phoenix. Useful for APIs for e.g. single page apps. -
sentinel
DEPRECATED - Phoenix Authentication library that wraps Guardian for extra functionality -
phx_component_helpers
Extensible Phoenix liveview components, without boilerplate -
plug_rails_cookie_session_store
Rails compatible Plug session store -
multiverse
Elixir package that allows to add compatibility layers via API gateways. -
filterable
Filtering from incoming params in Elixir/Ecto/Phoenix with easy to use DSL. -
access pass
provides a full user authentication experience for an API. Includes login,logout,register,forgot password, forgot username, confirmation email and all that other good stuff. Includes plug for checking for authenticated users and macro for generating the required routes. -
scrivener_headers
Scrivener pagination with headers and web linking -
better_params
Cleaner request parameters in Elixir web applications ๐ -
phoenix_pubsub_rabbitmq
RabbitMQ adapter for Phoenix's PubSub layer -
plug_rest
REST behaviour and Plug router for hypermedia web applications in Elixir -
trailing_format_plug
An elixir plug to support legacy APIs that use a rails-like trailing format: http://api.dev/resources.json -
Votex
Implements vote / like / follow functionality for Ecto models in Elixir. Inspired from Acts as Votable gem in Ruby on Rails -
plug_canonical_host
PlugCanonicalHost ensures that all requests are served by a single canonical host. -
phoenix_html_simplified_helpers
Some helpers for phoenix html( truncate, time_ago_in_words, number_with_delimiter, url_for, current_page? )
TestGPT | Generating meaningful tests for busy devs
Do you think we are missing an alternative of plug_checkup or a related project?
README
PlugCheckup
PlugCheckup provides a Plug for adding simple health checks to your app. The JSON output is similar to the one provided by the MiniCheck Ruby library. It was started to provide solarisBank an easy way of monitoring Plug based applications.
Usage
Add the package to "mix.exs"
defp deps do [ {:plug_checkup, "~> 0.3.0"} ] end
Create your checks
defmodule MyHealthChecks do def check_db do :ok end
def check_redis do :ok end end
- Forward your health path to PlugCheckup in your Plug Router
```elixir
checks = [
%PlugCheckup.Check{name: "DB", module: MyHealthChecks, function: :check_db},
%PlugCheckup.Check{name: "Redis", module: MyHealthChecks, function: :check_redis}
]
forward(
"/health",
to: PlugCheckup,
init_opts: PlugCheckup.Options.new(json_encoder: Jason, checks: checks)
)
If you're working with Phoenix, you need to change the syntax slightly to
accomodate Phoenix.Router.forward/4
:
checks = [
%PlugCheckup.Check{name: "DB", module: MyHealthChecks, function: :check_db},
%PlugCheckup.Check{name: "Redis", module: MyHealthChecks, function: :check_redis}
]
forward("/health", PlugCheckup, PlugCheckup.Options.new(json_encoder: Jason, checks: checks))
The Checks
A check is a function with arity zero, which should return either :ok or {:error, term}. In case the check raises an exception or times out, that will be mapped to an {:error, reason} result.
Response
PlugCheckup should return either 200 or 500 statuses, Content-Type header "application/json", and the body should respect [this](priv/schemas/health_check_response.json) JSON schema
If you configure the error_code
option when initializing the plug, the specified value will be used when an error occurs instead of the 500 status.
Demo
Check [.iex.exs](.iex.exs) for a demo of plug_checkup in a Plug.Router. The demo can be run as following.
git clone https://github.com/ggpasqualino/plug_checkup
cd plug_checkup
mix deps.get
iex -S mix
Open your browse either on http://localhost:4000/selfhealth or http://localhost:4000/dependencyhealth