PHPackages                             websupport/yii-opentracing - 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. websupport/yii-opentracing

ActiveYii-extension[Logging &amp; Monitoring](/categories/logging)

websupport/yii-opentracing
==========================

OpenTracing component for Yii

0.4.0(5y ago)319.2k↓40.6%1BSD-3-ClausePHPPHP &gt;=7.2

Since Feb 14Pushed 5y ago10 watchersCompare

[ Source](https://github.com/websupport-sk/yii-opentracing)[ Packagist](https://packagist.org/packages/websupport/yii-opentracing)[ RSS](/packages/websupport-yii-opentracing/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (6)Versions (9)Used By (0)

[![Code Climate coverage](https://camo.githubusercontent.com/fb947ec1a67b9bff3515bda9716befca0fe19b380bb1e316401b804efd56f2c1/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f636f7665726167652f776562737570706f72742d736b2f7969692d6f70656e74726163696e672e737667)](https://codeclimate.com/github/websupport-sk/yii-opentracing)[![Code Climate maintainability](https://camo.githubusercontent.com/f78039d7e8e27f227c61683c96deb33027c9ba68135ba2c37adbf6633d799a0b/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636c696d6174652f6d61696e7461696e6162696c6974792f776562737570706f72742d736b2f7969692d6f70656e74726163696e672e737667)](https://codeclimate.com/github/websupport-sk/yii-opentracing)[![Travis](https://camo.githubusercontent.com/60ab60395a20a603beadd6d97e0f9fa3081120f17e25abf23cd13372d84611a4/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f636f6d2f776562737570706f72742d736b2f7969692d6f70656e74726163696e672e737667)](https://travis-ci.com/websupport-sk/yii-opentracing)

Yii OpenTracing extension
=========================

[](#yii-opentracing-extension)

OpenTracing extension for Yii 1

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

[](#installation)

Install Yii extension with composer

```
composer require websupport/yii-opentracing
```

Install client library (depends on your tracing system)

```
composer require jonahgeorge/jaeger-client-php
```

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

[](#configuration)

Default (NoopTracer) configuration without client library

```
    # opentracing component must be preloaded
    'preload' => ['opentracing'],
    ...
    'components' => [
        'opentracing' => [
            'class' => \Websupport\OpenTracing\OpenTracing::class,
        ],
    ],
```

Jaeger client configuration

```
    # opentracing component must be preloaded
    'preload' => ['opentracing'],
    ...
    'components' => [
        'opentracing' => [
            'class' => \Websupport\OpenTracing\JaegerOpenTracing::class,
            'agentHost' => 'localhost',
            'agentPort' => 5775,
            'sampler' => [
                'type' => \Jaeger\SAMPLER_TYPE_CONST,
                'param' => true,
            ],
            'traceIdHeader' => 'x-trace-id',
            'baggageHeaderPrefix' => 'x-ctx-trace-',
        ],
    ],
```

### OpenTracing in `CActiveRecord`

[](#opentracing-in-cactiverecord)

OpenTracing can be enabled in `CActiveRecord` using `behaviors`.

```
