PHPackages                             alishojaeiir/yii2-elastic-apm - 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. alishojaeiir/yii2-elastic-apm

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

alishojaeiir/yii2-elastic-apm
=============================

Elastic Agent for Yii2 Framework

1.1.2(1mo ago)04BSD-3-ClausePHPPHP &gt;=7.1.0

Since Nov 30Pushed 1mo agoCompare

[ Source](https://github.com/alishojaeiir/yii2-elastic-apm)[ Packagist](https://packagist.org/packages/alishojaeiir/yii2-elastic-apm)[ RSS](/packages/alishojaeiir-yii2-elastic-apm/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (4)Dependencies (4)Versions (5)Used By (0)

yii2-elastic-apm
================

[](#yii2-elastic-apm)

Elastic Agent for Yii2 Framework

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

[](#installation)

Let install this module via composer

composer require --prefer-dist --profile -vvv alishojaeiir/yii2-elastic-apm

Configuration
-------------

[](#configuration)

```
'apm' => [
    'class' => 'ivoglent\yii2\apm\Module',
    'configs' => [
        'agent' => [
            'serverUrl' => 'localhost:8200',
            'name' => 'Service name',
            'token' => APM_TOKEN,
            'environment' => 'production',
        ],
        // top-level, sibling of 'agent' — NOT nested inside it
        'client_setting' => [
            'timeout' => 1,          // total request timeout, seconds
            'connect_timeout' => 1,  // TCP connect timeout, seconds
        ],
        'skipExceptions' => [ /* ... */ ],
        'skipCommands' => [ /* ... */ ],
    ],
    'enabled' => true,
],

```

To enable database monitoring, let config the DB command like :

```
'components' => [
    'db' => [
        'class' => 'yii\db\Connection',
        'dsn' => '',
        'username' => '',
        'password' => '',
        'charset' => 'utf8mb4',
        'commandClass' => APM_ENABLED ? 'ivoglent\yii2\apm\components\db\mysql\Command' : '\yii\db\Command',
    ]
]

```

NOTE Rememeber add apm module to bootstrap section:

```
'bootstrap' => ['log', 'apm'],

```

Transaction
-----------

[](#transaction)

This module will auto start new transaction after BEFORE\_REQUEDT event. But you can manual start new transaction on Console application like consumer ..etc

```
$transactionId = Uuid::uuid4()->toString();
$txtName = sprintf('consumer.%s', str_replace('-', '.', $queue->getName()));
Yii::$app->getModule('apm')->getAgent()->startTransaction($txtName, 'consumer', App::$app->getRequestId());
Yii::$app->getModule('apm')->getAgent()->setTransactionId($transactionId);

```

and stop

```
Yii::$app->getModule('apm')->getAgent()->stopTransaction();

```

Trace
-----

[](#trace)

Start new span

```
$span = Yii::$app->getModule('apm')->getAgent()->startTrace('Process::'.$reflect->getShortName(), 'process');

```

and stop :

```
Yii::$app->getModule('apm')->getAgent()->stopTrace($span->getId());

```

Error / exception notify
------------------------

[](#error--exception-notify)

try {

} catch (\\Exception $throwable) { Yii::$app-&gt;getModule('apm')-&gt;getAgent()-&gt;notifyException($throwable); }

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance94

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 70.4% 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

Every ~198 days

Total

4

Last Release

31d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cc76f616799ce3dc993be09bd9e84d6920b1f2684c2af7aa2fff652ede8ab37c?d=identicon)[m\_a\_sh](/maintainers/m_a_sh)

---

Top Contributors

[![ivoglent](https://avatars.githubusercontent.com/u/4499973?v=4)](https://github.com/ivoglent "ivoglent (19 commits)")[![alishojaeiir](https://avatars.githubusercontent.com/u/25051128?v=4)](https://github.com/alishojaeiir "alishojaeiir (8 commits)")

### Embed Badge

![Health badge](/badges/alishojaeiir-yii2-elastic-apm/health.svg)

```
[![Health](https://phpackages.com/badges/alishojaeiir-yii2-elastic-apm/health.svg)](https://phpackages.com/packages/alishojaeiir-yii2-elastic-apm)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.7M3.4k](/packages/craftcms-cms)[skeeks/cms

SkeekS CMS — control panel and tools based on php framework Yii2

13926.0k66](/packages/skeeks-cms)[lav45/yii2-activity-logger

Tools to store user activity log for Yii2

3463.4k](/packages/lav45-yii2-activity-logger)[yii2mod/yii2-cron-log

Component for logging cron jobs

2228.7k1](/packages/yii2mod-yii2-cron-log)

PHPackages © 2026

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