承接 macpaw/symfony-otel-bundle 相关项目开发

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

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

macpaw/symfony-otel-bundle

最新稳定版本:1.0

Composer 安装命令:

composer require macpaw/symfony-otel-bundle

包简介

README 文档

README

A comprehensive OpenTelemetry integration bundle for Symfony applications that provides automatic instrumentation, custom span creation, and distributed tracing capabilities.

Features

  • Automatic Instrumentation - Built-in instrumentations for HTTP requests, database operations, and more
  • Custom Instrumentations - Easy-to-use framework for creating custom instrumentations
  • Middleware System - Extensible middleware system for span customization
  • Exception Handling - Automatic span cleanup and error recording
  • Docker Support - Complete development environment with Tempo and Grafana
  • Performance Optimized - Support for both HTTP and gRPC transport protocols
  • OpenTelemetry Compliant - Follows OpenTelemetry specifications and semantic conventions

Quick Overview

This bundle provides a configured OpenTelemetry integration for Symfony applications, offering:

  • Automatic telemetry collection via kernel event listeners
  • Custom instrumentation framework for business logic
  • Built-in support for distributed tracing
  • Complete testing and development environment

Bundle Overview

This bundle is a wrapper around the official OpenTelemetry PHP SDK bundle that simplifies integration and provides additional instrumentation capabilities for Symfony applications.

Key characteristics:

  • Transport-agnostic - Uses standard OpenTelemetry SDK environment variables for transport configuration
  • Framework-focused - Provides Symfony-specific instrumentation and middleware
  • Extensible - Easy to add custom instrumentations and span processors

Built-in Features

  • Request Execution Time Tracking - Automatic HTTP request timing
  • Exception Handling - Automatic span cleanup and error recording
  • Custom Instrumentations - Framework for creating custom telemetry collection

For detailed instrumentation guide, see Instrumentation Guide.

Environment Variables

The bundle supports all standard OpenTelemetry SDK environment variables. For complete configuration reference, see Configuration Guide.

Essential variables:

  • OTEL_SERVICE_NAME - Your service name
  • OTEL_TRACER_NAME - Tracer name
  • OTEL_EXPORTER_OTLP_ENDPOINT - Collector endpoint
  • OTEL_EXPORTER_OTLP_PROTOCOL - Transport protocol (grpc/http/protobuf)

Transport Configuration

Important: This bundle is transport-agnostic - it doesn't handle transport configuration directly. All transport settings are managed through standard OpenTelemetry SDK environment variables.

Recommended for production:

# Install gRPC support
composer require open-telemetry/transport-grpc
pecl install grpc # may take a time to compile - 30-40 minutes

# Configure gRPC endpoint
OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4317
OTEL_EXPORTER_OTLP_PROTOCOL=grpc

Default HTTP endpoint: http://collector:4318

Transport protocols supported:

  • grpc - High performance, recommended for production
  • http/protobuf - Standard HTTP with protobuf encoding
  • http/json - HTTP with JSON encoding (slower)

Note: Our bundle supports all transport protocols supported by the OpenTelemetry PHP SDK since we don't decorate the transport layer. For complete transport configuration options, see the official OpenTelemetry PHP Exporters documentation.

For detailed Docker setup and development environment configuration, see Docker Development Guide.

Documentation

Quick Start

  1. Install the bundle:

    composer require macpaw/symfony-otel-bundle
  2. Enable in your application:

    // config/bundles.php
    return [
        Macpaw\SymfonyOtelBundle\SymfonyOtelBundle::class => ['all' => true],
    ];
  3. Configure environment variables:

    OTEL_SERVICE_NAME=your-service-name
    OTEL_TRACER_NAME=your-tracer-name
    OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
  4. Start testing:

    make up
    open http://localhost:8080

Usage

For detailed usage instructions, see Testing Guide.

统计信息

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

GitHub 信息

  • Stars: 9
  • Watchers: 12
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-07-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固