Connects / Exports / Data and dashboards
Apple Health to Grafana: Grafana Cloud or your own InfluxDB
To chart Apple Health data in Grafana, an iPhone app has to push it into a data source Grafana reads, because Apple Health has no API. Marrow does this for free in two ways: straight to Grafana Cloud's hosted metrics, or straight to your own InfluxDB for a self-hosted Grafana, on a schedule with nothing to run in between.
Open in Marrow works on an iPhone with Marrow 1.7.1 or later.
Automated: Dashboards from InfluxDB Automated: Grafana Cloud
Automated (Dashboards from InfluxDB) Free
Marrow writes to it directly on a schedule, with the app closed. Nothing to run in between. You need: An InfluxDB API token with write on one bucket.
- In Marrow, open Connects, then Exports, and tap Grafana dashboards. Turn Automated on.
- In InfluxDB: Load Data, API Tokens, Generate, write to one bucket.
- In Marrow: tap Connect. Its page asks for:
- Address: Where InfluxDB answers, with its port. It looks like
https://influx.example.com:8086. - Organization: Your org's name. InfluxDB 1.8 and 3 do not need one.
- Bucket: The bucket the token can write to, for example
health. - API token: The token you just made.
- Address: Where InfluxDB answers, with its port. It looks like
Automated (Grafana Cloud) Free
Marrow writes to it directly on a schedule, with the app closed. Nothing to run in between. You need: Grafana Cloud, the free tier works.
- In Marrow, open Connects, then Exports, and tap Grafana dashboards. Turn Automated on.
- In Grafana Cloud: Connections, Add new connection, Hosted Prometheus metrics, pick Influx line protocol, copy the URL, user and make a token.
- In Marrow: tap Connect. Its page asks for:
- Address: The URL Grafana Cloud shows for Influx line protocol. It looks like
https://influx-prod-13-prod-us-east-0.grafana.net. - User: The number Grafana Cloud shows as the user.
- Token: The token you just made.
- Address: The URL Grafana Cloud shows for Influx line protocol. It looks like
What arrives, and how to chart it
Grafana Cloud
Marrow sends Influx line protocol to your stack's hosted metrics, and Grafana Cloud stores each field as a Prometheus series named after the measurement and the field, with the tags as labels. Query them from the stack's own Prometheus data source. Sample series:
daily_qty{metric="step_count", units="count"} 8746
daily_Avg{metric="heart_rate", units="bpm"} 71
daily_totalSleep{metric="sleep_analysis", units="h"} 7.4
workout_duration_min{activity="Running"} 31
set_weight{exercise="Bench Press", set_type="work"} 185
meal_kcal{meal="lunch"} 640
Two things differ from InfluxDB. Grafana Cloud keeps numbers only, so text such as a food's name does not arrive. And it refuses a changed value at a time it already holds, so Marrow sends each day's totals once, when the day is complete, about six hours after midnight. Yesterday's totals show up in the morning. Raw samples, workouts, sets and meals arrive as they happen.
A panel of steps per day is the query daily_qty{metric="step_count"} with the panel's minimum interval set to one day.
Self-hosted Grafana
With your own Grafana, Marrow writes to InfluxDB and Grafana reads the bucket through an InfluxDB data source. The measurements, tags and fields are listed on Apple Health to InfluxDB. Steps per day in an InfluxQL panel:
SELECT last("qty") FROM "daily" WHERE "metric" = 'step_count' AND $timeFilter GROUP BY time(1d)
On both routes the first run sends 90 days unless you pick 30 days, 365 days or All under Advanced, History.
Built with Grafana dashboards
Made something? Add it to Built with Marrow.
If it does not work
In Grafana dashboards
- Test connection fails on InfluxDB. InfluxDB answers 401 when the token is wrong or cannot write to the bucket, and 404 when the org or bucket name is wrong. Check all three on the Connect screen.
- Test connection fails on Grafana Cloud. Use the URL, user and token from the Influx line protocol page of Hosted Prometheus metrics, not the address of your Grafana site. The token must be allowed to publish metrics.
- The dashboard is empty. Each day's totals are stored at noon UTC of that day, so set the time range to the last 30 days or more. The query languages Grafana offers depend on the InfluxDB version, and Flux is not on InfluxDB 3.
- Still running the bridge or Telegraf from before Marrow 1.7? An older automation that posts to the bridge keeps working. The direct connection replaces it, and the bridge can go once the direct one delivers.
Automated checks
- Test with Run now. The line under Run now says what happened. Any 2xx answer counts as delivered. Anything else shows as Server answered and the status code, or the network error.
- Check the Activity log. In the automation, More options, Activity log lists its last 30 runs with the result of each.
- Runs come late. iOS picks the moment for background runs, and a phone that stays locked sends when it is next unlocked. Since last run catches up on the next run that succeeds.
- A receiver on your home network. Marrow needs Local Network access to reach it (Settings, Privacy and Security, Local Network). Tap Run now once with Marrow open, so iOS can ask: in the background it refuses without asking.
- It will not switch on. Each automation that is on counts as a connection. Free keeps 3 connections on at a time. Marrow Pro keeps up to 20: AIs, servers and automations together. Sources never count.
More fixes in the guides: Automated.
Questions
Do I need InfluxDB to use Grafana Cloud?
No. Grafana Cloud takes Marrow's writes itself through its Influx line protocol endpoint and stores them as Prometheus metrics. The free tier works.
Does it work with a Grafana I host myself?
Yes. Marrow writes to your InfluxDB (1.8, 2, 3 or Cloud) and your Grafana reads that bucket. Pick Dashboards from InfluxDB on this page.
Is there a ready-made dashboard?
Not yet from us. Built with Marrow has dashboards people have shared, with the code to copy.
Can Grafana's assistant read my data too?
Yes, that is a different connection: Grafana Assistant reads Marrow over MCP and answers questions about it.
Other ways to do it, and when to pick them
We make Marrow, so here are the alternatives as fairly as we can put them.
- Health Auto Export. It posts JSON to a server you run, and its makers publish an open-source web app for your own dashboards. Automatic exports need its Premium tier. Pick it if you would rather host that stack, or want its Mac and iPad apps. See healthyapps.dev.
- Prometheus you scrape yourself. Post JSON to a small receiver and expose it as metrics. Pick it when Prometheus is already your source of truth and you do not use Grafana Cloud. Start at Apple Health to a webhook.
- Apple's export.zip. Health, your picture, Export All Health Data gives you everything once, as one large XML file. Pick it for a one-time backfill or a backup. It is not a feed, so new data means a new export. Our in-browser converter turns it into CSV.
Related: Apple Health to InfluxDB · Apple Health to Home Assistant · Built with Marrow: shared dashboards
