okwind/tempo-telemetry-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

okwind/tempo-telemetry-bundle

最新稳定版本:2.0.0

Composer 安装命令:

composer require okwind/tempo-telemetry-bundle

包简介

Tempo Telemetry Symfony Bundle

README 文档

README

This bundle provides SQL query tracing for Doctrine DBAL 4.0+ using the middleware approach. It sends trace data to a Tempo instance for monitoring and analysis.

Installation

Install the bundle via Composer:

composer require okwind/tempo-telemetry-bundle

Configuration

1. Register the bundle in your application

For Symfony applications, add the bundle to your config/bundles.php:

return [
    // ...
    Okwind\TempoTelemetryBundle\TempoTelemetryBundle::class => ['all' => true],
];

2. Create a configuration file

Create a file at config/packages/tempo_telemetry.yaml with the following content:

tempo_telemetry:
    timeout: 1 # default value is 3
    service_name: 'my-service'
    tempo_url: 'http://yourtempo'

Parameters:

  • timeout: Connection timeout in seconds (default: 3)
  • service_name: Name of your service (required)
  • tempo_url: URL of your Tempo instance (required)

3. Register the SQLTracingMiddleware with Doctrine DBAL

Add the following to your services configuration (e.g., config/services.yaml):

services:
    # ...

    # For all environments
    Okwind\TempoTelemetryBundle\Telemetry\Tempo:
        public: true
        arguments:
            - '@logger'
            - '%Okwind.tempo_telemetry.service_name%'
            - '%Okwind.tempo_telemetry.tempo_url%'
            - '%Okwind.tempo_telemetry.timeout%'

    # Only in production environment (recommended)
    when@prod:
        services:
            # Register the middleware with Doctrine DBAL
            doctrine.dbal.middleware.sql_tracing:
                class: Okwind\TempoTelemetryBundle\Telemetry\SQLTracingMiddleware
                arguments:
                    - '@Okwind\TempoTelemetryBundle\Telemetry\Tempo'
                tags:
                    - { name: doctrine.middleware }

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-07-09