badpixxel / paddock-mongodb
Paddock - Mongodb Extension
Package info
gitlab.com/paddock-project/paddock-mongodb
Type:bundle
pkg:composer/badpixxel/paddock-mongodb
Requires
- php: ^7.4|^8.0
- ext-mongodb: *
- badpixxel/paddock-core: ^4.0
- doctrine/mongodb-odm-bundle: ^4.0|^5.0
Requires (Dev)
- badpixxel/php-sdk: ^2.0
README
Paddock extension for monitoring MongoDb servers: version, server variables, and databases statistics, via Doctrine MongoDB ODM connections.
Requirements
- PHP 8.1+ with
ext-mongodb badpixxel/paddock-core^5.0 (Symfony 5.4 → 8.x)doctrine/mongodb-odm-bundle^4.7|^5.0
| Version | PHP | Paddock Core | Status |
|---|---|---|---|
| 5.x | ^8.1 | ^5.0 | Active |
| 4.x | ^7.4 | 4.x | Maintenance |
Installation
composer require badpixxel/paddock-mongodb
Configure the connection via the MONGODB_URL environment variable:
MONGODB_URL="mongodb://user:password@my-server.com:27017/mydb"
Available Collectors
| Code | Collected Data |
|---|---|
mongodb-version | MongoDb server version |
mongodb-variable | MongoDb server variables (serverStatus) |
mongodb-stats | Databases statistics (objects, dataSize, indexes) |
A ready-to-use health check track (mongodb-health-checker) is registered
automatically as soon as MONGODB_URL is defined.
Usage Example
tracks:
my-mongodb-checks:
collector: "mongodb-version"
description: "Check MongoDb Server"
rules:
version: { rule: version, gte: { error: "6.0" } }
More examples in tests/Tracks/ and src/Tracks/MongoDbHealthChecker.php.
Development & Tests
All checks run identically in CI and locally: the GitLab pipeline executes
the exact same commands as the docker containers (one per Symfony version,
5.4 → 8.x), with a mongo:7.0 service alongside:
# Start all containers & run everything (composer, quality, tests)
make verify
# Run PhpUnit tests in all containers
make test
# Quality suites (GrumPHP: lint, code style, PhpStan)
php vendor/bin/grumphp run --testsuite=travis
php vendor/bin/grumphp run --testsuite=csfixer
php vendor/bin/grumphp run --testsuite=phpstan
# PhpUnit testsuites
vendor/bin/phpunit --testsuite=integration
vendor/bin/phpunit --testsuite=operational
License
Paddock is released under the MIT License.