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
| Omni | OnlyMetrix SQL |
|---|---|
sum | SUM(col) |
count | COUNT(col) |
count_distinct | COUNT(DISTINCT col) |
avg / average | AVG(col) |
min | MIN(col) |
max | MAX(col) |
median | PERCENTILE_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
| Variable | Description |
|---|---|
OMX_API_URL | OnlyMetrix API (default: https://api.onlymetrix.com) |
OMX_API_KEY | OnlyMetrix API key |
OMNI_API_TOKEN | Omni API token (for API pull mode) |
See CLI reference for full command documentation.