monitoring-app
Batch monitoring for the Inferyx platform: email (and Teams / Google Chat) alerts when a scheduled batch fails or does not start, plus a web console with a dashboard, schedules, batch logs, settings and user management.
| Install directory | /opt/monitoring-app |
| Console | https://<your-host>/monitoring/admin/ (behind nginx) |
| Service | monitoring-app (systemd) |
| Guides shipped with the package | /opt/monitoring-app/.venv/share/monitoring-app/ — DEPLOYMENT.md (install, upgrade, rollback, security, MongoDB), USER_GUIDE.md (alerts and console), CHANGELOG.md |
What it does
- Reads the schedules from Inferyx and checks every run against its schedule, every minute.
- Failed — a scheduled run ends in a failed stage → mail with the error reason.
- Missed — no run was created for a scheduled time: after start time + grace (default 5 min) the monitor checks 5 times; only then is it Missed.
- No data — Inferyx could not be reached → mail to DevOps only (never reported as Missed).
- One mail per occurrence; follow-ups arrive as replies in the same thread. Failures from before the monitor was switched on are never mailed.
- Every alert is stored and shown in the console with its mail result.
Services (Environment Settings → Services): batch monitoring, Platform users and
AWS IDC users can each be switched on or off per server — e.g. PROD all on, DEV with
batch monitoring off and only its own users and IDC account. Details: DEPLOYMENT.md.
Batch status source (Environment Settings): api (Inferyx REST API, default) or
mongodb (reads the Inferyx MongoDB directly, read-only). With MongoDB only runs
started by the scheduler are alerted — runs started by hand are ignored — and
suspended, deleted and expired schedules are not monitored. Credentials are entered
in the console and stored encrypted.
Prerequisites
| Requirement | Notes |
|---|---|
| OS | Ubuntu 22.04+ (or Debian with apt) |
| Python | 3.10+ (python3, python3-venv) |
| nginx | Reverse proxy for /monitoring/admin/ and /monitoring/api/ |
| Network | SMTP; the Inferyx API; optional: Inferyx MongoDB, Teams / Google Chat webhooks, Google OAuth, AWS IAM Identity Center |
Install
export IM_HOME=/opt/monitoring-app
sudo mkdir -p "$IM_HOME"
sudo useradd --system --home-dir "$IM_HOME" --shell /usr/sbin/nologin inferyx 2>/dev/null || true
sudo -u inferyx python3 -m venv "$IM_HOME/.venv"
sudo -u inferyx "$IM_HOME/.venv/bin/pip" install --upgrade pip
sudo -u inferyx "$IM_HOME/.venv/bin/pip" install monitoring-app
sudo bash "$IM_HOME/.venv/share/monitoring-app/release.sh" install --skip-pip
Pin a version with pip install "monitoring-app==1.0.0", or install a local wheel:
pip install /path/to/monitoring_app-1.0.0-py3-none-any.whl.
The install script creates:
| Path | Purpose |
|---|---|
.env |
SMTP host, Inferyx API URL, alert settings — no secret values |
auth.policy |
Console sign-in (local, Google, AWS IAM Identity Center), paths |
secrets/ |
master.key (encryption key), session_secret — owner-only |
data/ |
alerts.db (alerts), config.db (encrypted secrets), console.db (users, approvals) |
www/ |
Console files |
logs/ |
Monitor log |
Configure
-
.env—MONITORING_APP_SMTP_HOST,_SMTP_USERNAME,_MAIL_TO,_DEVOPS_EMAIL,_API_BASE_URL,_API_TOKEN_HEADER. -
Secrets — stored encrypted, never in a file:
CLI=/opt/monitoring-app/.venv/bin/monitoring-app sudo -u inferyx $CLI secrets set MONITORING_APP_SMTP_PASSWORD --work-dir /opt/monitoring-app sudo -u inferyx $CLI secrets set MONITORING_APP_API_TOKEN --work-dir /opt/monitoring-app
Back up
secrets/master.keyseparately — stored secrets cannot be read without it. -
auth.policy—ui.public_base_urland the sign-in methods. SetMONITORING_APP_ADMIN_BOOTSTRAP_EMAILfor the first admin before the console is reachable. -
nginx:
sudo cp /opt/monitoring-app/.venv/share/monitoring-app/nginx.conf.example /etc/nginx/sites-available/monitoring-app sudo ln -sf /etc/nginx/sites-available/monitoring-app /etc/nginx/sites-enabled/ sudo nginx -t && sudo systemctl reload nginx
Afterwards, settings can be changed in the console (Environment Settings, Application Settings); changes apply within one check, no restart needed.
Verify
sudo systemctl status monitoring-app
curl -s http://127.0.0.1:8090/api/health
Upgrade
sudo -u inferyx /opt/monitoring-app/.venv/bin/pip install --upgrade monitoring-app
sudo bash /opt/monitoring-app/.venv/share/monitoring-app/release.sh upgrade --skip-pip
The upgrade deploys the new console, adds new settings (existing values are kept), removes retired ones, updates the service and restarts it. If the new service does not answer its health check, it rolls back automatically.
Switching from inferyx-monitoring (/opt/pipeline-monitor)
The package was renamed from inferyx-monitoring to monitoring-app. On an old server,
put the new package into the old virtualenv (only to get the new upgrade script) and
run the upgrade — it moves the installation to /opt/monitoring-app in one step:
OLD=/opt/pipeline-monitor
sudo -u inferyx "$OLD/.venv/bin/pip" install monitoring-app
sudo bash "$OLD/.venv/share/monitoring-app/release.sh" upgrade --skip-pip
Settings PIPELINE_* become MONITORING_APP_* (values kept), plain-text secrets move
into the encrypted store, paths in config / systemd / nginx are rewritten, and the old
folder is kept as /opt/pipeline-monitor.migrated-<date>. Details: DEPLOYMENT.md.
Using MongoDB as the batch status source (optional)
- Create a read-only MongoDB user with
findonschedule,scheduleexec,batchexec,batchandapplication, and the two indexes — commands inDEPLOYMENT.md. - Console → Environment Settings → MongoDB (batch status): connection string (hosts
and options only, no user / password), user, password and auth database (stored
encrypted), database (
framework) → Save → Test connection. - Set Batch Status Source to
mongodb. Only failures after this moment are mailed. - To go back, set it to
api.
Alert settings
| Setting | Default | Meaning |
|---|---|---|
MONITORING_APP_CHECK_MODE |
full_window |
full_window checks through the whole run (recommended); schedule_windows only at start and expected end |
MONITORING_APP_SCHEDULE_GRACE_MINUTES |
5 |
Minutes after the scheduled time before a run counts as missed |
MONITORING_APP_ALERT_FAILED / _MISSED / _NO_DATA |
true |
Switch each alert type on or off |
MONITORING_APP_ALERT_ONCE_PER_DAY_ALL_SCENARIOS |
true |
One new mail thread per issue per day |
MONITORING_APP_ALERT_REPLY_TO_THREAD |
true |
Follow-ups as replies in the same thread |
MONITORING_APP_LOG_RETENTION_DAYS |
30 |
Keep rotated monitor logs for N days |
Test the mail setup: sudo -u inferyx /opt/monitoring-app/.venv/bin/monitoring-app --test-mail-thread
Troubleshooting
| Symptom | Fix |
|---|---|
| Service restarts in a loop | sudo journalctl -u monitoring-app -n 50 — usually a missing .env value |
| Console shows "Unavailable" | curl http://127.0.0.1:8090/api/health; check nginx with nginx.conf.example |
| No data alerts | Inferyx API unreachable or token expired — monitoring-app secrets set MONITORING_APP_API_TOKEN |
| Missed although the batch ran | The run was started by hand, not by the scheduler (MongoDB source) — check the Inferyx scheduler |
| No mails at all | Environment Settings → SMTP; the console's Alert mail column shows the error |
| MongoDB test fails | Network to MongoDB, user / password / auth database, TLS settings |
Service commands
sudo systemctl restart monitoring-app
sudo systemctl status monitoring-app
sudo journalctl -u monitoring-app -f
sudo bash /opt/monitoring-app/.venv/share/monitoring-app/release.sh uninstall --skip-pip # keep config
sudo bash /opt/monitoring-app/.venv/share/monitoring-app/release.sh uninstall --purge --skip-pip # remove everything
Metadata
Release files for monitoring-app 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| monitoring_app-1.0.5.tar.gz | 583.0 kB | Without provenance | Details for monitoring_app-1.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| monitoring_app-1.0.5-py3-none-any.whl | Python 3 | none | any | Details for monitoring_app-1.0.5-py3-none-any.whl |
Total release size: 1.2 MB
Release files / monitoring_app-1.0.5.tar.gz
| Download URL | monitoring_app-1.0.5.tar.gz |
|---|---|
| Size | 583.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
de4274666da2eb8319b8b30d3649ae7f0d117829381456facd51a925f01892ff
|
|
BLAKE2b-256 checksum How to use checksums |
976108366ff98733c1f13397080ff952c479d758c60e7f00ac0ccb524c5d69fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.16
|
Release files / monitoring_app-1.0.5-py3-none-any.whl
| Download URL | monitoring_app-1.0.5-py3-none-any.whl |
|---|---|
| Size | 623.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5a42894a8cf1869a6f8564651c82083cc8849400b8a3d1a23df96157ed254140
|
|
BLAKE2b-256 checksum How to use checksums |
a937dd20265ac32566284b235436b3c6c6486aaec163e0026e835bdc0ad2599b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.16
|
Security for monitoring-app 1.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.