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 application-owned CLI work

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

HTTP middleware and manual CLI profiling for Slim 3 and Slim 4 applications

Supported versions

Slim 3-4 / PHP 7.4-8.5

Quick install

composer require perfbase/slim:^1.0

Starter config

use Perfbase\Slim\Slim4\PerfbaseMiddleware;

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

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 and manually wrapped 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 application-owned scripts and CLI commands with CliTraceRunner.

User ID resolver

Attach user identity with a callback-based resolver.

Route pattern attributes

Route patterns are stored in low-cardinality action attributes 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 manual CLI trace runner for application-owned scripts and command-line tasks. It does not include automatic queue, scheduler, or async runtime instrumentation in v1.

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.