waffle-commons/telemetry
Composer 安装命令:
composer require waffle-commons/telemetry
包简介
SDK-free enterprise telemetry for Waffle Commons: contract-first tracing no-ops, a Prometheus /waffle-metrics exporter, and stateless worker-metric collectors.
README 文档
README
Waffle Commons — Telemetry
SDK-free enterprise telemetry for the Waffle Commons framework. This
package provides the no-op tracing defaults, a Prometheus /waffle-metrics exporter + diagnostics
middleware, and stateless worker-metric collectors (memory peaks, GC cycles, request timing, cache hit
ratio, DB-pool utilization) for long-running FrankenPHP workers.
Status: shipped in Beta 5 / AXE 5 (RFC-005). The OpenTelemetry SDK bridge lives in the separate
waffle-commons/telemetry-otelpackage so the vendor SDK never enters the core perimeter.
What's inside
- Metrics —
Metric\MetricsRegistry(counters / gauges / histograms) backed byMetric\ApcuMetricStore, so counters live in APCu shared memory and never on the worker heap. Falls back to the contract'sNullMetricsRegistrywhen APCu is unavailable. - Collectors — stateless
Collector\MemoryCollector(usage + peak),Collector\GcCollector(cycles, collected objects, root buffer) andCollector\PoolUtilizationCollector(DB-pool active / idle / capacity). - Exporter & endpoint —
Exporter\PrometheusExporterrenders the text exposition format;Middleware\MetricsMiddlewareserves a fail-closed/waffle-metricsscrape (404 unless a bearer token or allow-listed client IP matches — the endpoint is never revealed to unauthorized callers). - Request instrumentation —
Middleware\TracingMiddlewareopens the per-request server span (extracting an inbound W3Ctraceparent) and records request count + duration; defaults to the contract no-ops so it is safe to install unconditionally. - Decorators —
Cache\MeteredCache(hit / miss counters around any PSR-16 cache) andRepository\TracingRepositoryDecorator(optional client spans around an RFC-022 repository; coredata/now emits DB spans natively, so this decorator is an add-on for non-core repositories).
Perimeter
Depends only on waffle-commons/contracts (+ waffle-commons/utils). Every telemetry interface
(Waffle\Commons\Contracts\Telemetry\*) lands in contracts first — mago guard enforces the boundary.
Counters live in shared memory (APCu), never on the resettable worker heap (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
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-07-08