Skip to content

Add Grafana integration for CareLink data - #38

Open
albycrescini wants to merge 2 commits into
ondrej1024:mainfrom
albycrescini:albycrescini/grafana-dashboard
Open

albycrescini wants to merge 2 commits into
ondrej1024:mainfrom
albycrescini:albycrescini/grafana-dashboard

Conversation

@albycrescini

Copy link
Copy Markdown

Add Grafana integration for CareLink data

Grafana can visualize the historical CareLink data retained in DuckDB, but it must not query the proxy's actively-written database file. DuckDB is file-based and the proxy is its writer, so the integration publishes a separate read-only replica for Grafana instead.

The replica keeps a stable DuckDB catalog and atomically replaces its Parquet-backed data. This lets Grafana's long-lived datasource connection see new data safely without opening or locking the proxy's primary database.

Changes

  • Add --replica-database to publish a Grafana-readable DuckDB replica.
  • Atomically publish snapshot and history data as Parquet for the replica catalog.
  • Add the Grafana proxy configuration to the systemd service example.
  • Add an importable Grafana dashboard for CareLink pump and CGM data.

Dashboard

This is a live dashboard of my own CGM readings.

- Introduced a new command-line argument `--replica-database` to specify a read-only DuckDB replica for Grafana.
- Implemented the `publish_replica` method in `CareLinkStorage` to atomically publish data to the specified replica database.
- Updated the `start_webserver` function to handle the new argument and call the publish method after saving data.
- Modified the systemd service file to include the new `--replica-database` argument for the CareLink proxy service.
@albycrescini
albycrescini force-pushed the albycrescini/grafana-dashboard branch from dc456b3 to e4d5d95 Compare September 13, 2026 18:46
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