Skip to content

Omni Analytics Integration

Import Omni model definitions into OnlyMetrix. Run validation tests, reliability checks, and agent investigations on Omni-sourced metrics.

Quick Start

bash
pip install onlymetrix pyyaml

# From local Omni model repo
omx omni sync --project-dir ~/omni-models --dry-run    # preview
omx omni sync --project-dir ~/omni-models               # sync

# From Omni API
omx omni sync \
  --host https://company.omniapp.co \
  --model-id <uuid> \
  --token $OMNI_API_TOKEN

# After sync — full pipeline works
omx reliability check
omx validation run
omx agent "analyze revenue trends"

What Gets Imported

OnlyMetrix reads Omni .view and .topic YAML files:

  • Views provide source tables, dimensions, and measures
  • Topics provide join relationships between views
  • Dimension types are read directly from Omni (no heuristics)
  • Pass 2b (dimension discovery) is skipped — Omni is the source of truth

Supported Aggregation Types

OmniOnlyMetrix SQL
sumSUM(col)
countCOUNT(col)
count_distinctCOUNT(DISTINCT col)
avg / averageAVG(col)
minMIN(col)
maxMAX(col)
medianPERCENTILE_CONT(0.5)

Python SDK

python
from onlymetrix.omni import parse_omni_project

metrics = parse_omni_project("~/omni-models")
for m in metrics:
    print(f"{m.name}: {m.sql}")
    print(f"  dimensions: {[d.name for d in m.dimensions]}")
    print(f"  joins: {[(j.from_table, j.to_table) for j in m.joins]}")

Environment Variables

VariableDescription
OMX_API_URLOnlyMetrix API (default: https://api.onlymetrix.com)
OMX_API_KEYOnlyMetrix API key
OMNI_API_TOKENOmni API token (for API pull mode)

See CLI reference for full command documentation.

MIT Licensed (SDK) | Proprietary (Server)