定制 waffle-commons/telemetry-otel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

waffle-commons/telemetry-otel

Composer 安装命令:

composer require waffle-commons/telemetry-otel

包简介

OpenTelemetry SDK bridge for Waffle Commons: implements the framework TracerInterface with W3C trace-context propagation, keeping the OTel SDK out of the core perimeter.

README 文档

README

Discord PHP Version Require PHP CI codecov Latest Stable Version Packagist License

Waffle Commons — Telemetry (OpenTelemetry Bridge)

OpenTelemetry SDK bridge for the Waffle Commons framework. It implements Waffle\Commons\Contracts\Telemetry\TracerInterface on top of the audited OpenTelemetry PHP SDK and propagates W3C Trace Context on outbound HTTP calls — isolating the vendor SDK in this adapter so the core packages stay vendor-free.

Status: shipped in Beta 5 / AXE 5 (RFC-005). The SDK-free defaults, the Prometheus endpoint and the metric collectors live in waffle-commons/telemetry.

What's inside

  • Tracer adaptersTrace\OtelTracer, Trace\OtelSpan and Trace\OtelSpanContext adapt the OpenTelemetry SDK to the framework's Contracts\Telemetry\TracerInterface / SpanInterface / SpanContextInterface. The SDK owns the active-context stack, so the adapters hold no per-request worker state.
  • W3C propagationPropagation\W3CTraceContextPropagator injects / extracts traceparent + tracestate, enabling transparent distributed tracing across services.
  • FactoryFactory\OtelTracerFactory assembles a tracer from any SpanExporterInterface (or a console JSON exporter for local docker logs inspection), keeping every OpenTelemetry\SDK\* symbol out of the core perimeter.

Perimeter

The only Waffle package permitted to require the OpenTelemetry SDK (open-telemetry/*). Depends on waffle-commons/contracts plus the OTel SDK; mago guard is configured to allow the SDK here and nowhere else. The request-scoped trace-context holder implements ResettableInterface (wfl igor 0 KO).

Development

composer install
composer mago     # fmt + lint + analyze + guard — must be ZERO output
composer tests    # PHPUnit 12.5, >=95% coverage
composer igor     # worker-safety audit — 0 KO

License

MIT — see LICENSE.md.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-07-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固