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
Laravel Metrics

Laravel Metrics Laravel Package

stechstudio/laravel-metrics

A Laravel package for recording and querying application metrics. Track counters, trends, and key performance or business data over time through a simple API, backed by database storage, so you can monitor and visualize what matters in your app.

View on GitHub
Deep Wiki
Context7

Easily track metrics from Laravel events and ship to InfluxDB, Prometheus, CloudWatch, or PostHog.

Frequently asked questions about Laravel Metrics
How do I install stechstudio/laravel-metrics in a Laravel app?
Install it with Composer using composer require stechstudio/laravel-metrics. Laravel package discovery should register the service provider, then you publish the package config and set your default driver and backend credentials. From there, map Laravel events to metric names in config and emit through the package API or event listeners.
Which metric backends does laravel-metrics support?
The package provides drivers for InfluxDB, Prometheus, Amazon CloudWatch, and PostHog. This lets you keep one tracking API while choosing a backend per environment or team. Verify each driver's configuration and semantics before rolling it out to production.
Does stechstudio/laravel-metrics send metrics synchronously or through a queue?
The overview does not state whether metric emission is synchronous or queued, and the technical assessment flags this as a key verification item. Check the config and driver implementation for queue or job support and batching options. If queued shipping is available, wire it to Redis or SQS to avoid adding latency in the request path.
Can I use laravel-metrics with Laravel 10 or 11 and PHP 8.2?
The package is positioned for a Laravel 10 or 11 monolith on PHP 8.2+, but the exact Laravel and PHP version constraints must be verified in its composer.json and CI matrix. Do not assume support from the overview alone; confirm the compatibility surface against your baseline before adopting it.
How do I test metrics in Laravel feature tests with this package?
The provided materials do not confirm a built-in fake or assertion helper for feature tests. Verify whether the package offers a facade fake or test double; otherwise wrap it behind an internal recorder interface and swap in a fake for tests. That wrapper also keeps vendor-specific calls out of your domain code.
What are the risks of high-cardinality tags like user ID or order ID?
High-cardinality tags such as user ID, order ID, or request ID are the classic metrics footgun. They can inflate InfluxDB tag cardinality, increase CloudWatch costs per put, and grow Prometheus memory. Define a naming and tagging convention up front and limit tags to low-cardinality dimensions like plan, region, and status.
Can I add a custom driver such as OpenTelemetry or StatsD without forking laravel-metrics?
The assessment lists custom driver support as an open question, so confirm the driver contract in the package source before relying on it. If the driver interface is extensible, you can bind an OpenTelemetry or StatsD implementation through the service container. If not, keep the package behind an internal wrapper so you retain a swap path.
What happens when the metrics backend is unreachable?
The materials do not specify whether the package silently drops metrics, throws an exception, or retries when the backend is unreachable. This fail-open behavior is critical for production because synchronous emission can add a failure dependency in the request path. Test the failure mode and prefer queued or buffered shipping where possible.
Is stechstudio/laravel-metrics a full observability platform with dashboards and tracing?
No. It is an application-level metrics emission layer that feeds an existing backend; it does not provide tracing, log correlation, or dashboards. Treat it as the instrumentation piece and use your backend or existing tooling for visualization and alerting.
How do I migrate from Log::info metric calls or StatsD to laravel-metrics?
Start in one bounded service, publish the config, and wire a non-critical event to a backend you already use. Define a metric naming and tagging convention, then replace ad-hoc Log::info metric calls and StatsD calls behind a thin internal wrapper such as App\Metrics\Recorder. Expand event coverage after the wrapper and conventions are in place.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections