Weave Code
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

Metrics Laravel Package

directorytree/metrics

Record and query metrics in Laravel with a simple, elegant API. Track page views, API calls, signups, and other events with optional values, categories, dates, hourly buckets, model-scoped metrics, and custom attributes. Supports Redis and extensible drivers.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. Buy: Accelerates development by eliminating the need to build a custom metrics tracking system from scratch, reducing time-to-market for analytics features.
  • Feature Roadmap:
    • User Analytics: Track signups, logins, and user activity with granularity (daily/hourly) and segmentation (categories, custom attributes).
    • API/Performance Monitoring: Measure API call volumes, error rates, or endpoint-specific usage (e.g., api:requests by category:users).
    • Business Metrics: Monitor conversions, purchases, or revenue-generating events with custom attributes (e.g., source, country).
    • Backfilling Data: Support historical data imports via date() method for migrations or audits.
  • Use Cases:
    • Product Analytics: Understand feature adoption (e.g., feature:usage by user_segment).
    • Growth Metrics: Track funnel conversions (e.g., trial:to:paid).
    • Operational Insights: Monitor batch job success rates or system health (e.g., jobs:completed, app:errors by severity).
    • A/B Testing: Segment metrics by experiment variants (e.g., cta:clicks with variant:blue).
  • Scalability: Redis driver reduces database load for high-traffic applications by batching commits.

When to Consider This Package

  • Adopt if:

    • Your Laravel app needs lightweight, structured metrics tracking without heavy dependencies (e.g., no GraphQL/third-party APIs).
    • You require granularity (daily/hourly) and segmentation (categories, custom attributes) for analytics.
    • Your team lacks dedicated backend resources to build a custom solution.
    • You need model association (e.g., track metrics per user/team) or backfilling capabilities.
    • Performance is critical, and you can leverage Redis batching for high-volume scenarios.
  • Look elsewhere if:

    • You need real-time dashboards or complex visualizations (consider tools like Mixpanel, Amplitude, or Laravel Scout + custom charts).
    • Your metrics require sub-hourly granularity (e.g., per-second tracking; this package supports hourly but not finer).
    • You’re using Laravel <9.0 or PHP <8.1 (compatibility constraints).
    • You need multi-tenant isolation out of the box (this requires custom implementation).
    • Your use case demands event sourcing or time-series databases (e.g., InfluxDB, TimescaleDB).

How to Pitch It (Stakeholders)

For Executives:

*"This package lets us build analytics features 10x faster without sacrificing flexibility. For example:

  • Track user growth (signups, logins) with hourly/daily granularity to measure campaign effectiveness.
  • Monitor API health in real-time to catch usage spikes or errors before they impact customers.
  • Segment metrics by user attributes (e.g., country, device) to personalize experiences. It’s open-source, MIT-licensed, and integrates seamlessly with Laravel—no vendor lock-in. The Redis driver also ensures scalability for high-traffic apps. We can start small (e.g., basic signups) and expand to complex use cases like A/B testing or revenue analytics."*

For Engineering:

*"This is a batteries-included metrics solution for Laravel that handles:

  • Core needs: Simple counters (metric('signups')->record()), categories, and custom attributes.
  • Performance: Redis-backed batching to reduce DB load (critical for high-volume apps).
  • Extensibility: Custom models, repositories, or query scopes for edge cases.
  • Testing: Built-in fakes and model associations for reliable analytics. Trade-offs:
  • Not a full analytics suite (no dashboards), but plugs into tools like Laravel Nova or custom admin panels.
  • Hourly granularity is supported, but not sub-hourly (use a time-series DB if needed). Recommendation: Use this for 80% of use cases; pair with a third-party tool for advanced visualizations."*

Key Selling Points: ✅ Developer Productivity: Drop-in replacement for manual metric tracking. ✅ Scalability: Redis driver for high-throughput apps. ✅ Flexibility: Supports models, custom attributes, and backfilling. ✅ Cost-Effective: No SaaS fees; self-hosted and open-source.

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.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope