Skip to main content

Installation

Currently Metlo’s Node Agent supports 3 frameworks:
  • Express
  • Koa
  • Fastify
It can be installed from npm by running:
Bash
Or from yarn by running:
Bash

Configuration

Express

Metlo can be included as a standard Express Middleware.

Koa

Metlo can be included as a standard Koa Middleware.

Fastify

Metlo can be included as a standard Fastify plugin.

Extra configuration

Metlo for NodeJS can further be customized to add more context to collected traces or to enable/disable functionality.
  • host : Location of the Metlo instance
  • key : API key used for collecting to Metlo
  • backendPort : Backend port used by Metlo.
  • collectorPort : Collector port used to capture traces. Defaults to 8081
  • logLevel : The log level Metlo should log at. Can be
    • trace
    • info
    • debug
    • warn
    • error
  • getUser : A function that takes in a request/response or context and returns the user for that request. By default, Metlo collects no information about user of a request.
  • rejectResponse : Response to return when Metlo is set to block malicious requests.
  • maxBodyCaptureSize : Max size of request/response bodies that Metlo should capture. Defaults to 5 KB
  • disableBlocking : Used to disable request blocking by Metlo.
In addition, Metlo accepts two environment variables
  • METLO_DISABLE_BLOCKING : If provided a truthy value (true, 1, yes), then will disable request blocking by Metlo. Defaults to false.
  • METLO_ENABLE : If left unset or provided a truthy value (true, 1, yes), then will enable Metlo. Conversely, providing a value other than that listed above would disable Metlo. Defaults to true