jmonitor/jmonitor-bundle

Integration of jmonitor monitoring library in symfony.

v1.0.0 2025-08-22 14:36 UTC

This package is auto-updated.

Last update: 2025-08-22 15:45:06 UTC


README

Integration of the jmonitor/collector, library into Symfony.
Jmonitor.io is a simple monitoring sass 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 jmonitor/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' # Remove it if you do not want to use symfony scheduler.
    
    # Enable the collectors you want to use (remove the unused ones).
    collectors:
        system: ~
        apache:
            server_status_url: 'https://localhost/server-status' # for more informations, see https://github.com/jmonitor/collector?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'
        frankenphp:
            endpoint: 'http://localhost:2019/metrics' # see https://frankenphp.dev/docs/metrics/ and/or https://caddyserver.com/docs/metrics
        caddy:
            endpoint: 'http://localhost:2019/metrics' # see https://caddyserver.com/docs/metrics

You can customize the HTTP client used by Jmonitor.

jmonitor:
    #...
    http_client: 'some_http_client'