plug_statsd alternatives and similar packages
Based on the "Framework Components" category.
Alternatively, view plug_statsd 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 -
plug_rails_cookie_session_store
Rails compatible Plug session store -
phx_component_helpers
Extensible Phoenix liveview components, without boilerplate -
filterable
Filtering from incoming params in Elixir/Ecto/Phoenix with easy to use DSL. -
multiverse
Elixir package that allows to add compatibility layers via API gateways. -
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. -
better_params
Cleaner request parameters in Elixir web applications ๐ -
scrivener_headers
Scrivener pagination with headers and web linking -
phoenix_pubsub_rabbitmq
RabbitMQ adapter for Phoenix's PubSub layer -
plug_checkup
PlugCheckup provides a Plug for adding simple health checks to your app -
plug_rest
REST behaviour and Plug router for hypermedia web applications in Elixir -
Votex
Implements vote / like / follow functionality for Ecto models in Elixir. Inspired from Acts as Votable gem in Ruby on Rails -
trailing_format_plug
An elixir plug to support legacy APIs that use a rails-like trailing format: http://api.dev/resources.json -
phoenix_html_simplified_helpers
Some helpers for phoenix html( truncate, time_ago_in_words, number_with_delimiter, url_for, current_page? ) -
plug_canonical_host
PlugCanonicalHost ensures that all requests are served by a single canonical host.
Learn Elixir in as little as 12 Weeks
Do you think we are missing an alternative of plug_statsd or a related project?
README
PlugStatsd
Description
A plug for automatically sending timing and count metrics to statsd.
This plug can currently can use any of these statsd backends:
If you have additional statsd clients you'd like added, please open an issue and let me know.
Usage
Add the plug and your chosen statsd backend as a dependencies for your application.
defp deps do
[
{:plug_statsd, "~> 0.3"},
{:ex_statsd, "~> 0.5"},
]
end
You should also update your applications list to include the statsd plug and the backend:
def application do
[applications: [:plug_statsd, :ex_statsd]]
end
Add the plug to your endpoints, here's an example from a Phoenix chat application (lib/chat/endpoint.ex
)
defmodule Chat.Endpoint do
...
plug Plug.Logger
#send connection request timing and counts to statsd
plug Plug.Statsd
...
end
Configure your statsd backend (ex_statsd or statderl) using Mix.Config
as usual (probably in your
config/
):
use Mix.Config
config :ex_statsd,
host: "your.statsd.host.com", # This is optional and will default to 127.0.0.1
port: 1234, # This is optional and will default to 8125
namespace: "your-app" # This is optional and will default to nil
config :plug_statsd,
metrics: [
# custom_text.4xx.more_custom_text
{:timer, ["custom_text", :generalized_http_status, "more_custom_text"]},
# request.GET.api-v1-users-jeff=weiss
{:counter, ["request", &Plug.Statsd.http_method/2, :uri], sample_rate: 0.1},
# or this is equivalent as request.GET.api-v1-users-jeff=weiss
{:counter, ["request", {Plug.Statsd, :http_method}, :uri], sample_rate: 0.1},
],
slash_replacement: "-", # defaults to "."
dot_replacement: "=" # defaults to "_"
You can also add custom dynamic segments to your metric name by creating a 2-arity function that takes a Plug.Conn
and a Keyword
list.
Seeing it in action
If you don't immediately have a statsd server available, you can run socat in a terminal.
$ socat UDP-RECV:8125 STDOUT
Depending on your sample rates, you should see a series of output that looks something like
custom_text.2xx.more_custom_text:27|ms
request.GET.[root]:1|c
custom_text.2xx.more_custom_text:18|ms
request.GET.[root]:1|c
custom_text.2xx.more_custom_text:32|ms
request.GET.[root]:1|c
custom_text.4xx.more_custom_text:1|ms
request.GET.api-v1-users-jeff=weiss:1|c
custom_text.4xx.more_custom_text:0|ms
request.GET.api-v1-users-jeff=weiss:1|c