User telemetry and Performance Data

Hi,

Regarding User Telemetry and Performance data , I refer to the following documentation. CHT collects telemetry data automatically. Unfortunately, I’m having difficulty locating them in the database. To examine the data, I utilize the fauxton interface.

Please navigate to the medic-user-<username>-meta database or medic-users-meta database in CouchDB Fauxton. The URLs should look something like these:

  1. User specific: https://localhost/_utils/#database/medic-user-username-meta/_all_docs
  2. All users: https://localhost/_utils/#database/medic-users-meta/_all_docs

After getting there, you can run mango queries to fetch the desired telemetry docs.

{
   "selector": {
      "type": "telemetry"
   }
}

It might be easier to play with the telemetry data if you have the data exported to RDBMS. For that, you can refer to the Couch2pg setup guide.

…and if you do end up deciding to use couch2pg and want to explore using SQL, here’s a sample statement to get you started. couch2pg will put data from CouchDB’s medic-users-meta DB into a table called couchdb_users_meta in PostgreSQL.

SELECT 
	doc#>>'{metadata,user}' AS t_user,
	doc#>>'{metadata,versions,app}' AS t_app_version,
	doc#>>'{metadata,year}' AS t_year,
	lpad(doc#>>'{metadata,month}',2,'0') AS t_month,
	lpad(doc#>>'{metadata,day}',2,'0') AS t_day,		
    jsonb_pretty(doc) AS obj_key

FROM 
    couchdb_users_meta
    
WHERE
	doc->>'type'='telemetry'
	AND doc#>>'{metadata,year}' = '2022'

LIMIT 100
;