jmonitoring/jmonitor-bundle

Integration of jmonitor monitoring library in symfony.

dev-master 2025-07-15 21:06 UTC

This package is auto-updated.

Last update: 2025-07-15 21:08:54 UTC


README

Integration of the jmonitoring/jmonitor, library into Symfony.
Jmonitor.io is a simple monitoring service for PHP applications and web servers that provides insights and alerting from various sources like MySQL, Redis, Apache, Nginx...

This bundle uses Symfony Scheduler to send metrics to Jmonitor.io every 15 seconds.
You can still use it without it, but you will need to set up a cron by yourself.

Requirements

Installation

composer require jmonitoring/jmonitor-bundle

Configuration

Create a project in jmonitor.io and get your API key.

.env

JMONITOR_API_KEY=your_api_key

config/packages/jmonitor.yaml

jmonitor:
    enabled: true
    project_api_key: '%env(JMONITOR_API_KEY)%'
    schedule: 'default' # Optionnal. You can omit this line if already use a "default" schedule. Remove it if you do not use symfony scheduler.
    
    # Enable the collectors you want to use.
    collectors:
        system: ~
        apache:
            server_status_url: 'https://localhost/server-status' # for more informations, see https://github.com/jmonitoring/jmonitor?tab=readme-ov-file#apache 
        mysql:
            db_name: 'your_db_name'
        php: ~
        redis: 
            # you can use either DSN or a service name (adapter). 
            # Remove the unused one.
            dsn: '%env(SOME_REDIS_DSN)%'
            adapter: 'some_redis_service_name'

You can customize the HTTP client used by Jmonitor.

jmonitor:
    #...
    http_client: 'some_http_client'