PHPackages                             waffle-commons/telemetry - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. waffle-commons/telemetry

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

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.

0.1.0-beta5(1mo ago)031MITPHPPHP ^8.5CI passing

Since Jul 8Pushed 1mo agoCompare

[ Source](https://github.com/waffle-commons/telemetry)[ Packagist](https://packagist.org/packages/waffle-commons/telemetry)[ RSS](/packages/waffle-commons-telemetry/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (8)Versions (3)Used By (1)

[![Discord](https://camo.githubusercontent.com/b30f41baece56d71f7f496f7e39fd33a2a096221c66c648b350dd4fe14276c2e/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f3735353238383030313539323033333339313f6c6f676f3d646973636f7264)](https://discord.gg/eKgywnfXr2)[![PHP Version Require](https://camo.githubusercontent.com/d0d0f8b0ff97b3eadc1023e533e4af90531ad3d9a919bfd6665581640af378ef/687474703a2f2f706f7365722e707567782e6f72672f776166666c652d636f6d6d6f6e732f74656c656d657472792f726571756972652f706870)](https://packagist.org/packages/waffle-commons/telemetry)[![PHP CI](https://github.com/waffle-commons/telemetry/actions/workflows/main.yml/badge.svg)](https://github.com/waffle-commons/telemetry/actions/workflows/main.yml)[![codecov](https://camo.githubusercontent.com/ce15b1f9a8ca00b73b48573ff7a0c316af7a509c93f7fb6d24b6979f409b88bb/68747470733a2f2f636f6465636f762e696f2f67682f776166666c652d636f6d6d6f6e732f74656c656d657472792f67726170682f62616467652e737667)](https://codecov.io/gh/waffle-commons/telemetry)[![Latest Stable Version](https://camo.githubusercontent.com/48aa69a194cd01b622f6e56b65ab6412b7248f9cd27878868e2d251656a441c2/687474703a2f2f706f7365722e707567782e6f72672f776166666c652d636f6d6d6f6e732f74656c656d657472792f76)](https://packagist.org/packages/waffle-commons/telemetry)[![Packagist License](https://camo.githubusercontent.com/f438ddeec507b4c75fcd6494d5177875c483563ff1c3bc6cd9162e6fb5f9166b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f776166666c652d636f6d6d6f6e732f74656c656d65747279)](https://github.com/waffle-commons/telemetry/blob/main/LICENSE.md)

Waffle Commons — Telemetry
==========================

[](#waffle-commons--telemetry)

SDK-free enterprise telemetry for the [Waffle Commons](https://github.com/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-otel`](https://github.com/waffle-commons/telemetry-otel) package so the vendor SDK never enters the core perimeter.

What's inside
-------------

[](#whats-inside)

- **Metrics** — `Metric\MetricsRegistry` (counters / gauges / histograms) backed by `Metric\ApcuMetricStore`, so counters live in APCu shared memory and never on the worker heap. Falls back to the contract's `NullMetricsRegistry` when APCu is unavailable.
- **Collectors** — stateless `Collector\MemoryCollector` (usage + peak), `Collector\GcCollector` (cycles, collected objects, root buffer) and `Collector\PoolUtilizationCollector` (DB-pool active / idle / capacity).
- **Exporter &amp; endpoint** — `Exporter\PrometheusExporter` renders the text exposition format; `Middleware\MetricsMiddleware` serves a **fail-closed** `/waffle-metrics` scrape (404 unless a bearer token or allow-listed client IP matches — the endpoint is never revealed to unauthorized callers).
- **Request instrumentation** — `Middleware\TracingMiddleware` opens the per-request server span (extracting an inbound W3C `traceparent`) 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) and `Repository\TracingRepositoryDecorator` (optional client spans around an RFC-022 repository; core `data/` now emits DB spans natively, so this decorator is an add-on for non-core repositories).

Perimeter
---------

[](#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
-----------

[](#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
-------

[](#license)

MIT — see [LICENSE.md](./LICENSE.md).

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance90

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

48d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/34a7557a3fb23aaf788ca3892b9b7efdf96e753264bafd0599153c9e8a921316?d=identicon)[LesliePetrimaux](/maintainers/LesliePetrimaux)

---

Top Contributors

[![supa-chayajin](https://avatars.githubusercontent.com/u/695448?v=4)](https://github.com/supa-chayajin "supa-chayajin (9 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/waffle-commons-telemetry/health.svg)

```
[![Health](https://phpackages.com/badges/waffle-commons-telemetry/health.svg)](https://phpackages.com/packages/waffle-commons-telemetry)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B12.9k](/packages/psr-log)[open-telemetry/api

API for OpenTelemetry PHP.

2144.7M354](/packages/open-telemetry-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
