PHPackages                             palzin-apm/palzin-slim - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. palzin-apm/palzin-slim

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

palzin-apm/palzin-slim
======================

Real-Time monitoring Slim package using Palzin Monitor (APM).

23.03.22(2y ago)013MITPHPPHP &gt;=7.2

Since Jun 12Pushed 2y agoCompare

[ Source](https://github.com/palzin-apm/palzin-slim)[ Packagist](https://packagist.org/packages/palzin-apm/palzin-slim)[ RSS](/packages/palzin-apm-palzin-slim/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Real-Time monitoring package using Palzin Monitor
=================================================

[](#real-time-monitoring-package-using-palzin-monitor)

[![Latest Stable Version](https://camo.githubusercontent.com/7fd9095d807ce54305beedae19edd04a55060a8dc870aeb45af46aa4d6cfa8f4/687474703a2f2f706f7365722e707567782e6f72672f70616c7a696e2d61706d2f70616c7a696e2d736c696d2f763f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/palzin-apm/palzin-slim) [![Total Downloads](https://camo.githubusercontent.com/447173620f991d72243b511e1c7e6f5aa708f511a693513e9d0af0462d88016b/687474703a2f2f706f7365722e707567782e6f72672f70616c7a696e2d61706d2f70616c7a696e2d736c696d2f646f776e6c6f6164733f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/palzin-apm/palzin-slim) [![License](https://camo.githubusercontent.com/332a445f791524f5f4f8b6da164e77ec0f3263fb4633e21800c2e7127fdda81e/687474703a2f2f706f7365722e707567782e6f72672f70616c7a696e2d61706d2f70616c7a696e2d736c696d2f6c6963656e73653f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/palzin-apm/palzin-slim)

Palzin Monitor offers a comprehensive real-time monitoring platform that allows you to monitor and analyze the performance of your applications. With Palzin Monitor Slim Package, you can effortlessly capture and track all requests without making any code modifications. This feature provides valuable insights into the impact of your methods, database statements, and external requests on the overall user experience.

This package is specifically designed for applications built on the Slim framework.

Requirements
------------

[](#requirements)

- PHP &gt;= 7.2.0
- Slim &gt;= 4.x

Installation
------------

[](#installation)

To install the latest version, use the following composer command:

```
composer require palzin-apm/palzin-slim

```

### Register On Container

[](#register-on-container)

You need to register the Palzin Monitor (APM) instance inside the application container to make the monitoring agent available within your application. Here's an example of how to register the Palzin Monitor instance:

```
$container->set('palzin', function () {
    $configuration = new \Palzin\Slim\Configuration('PALZIN_APM_INGESTION_KEY');
    $configuration->setUrl('YOUR URL');
    return new Palzin($configuration);
});
```

Consider using [environment variables](https://github.com/vlucas/phpdotenv) to store your project's INGESTION KEY. If you are using a Slim 4 skeleton, you can add a new container definition in the `app/dependencies.php` file.

```
use DI\ContainerBuilder;
use Psr\Container\ContainerInterface;

return function (ContainerBuilder $containerBuilder) {
    $containerBuilder->addDefinitions([
        // Other service definitions...

        'palzin' => function (ContainerInterface $container) {
            $configuration = new \Palzin\Slim\Configuration('PALZIN_APM_INGESTION_KEY');
            $configuration->setUrl('YOUR URL');
            return new Palzin\Palzin($configuration);
        }
    ]);
}
```

You can obtain the `PALZIN_APM_INGESTION_KEY` and `PALZIN_APM_URL` by creating a new project in your [Palzin](https://palzin.app) account.

Middleware
----------

[](#middleware)

To attach the middleware, you can either attach it globally or to specific routes. Here are examples of both:

Attach globally:

```
$app->add(\Palzin\Slim\WebRequestMonitoring::class);
```

Attach to specific routes:

```
$app->get('/', function () {
    // Your code here...
})->add(\Palzin\Slim\WebRequestMonitoring::class);
```

Test
----

[](#test)

To verify that everything is working correctly, create a test route and open it in the browser . Here's an example of a test route:

```
$app->get('/test', function () {
    throw new \Exception('My First Exception.');
})->add(\Palzin\Slim\WebRequestMonitoring::class);
```

Add Segment
-----------

[](#add-segment)

You can add segments to the

transaction's timeline from route functions. Here's an example of how to add a segment:

```
$app->get('/', function (Request $request, Response $response) {
    $this->get('palzin')->addSegment(function () {
        // Your code here...
        sleep(1);
    }, 'sleep');

    return $response;
});
```

If your routes are organized using controllers, you need to inject the container into the controller constructor. Here's an example:

```
namespace App\Controllers;

use Psr\Container\ContainerInterface;
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;

class TestController
{
    protected $container;

    /**
     * Inject the container to retrieve the palzin instance later.
     */
    public function __construct(ContainerInterface $container)
    {
        $this->container = $container;
    }

    public function __invoke(Request $request, Response $response)
    {
        $this->container->get('palzin')->addSegment(function () {
            // Your code here...
            sleep(1);
        }, 'sleep');

        $response->getBody()->write('Test route.');

        return $response;
    }
}
```

Official Documentation
----------------------

[](#official-documentation)

For more detailed information, please refer to the [official documentation](https://palzin.app/guides/slim-introduction).

License
-------

[](#license)

This package is licensed under the [MIT](LICENSE) license.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1065d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8a264dfc5a2c34c13cc7acf7c4b609c96848416e847de577e6ebe9b392e9d465?d=identicon)[palzin](/maintainers/palzin)

---

Top Contributors

[![palzin](https://avatars.githubusercontent.com/u/116488348?v=4)](https://github.com/palzin "palzin (1 commits)")

---

Tags

phpmonitoringslimpalzin

### Embed Badge

![Health badge](/badges/palzin-apm-palzin-slim/health.svg)

```
[![Health](https://phpackages.com/badges/palzin-apm-palzin-slim/health.svg)](https://phpackages.com/packages/palzin-apm-palzin-slim)
```

###  Alternatives

[ptrofimov/beanstalk_console

Admin console for Beanstalk queue server

1.3k124.7k](/packages/ptrofimov-beanstalk-console)[inspector-apm/inspector-php

Inspector monitoring for PHP applications.

342.4M15](/packages/inspector-apm-inspector-php)[bacula-web/bacula-web

The open source web based reporting and monitoring tool for Bacula

1537.5k](/packages/bacula-web-bacula-web)[inspector-apm/inspector-symfony

Code Execution Monitoring for Symfony applications.

2830.1k2](/packages/inspector-apm-inspector-symfony)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
