Skip to content

Add Nightscout database size info row and alarm#697

Open
bjorkert wants to merge 1 commit into
devfrom
feature/nightscout-dbsize
Open

Add Nightscout database size info row and alarm#697
bjorkert wants to merge 1 commit into
devfrom
feature/nightscout-dbsize

Conversation

@bjorkert

@bjorkert bjorkert commented Jul 8, 2026

Copy link
Copy Markdown
Member

Nightscout's dbsize plugin exposes the database size at /api/v2/properties/dbsize. A new scheduler task polls it every 6 hours and surfaces the result in two places.

Info row — a new optional DB Size row showing used MiB and the percentage of the site's configured limit. Hidden by default.

Alarm — a new Nightscout Database Size alarm firing at or above a percentage threshold, defaulting to 75% to match the plugin's own urgent level. The database fills over weeks, so it defaults to daytime only.

The percentage is measured against DBSIZE_MAX, which is 496 MiB unless the site owner changed it. The info row therefore leads with the absolute MiB figure, and the alarm editor explains the caveat.

Nightscout's dbsize plugin exposes the Mongo data + index size at
/api/v2/properties/dbsize. Poll it on a new 6 hour scheduler task and
surface it two ways:

- An optional "DB Size" info row showing used MiB and the percentage of
  the site's configured DBSIZE_MAX.
- A new "Nightscout Database Size" alarm that fires at or above a
  percentage threshold, defaulting to 75% to match the urgent level of
  the plugin itself.

The database fills over weeks, so the alarm defaults to day-only and
never repeats at night.

Nightscout still reports the property with a zero size when db.stats()
fails, which would read as an empty database rather than a missing
reading. Treat that as no reading, mirroring how the plugin's own pill
hides itself in that case.
@bjorkert

bjorkert commented Jul 8, 2026

Copy link
Copy Markdown
Member Author
CleanShot 2026-07-08 at 21 39 51@2x CleanShot 2026-07-08 at 21 41 13@2x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant