cusodede / yii2-opentracing
OpenTracing implementation
Installs: 53
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Type:yii2-extension
Requires
- php: >=8.0
- opentracing/opentracing: ^1.0.0
- yiisoft/yii2: ~2.0.0
- yiisoft/yii2-httpclient: ^2.0.0
Requires (Dev)
- codeception/codeception: ^4.1
- codeception/module-asserts: ^1.3
- codeception/module-filesystem: ^1.0
- codeception/module-phpbrowser: ^1.0.0
- codeception/module-rest: ^1.3.1
- codeception/module-yii2: dev-feature_disable_logger as 1.1.5
- phpunit/phpunit: ^9.5
- vlucas/phpdotenv: ^5.4.1
- yiisoft/yii2-bootstrap: ~2.0.10
- yiisoft/yii2-bootstrap4: ~2.0.10
This package is auto-updated.
Last update: 2024-10-29 09:49:23 UTC
README
OpenTracing support component
Установка
Добавляем
{
"type": "vcs",
"url": "https://github.com/cusodede/yii2-opentracing"
}
В секцию repositories
файла composer.json
, затем запускаем
php composer.phar require cusodede/yii2-opentracing "^1.0.0"
или добавляем
"cusodede/yii2-opentracing": "^1.0.0"
в секцию require
.
Подключение
$config = [ ... 'bootstrap' => ['log', 'opentracing'], //Обязательно добавляем в bootstrap ... 'components' => [ ... 'opentracing' => [ //Подключаем сам компонент 'class' => OpenTracingComponent::class, 'excludedRequestsPaths' => [ 'assets/*' ], 'handlers' => [//Указываем хендлеры логирования HttpClientEventsHandler::class ] ], 'log' => [ ... 'targets' => [ ... [//добавляем target для логирования событий категории opentracing, OpenTracingFileTarget позволяет гибче конфигурировать имя файла 'class' => OpenTracingFileTarget::class, 'categories' => ['opentracing'], 'logVars' => [], 'logFile' => fn():string => '@app/runtime/logs/ot-'.date('YmdH').'.log' ] ], ], ... ];
todo
Добавить Target для постинга Url - Лёша Галлямов предоставит отдельный сервис.