jimdo/prometheus_client_php
PHP Prometheus client library for exposing counters, gauges, and histograms, with Redis, APCu, or in-memory client-side aggregation and text-format rendering. Note: development has moved to endclothing/prometheus_client_php.
Architecture fit. The library maps cleanly onto the Laravel/PHP request lifecycle: metric collectors are instantiated per request via CollectorRegistry::getDefault(), but because PHP workers are stateless, aggregation state must live outside the process. That is why the package ships three adapters — Redis (shared, network hop), APCu (shared only within a single host's workers), and in-memory (single process only). For a standard Laravel app under PHP-FPM, this means the package is architecturally sound only when paired with a co-located Redis or APCu. The in-memory adapter is effectively unusable for web traffic and only fits long-running CLI/cron/queue workers. Net: the architecture fits a typical Laravel deployment if and only if you accept a local aggregation store as a hard dependency.
Integration feasibility. Composer-installable with no framework coupling — it is a plain library, so a thin Laravel service provider + facade is all that is required for DI and config binding. Instrumentation is explicit (counters, gauges, histograms via getOrRegister*), which is straightforward to wrap in middleware (HTTP latency/count) and job hooks (queue depth/failures). The main feasibility risk is not the PHP API, it is the aggregation backend: you must provision Redis/APCu, wire credentials, and expose a scrape endpoint that renders the registry (RenderTextFormat). That scrape endpoint itself becomes a route in Laravel and needs authz and performance treatment.
Technical risk. This is the dominant concern. The repository is archived and the README explicitly redirects to endclothing/prometheus_client_php; adopting the Jimdo namespace means adopting an unmaintained dependency. Mitigating factors: Apache-2.0 license permits forking, the code is small and stable, and the successor fork exists. Compounding risks: zero dependents reported (low signal on battle-testing in the wider ecosystem), "readme"-level maturity (thin evidence of test/CI coverage or release discipline), and a known operational sharp edge — counters/histograms are aggregated client-side, so metric cardinality and label discipline are entirely the application's responsibility. A mislabeled metric (e.g. user ID as a label) can silently blow up Redis memory and scrape payloads. Redis unavailability is also a write-path failure unless you explicitly design for it.
Key questions.
endclothing fork under a maintained namespace? (Strong default: the fork.)Stack fit. Good fit for Laravel 8–11 / PHP 7.4–8.3 (pin and verify PHP version support before committing — an archived package may lag). It is framework-agnostic, so it composes with Laravel's container, config, and middleware without fighting the framework. It is not a drop-in for existing APM/OpenTelemetry tooling; choose one instrumentation path rather than running both.
Migration path. Because the archive notice is explicit, the migration path is effectively the first step: target the maintained fork (endclothing/prometheus_client_php), or vendor the Jimdo source and treat it as internal. Plan a thin internal abstraction layer — an MetricsService interface wrapping registry calls — so the underlying client can be swapped (including to OpenTelemetry later) without touching call sites. If you are already instrumented elsewhere, this package becomes a parallel export path, not a replacement.
Compatibility. Verify: PHP version vs. supported matrix; ext-apcu availability on the runtime image; Redis client (predis vs. phpredis) and its version; Laravel's service-provider auto-discovery; and container image parity (APCu is per-container, so horizontal scaling breaks APCu aggregation — Redis is the safe choice for multi-replica deployments). Confirm your Prometheus scrape config and exposition format expectations align with the package's RenderTextFormat.
Sequencing.
/metrics route; confirm Prometheus scrape succeeds end-to-end.Maintenance. Highest ongoing cost is ownership of an unmaintained dependency. Budget for: periodic security/dependency review, PHP version bumps requiring patches, and a documented "we own this if it breaks" stance. The abstraction layer from the migration path is the primary control here — it converts a fork-or-patch emergency into a bounded swap.
Support. No upstream support from the Jimdo repo. Community support is limited (low stars, zero recorded dependents). Internal runbooks must cover: how metrics are defined, how to add one, cardinality policy, and how to disable instrumentation in an incident.
Scaling. Aggregation is client-side, so scale characteristics are driven by Redis/APCu, not the PHP library. Watch: Redis memory growth from label cardinality, per-request network round-trips to Redis (co-locate it, per the README), scrape latency on large registries, and APCu inconsistency across replicas (avoid APCu for multi-instance web tiers). Histogram bucket design directly affects both accuracy and memory.
Failure modes.
/metrics endpoint exposed without auth → metric/label leakage; gate it at the network or auth layer.Ramp-up. Low for a PHP developer who knows Prometheus semantics — the API is a handful of calls — but medium for the operational side: adapters, aggregation model, cardinality discipline, and scrape configuration. Realistically half a day to first metric in staging, one to two weeks to a trustworthy, reviewed instrumentation set with a runbook. The dominant learning cost is Prometheus concepts, not this library.
How can I help you explore Laravel packages today?