Homeโ€บ๐Ÿ† Track 5: Masterโ€บModule 182 min read ยท 19/21

Business Analytics

Tutorial

Business Analytics

Business events connect technical metrics to business outcomes โ€” revenue, conversions, user journeys.

Business Event Sources

Source                  How It Works                              Setup
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€    โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
OneAgent HTTP capture   Captures events from HTTP requests         Settings โ†’ capture rules
RUM JavaScript API      dtrum.sendBusinessEvent() from browser     Code in your app
External API            POST /api/v2/bizevents/ingest              Any system โ†’ REST call
Logs via OpenPipeline   Transform log records into bizevents       OpenPipeline config
Mobile / OpenKit        Mobile app business events                 SDK integration

Querying Business Events

// All business events
fetch bizevents
| summarize cnt=count(), by:{event.type, event.provider}
| sort cnt desc

// Revenue tracking
fetch bizevents
| filter event.type == "com.shop.purchase"
| summarize total_revenue=sum(revenue), orders=count()

// Conversion funnel
fetch bizevents
| filter event.type == "com.shop.page.view" OR event.type == "com.shop.add.to.cart" OR event.type == "com.shop.purchase"
| summarize cnt=count(), by:{event.type}

OpenPipeline

OpenPipeline processes all incoming data โ€” logs, events, business events, spans, metrics:

Ingest โ†’ Routing โ†’ Processing โ†’ Storage
  โ†“         โ†“          โ†“           โ†“
OneAgent  Match to   Parse,      Route to
API       pipeline   enrich,     Grail bucket
OTel                 mask

Use cases: mask PII in logs, extract metrics from log patterns, route compliance data to long-retention buckets.

Real User Monitoring (RUM) Analytics

// User sessions
fetch user.sessions
| summarize cnt=count()

// User actions by type
fetch user.events
| summarize cnt=count(), by:{type}
| sort cnt desc

๐Ÿ’ก Business events are the bridge between "the server is slow" and "we're losing revenue." Start by capturing page visits, then add cart events and purchases.

๐Ÿ›  Try it: Open Ctrl+K โ†’ "Business Analytics" โ†’ explore the funnel analysis view. Then try: fetch bizevents | summarize cnt=count(), by:{event.type} | sort cnt desc in a Notebook to see your captured business events.

Business Event DQL Patterns

// Revenue timeseries
fetch bizevents, from:now()-24h
| filter event.type == "com.example.purchase"
| makeTimeseries revenue = sum(amount * price), interval:5m

// Funnel analysis
fetch bizevents, from:now()-7d
| summarize
    browse = countIf(event.type == "page.view"),
    cart = countIf(event.type == "add.to.cart"),
    purchase = countIf(event.type == "purchase")