Kommo + Apache Superset: Sales BI Analytics Without License Costs

Kommo + Apache Superset: Sales BI Analytics Without License Costs

Apache Superset is an open-source BI platform with enterprise-level capabilities: 40+ visualization types, SQL Lab for ad hoc queries, role-based access, embeddable dashboards. Unlike Metabase Community or Google Looker Studio, Superset has no user count limits and allows fine-grained data access control. Connecting Kommo to Superset via an intermediate database delivers full-featured pipeline BI analytics without licensing costs.

Superset vs Metabase: When to Choose Which

Both tools are open source and both connect to PostgreSQL. The difference lies in the depth of capabilities and the complexity of setup.

ParameterApache SupersetMetabase Community
Visualization types40+ (including heatmap, treemap, sunburst)~20
SQL LabYes (full IDE)Simplified
Role-based accessGranular (row-level security)Basic
Embedding (embed)Yes (free)Paid (Pro)
Deployment time30–60 min (Docker Compose)5–10 min
Entry thresholdHigherLower

Metabase is the right choice when the team is small and a quick start is needed. More details on that approach in the article on Kommo and Metabase for CRM analytics. Superset is the choice when enterprise flexibility, embedding dashboards in a product, or strict role-based access is required.

Architecture: Kommo -> PostgreSQL -> Superset

Superset does not connect directly to the Kommo API — it works with relational databases. An ETL pipeline is required:

Kommo API (every 15–60 min)
  ↓ ETL script
PostgreSQL

Apache Superset -> dashboards, SQL Lab, alerts

The table schema is the same as for Metabase: leads, contacts, lead_status_history, tasks, users, pipelines. The key table for time-on-stage analytics is lead_status_history.

Deploying Superset via Docker Compose

# docker-compose.yml (minimal configuration)
version: '3'
services:
  superset:
    image: apache/superset:latest
    ports:
      - '8088:8088'
    environment:
      - SUPERSET_SECRET_KEY=your-secret-key-here
    volumes:
      - superset_home:/app/superset_home

volumes:
  superset_home:

After startup:

docker exec -it superset superset fab create-admin \
    --username admin --firstname Admin \
    --lastname User --email admin@example.com \
    --password yourpassword

docker exec -it superset superset init

Superset is available at localhost:8088. Connect to PostgreSQL via Settings -> Database Connections -> postgresql://user:pass@host:5432/db.

ETL: Exporting Data from Kommo

The same incremental approach as for Metabase:

def sync_kommo_to_postgres():
    last_sync = get_last_sync_timestamp()

    # Leads changed since the last sync
    leads = kommo_api.get_leads(
        updated_from=int(last_sync.timestamp()),
        with_=["contacts", "custom_fields"]
    )

    for lead in leads:
        upsert_lead(lead)  # INSERT ... ON CONFLICT (id) DO UPDATE
        upsert_lead_contacts(lead)

    # Status change history
    events = kommo_api.get_events(
        filter_type="lead_status_changed",
        created_from=int(last_sync.timestamp())
    )
    for event in events:
        insert_status_history(event)

    save_sync_timestamp(datetime.now())

Runs via cron every 15–30 minutes for real-time dashboards.

Row-Level Security: Role-Based Data Access

Superset supports Row-Level Security (RLS) — restricting table rows for specific users or groups. This is critical when department heads should only see their own deals:

-- RLS rule: a manager sees only their own deals
-- Binding: Superset user.username = kommo.users.email
[responsible_user_email] = '{{current_username()}}'

Configure in Superset: Security -> Row Level Security -> Add Rule. Applied to the leads table — each manager sees only their own rows, the manager (admin role) sees everything.

Dashboard Examples

Pipeline with conversion by stage (Funnel Chart):
Superset has a native Funnel Chart — no SQL needed for a basic pipeline. Source: leads table, grouped by status_id, sorted by count.

Time on stage (Box Plot or Heatmap):

SELECT
  stage_name,
  PERCENTILE_CONT(0.5) WITHIN GROUP
    (ORDER BY hours_on_stage) AS median_hours,
  PERCENTILE_CONT(0.9) WITHIN GROUP
    (ORDER BY hours_on_stage) AS p90_hours
FROM lead_status_history h
JOIN stages s ON h.to_status = s.id
WHERE h.changed_at > NOW() - INTERVAL '90 days'
GROUP BY stage_name

Cohort analytics (leads by creation month -> conversion):

SELECT
  DATE_TRUNC('month', created_at) AS cohort_month,
  COUNT(*) AS total,
  COUNT(*) FILTER (WHERE status_id = 142) AS won,
  ROUND(100.0 * COUNT(*) FILTER (WHERE status_id = 142) / COUNT(*), 1) AS win_rate
FROM leads
GROUP BY 1
ORDER BY 1

Dashboard Embedding

Superset supports the Guest Token API for embedding dashboards in third-party applications without login:

# Get a guest token
response = requests.post(
    f'{SUPERSET_URL}/api/v1/security/guest_token/',
    json={
        'user': {'username': 'guest'},
        'resources': [{'type': 'dashboard', 'id': DASHBOARD_UUID}],
        'rls': [{'clause': f'responsible_user_email = \'manager@company.com\''}]
    },
    headers={'Authorization': f'Bearer {admin_token}'}
)
guest_token = response.json()['token']

The dashboard is embedded in an iframe with ?token={guest_token} — without the need to create a Superset account for each manager.

Who This Is Relevant For

Kommo + Superset makes sense if:
— Dashboards are needed in a product or client portal (embedded analytics)
— Strict row-level security is required: managers see only their own data
— An analytics team wants SQL Lab without restrictions
— Scale: 50,000+ deals, where Metabase starts slowing down on complex queries
— There is no budget for Tableau ($70/user/month) or Looker ($3,000+/month)

Frequently Asked Questions

Superset is more complex than Metabase — is it worth switching?

If the current tool handles the job — there is no reason to switch. Superset provides advantages in three specific cases: dashboard embedding, row-level security, and advanced visualization types (heatmap, treemap). If those needs are absent — Metabase is simpler and faster to configure.

How to update Superset without losing settings?

All settings (dashboards, charts, datasets) are stored in the Superset PostgreSQL metadata (a separate database from the Kommo data). When updating the Docker image, data is not lost if volumes are correctly configured. It is recommended to export dashboards to ZIP (Dashboard -> Export) before updating.

Which database is better — PostgreSQL or ClickHouse?

Up to 5 million rows — PostgreSQL with indexes handles it. At larger volumes and GROUP BY across hundreds of millions of rows — ClickHouse is 10–100 times faster. For most Kommo accounts (up to 100,000 deals), PostgreSQL is sufficient.

Does Superset support alerts?

Yes. Superset has built-in Alerts & Reports: set a condition (e.g., conversion < 10%) -> send an email or Slack message. Requires Celery and Redis configuration in docker-compose.

Summary

  • Apache Superset is an open-source alternative to Tableau and Looker with enterprise features: row-level security, embedding, SQL Lab
  • Architecture is identical to Metabase: Kommo API -> PostgreSQL (ETL every 15–30 min) -> Superset
  • Advantage over Metabase: granular access control, embedded analytics, 40+ visualization types
  • Deployment via Docker Compose, 30–60 minutes
  • Typical development timeline for ETL + basic dashboards — 3–4 weeks

If you need Kommo pipeline analytics with portal embedding or row-level security for managers — describe the task. Exceltic.dev will assess the data volume and configure the ETL + Superset.

More articles

All →