Since the beginning, OpenNMS has stored performance data in RRD files and that is still a right-enough answer (for now). RRD is fast and compact. It is also a flat file on the local disk of your OpenNMS server, which means every question about backup, replication, failover, or reporting gets answered with some variation of rsync.
For a couple of years I have maintained an alternative: the pgtimeseries plugin, an implementation of the OpenNMS Time Series Storage layer that keeps collected metrics in a range-partitioned PostgreSQL table. It can live in either the OpenNMS database you already run or in a separate, external PostgreSQL instance.
Once your metrics are in PostgreSQL, you get everything PostgreSQL already does for free. Backups, streaming replication, read replicas, point-in-time recovery, and plain SQL for reporting from a database you already run. Plus, you keep every raw sample until it ages out of retention, so a graph of last February has the same resolution as a graph of last Tuesday.
What RRD throws away
RRD keeps its on-disk footprint small and fixed by deciding, when the file is created, how much history it will keep at each resolution and consolidating everything older. The stock OpenNMS collection config keeps 5-minute averages for 7 days, hourly averages for 62 days, and daily averages, min and max for 366 days. That works out to 37.5 KB per metric, and it never gets any bigger, but it's also throwing away data by aggregating it. The 5-minute samples from last month are gone. A 90-day graph is 91 points; a 1-year graph is 366.
The pgtimeseries plugin stores every sample it's handed, at the resolution it was collected, until the partition it lives in ages past the retention policy (one year by default) and gets dropped. A 365-day graph is drawn from the same 5-minute samples as a 1-day graph.
Everything you love about PostgreSQL, applied to your metrics
This is why I wrote the plugin in the first place. Once performance data is rows in a table, you get all the flexibility that entails:
Backup. With the pgtimeseries plugin, pg_dump, pg_basebackup, or whatever backup tooling you already use covers the metrics too, consistent with the nodes, interfaces, and resources they belong to. If the metrics are in an external database, back that up on its own schedule. Point-in-time recovery works on time series the same as on anything else.
Replication. Streaming replication carries the metrics to the standby along with everything else. There's no second mechanism to set up or monitor.
Read-only replicas. With the metrics in PostgreSQL, a replica can serve every report, every Grafana dashboard, and every ad-hoc query, and the primary never sees that load. Point the reporting tools at the replica and leave the primary to OpenNMS.
Reporting. The metrics table is a table. Anything that talks to PostgreSQL can report on it, and most things already do.
Scale out. Set externalDatasourceURL and the metrics table lives in a separate PostgreSQL database on its own hardware, with its own connection pool, backup policy, and retention, keeping the OpenNMS database dedicated.
One fewer thing to run
OpenNMS has other alternatives to RRD. The Time Series Storage layer opened the door to Prometheus (Victoria Metrics/Cortex/Mimir/Thanos/etc), TimescaleDB, and others. Each of those is a new system that requires additional operational work.
OpenNMS already depends on PostgreSQL, it's already backed up and monitored, and somebody on your team already knows how to tune it. The plugin requires PostgreSQL 16 or later and nothing else.
Compression with citus_columnar
Compression makes keeping older samples cheaper. If the citus_columnar extension is installed, maintenance converts partitions older than compressionPolicy (three months by default) from the normal heap storage to columnar. Columnar stores each column's values together, and a run of timestamps five minutes apart and a run of mostly-similar doubles both compress very well.
Without the optional extension, the policy is ignored with a log message and everything else works. With it, set the policy with ts-config -c and old partitions get compressed on the next maintenance run. Recent partitions stay heap tables, so writes and the graphs people actually look at aren't affected.
How it compares to RRD
Let's look at both side by side:
Writes. RRD updates every file in place, so write IOPS grow with the metric count. The plugin batches inserts through a write-behind buffer, so its IOPS stay close to flat.
| Metrics | RRD write IOPS | pgtimeseries write IOPS | RRD write MB/s | pgtimeseries write MB/s |
|---|---|---|---|---|
| 25k | 111 | 86 | 1.1 | 0.8 |
| 100k | 164 | 88 | 2.7 | 1.1 |
| 200k | 239 | 94 | 4.2 | 1.7 |
| 400k | 398 | 105 | 7.1 | 3.0 |
| 800k | 807 | 122 | 11.0 | 4.7 |
Both wrote 100% of samples at every step with the disk uncapped. With the disk capped at 400 IOPS, roughly what a modest cloud volume gives you, RRD hit the cap at 400k metrics and fell over at 800k, writing 30% of samples with a queue growing without bound. The pgtimeseries plugin handled 1.6M metrics at 124 write IOPS, under a third of the cap, with no backlog and 0.4% I/O pressure. On the same IOPS budget it carries at least 4x the metrics, and its limit on that host was CPU and memory, not disk.
Reads. Up to 7 days the two are indistinguishable (29 ms vs 34 ms for a warm 1-day graph). Past that, pgtimeseries reads every raw sample it's going to plot while RRD reads a pre-averaged archive, so a warm 365-day graph took 1.8 seconds against RRD's 24 ms, and a cold one 19.5 seconds. On compressed partitions the planner scans the whole key column of every partition, which made 1-year graphs significantly slower.
Disk. This is where the pgtimeseries plugin pays the price of keeping every sample. The plugin uses 112.7 bytes per sample uncompressed (52.2 of data, 60.6 of indexes) and 46.5 compressed. RRD uses 8 bytes per sample and, with stock RRAs, throws most of them away after a week.
| 800k metrics, allocated on disk | 3 months | 1 year |
|---|---|---|
| RRD, stock RRAs (5-min for 7 days, then hourly and daily) | 31 GB | 31 GB |
| RRD, 5-min for a full year, then hourly and daily | 691 GB | 691 GB |
| pgtimeseries, uncompressed | 2.4 TB | 9.5 TB |
| pgtimeseries, compressed after 3 months (default) | 2.4 TB | 5.3 TB |
The fair comparison is the second row against the last two, since that's the only RRD layout keeping the same data: pgtimeseries uses 7.7x the disk of RRD for a full year with compression, 13.7x without. Most of the gap against the stock layout is data RRD has aggregated away.
Trying it
Release KARs are built for Plugin API 1.6.1 (Meridian 2024 and 2025, Horizon 35 and older) and 2.0.0 (Meridian 2026, Horizon 36 and newer), so there's one for whatever you're running. Drop the KAR in $OPENNMS_HOME/deploy, switch the time series strategy, and install the feature:
echo "org.opennms.timeseries.strategy=integration" | sudo tee -a etc/opennms.properties.d/timeseries.properties
echo "org.opennms.rrd.storeByForeignSource=true" | sudo tee -a etc/opennms.properties.d/timeseries.properties
Restart OpenNMS, then from the Karaf shell:
admin@opennms()> feature:install opennms-pgtimeseries-tss-plugin
admin@opennms()> opennms-pgtimeseries:ts-config
admin@opennms()> opennms-pgtimeseries:maintenance status
Source, releases, and the full configuration reference are on GitHub. It's AGPL; issues and pull requests welcome. For background on the storage layer the plugin sits on, see the Time Series Storage introduction in the OpenNMS docs.
If you're deciding where your metrics should live, or want to talk through what retention and replication would look like for your install, contact our team.