How to monitor OpenEMR with Prometheus and Grafana
A clinic IT lead running a self-hosted OpenEMR needs to hear about a failure from a dashboard or an alert, not from a front desk nurse. Prometheus collects and stores the metrics, Grafana draws the dashboards people read during an incident, and Alertmanager groups, silences and routes the notifications that tell someone to act. Together they show whether the web server, PHP, the database and user sessions are healthy, and they page the right person when one of them is not. Prometheus is licensed under Apache-2.0 and has no paid enterprise edition, so the cost is the infrastructure it runs on and the people who build, maintain and answer to it. Ask any implementation partner to separate those two lines in a quote.
A team needs this monitoring once OpenEMR is serving live patient care from infrastructure it controls, and especially once it runs after hours or across more than one site. Symptoms of an OpenEMR outage rarely appear in one place. The web tier can return errors while the database is healthy, PHP workers can exhaust while the server looks idle, or sessions can pile up until logins stall. Each failure needs its own signal, so the metrics should cover four areas: web responses and latency, PHP process and error health, database connections and query load, and session volume. Standard host metrics such as CPU, memory and disk usually come from an exporter such as node_exporter, and the database and web server each have their own exporters. Confirm which exporters your chosen OpenEMR deployment method supports before you build the dashboards.
Prometheus stores its data locally and is not clustered or replicated, so a single instance is a single point of failure for your monitoring. Its default retention is 15 days, which is shorter than many clinics expect for capacity and incident review, so plan remote write to longer-term storage if you need more history. Run Alertmanager as a cluster if notifications must survive one node failing, and point Prometheus at every Alertmanager instance rather than at a load balancer. Choose alerts that match clinic impact: the login page failing, the database refusing connections, disk filling on the documents directory, and backup jobs not reporting success. Prometheus values reliability over precision, so treat its numbers as trends and alarms, not as audit evidence. Confirm the current release line on the Prometheus release cycle page before you pin a version.
Monitoring options and when each fits
This table compares the monitoring setups a team weighs for a self-hosted OpenEMR, from a single Prometheus with Grafana to remote storage, clustered Alertmanager and the EKS stack shipped with the project. Read each row for when the option fits, what it does to retention, and how much operating work it adds. The main takeaway is that local Prometheus storage holds about 15 days by default and is not replicated, so any option that must keep history or survive a node loss needs a planned answer.
| Option | When it fits | Retention and storage trade-off | What it adds to operating burden |
|---|---|---|---|
| Prometheus with self-hosted Grafana | A single clinic or small group with one OpenEMR host and a small team that can run one monitoring server | Local storage with default retention of 15 days, configurable by time or size; not clustered or replicated, so history is lost if the node fails without a backup plan | Patching and upgrades for Prometheus and Grafana, disk sizing, dashboard and alert rule maintenance by your own staff |
| Prometheus with remote long-term storage | Practices that need metric history for trend reviews, capacity planning or incident reviews beyond a few weeks | Remote write sends samples to an external long-term store; you choose and pay for that system, and its retention and access controls must be confirmed with its vendor or project | A second system to operate, network paths and credentials for remote write, and checks that the remote store actually receives samples |
| Alertmanager on its own host | Small deployments where one alert routing point is enough and a short outage in alert delivery is tolerable | Alertmanager keeps silences and notification state on its host, so a rebuilt host loses them unless its data directory is backed up | One host to patch and monitor, plus routing configuration for on-call and clinic contacts |
| Clustered Alertmanager | Sites where a missed clinical or availability alert is costly and two or more Alertmanager instances can run in separate failure domains | Cluster flags keep instances in sync; Prometheus should point at every Alertmanager instance rather than a load balancer, which the Alertmanager docs state | More instances to run, cluster peer networking to open and test, and a failover drill to schedule and document |
| EKS monitoring stack shipped with the project | Teams already running OpenEMR on Amazon EKS who want a starting point rather than building dashboards and rules from scratch | Storage and retention follow the packaged configuration, so confirm retention, volume sizes and whether remote storage is included with the project's documentation | Learning the packaged components, reviewing defaults against your clinic's alerts, and keeping the bundle aligned with the OpenEMR release you run |
| Custom build on your own stack | Organizations with an existing observability platform, strict data residency rules or internal standards that the packaged stack does not meet | Retention, replication and remote storage are designed from scratch, which gives control but makes the decisions your responsibility | Design, build, testing and ongoing ownership of every component, with costs for staff time and infrastructure that a quote should itemize |
| Prometheus release lifecycle | Any option, because it sets how often you must upgrade | Minor releases stop receiving bug fixes after about 6 weeks; LTS line 3.13 is supported until July 31, 2027 according to the Prometheus release cycle page | Scheduled upgrades on a fixed cadence, with a plan to move off a line before its end of support |
How to set up Prometheus, Grafana and alerts for OpenEMR
This sequence takes a self-hosted OpenEMR from an unmonitored deployment to scraped metrics, dashboards, alert rules and a tested alert path to the on-call channel. Each step ends with a check that the previous layer is working before the next one is built.
Confirm the OpenEMR version and deployment model
The engineer responsible for the platform records the exact OpenEMR version, the PHP version, the database engine and whether the application runs under Docker, Kubernetes or another host layout. Recent OpenEMR releases require PHP 8.3 or later and a MySQL- or MariaDB-compatible database, so confirm both against the release notes before choosing exporters. Write down every host, container and database instance that needs a scrape target. The step is done when the team has a one-page inventory that a new engineer could follow without asking questions.
Choose exporters and metric endpoints
Decide which exporters expose each layer: the web server, PHP runtime, database and host metrics. Confirm with the exporter project and your own environment which metrics each exporter provides, and check whether OpenEMR itself exposes any application-level endpoint in your version. Do not assume a session or login metric exists; confirm it. Expose exporters only on a private network or behind authentication, and record each endpoint with its port. The step is done when every layer in the inventory has an endpoint that answers a manual request from the monitoring host.
Configure Prometheus scrape targets
The platform engineer adds scrape jobs to the Prometheus configuration, using static targets for fixed hosts or service discovery where containers or Kubernetes pods change often. Label each target with environment, site and role so dashboards and alerts can filter a clinic from a test system. Keep scrape credentials out of the configuration file where the platform supports it. Reload Prometheus and open the targets page. The step is done when every expected target shows as up, and any target that shows as down has a documented cause.
Set retention by time or size
Set the local storage retention in the Prometheus startup flags so the database stops growing beyond what the disk can hold. Prometheus defaults to 15 days of local retention, and you can configure retention by time or by size. Agree the retention period with the clinic's operations and compliance owners, since metric history is useful for incident review but is not a substitute for the OpenEMR audit log. Remember that local storage is not clustered or replicated, so treat the Prometheus data directory like any single-node database and back it up if history matters. The step is done when the configured retention is visible in the running instance and disk usage is being tracked.
Build Grafana dashboards on the Prometheus data source
Connect Grafana to Prometheus as a data source, then build dashboards for the layers you chose: web request rate and errors, PHP process health, database connections and query latency, host resources and the session-related signals your exporters provide. Use the labels from the scrape step so each dashboard can switch between sites or environments. Limit access to dashboards that show patient-adjacent operational detail, and confirm who can edit them. The step is done when each dashboard loads with live data for every production target and a second person can read it without help from the builder.
Write alert rules for clinic-relevant failures
Write alert rules in Prometheus that fire on conditions a clinic would act on: a web or PHP target going down, database unavailability, sustained error responses, disk space nearing exhaustion and failed certificate or backup-related signals where your exporters report them. Set each threshold and the evaluation period after reviewing a baseline from the dashboards, and document why each value was chosen. Tag every rule with a severity so routing can separate urgent clinic impact from routine notices. Validate the rule syntax before loading it. The step is done when the rules load without errors and appear as inactive in the Prometheus rules view.
Deploy Alertmanager as a cluster and list every instance
Deploy Alertmanager with its grouping, inhibition and silence settings, and route notifications to the on-call channel the clinic actually reads. If you run more than one Alertmanager for high availability, enable the cluster flags and configure Prometheus to point at every Alertmanager instance directly rather than through a load balancer. Confirm the Alertmanager status page shows the expected cluster members. The step is done when the team can see every Alertmanager instance listed in the Prometheus alerting configuration and each one reports as active.
Test the alert path end to end
Trigger a controlled test alert, for example by stopping a non-production exporter or using a dedicated test rule, and confirm that it moves from pending to firing in Prometheus, reaches Alertmanager and arrives in the on-call channel with the expected labels. Repeat the test with one Alertmanager instance stopped to confirm that notifications still arrive. Record the results, the person who received each notification and the time they acknowledged it. The step is done when the test alert arrives at the on-call channel, the failover check passes, and the runbook names who acts on each alert.
How the monitoring parts connect across the clinical network boundary
The flow starts at the OpenEMR web server, PHP and the database, where exporters expose metrics on endpoints that only Prometheus can reach inside the clinical network. Prometheus scrapes those targets, evaluates alert rules and sends firing alerts to Alertmanager, which must be reached by every Prometheus instance it is paired with. Grafana reads from Prometheus as a data source, so dashboards never touch the metrics endpoints directly. Check that no exporter port is reachable from outside the trust boundary and that Grafana access goes through your identity controls.
Metrics flow inward from OpenEMR to Prometheus, then to Alertmanager and Grafana.
What to alert on for a clinic
Start with a short alert set that pages someone only when a clinician cannot work or patient data may be at risk. For a self-hosted OpenEMR, that means site unreachable over HTTPS, a certificate approaching expiry, the database being unavailable or running out of connections, and sustained PHP error rates. Each of these maps to a symptom staff notice within minutes. Probe the public HTTPS endpoint from outside your network as well as from inside it, so a broken load balancer or DNS record still triggers an alert. Certificate expiry should warn well before the date, with a second, louder threshold close to expiry. Connection exhaustion deserves its own alert because it often appears before the database stops answering. The thresholds for PHP errors and connection counts are not published values. Set them from a few weeks of your own metrics, measured at your normal peak hours.
Add three alerts that protect data rather than availability. Disk usage growth on the volumes holding the database and the sites directory should alert on both current fill level and projected time to full, because audit and document growth is gradual and easy to miss. Backup job failure should alert on the absence of a successful completion, not only on an explicit error, since a cron job that silently stops produces no error at all. Failed login spikes should alert on a rate over a short window compared with your baseline, which points to credential attacks or a misconfigured single sign-on integration. Confirm with your own backup tooling which signal it exposes, such as a metric, a log line or a file timestamp.
Alertmanager controls noise. Grouping combines related alerts from one site into a single notification, so a database outage does not produce separate pages for every dependent check. Inhibition suppresses symptom alerts while a root-cause alert is firing, for example hiding HTTP failures when the database is down. Silences cover planned maintenance such as OpenEMR upgrades, database restarts or certificate renewals, and should carry an owner and an expiry time so they do not hide real faults for days. Prometheus should send alerts to every Alertmanager instance if you run more than one, as the Alertmanager documentation describes. Review each alert after every incident and after every upgrade, because a threshold that fit last quarter may be wrong for a larger patient panel.
Security and operational considerations for monitoring
A monitoring stack for a clinic holds sensitive operational data and can drive clinical response, so it needs the same access discipline as the EHR it watches. The cards below cover network exposure, data hygiene, access control, release currency, storage limits and alert ownership.
Restrict metrics endpoints to the internal network
OpenEMR, the web server, PHP-FPM and database exporters expose metrics that reveal versions, request paths, error rates and session counts. Keep every scrape endpoint off the public internet, bind exporters to a management interface or private subnet, and allow Prometheus access through firewall rules or network policies. Confirm this from outside the network with a port scan after each change, since exporters are often added during troubleshooting and left open.
Prometheus security modelKeep patient identifiers out of labels and logs
Prometheus labels become series identifiers, so a patient ID, name or MRN used as a label creates unbounded cardinality and stores personal data in a database many staff can query. Review exporter labels, request path templates and log formats so that identifiers appear only as aggregated counts or hashed references where needed. Ask your privacy officer to confirm which fields your monitoring retention and access rules treat as protected health information.
Protect Grafana and Alertmanager with SSO and roles
Grafana dashboards and Alertmanager silences can reveal clinical workload and can suppress alerts that matter. Connect Grafana to your identity provider, map groups to viewer, editor and admin roles, and disable local admin accounts after setup. Restrict who can create silences in Alertmanager and log those changes, because a silence placed during an incident is one of the easiest ways for a real outage to go unnoticed.
Stay on supported Prometheus release lines
Prometheus minor releases stop receiving bug fixes about six weeks after the next minor release begins, so an unpatched minor line falls behind quickly. For production, pin to the LTS 3.13 line, supported until July 31, 2027, and apply patch releases on a schedule. Track Alertmanager and exporter versions alongside Prometheus, and confirm the upgrade path with your team before the LTS line reaches end of support.
Release cycle docsTreat local storage as a single-node database
The default local Prometheus store is not clustered or replicated, so a failed disk or server means lost history and a gap in dashboards. Plan the volume size, retention period and backup method for the Prometheus data directory, and use remote write to a long-term store if audit or trend records must outlive the local window. Test restoring the data directory onto a spare host, because monitoring is often the last system anyone checks after an incident.
Prometheus storage docsRecord who receives and acts on alerts
An alert rule has value only if a named person or rota receives it, acknowledges it and knows the response. Document the routing tree in Alertmanager, the escalation path for clinical-impact alerts such as database unavailability or failed logins, and the owner of each receiver. Keep the record of alerts, acknowledgements and silences, since these entries support the audit controls in the HIPAA Security Rule's technical safeguards (45 CFR 164.312), which is context for your review and not a certification claim.
Questions buyers ask before monitoring OpenEMR
What drives the cost of a Prometheus and Grafana monitoring build for OpenEMR?
The cost comes from four places: infrastructure to run the monitoring servers, storage for metrics and logs, the implementation work, and the people who operate the stack afterward. Prometheus is open source under the Apache-2.0 license and there is no paid enterprise edition of the project itself, so no license fee is paid for Prometheus. Grafana, Alertmanager and any exporters or log tools you add need their own review of license terms and support options before you commit. Implementation is a one-time cost sized by the number of OpenEMR components, targets and alert routes in the written scope. Staffing recurs: someone must patch the stack, review alerts and tune thresholds. Ask any quote to show each of these lines separately.
How long does a monitoring setup for OpenEMR take?
Duration depends on the number of hosts and services in scope, whether the monitoring stack is built from scratch or added to an existing Prometheus or Grafana deployment, how many alert recipients and escalation paths you define, and how quickly your change process approves changes to production. A single OpenEMR server with a database on the same host is a smaller job than a Kubernetes deployment with separate web, PHP and database tiers. Your environment's approval windows and the availability of test systems often matter more than the technical work. No duration is set in advance here; a written scope and timeline should come from a planning conversation and be confirmed in writing before work starts.
Can a clinic's IT team build OpenEMR monitoring without a partner?
Often yes, if the team already runs Linux servers, has operated a time series database or a container platform, and can own on-call alerts. The build needs skills in Prometheus configuration, PromQL, exporters for the web server, PHP and the database, dashboard design in Grafana, and Alertmanager routing. The harder part is ongoing: Prometheus local storage is not clustered or replicated and should be managed like any other single-node database, and Alertmanager high availability needs careful configuration. Check whether your team can keep the stack patched, since Prometheus minor releases stop receiving bug fixes after six weeks. A partner can cover the first build, runbooks and handover, or the ongoing support, while your staff keep ownership.
What does the monitoring work need from our team?
The work needs a short list of inputs before it begins:
- Administrative access to the OpenEMR hosts, database server, web server and any container platform, with named accounts for the people doing the work.
- A test environment that runs the same OpenEMR version and configuration as production, so exporters and alert rules can be tested without paging anyone.
- A named list of alert recipients, on-call rotations and escalation paths, plus the channels they use.
- A maintenance window for changes that restart the web server, the database or the monitoring host.
- Your clinical and operations contacts, who can confirm which symptoms affect patient care and which can wait until business hours.
Ask your team to confirm each input before the scope is signed.
When is outside help worth paying for on OpenEMR monitoring?
Outside help is most useful when the clinic lacks in-house time or skills for the first build, when the OpenEMR environment spans several hosts or a Kubernetes cluster, or when alerts must reach clinical and on-call staff in a defined way. It is also worth considering when a security review or compliance assessment asks for evidence of logging, alerting and monitoring. Monitoring results support those reviews, but they do not establish compliance on their own, and independent auditors and certification bodies make those determinations. DeployOpen implements, hardens and documents self-hosted platforms in your infrastructure and runs fixed-scope engagements, with ongoing support available as a retainer. Quotes follow a written scope.
Which OpenEMR problems should trigger an alert for a clinic?
Start with symptoms that stop clinicians from working or put records at risk: the web endpoint not responding over HTTPS, PHP errors rising sharply, database connections exhausted, disk space running low on the sites directory or database volume, and failed backup jobs. Add slow page response and session-related errors as warnings that go to the team during business hours. Keep the list short at first so that alerts stay actionable. Each alert needs an owner, a response expectation, and a runbook link. Confirm thresholds with your application owners, because the right values depend on normal load in your practice.
Does monitoring OpenEMR need extra security controls?
Yes. Metrics and dashboards can reveal internal hostnames, versions, query patterns and error messages, so restrict who can reach Prometheus, Alertmanager and Grafana, and do not expose exporter endpoints to the public internet. Use HTTPS and authentication for dashboards, keep the monitoring hosts on a network segment that clinicians cannot reach directly, and avoid placing patient data in alert text or log labels. Review how long logs are kept, since logs may contain identifiers. Check these choices against your own HIPAA risk analysis, because the HIPAA Security Rule applies to electronic protected health information your systems create, receive, maintain or transmit.
Primary sources for OpenEMR and Prometheus monitoring
Read the Prometheus documentation before you write a single scrape configuration, because most of the decisions that shape a clinic's monitoring are already described there. The Prometheus overview explains the pull model, service discovery, the push gateway for short-lived jobs and the PromQL query language. It also states that Prometheus favors reliability over precision, which matters if you are tempted to use it for anything that must count every event exactly. Your team should confirm that this model fits how the OpenEMR web tier, PHP-FPM and database hosts expose their metrics in your environment, since OpenEMR itself does not ship a metrics endpoint that you can assume exists.
Next, read the Prometheus release cycle and long-term support page and the Prometheus storage documentation. The release cycle page explains that a minor release generally stops receiving bug fixes six weeks after it ships, and that long-term support lines get fixes for one year, so you should pick a line on purpose and record the end-of-support date. The storage page explains that the local time series database keeps 15 days by default, is not clustered or replicated, and can send samples to external long-term storage through remote write. Those two facts drive your retention and backup choices. The Alertmanager documentation covers grouping, inhibition, silences and clustering, and it is where you will decide how clinic alerts reach an on-call person.
Finally, check the OpenEMR releases page in the openemr/openemr repository before you choose alert thresholds. Release notes list the PHP and database requirements for each version, and they record security fixes, which can change which endpoints and services you monitor after an upgrade. The same repository contains the Docker deployment files you may be running. Confirm which OpenEMR version and PHP version your environment runs, then match your exporters and dashboards to that version rather than to a guess from an older guide.
How DeployOpen works on this
DeployOpen plans, builds and hands over OpenEMR monitoring inside your own infrastructure, so your clinical and IT teams can see health signals for the web tier, PHP, the database and sessions. Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
How we scope
- Inventory the OpenEMR hosts, containers, database, web server and session store that the monitoring must cover.
- Agree which metrics, logs and alerts are in scope, and who receives each alert and during which hours.
- Record in writing how Prometheus, Alertmanager and Grafana will be hosted, and who owns their storage and upgrades.
How we build
- Deploy Prometheus exporters and scrape targets for the OpenEMR web tier, PHP runtime and MySQL or MariaDB database.
- Configure Alertmanager routing, grouping and silences so clinic staff receive alerts they can act on.
- Build Grafana dashboards and test alert rules against controlled failures before the monitoring goes live.
How we hand over
- Document each metric, alert rule, dashboard and its intended response in a runbook your team can keep.
- Walk your operators through scrape configuration, alert routing, retention settings and how to add a new target.
- Confirm with your team how long metrics are retained locally and whether a longer-term storage system is needed.
How we support
- Ongoing support, upgrades and continuous testing of the monitoring stack are available as a retainer.
- Retainer work can cover Prometheus and Grafana version upgrades, reviewing alert noise and updating rules after OpenEMR upgrades.
- Ask for the support scope, response expectations and upgrade handling in writing as part of any quote.

