Installation
Currently Metlo’s Ruby Agent supports frameworks compatible with rack middleware. An incomplete set of frameworks that support this are: installed- Puma
- Sinatra
- Iodine
- Unicorn
- uWSGI
gem
by running:
Shell
Shell
Gemfile
Shell
Configuration
Rails
Once installed, Metlo’s middleware can be added by adding it to the middlewares list (generally in theapplication.rb
file) like so:
Ruby
:backend_port
: Backend port used by Metlo:collector_port
: Collector port used to capture traces. Defaults to 8081:encryption_key
: Key used to encrypt sensitive data, such as User session keys:log_level
: The log level Metlo should log at. The debug levels and above correspond to values used by the python logging module. A specialtrace
level is also present, that provides verbose logging info. Can be- “trace”
- “debug”
- “info”
- “warn”
- “error”
:block_response
: Function that produces a reponse when Metlo is set to block malicious requests. It takes in a param for the env and expects a tuple containing the status code, response headers, and response (as an array of strings).:get_user
: A function that takes in the rack env scope parameter and returns the user for that request as a string. By default, Metlo collects no information about user of a request.
Sinatra
Once installed, Metlo’s middleware can be added by simply doing::backend_port
: Backend port used by Metlo:collector_port
: Collector port used to capture traces. Defaults to 8081:encryption_key
: Key used to encrypt sensitive data, such as User session keys:log_level
: The log level Metlo should log at. The debug levels and above correspond to values used by the python logging module. A specialtrace
level is also present, that provides verbose logging info. Can be- “trace”
- “debug”
- “info”
- “warn”
- “error”
:block_response
: Function that produces a reponse when Metlo is set to block malicious requests. It takes in a param for the env and expects a tuple containing the status code, response headers, and response (as an array of strings).:get_user
: A function that takes in the rack env scope parameter and returns the user for that request as a string. By default, Metlo collects no information about user of a request.