Skip to main content
← All integrations
Slim profiler + performance monitoring

Profile Slim middleware, routes, and CLI workloads with lightweight performance monitoring

Perfbase gives Slim teams a pragmatic way to see request latency, route bottlenecks, and background work without turning a minimalist stack into a maintenance project.

Profile PSR-15 middleware stacks
Trace route-level latency
Profile cron scripts and CLI jobs

Why teams choose Perfbase for Slim

Slim 4 middleware and Slim 3 middleware support

CLI trace runner for non-HTTP work

User resolver hooks for attribution

S

Slim

Performance monitoring for Slim 3 and Slim 4 applications

Supported versions

Slim 3 and Slim 4

Quick install

composer require perfbase/slim

Starter config

use Perfbase\Slim\Slim4\PerfbaseMiddleware;

$app->add(new PerfbaseMiddleware([
  'enabled' => true,
  'api_key' => 'your-api-key',
]));

Use cases

Why teams use Perfbase for Slim

Perfbase is built for teams that need more than a local debug toolbar. It brings production-facing traces, framework-specific context, and shared visibility across the slow paths that matter most in Slim.

Keep Slim simple while gaining visibility

Add profiling without inflating a lean framework stack with custom observability plumbing.

Understand middleware cost clearly

See where authentication, routing, and downstream calls are adding latency in your request pipeline.

Cover HTTP and CLI paths together

Use the same profiling system for web traffic, cron scripts, workers, and command-line entrypoints.

Profiling coverage

What gets profiled and how Perfbase works in Slim

Perfbase stays framework-aware while keeping setup light. These are the behaviors and operational paths this integration is built to expose.

Slim 4 PSR-15 middleware

Standard PSR-15 middleware for Slim 4 applications.

Slim 3 middleware

Callable middleware support for Slim 3 applications.

CLI trace runner

Profile cron scripts, workers, and CLI commands with CliTraceRunner.

User ID resolver

Attach user identity with a callback-based resolver.

Route pattern naming

Low-cardinality span names are derived from Slim route patterns when available.

Include and exclude filters

Per-context filters for HTTP and CLI profiling.

FAQ

Slim profiler and performance monitoring FAQ

Does Perfbase support both Slim 3 and Slim 4?

Yes. Perfbase supports both Slim 3 and Slim 4 so teams can standardize profiling even across mixed or migrating applications.

Can I profile non-HTTP Slim entrypoints?

Yes. Perfbase includes a CLI trace runner so workers, cron scripts, and command-line tasks can be profiled alongside HTTP routes.

Is Perfbase a good fit for lightweight Slim apps?

Yes. The integration is designed to stay lightweight while still giving you flame graphs, query visibility, and route-level performance insights.

Start profiling

Ready to start profiling production traffic?

Create a project, install the package, and start capturing framework-level traces in minutes.