Skip to main content

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.

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

  1. .env — MONITORING_APP_SMTP_HOST, _SMTP_USERNAME, _MAIL_TO, _DEVOPS_EMAIL, _API_BASE_URL, _API_TOKEN_HEADER.

  2. 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.key separately — stored secrets cannot be read without it.

  3. auth.policy — ui.public_base_url and the sign-in methods. Set MONITORING_APP_ADMIN_BOOTSTRAP_EMAIL for the first admin before the console is reachable.

  4. 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)

  1. Create a read-only MongoDB user with find on schedule, scheduleexec, batchexec, batch and application, and the two indexes — commands in DEPLOYMENT.md.
  2. 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.
  3. Set Batch Status Source to mongodb. Only failures after this moment are mailed.
  4. 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.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for monitoring-app 1.0.2
File Size Uploaded Provenance Actions
monitoring_app-1.0.2.tar.gz 574.9 kB Without provenance Details for monitoring_app-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for monitoring-app 1.0.2
File Interpreter ABI Platform Actions
monitoring_app-1.0.2-py3-none-any.whl Python 3 none any Details for monitoring_app-1.0.2-py3-none-any.whl

Total release size: 1.2 MB

Release files / monitoring_app-1.0.2.tar.gz

Download URL monitoring_app-1.0.2.tar.gz
Size 574.9 kB
Tags Source
SHA-256 checksum
How to use checksums
52da3a1871fe02769851bc0786dcd964f30ffbd7a537805dc57dd7399fadec91
BLAKE2b-256 checksum
How to use checksums
e4e0b33ddf27987d56f4c40788068a982415471b2d0c4bd330d112d0c19f0eec
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.2-py3-none-any.whl

Download URL monitoring_app-1.0.2-py3-none-any.whl
Size 614.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5e9d50a5f988f265885cc9252f5af16f72323f5ab18a0daa7cf54bd1912bc0da
BLAKE2b-256 checksum
How to use checksums
ad347dff646b1770f1de9d91a02110407edec97804e6e2b1207759de1adc75f3
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.2

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page