pccomponentes/apm-guzzle
最新稳定版本:0.1.3
Composer 安装命令:
composer require pccomponentes/apm-guzzle
包简介
Elastic APM for Guzzle
README 文档
README
This library supports Span traces of HTTP calls and distributed traces with Guzzle.
Installation
-
Install via composer
composer require pccomponentes/apm-guzzle
Usage
In all cases, an already created instance of ElasticApmTracer is assumed.
Native PHP
<?php declare(strict_types=1); $apmMiddleware = PcComponentes\ElasticAPM\GuzzleHttp\ElasticApmMiddleware::trace( $apmTracer, /** \ZoiloMora\ElasticAPM\ElasticApmTracer instance. */ ); $handler = GuzzleHttp\HandlerStack::create(); $handler->push($apmMiddleware); $config = [ 'handler' => $handler, ]; $client = new GuzzleHttp\Client($config);
Service Container (Symfony)
http.client: class: GuzzleHttp\Client arguments: $config: handler: '@guzzle.handler' guzzle.handler: class: GuzzleHttp\HandlerStack factory: 'GuzzleHttp\HandlerStack::create' calls: - method: push arguments: ['@guzzle.middleware.apm', 'trace'] guzzle.middleware.apm: class: Closure factory: 'PcComponentes\ElasticAPM\GuzzleHttp\ElasticApmMiddleware::trace' arguments: $elasticApmTracer: '@apm.tracer' # \ZoiloMora\ElasticAPM\ElasticApmTracer instance.
License
Licensed under the MIT license
Read LICENSE for more information
统计信息
- 总下载量: 13.56k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-05-28