auxmoney / opentracing-bundle-php-http-httplug-bundle

Symfony Opentracing 扩展包,用于 php-http/HttplugBundle

This package is auto-updated.

Last update: 2024-08-31 00:25:58 UTC


README

test GitHub release (latest SemVer) Codacy Badge Code Climate maintainability Scrutinizer code quality (GitHub/Bitbucket) GitHub

此包为 php-http/httplug-bundle 客户端添加了对 php-http/httplug-bundleOpentracingBundle 的自动头部注入。

安装

先决条件

此包仅作为插件,不应独立安装。在安装此包之前,请先查看 OpentracingBundleHttplugBundle

依赖关系

安装完 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 管道中运行。