pccomponentes/apm-mongodb

Elastic APM for MongoDB

0.1.3 2020-07-15 11:00 UTC

This package is auto-updated.

Last update: 2024-12-15 20:36:30 UTC


README

This library supports Span traces of command using MongoDB.

Installation

  1. Install via composer

    composer require pccomponentes/apm-mongodb

Usage

In all cases, an already created instance of ElasticApmTracer is assumed.

Native PHP

<?php
declare(strict_types=1);

use function MongoDB\Driver\Monitoring\addSubscriber;

$commandSubscriber = new PcComponentes\ElasticAPM\MongoDB\Driver\Monitoring\CommandSubscriber(
    $apmTracer, /** \ZoiloMora\ElasticAPM\ElasticApmTracer instance. */
);

addSubscriber($commandSubscriber);

License

Licensed under the MIT license

Read LICENSE for more information