承接 kuiper/tracing-client 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kuiper/tracing-client

最新稳定版本:v0.8.2

Composer 安装命令:

composer require kuiper/tracing-client

包简介

Bindings for PHP OpenTracing API

README 文档

README

This is a client-side library that can be used to instrument PHP apps for distributed trace collection. See the OpenTracing PHP API for additional detail.

Installation

Tracing client can be installed via Composer:

composer require kuiper/tracing-client

Getting Started

Configuration:

<?php
return [
    'application' => [
        'tracing' => [
            'enabled' => env('TRACING_ENABLED') === 'true',
            'debug_id_header_key' => env('TRACING_DEBUG_ID_HEADER', 'tracing-debug-id'),
            'service_name' => env('TRACING_SERVICE_NAME'),
            'tags' => env('TRACING_TAGS'),
            'sampler' => [
                'type' => env('TRACING_SAMPLER_TYPE'),
                'param' => env('TRACING_SAMPLER_PARAM')
            ],
        ],
    ]
]

Samplers

List of supported samplers, for more info about samplers, please read Jaeger Sampling guide.

Const sampler

This sampler either samples everything, or nothing.

Configuration
'sampler' => [
    'type' => Jaeger\SAMPLER_TYPE_CONST,
    'param' => true, // boolean wheter to trace or not
],

Probabilistic sampler

This sampler samples request by given rate.

Configuration
'sampler' => [
    'type' => Jaeger\SAMPLER_TYPE_PROBABILISTIC,
    'param' => 0.5, // float [0.0, 1.0]
],

Rate limiting sampler

Samples maximum specified number of traces (requests) per second.

Requirements
  • psr/cache PSR-6 cache component to store and retrieve sampler state between requests. Cache component is passed to Jaeger\Config trough its constructor.
  • hrtime() function, that can retrieve time in nanoseconds. You need either php 7.3 or PECL/hrtime extension.
Configuration
'sampler' => [
    'type' => Jaeger\SAMPLER_TYPE_RATE_LIMITING,
    'param' => 100 // integer maximum number of traces per second,
    'cache' => [
        'currentBalanceKey' => 'rate.currentBalance' // string
        'lastTickKey' => 'rate.lastTick' // string
    ]
],

Testing

Tests are located in the tests directory. See tests/README.md.

Roadmap

License

MIT License.

统计信息

  • 总下载量: 1.46k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-03-06