Search by

inspector-apm / cakephp

valerione

Code Execution Monitoring for CakePHP applications, powered by Inspector.

Package info

github.com/inspector-apm/cakephp

Homepage

Issues

Documentation

Type:cakephp-plugin

pkg:composer/inspector-apm/cakephp

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

1.0.0 2026-09-19 19:00 UTC

This package is auto-updated.

Last update: 2026-09-19 19:02:14 UTC


README

Total Downloads Latest Stable Version License

Before moving on, please consider giving us a GitHub star ⭐️. Thank you!

Code Execution Monitoring for CakePHP applications.

Requirements

  • PHP >= 8.2
  • CakePHP >= 5.3

Install

Install the latest version by:

composer require inspector-apm/cakephp

Configure the Ingestion Key

First put the Ingestion Key in your environment file:

INSPECTOR_INGESTION_KEY=[ingestion key]

You can obtain an INSPECTOR_INGESTION_KEY creating a new project in your Inspector account.

Enable the plugin

Load the plugin in your src/Application.php bootstrap:

public function bootstrap(): void
{
    parent::bootstrap();

    // ...
    $this->addPlugin('Inspector/Cakephp');
}

That is all. Monitoring middleware, console listeners and the reliability monitors are attached automatically. Without an ingestion key the plugin is a safe no-op, so the addPlugin() call can be committed unconditionally.

What is monitored

  • HTTP requests — one transaction per request, with request/response context, masked parameters, the authenticated user, and errors.
  • Console commandsbin/cake ... executions as command transactions.
  • Database queriesdb.{connection} segments with SQL and (masked) bindings.
  • Cache operationscache.* segments.
  • View rendering — a view segment per rendered template.
  • HTTP client — a segment per outbound request.
  • Queue jobs — one job transaction per processed job (with cakephp/queue).
  • Logs and exceptions — application log messages as transaction context, and unhandled exceptions reported automatically.

Test everything is working

Run the command below:

bin/cake inspector test

Go to https://app.inspector.dev to explore your data.

Configuration

Every setting is optional and can be provided through environment variables (resolved by the bundled defaults) or an application override file at config/app_inspector.php:

<?php
return [
    'Inspector' => [
        'ignore_url' => ['health*'],
        'hidden_parameters' => ['password', 'api_token'],
        'cache' => false,
    ],
];

Frequently used environment variables:

Variable Default Purpose
INSPECTOR_INGESTION_KEY (none) Ingestion key. Activates the agent when set.
INSPECTOR_API_KEY (none) Legacy alias for the ingestion key.
INSPECTOR_ENABLE true Force-disable (false) even with a key present.
INSPECTOR_URL https://ingest.inspector.dev Ingestion endpoint (self-hosted).
INSPECTOR_TRANSPORT async async (non-blocking) or sync.
INSPECTOR_MAX_ITEMS 100 Max items recorded per execution cycle.
INSPECTOR_COMMANDS true Monitor console commands.
INSPECTOR_QUERY true Record database queries as segments.
INSPECTOR_QUERY_BINDINGS true Include (masked) query bindings.
INSPECTOR_CACHE true Record cache operations.
INSPECTOR_VIEWS true Record view rendering.
INSPECTOR_HTTP_CLIENT true Record outbound HTTP client requests.
INSPECTOR_HTTP_CLIENT_BODY false Include outbound request/response bodies.
INSPECTOR_JOBS true Monitor cakephp/queue jobs.
INSPECTOR_JOB_DATA true Include the job payload in the transaction.
INSPECTOR_LOGS true Capture application log messages.
INSPECTOR_UNHANDLED_EXCEPTIONS true Report unhandled exceptions.
INSPECTOR_USER true Attach the authenticated user to transactions.
INSPECTOR_RESPONSE_BODY false Include the response body in request context.

List settings (ignore_url, ignore_commands, ignore_jobs, hidden_parameters) and the remaining options are configured through config/app_inspector.php, where list values are appended to the shipped defaults rather than replacing them.

Note: the plugin defaults load after config/app_local.php, so put Inspector overrides in config/app_inspector.php (not app_local.php).

Agentic Integration

You can connect the Inspector library documentation to your coding assistant as a Model Context Protocol (MCP) server.

It makes it easy for tools like Claude Code, Cursor, and VS Code extensions reliably understand what Inspector client library can do, its configurations, how to use it.

AI Assisted Integration

Official documentation

Check out the official documentation

Contributing

We encourage you to contribute to Inspector! Please check out the Contribution Guidelines about how to proceed. Join us!

LICENSE

This package is licensed under the MIT license.