承接 opencodeco/hyperf-opentelemetry 相关项目开发

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

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

opencodeco/hyperf-opentelemetry

Composer 安装命令:

composer require opencodeco/hyperf-opentelemetry

包简介

OpenTelemetry instrumentation for Hyperf framework

README 文档

README

Status License PHP Hyperf OpenTelemetry

Instrumentation library for Hyperf applications with OpenTelemetry support.

This library enables instrumentation of Hyperf-based applications for exporting metrics, traces, and logs compatible with the OpenTelemetry standard.

✨ Features

  • 📦 Ready-to-use with Swoole and Coroutine
  • 📊 Custom metrics support via Meter
  • 📈 Trace instrumentation for:
    • HTTP requests (Hyperf\HttpServer)
    • Redis
    • Guzzle
    • SQL queries (Hyperf\Database)
    • MongoDB (GoTask)
  • ♻️ Integration with Swoole ContextStorage

📦 Installation

composer require opencodeco/hyperf-opentelemetry

⚙️ Configuration

  1. Publish the configuration file
php bin/hyperf.php vendor:publish opencodeco/hyperf-opentelemetry

Edit the file config/autoload/open-telemetry.php to adjust settings (enable/disable features, OTLP endpoints, resource attributes, etc).

  1. Configure environment variables

Example .env:

OTEL_TRACES_ENDPOINT=http://otelcol:4318/v1/traces
OTEL_METRICS_ENDPOINT=http://otelcol:4318/v1/metrics
  1. Add instrumentation middlewares

config/autoload/middlewares.php:

<?php

declare(strict_types=1);

use Hyperf\OpenTelemetry\Middleware\MetricMiddleware;
use Hyperf\OpenTelemetry\Middleware\TraceMiddleware;

return [
    'http' => [
        MetricMiddleware::class,
        TraceMiddleware::class,
    ],
];

👨‍💻 Development

Build the image

make build

Install dependencies

make install

Run tests

make test

🤝 Contributing

Please see CONTRIBUTING for details.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-09-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固