auxmoney / opentracing-bundle-php-http-httplug-bundle
Symfony Opentracing 扩展包,用于 php-http/HttplugBundle
v1.2.3
2023-05-02 12:58 UTC
Requires
- php: ^8.0
- auxmoney/opentracing-bundle-core: ^v1.0
- opentracing/opentracing: ^1.0.1
- php-http/httplug-bundle: ^1.20
Requires (Dev)
- mtdowling/jmespath.php: ^2.6
- nyholm/psr7: ^1.5
- php-coveralls/php-coveralls: ^2.5
- php-http/curl-client: ^2.2
- phpmd/phpmd: ^2.12
- phpspec/prophecy-phpunit: ^2.0
- phpstan/phpstan: ^1.5
- phpunit/phpunit: ^9.5
- roave/security-advisories: dev-latest
- squizlabs/php_codesniffer: ^3.6
- symfony/filesystem: *
- symfony/process: *
- symfony/yaml: *
README
此包为 php-http/httplug-bundle 客户端添加了对 php-http/httplug-bundle 和 OpentracingBundle 的自动头部注入。
安装
先决条件
此包仅作为插件,不应独立安装。在安装此包之前,请先查看 OpentracingBundle 和 HttplugBundle。
依赖关系
安装完 OpentracingBundle 和 HttplugBundle 后
composer req auxmoney/opentracing-bundle-php-http-httplug-bundle
启用包
如果您使用 Symfony Flex,则无需操作!
如果您没有使用它,则需要手动启用包
# Symfony 3: AppKernel.php $bundles[] = new Auxmoney\OpentracingHttplugBundle\OpentracingHttplugBundle();
# Symfony 4+: bundles.php Auxmoney\OpentracingHttplugBundle\OpentracingHttplugBundle::class => ['all' => true],
配置
无需配置,提供的编译器传递会装饰 PluginClientFactory
以将 OpentracingPlugin
(头部注入发生的地方)添加到所有现有的 Httplug 客户端。
使用
在向其他系统发送请求时,跟踪头部会自动注入到请求中,从而启用分布式跟踪的全部功能。
开发
在推送代码更改之前,请务必运行
composer run-script quality
该脚本运行的工具也会在 CI 管道中运行。