A Cowboy based Folsom HTTP Wrapper.
Switch branches/tags
Nothing to show
Pull request Compare This branch is 24 commits behind boundary:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


folsom_cowboy, a cowboy based wrapper for folsom

This is an application that exposes folsom metrics via http using cowboy. It is a port of folsom_webmachine to cowboy.


Just add the folsom_cowboy to your app, in addition to its dependencies: cowboy, folsom.

    %% It's not typical to do this manually, but here's how:
    > lists:map(fun application:start/1,
            [cowboy, folsom, folsom_cowboy]).

You can configure the port, transport, transport_options, num_acceptors and dispatch in the folsom_cowboy application environment. This is typically done in your application's sys.config, but can also be specified on the command line:

    $ erl -pa ebin deps/*/ebin -folsom_cowboy port 8888
  • transport is the cowboy transport module (cowboy_tcp_transport or cowboy_ssl_transport)
  • transport_options is the options list to pass to that module (port is handled separately), such as [{ip, {127, 0, 0, 1}}]
  • num_acceptors is the number of acceptor processes to start for the listening socket (default is 100)
  • dispatch is the cowboy_http_module dispatch tree, which you could use to change the URL scheme


Query the list of available metrics:

    $ curl http://localhost:5565/_metrics

Query a specific metric:

    $ curl http://localhost:5565/_metrics/name

Create a new metric:

    $ curl -X PUT http://localhost:5565/_metrics -d '{"id": "a", "type": "counter"}' -H "Content-Type: application/json"

Update a metric:

    $ curl -X PUT http://localhost:5565/_metrics/a -d '{"value" : {"inc": 1}}' -H "Content-Type: application/json"

Delete a metric:

    $ curl -X DELETE http://localhost:5565/_metrics/a

Query Erlang VM metrics:

    $ curl http://localhost:5565/_memory

Query Erlang VM stats:

    $ curl http://localhost:5565/_statistics

Query Erlang VM information:

    $ curl http://localhost:5565/_system


    $ curl http://localhost:5565/_metrics/a

     $ curl http://localhost:5565/_metrics/test


     $ curl http://localhost:5565/_memory