Powered by AppSignal & Oban Pro

Emisar Product Analytics

00-product-analytics.livemd

Emisar Product Analytics

This notebook pack reports product, revenue, reliability, and security facts from the production PostgreSQL mirror. Every query is aggregate or bounded, runs through an IAM-authenticated local proxy, defaults to read-only, and has a 30-second statement timeout.

Dashboards

  1. Executive overview
  2. Growth and activation
  3. Revenue
  4. Engagement and retention
  5. Runs and reliability
  6. MCP agents and client families
  7. Security and approvals
  8. Account health
  9. Metric definitions and data quality

Setup

Mix.install([
  {:postgrex, "~> 0.22.0"},
  {:kino, "~> 0.19.0"},
  {:kino_vega_lite, "~> 0.1.13"}
])

Code.require_file("/opt/emisar/product_analytics.exs")
alias EmisarProductAnalytics, as: Analytics
db = Analytics.connect!()

Data freshness

freshness =
  Analytics.query(db, """
  SELECT 'accounts' AS dataset, max(inserted_at) AS latest_record FROM accounts
  UNION ALL
  SELECT 'action_runs', max(inserted_at) FROM action_runs
  UNION ALL
  SELECT 'audit_events', max(inserted_at) FROM audit_events
  UNION ALL
  SELECT 'subscriptions', max(updated_at) FROM subscriptions
  ORDER BY dataset
  """)

Analytics.table(freshness)