luoxiaojun/yii2-zipkin

dev-master 2020-10-17 02:43 UTC

This package is auto-updated.

Last update: 2024-10-17 10:56:17 UTC


README

Build Status

Description

Zipkin in Yii2

Usage

  1. Add zipkin to components
    'zipkin' => [
       'class' => TracerAlias::class,
       'serviceName' => 'yii2',
       'endpointUrl' => 'http://127.0.0.1:9411/api/v2/spans',
       'sampleRate' => 1,
       'apiPrefix' => '/'
    ],
    
  2. Add zipkin sampler
    • For single controller
      //Add Lxj\Yii2\Zipkin\Filter to behaviors mathod.
      public function behaviors()
      {
          return [
              'zipkin' => [
                  'class' => Filter::class,
              ],
          ];
      }
      
    • For module
      //Define your module extended 'Lxj\Yii2\Zipkin\Module'
      class MyModule extends Lxj\Yii2\Zipkin\Module
      
  3. Demo is here.