mix monitorex.install (monitorex v0.8.0)

Copy Markdown

Installs Monitorex into a Phoenix application.

This task is run automatically when you add Monitorex with mix igniter.install monitorex.

It detects from the host application's AST:

  • which sources to enable (:tesla, :finch and/or :req, based on the dep tree)
  • whether dedup is needed (a config :tesla, adapter: {Tesla.Adapter.Finch, _} sets clients: [:tesla, :finch])
  • whether an existing scope "/api" in the router makes the built-in REST API redundant (it is disabled with api_path: false either way)
  • where to mount (a --path option, defaulting to /monitoring, warned about when it collides with an existing scope)
  • whether :req_telemetry should be added (:req present but :req_telemetry absent)

The mount uses a dedicated :monitoring pipeline — deliberately not your :browser pipeline. :browser includes protect_from_forgery, which rejects the cross-origin app.js asset request with a 403; the :monitoring pipeline omits it (see the installation guide).

Options

  • --path - the path to mount the dashboard at (default: /monitoring)
  • --yes - automatically answer yes to all prompts