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

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

ivoglent/yii2-elastic-apm
=========================

Elastic Agent for Yii2 Framework

1.0.8(5y ago)212.6k6BSD-3-ClausePHPPHP &gt;=7.1.0

Since Mar 26Pushed 5y ago1 watchersCompare

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

READMEChangelogDependencies (2)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 --prefer-dist --profile -vvv ivoglent/yii2-elastic-apm

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

[](#configuration)

```
'apm' => [
    'class' => 'ivoglent\yii2\apm\Module',
    'configs' => [
        'agent' => [
            'serverUrl' => 'localhost:8200', //Host and port of APM server
            'name' => 'Service name', //Service name
            'token' => 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' => 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

```
$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

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 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

Every ~46 days

Total

5

Last Release

2053d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/648b0a3019094426579d72fcbcdc0d88b7398dbface60d53a25f73c6b0c2538c?d=identicon)[ivoglent](/maintainers/ivoglent)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[bedezign/yii2-audit

Yii2 Audit records and displays web/cli requests, database changes, php/js errors and associated data.

201657.4k4](/packages/bedezign-yii2-audit)[mito/yii2-sentry

Yii 2 extension for Sentry

92377.7k](/packages/mito-yii2-sentry)

PHPackages © 2026

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