We also record several telemetry keys related specifically to replication
and it is tracked for both the medic
DB (contacts, reports) and the meta
DB (telemetry, etc…).
You can see when the most recent replication to the server was completed successfully for the medic
DB by the existence of replication:medic:to:success
, for example (what do these look like when there is nothing to replicate?).
There are also keys like: replication:medic:from:success
and replication:meta:sync:success
, as well as tracking failure
s.
Here’s a way to see the most recent telemetry record and most recent successful replication to the medic DB by user
.
SQL
SELECT
user_name,
max(period_start) AS most_recent_telemetry,
max(period_start) FILTER (WHERE metric = 'replication:medic:to:success') AS most_recent_medic_to_success
FROM
useview_telemetry_metrics
GROUP BY
user_name
Sample output