Plug Performance Monitoring

Errors, logs, and traces for your Plug and Plug.Router applications. Scout's Elixir agent instruments Plug pipelines automatically via telemetry. Works with standalone Plug apps and any framework built on top of Plug, including Phoenix.

Errors, Logs, and Traces

Errors, Logs, and Traces for Plug Applications

Scout connects Plug request exceptions to the full transaction trace and surrounding log lines in a single view. When a plug raises an exception, you see the error, the trace with per-operation timing through each plug in the pipeline, and the log context together.

Plug Trace Timeline
Error Monitoring

Automatic exception capture across Plug pipelines and Plug.Router endpoints. Errors are linked to the originating trace with request context.

Log Management

Log output is enriched with trace context. Filter logs by trace ID to see exactly what happened during a specific Plug request, including any Ecto queries and HTTP calls made downstream.

App Traces

Transaction tracing with visibility into each plug in your pipeline, Ecto queries, and external HTTP calls. Detailed backtraces show the exact location of slow or failing code.

Query Analysis

Ecto Query Visibility in Plug Apps

Scout instruments Ecto queries within Plug request handling via telemetry. Every query appears in the request trace with timing, and N+1 patterns are identified automatically with the code location and performance impact.

Plug N+1 Detection
Auto-Instrumentation

Telemetry-Based Plug Instrumentation

Scout's Elixir agent 2.0 instruments Plug via telemetry events. Request start, stop, and exception events are captured automatically. Ecto queries, Finch, Req, and Tesla HTTP calls made within Plug handlers are all included in the transaction trace.

Plug Auto-Instrumentation
Supported Frameworks

Works with the Plug frameworks you already use

Scout auto-instruments the frameworks and libraries in your stack. No manual configuration required.

Web Framework

  • Plug
  • Plug.Router
  • Phoenix

Database

  • Ecto

HTTP Clients

  • Finch
  • Req
  • Tesla
Memory Profiling

Memory Bloat Detection for Plug

Plug applications can accumulate memory over time, especially in long-running processes handling large request bodies. Scout detects memory bloat at the transaction level, showing which endpoints and code paths are responsible for memory growth.

Plug Memory Bloat Detection
AI Native

Query Your Plug App Data from AI Assistants and the Terminal

Scout offers hosted and local MCP servers with 17 tools, a Go CLI via Homebrew with TOON format, and a public API. Query your Plug application's errors, traces, and performance data from Claude Code, Cursor, or the terminal.

AI Native Monitoring
MCP Server

Hosted or local MCP server with 17 tools covering apps, endpoints, traces, errors, insights, background jobs, and usage data. Works with Claude Code, Cursor, VS Code Copilot, and any MCP-enabled assistant.

Scout CLI

Go binary available via Homebrew. Query app metrics, endpoint performance, traces, error groups, and insights from the terminal. Outputs human-friendly tables or TOON format for LLM consumption.

Public API

Full programmatic access to your monitoring data for building custom integrations, dashboards, or automation workflows.

Get Started in Minutes

Add Scout to Your Plug App

Get Scout running on your Plug app in under 3 minutes.

1

Add to your mix.exs:

{:scout_apm, "~> 2.0"}
2

Download your customized config to config/scout_apm.exs.

3

Add instrumentation to your application and deploy.

FAQ

Plug Monitoring FAQ

What is the best monitoring tool for Plug apps?

Scout Monitoring instruments Plug pipelines and Plug.Router endpoints automatically via telemetry. Every request appears as a transaction with per-plug timing, Ecto query tracking, error capture, and log context. Works with standalone Plug apps and any framework built on Plug.

Does Scout work with Plug.Router?

Yes. Scout instruments Plug at the telemetry level, so it works with Plug.Router, Phoenix, and any other framework built on top of Plug. Each endpoint appears as a transaction in Scout with timing for every plug in the pipeline.

How does Scout instrument Plug without code changes?

Scout's Elixir agent 2.0 attaches to Plug's telemetry events at startup. No changes to your plug modules, routers, or pipelines are required. You add the dependency, configure your Scout key, and deploy.

Does Scout support Ecto queries in Plug apps?

Yes. Ecto queries made within Plug request handlers are captured automatically and appear in the request trace with individual timing. N+1 patterns are identified with the code location and performance impact.

Does Scout support error monitoring for Plug?

Yes. Exceptions raised within Plug pipelines are captured automatically via telemetry. Each error is linked to the request trace and shown alongside the surrounding log context.

Ready to Optimize Your App?

Join engineering teams who trust Scout Monitoring for hassle-free performance monitoring. With our 3-step setup, powerful tooling, and responsive support, you can quickly identify and fix performance issues before they impact your users.

Start Monitoring for Free