Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Prometheus Client Php

Prometheus Client Php Laravel Package

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.

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Prometheus Client Php
How do I install jimdo/prometheus_client_php in a Laravel app?
Install it with composer require jimdo/prometheus_client_php. Because the package is framework-agnostic, you then add a thin service provider to bind a CollectorRegistry and storage adapter, plus a facade if you want one. Before adopting it, note the Jimdo repository is archived and the README points to endclothing/prometheus_client_php, so most teams should install the maintained fork instead.
Does jimdo/prometheus_client_php support Laravel 11 and PHP 8.3?
It is a plain PHP library with no Laravel coupling, so it can be used with Laravel 8 through 11 and PHP 7.4 through 8.3, but you must verify the exact PHP version matrix before committing. Because the Jimdo package is archived, compatibility with newer PHP releases is not guaranteed and the maintained fork is the safer choice.
Do I need Redis or APCu to use this package with Laravel?
Yes for normal web traffic. PHP-FPM workers do not share state, so aggregation must live in Redis or APCu; the in-memory adapter only works for a single long-running process such as a CLI script or cron job. Redis is the common choice when you need aggregation across multiple hosts, while APCu only shares data within one host's workers.
How do I expose Prometheus metrics from Laravel?
Add a route such as /metrics that gets the default CollectorRegistry, renders it with RenderTextFormat, sets the Content-Type to RenderTextFormat::MIME_TYPE, and returns the output. Protect that route with authentication or network restrictions, and keep it off public traffic paths. The scrape endpoint is an application route, so it also needs performance and authorization treatment.
Is jimdo/prometheus_client_php still maintained?
No. The GitHub repository is archived and the README explicitly redirects users to https://github.com/endclothing/prometheus_client_php. The Apache-2.0 license allows you to fork or vendor the code, but adopting the Jimdo namespace means adopting an unmaintained dependency. Most new Laravel integrations should use the endclothing fork.
How do I instrument Laravel HTTP requests with counters and histograms?
Wrap the route or middleware with a counter for request totals and a histogram for latency, using labels only for bounded values such as route name, method, and status code. Call the registry's getOrRegisterCounter and getOrRegisterHistogram methods and observe or increment per request. Keep label values low-cardinality, because aggregation happens client-side.
What is the risk of high-cardinality labels in this Prometheus client?
Counters and histograms are aggregated client-side, so every unique label combination becomes state stored in Redis or APCu. Using user IDs, request IDs, or raw URLs as labels can silently grow Redis memory and make scrape payloads huge. Define a label-cardinality budget and stick to bounded dimensions like route, method, and status.
What happens if Redis is unavailable for Prometheus metrics?
Redis is on the metrics write path, so if it is down metric updates can fail unless you explicitly design for that failure. For a Laravel app this can turn observability into an application availability risk if exceptions are not handled. Consider a co-located Redis instance, timeout and fallback behavior, and monitoring for the metrics backend itself.
Can I use this package in Laravel queue workers and cron jobs?
Yes. Long-running CLI processes can use the in-memory adapter if you only need metrics within that process, but multiple queue workers or hosts will not share counters unless you use Redis or APCu. For queue depth, job counts, and failures, emit metrics from job hooks and keep label values bounded. Be careful with in-memory state on long-running workers because it is not shared across processes.
Should I use this package or OpenTelemetry for Laravel metrics?
This package is a Prometheus-specific exporter, not a full APM or OpenTelemetry replacement. Choose one instrumentation path rather than running both, and if you need vendor-neutral traces and metrics, OpenTelemetry may be the better long-term fit. If you stay with Prometheus, wrap the client behind an internal MetricsService interface so you can swap implementations later.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route