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

ActiveModule

irfankurniawan/yii2-elastic-apm
===============================

Elastic Agent for Yii2 Framework

1.0.4(5y ago)0337BSD-3-ClausePHPPHP &gt;=7.1.0

Since Sep 15Pushed 2y agoCompare

[ Source](https://github.com/irfan-kurniawan-umn/yii2-elastic-apm)[ Packagist](https://packagist.org/packages/irfankurniawan/yii2-elastic-apm)[ RSS](/packages/irfankurniawan-yii2-elastic-apm/feed)WikiDiscussions master Synced 1mo ago

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

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

[](#yii2-elastic-apm)

Elastic Agent for Yii2 Framework

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

[](#installation)

Let install this module via composer

```
composer require irfankurniawan/yii2-elastic-apm

```

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

[](#configuration)

```
'apm' => [
    'class' => 'ivoglent\yii2\apm\Module',
    'configs' => [
        'agent' => [
            'serverUrl' => env('APM_SERVER_URL'), // 'localhost:8200', // Host and port of APM server
            'name' => env('APM_SERVICE_NAME'), //'Service name', // Service name
            'token' => env('APM_TOKEN'), // Token
        ],
        'skipExceptions' => [
            // List of exceptions which you want to ignore
            // \yii\web\NotFoundHttpException::class,
            // \yii\web\UnauthorizedHttpException::class,
        ],
        'skipCommands' => [
            // List of command you dont want to track
            // 'rabbitmq/consume',
        ],
    ],
    'enabled' => env('APM_ENABLED') // true // or false,
],

```

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. Below is the example to see apm transaction

```
try {
    $transactionId = Uuid::uuid4()->toString();
    $test1 = Yii::$app->getModule('apm')->getAgent()->startTransaction('testet nihhh abwueaue', 'consumer', 222222);
    $test2 = Yii::$app->getModule('apm')->getAgent()->setTransactionId($transactionId);
    $test3 = Yii::$app->getModule('apm')->getAgent()->stopTransaction();
    dd($test1,  $test3);

} catch (\Exception $throwable) {
    $test = Yii::$app->getModule('apm')->getAgent()->notifyException($throwable);
    dd($test);
}

```

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->getModule('apm')->getAgent()->notifyException($throwable);
}

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63.2% 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 ~13 days

Total

5

Last Release

2186d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cafcd2af8d16327af66de4b836df14c41fdf2cc774a4a5c8d11b945427836a40?d=identicon)[irfan-kurniawan-umn](/maintainers/irfan-kurniawan-umn)

---

Top Contributors

[![ivoglent](https://avatars.githubusercontent.com/u/4499973?v=4)](https://github.com/ivoglent "ivoglent (12 commits)")[![irfan-kurniawan-umn](https://avatars.githubusercontent.com/u/122420815?v=4)](https://github.com/irfan-kurniawan-umn "irfan-kurniawan-umn (4 commits)")[![FireDemonsu](https://avatars.githubusercontent.com/u/4716299?v=4)](https://github.com/FireDemonsu "FireDemonsu (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)

PHPackages © 2026

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