Download the PHP package itsemon245/lamet without Composer

On this page you can find all versions of the php package itsemon245/lamet. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package lamet

Laravel Lamet Banner

Total Downloads Latest Stable Version License

Laravel Lamet (Laravel + Metrics)

A simple, high-performance package to record and aggregate metrics in Laravel applications, ready for Grafana dashboards.

📋 Table of Contents

🚀 Installation

  1. Install via Composer:

  2. Publish the configuration and migration:

    This will publish config/lamet.php and the migration to database/migrations/lamet/.

    Alternatively, you can publish them separately:

  3. Configure your database and cache:

    • Set up your desired database connection in config/database.php (e.g., sqlite, mysql, pgsql). Postgres is recommended

    • Create a new cache store or use an existing one from config/cache.php (e.g., redis).
    • Add and update the .env variables for the new database connection

    [!NOTE] > Quick Setup: Use the provided misc/postgres-docker-compose.yml example to quickly spin up a PostgreSQL container for development and testing.

  4. Run the migration:

    [!IMPORTANT] The 5th step is very important. If you skip this your metrics won't be saved in the database. Also keep in mind that you have to set the frequency lower than the ttl value in config/lamet.php

  5. Schedule periodic flushing: In app/Console/Kernel.php:

    [!TIP] Higher frequency means less granularity, not suitable for realtime metrics but lower memory usage Lower frequency means more granularity, suitable for realtime metrics but higher memory usage Keep it between 5-20 minutes in general.

✨ Usage

Basic Usage

Record a simple metric using the facade:

Available Methods

Each method supports three usage patterns:


For advanced usage and query examples, see:

📝 Notes

📚 More

Commands

lamet:install

Installs the package by publishing configuration and migration files.

Options:

lamet:flush

Flushes cached metrics to the database.

Options:

lamet:clean

Cleans old metrics from the database.

Options:

Configuration

The package configuration is located in config/lamet.php. You can customize the following options:

General Settings

Database Query Monitoring

Exception Monitoring

Ignore Configuration

Cache Configuration

Database Settings

Environment Variables

You can configure the package using these environment variables:

Cache System

The package includes a caching system that stores metrics in cache first, then periodically flushes them to the database. This provides:

Cache Configuration

Scheduled Tasks

Add these to your app/Console/Kernel.php to automatically flush and clean metrics:

Grafana Integration

The package is designed to work seamlessly with Grafana for creating beautiful dashboards and visualizations.

Database as Data Source

Connect your metrics database to Grafana:

  1. Add Data Source in Grafana:

    • PostgreSQL: Use the PostgreSQL data source
    • MySQL: Use the MySQL data source
  2. Connection Settings:

Recommended Dashboard Panels

  1. Time Series: Response times, memory usage, CPU usage
  2. Stat: Current values, totals, averages
  3. Table: Top endpoints, error rates, recent events
  4. Gauge: Current system health, utilization

Alerting

Set up Grafana alerts based on your metrics:

For more Grafana query examples, see Grafana Queries.

Testing

Run the test suite:

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

License

The MIT License (MIT). Please see License File for more information.


All versions of lamet with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package itsemon245/lamet contains the following files

Loading the files please wait ...