Kanject.Insights

View .md

A backend analytics engine you deploy into your own AWS — it ingests your domain events and computes six proven analysis kinds (funnels, cohorts, correlations, and more) with background workers. Define event types in code, run analyses through typed manager services.

You'll learn
  • Provision Insights into your AWS account
  • Register the client surface and the background workers
  • Define event types with IInsightEventManager
  • Know the six built-in analysis kinds and the alerting surface

Provision

bash
kanject baas deploy insights --env dev

Register it in your service

Insights has two registration surfaces from Kanject.Insights.Provider.AwsV2.Extensions: AddKanjectInsight wires the client (define events, run analyses), and AddKanjectInsightWorkers wires the background consumers that ingest events and compute snapshots. Both take a typed InsightOption delegate; generic overloads accept your own data context.

csharp
using Kanject.Insights.Provider.AwsV2.Extensions;var builder = WebApplication.CreateBuilder(args);// The client surface (define events, run analyses).builder.Services.AddKanjectInsight(options =>{    options.Region    = appSettings.AwsRegion;    options.Namespace = appSettings.Stage;});// The background workers that ingest events and compute snapshots.builder.Services.AddKanjectInsightWorkers(options => { /* … */ });var app = builder.Build();app.Run();

Define events, run analyses

This is a server-side engine, not a Track() client. You register the event types you want to analyse through IInsightEventManager, and run each analysis through the manager service for its kind:

csharp
// Define the event types you'll analyse through IInsightEventManager.public class AnalyticsSetup(IInsightEventManager events){    public Task DefineCheckoutEventAsync(CreateInsightEventRequest request)        => events.CreateInsightEventAsync(request);}// Run an analysis through the manager service for its kind.public class Reporting(IFunnelInsightManagerService funnels){    // Build/query a funnel (InsightKind.Funnel) over the ingested events.    // Each InsightKind has its own manager service.}

Six built-in analysis kinds

Every kind is a real InsightKind with its own manager service over the ingested event stream:

  • Standard — deconstruct single events across metrics (IStandardInsightManagerService).
  • Funnel — map a conversion journey and find the friction step.
  • Correlation — relate distinct events and measure significance.
  • Cohort — track a segment's behaviour over time.
  • Comparative — period-over-period trend changes.
  • Event sequence — ordered patterns with temporal constraints.

What you get

  • Backend ingestion — event ingestion + snapshot computation on SQS/EventBridge/SNS workers, in your account.
  • Six analysis kinds — Standard, Funnel, Correlation, Cohort, Comparative, Event Sequence, each a typed manager service.
  • Alert rulesAlertRuleType.Threshold and AlertRuleType.AnomalyDetection with configurable sensitivity.
  • Scheduled evaluation — EventBridge-scheduled alert/snapshot evaluation.
  • Event management — define and toggle event types via IInsightEventManager.
Recap
  • Provision with kanject baas deploy insights; register AddKanjectInsight + AddKanjectInsightWorkers.
  • It's a backend engine — define event types via IInsightEventManager, not a client-side Track().
  • Six InsightKind analyses (Standard/Funnel/Correlation/Cohort/Comparative/EventSequence) via manager services.
  • Threshold and anomaly alert rules run on scheduled evaluation.
Was this page helpful?