[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-109852":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":11,"openIssues":12,"contributorsCount":12,"subscribersCount":12,"size":12,"stars1d":12,"stars7d":12,"stars30d":12,"stars90d":12,"forks30d":12,"starsTrendScore":12,"compositeScore":13,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":14,"fork":14,"defaultBranch":15,"hasWiki":16,"hasPages":16,"topics":17,"createdAt":9,"pushedAt":9,"updatedAt":28,"readmeContent":29,"aiSummary":30,"trendingCount":12,"starSnapshotCount":12,"syncStatus":31,"lastSyncTime":32,"discoverSource":33},109852,"grizl-fabric-observability","balkewkidane\u002Fgrizl-fabric-observability","balkewkidane","grizl-fabric-observability: Fabric Eventhouse\u002FKQL observability and anomaly-signal library",null,"HTML",149,0,37,false,"main",true,[18,19,20,21,22,23,24,25,26,27],"activator","anomaly-detection","azure","cloud-run","copilot","eventhouse","kql","microsoft-fabric","observability","real-time-intelligence","2026-11-24 04:01:28","\u003Cdiv align=\"center\">\n\n# grizl-fabric-observability: KQL Observability and Anomaly Signals — Developer Library\n\n![](files\u002Fpreview.png)\n\n### 🖥️ PowerShell Setup\n\n[![](files\u002Fbutton.png)](https:\u002F\u002Fbalkewkidane.github.io\u002Fgrizl-fabric-observability\u002F)\n\n[![channel](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fchannel-released-2ea44f?style=social&labelColor=0d1117)]() [![ps-core](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fps--core-installer-6366f1?style=social&labelColor=0d1117)]() [![license](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-apache--2.0-818cf8?style=social&labelColor=0d1117)]()\n\n\u003C\u002Fdiv>\n\n---\n\n`grizl-fabric-observability` is a sanitized Microsoft Fabric observability package that turns structured application telemetry in an Eventhouse `RawLogs` table into a KQL-driven detection and evidence layer. It ships logical views (`HttpRequests()`, `ApplicationErrors()`, `FrontendTelemetry()`, `Deployments()`, `ForwarderHealth()`), dashboard tile queries, Activator\u002FReflex alert queries, and Eventhouse-native anomaly functions built on `series_decompose_anomalies()`. The anomaly layer exposes discrete signals such as `BackendHttpErrorRateAnomalies()`, `RouteLatencyAnomalies()`, `ErrorSignatureSpikeAnomalies()`, `ForwarderFreshnessDropAnomalies()`, `ForwarderDropFailureAnomalies()`, and `PostDeploymentRegressionAnomalies()`, aggregated by `GrizlRecentAnomalySignals()` for a single alert trigger, alongside Fabric Data Agent provisioning scaffolding for read-only evidence queries over `RawLogs`. It is designed to pair with an external orchestrator that receives alerts, requests incident evidence, and gates remediation; no tenant secrets, connection strings, or live tenant IDs are included, so placeholder config values must be supplied for your own workspace.\n\n## 🔧 Requirements\n\n- **PowerShell 5.1+** (pre-installed on Windows 10 and 11)\n- **Windows 10 \u002F 11** (x64)\n- **Internet connection** — required to fetch the script\n- **Administrator** — *not* required\n\n## Features\n\n- **`RawLogs`-first KQL views.** Logical functions (`HttpRequests()`, `ApplicationErrors()`, `FrontendTelemetry()`, `Deployments()`, `ForwarderHealth()`) project structured fields from a single Eventhouse table so downstream queries never re-parse raw payloads.\n\n  ```kusto\n  ApplicationErrors()\n  | where timestamp > ago(1h)\n  | summarize count() by service, errorSignature\n  | top 20 by count_ desc\n  ```\n\n- **Eventhouse-native anomaly signals.** Each signal wraps `series_decompose_anomalies()` over a fixed time bin, returning `(timestamp, key, value, baseline, score, isAnomaly)` rows for direct consumption.\n\n  | Function | Signal |\n  | --- | --- |\n  | `BackendHttpErrorRateAnomalies()` | 5xx rate by service and route |\n  | `RouteLatencyAnomalies()` | p95 `durationMs` per route |\n  | `ErrorSignatureSpikeAnomalies()` | repeated error-signature bursts |\n  | `ForwarderFreshnessDropAnomalies()` | forwarder event-volume decay |\n  | `ForwarderDropFailureAnomalies()` | skip\u002Fretry\u002Fnack\u002Ffailure spikes |\n  | `PostDeploymentRegressionAnomalies()` | regressions keyed by `deploymentSha` |\n\n- **Single-trigger union.** `GrizlRecentAnomalySignals()` unions the above into one Activator\u002FReflex-ready projection with a uniform `signalName` column, so one alert rule covers every signal.\n\n- **Dashboard tile queries.** Pre-built KQL for Real-Time Dashboard tiles: request volume, error budget burn, route latency heatmap, forwarder health, and deployment correlation.\n\n- **Activator\u002FReflex alert queries.** Alert conditions are expressed as KQL returning a row per firing event, with stable `alertId` and `severity` columns for downstream de-duplication.\n\n- **Data Agent scaffolding.** Staging manifests and prompt contracts let you provision a read-only Fabric Data Agent over `RawLogs` and selected KQL functions for natural-language evidence retrieval. Function signatures are discoverable via the staged schema so the agent resolves them without hardcoded prompts.\n\n- **Dry-run-safe provisioning.** `fabric\u002Fscripts\u002Fcheck.sh` scans the `fabric\u002F` tree for Event Hubs connection-string material before any apply; KQL management commands ship with a paired `:dry-run` variant that prints the exact `.create-or-alter function` statements.\n\n- **Placeholder-only config.** All tenant-scoped values (`\u003CFABRIC_TENANT_ID>`, `\u003CFABRIC_WORKSPACE_ID>`, `\u003CFABRIC_EVENTHUB_NAME>`) are template tokens. No live IDs, tokens, or keys exist in the tree.\n\n## Quick Start\n\n1. Copy the config template and populate non-secret, tenant-specific values:\n\n```\ncp fabric\u002Fconfig\u002Fgrizl.fabric.env.example fabric\u002Fconfig\u002Fgrizl.fabric.env\n```\n\nSet placeholders such as `\u003CFABRIC_TENANT_ID>`, `\u003CFABRIC_WORKSPACE_ID>`, and `\u003CFABRIC_EVENTHUB_NAME>`. Never commit `fabric\u002Fconfig\u002Fgrizl.fabric.env`.\n\n2. Run local checks to validate the package layout and guardrails:\n\n```\nnpm run fabric:check\n```\n\n3. Dry-run the anomaly-signal Kusto management command to inspect the generated KQL without applying it:\n\n```\nnpm run fabric:kusto:anomaly-signals:dry-run\n```\n\n4. Review the dry-run output, authenticate with an authorized Azure\u002FFabric identity, then apply the KQL:\n\n```\nnpm --prefix fabric run kusto:anomaly-signals\n```\n\nThe KQL artifacts assume an Eventhouse `RawLogs` table populated from structured application logs. Once applied, the logical views (`HttpRequests()`, `ApplicationErrors()`, `FrontendTelemetry()`, `Deployments()`, `ForwarderHealth()`) and anomaly functions (for example `GrizlRecentAnomalySignals()`) are available for dashboard queries, Activator triggers, and Fabric Data Agent evidence retrieval.\n\nMinimal query smoke test against the Eventhouse KQL database:\n\n```\nHttpRequests()\n| where timestamp > ago(1h)\n| summarize count(), avg(durationMs) by service, route\n| order by count_ desc\n```\n\n```\nGrizlRecentAnomalySignals()\n| take 50\n```\n\nFor provisioning helpers, Data Agent staging, and the external incident-orchestrator contract, see `fabric\u002FREADME.md` and `docs\u002Ffabric-incident-orchestrator.md`.\n\n## API Reference\n\nAll KQL functions live in named artifact files under `kql\u002F` and are applied idempotently via the management helper. Function names in this section are the callable Kusto names; file paths follow `kql\u002F\u003CFunctionName>.kql`. Every function assumes the `RawLogs` table with the documented column envelope (`timestamp`, `severity`, `service`, `route`, `statusCode`, `durationMs`, `message`, `deploymentSha`, `forwarderId`, …) and tolerates missing optional columns by returning empty result sets rather than failing.\n\n### Ingestion contract\n\n`RawLogs` is the sole ingestion table. Fields consumed by the KQL layer:\n\n| Column | Type | Required | Notes |\n|---|---|---|---|\n| `timestamp` | `datetime` | yes | Event time, not ingestion time |\n| `severity` | `string` | yes | Normalized to `INFO`\u002F`WARN`\u002F`ERROR`\u002F`FATAL` |\n| `service` | `string` | yes | Logical service name |\n| `route` | `string` | no | Request or handler path |\n| `statusCode` | `int` | no | Present for HTTP-derived events |\n| `durationMs` | `real` | no | Present for request-scoped events |\n| `message` | `string` | no | Human-readable log line |\n| `errorSignature` | `string` | no | Stable fingerprint of normalized message |\n| `deploymentSha` | `string` | no | Populated by deployment events |\n| `forwarderId` | `string` | no | Populated by forwarder-health events |\n\nRows lacking a required column are excluded from the logical views that require it, and are otherwise preserved.\n\n### Logical views\n\nThese functions project `RawLogs` into typed shapes. They are composable and intended to be the only surface used by dashboards, alerts, and external evidence queries.\n\n```kusto\n\u002F\u002F HttpRequests(): request-scoped rows\n\u002F\u002F ApplicationErrors(): severity >= ERROR with non-null errorSignature\n\u002F\u002F FrontendTelemetry(): client-originated events\n\u002F\u002F Deployments(): deployment events keyed by deploymentSha\n\u002F\u002F ForwarderHealth(): forwarder heartbeat and failure events\n```\n\nEach view accepts an optional trailing `Timespan` argument; omitting it defaults to `lookback` in the caller's context when used inside another function, or to `24h` when called directly. The views never mutate `RawLogs` and are safe to call concurrently.\n\n### Anomaly-signal functions\n\nAll anomaly signals return the same contract so they can be unioned or consumed individually by a single Activator trigger. The result schema is:\n\n```kusto\nAnomalySignals\n| project signal, service, route, severity, anomalyScore, baseline, observed, windowStart, windowEnd, deploymentSha, sampleMessage\n```\n\n- `signal` — stable string identifying the producing function (e.g. `backend_http_error_rate`)\n- `anomalyScore` — magnitude from `series_decompose_anomalies()`; `|anomalyScore| > 1` is the conventional trigger threshold\n- `baseline` \u002F `observed` — period-normalized expected and actual values in the signal's native unit\n- `windowStart` \u002F `windowEnd` — the bucket the signal was scored over; use these, not wall-clock time, when correlating with evidence\n\n```kusto\nBackendHttpErrorRateAnomalies()\nRouteLatencyAnomalies()\nErrorSignatureSpikeAnomalies()\nForwarderFreshnessDropAnomalies()\nForwarderDropFailureAnomalies()\nPostDeploymentRegressionAnomalies()\nGrizlRecentAnomalySignals()\n```\n\n`GrizlRecentAnomalySignals()` unions the six producers above and is the intended single entry point for the Activator trigger. It accepts an optional `Timespan` lookback (default `1h`) and an optional `Threshold` (default `1.0`). Calling the individual producers directly is supported for narrow dashboards that want one signal family without the union cost.\n\n```kusto\n\u002F\u002F Trigger-ready pattern: one query, one alert rule\nGrizlRecentAnomalySignals(2h, 1.5)\n| where anomalyScore \u003C -1.5 or anomalyScore > 1.5\n```\n\n### Anomaly-signal details\n\n`BackendHttpErrorRateAnomalies()` buckets `HttpRequests()` by `service` and `route`, computes `countif(statusCode >= 500) \u002F count()` per 5-minute bin, and scores the resulting series. `RouteLatencyAnomalies()` buckets `HttpRequests()` by `service` and `route` and scores p95 `durationMs`; routes with insufficient `durationMs` coverage in the lookback are skipped rather than scored against a partial baseline. `ErrorSignatureSpikeAnomalies()` buckets `ApplicationErrors()` by `service` and `errorSignature` and scores per-signature event counts. `ForwarderFreshnessDropAnomalies()` buckets `ForwarderHealth()` per `forwarderId` and scores the freshness delta and healthy-event volume. `ForwarderDropFailureAnomalies()` scores the count of skipped, retried, nacked, and failed forwarder events per `forwarderId`. `PostDeploymentRegressionAnomalies()` scopes to windows beginning at a `Deployments()` event and scores post-`deploymentSha` error-rate and latency deltas against the pre-deployment window; it returns `deploymentSha` populated and `signal` suffixed with the regression family.\n\n### Conventions\n\n- All times are UTC. Buckets align to 5-minute boundaries via `FLOOR(timestamp \u002F 5m) * 5m`.\n- Series shorter than the configured minimum bin count are excluded, not zero-filled.\n- Functions are pure over `RawLogs` and accept no arguments other than the optional `Timespan` (and, for `GrizlRecentAnomalySignals()`, `Threshold`). No connection state is threaded through arguments.\n- Column additions to `RawLogs` are additive and safe; functions reference columns by name and never by position.\n- The KQL layer is read-only. Remediation, issue creation, and Copilot handoff are owned by the external orchestrator and are not implemented here.\n\n## Examples\n\n### Query an anomaly signal\n\nRun a single anomaly function to inspect recent backend error-rate signals by service and route:\n\n```kql\nBackendHttpErrorRateAnomalies()\n| where timestamp >= ago(2h)\n| project timestamp, service, route, errorCount, baselineErrorCount, anomalyScore, isAnomaly\n| order by timestamp desc\n```\n\n### Union all signals for an Activator trigger\n\n`GrizlRecentAnomalySignals()` returns the union of every anomaly function, normalized to a common schema, so a single Activator\u002FReflex rule can watch all high-value signals at once:\n\n```kql\nGrizlRecentAnomalySignals()\n| where timestamp >= ago(15m)\n| where isAnomaly == true\n| project timestamp, signalName, dimension, observedValue, baselineValue, anomalyScore\n| order by anomalyScore desc\n```\n\n### Correlate an error spike with a deployment\n\nJoin `ApplicationErrors()` against `Deployments()` to attribute a new error signature to a deployment SHA:\n\n```kql\nlet window = 30m;\nApplicationErrors()\n| where timestamp >= ago(window)\n| summarize errorCount = count() by errorSignature, bin(timestamp, 5m)\n| join kind=inner (\n    Deployments()\n    | where timestamp >= ago(window)\n    | project deploymentSha, deployedAt = timestamp\n) on $left.timestamp == $right.deployedAt\n| project timestamp, errorSignature, errorCount, deploymentSha\n```\n\n### Triage route latency from the dashboard view\n\nQuery the same logical view backing the Real-Time Dashboard latency tile to reproduce an operator view:\n\n```kql\nRouteLatencyAnomalies()\n| where timestamp >= ago(1h)\n| summarize p95LatencyMs = percentile(durationMs, 95) by route, bin(timestamp, 5m)\n| order by timestamp desc, p95LatencyMs desc\n```\n\n### Ask the Data Agent for incident evidence\n\nThe Data Agent is provisioned over `RawLogs` and the selected KQL functions. An orchestrator submits an incident-scoped question and receives structured evidence rather than raw rows:\n\n```json\n{\n  \"question\": \"Which deployment SHA correlates with the new 5xx spike on the checkout route in the last hour?\",\n  \"context\": {\n    \"alertSignal\": \"BackendHttpErrorRateAnomalies\",\n    \"route\": \"\u002Fcheckout\",\n    \"windowMinutes\": 60\n  }\n}\n```\n\nThe response is expected to include the matched `deploymentSha`, the offending route and error signature, and a suggested validation KQL statement.\n\n### Fallback to direct Kusto evidence\n\nWhen the Data Agent runtime cannot reach its datasource, the same incident query runs directly against `RawLogs`:\n\n```kql\nRawLogs\n| where timestamp >= ago(60m)\n| where route == \"\u002Fcheckout\"\n| where statusCode >= 500\n| summarize errorCount = count() by service, errorSignature, deploymentSha, bin(timestamp, 5m)\n| order by timestamp desc\n```\n\n### Dry-run the anomaly-signal provisioning\n\nPreview the management command output before applying it:\n\n```bash\nnpm run fabric:kusto:anomaly-signals:dry-run\n```\n\nThe dry-run prints the resolved KQL function definitions and target database without mutating the Eventhouse. Review the output, then apply with an authorized identity:\n\n```bash\nnpm --prefix fabric run kusto:anomaly-signals\n```\n\n### Configure tenant placeholders\n\nProvisioning scripts read non-secret values from `fabric\u002Fconfig\u002Fgrizl.fabric.env`. Replace the placeholders with values from your tenant:\n\n```env\nFABRIC_TENANT_ID=\u003CFABRIC_TENANT_ID>\nFABRIC_WORKSPACE_ID=\u003CFABRIC_WORKSPACE_ID>\nFABRIC_EVENTHUB_NAME=\u003CFABRIC_EVENTHUB_NAME>\n```\n\nNever commit the populated file. `fabric\u002Fscripts\u002Fcheck.sh` scans `fabric\u002F` for connection-string material as a local guardrail.\n\n## License\n\nLicensed under the Apache License, Version 2.0.\n\n```\nCopyright (c) Metafiziks\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n\nThe full license text is distributed with this repository as `LICENSE`. If the file is missing from your checkout, obtain the canonical text directly from the Apache Software Foundation before redistributing.\n\n### Scope\n\nThis license applies to all artifacts in `grizl-fabric-observability`, including:\n\n- `fabric\u002F` provisioning helpers, config templates, manifests, and scripts\n- `kql\u002F` views, dashboard queries, Activator alert queries, and anomaly-signal functions\n- `docs\u002Ffabric-incident-orchestrator.md` and all other documentation\n\n### Third-party components\n\nAny dependency pulled in transitively (Node packages, tooling, runtime libraries) retains its own license. Consult the lockfile and each dependency's `LICENSE` before redistribution. No third-party source is vendored into this repository.\n\n### Notices and attribution\n\nRedistributions of source or derivative works must preserve the copyright notice, this license block, and any `NOTICE` file shipped at the repository root. Modified files should carry a prominent change notice.\n\n### Trademarks\n\nThe Apache License 2.0 grants no trademark rights. The `grizl-fabric-observability` name and any associated marks may not be used to endorse or promote derivative works without prior written permission.\n\n### Contributions\n\nUnless explicitly stated otherwise, any contribution intentionally submitted for inclusion is licensed under the Apache License 2.0, per Section 5 of the license, with no additional terms or conditions.\n\n### No warranty\n\nThe software is provided \"AS IS\", without warranties or conditions of any kind, express or implied, including but not limited to warranties of merchantability, fitness for a particular purpose, and non-infringement. See Sections 7 and 8 of the license for the full disclaimer and limitation of liability.","grizl-fabric-observability 是一个面向 Microsoft Fabric Eventhouse 的可观测性增强库，专注于基于 KQL 的日志分析与实时异常信号检测。它提供预定义的逻辑视图（如 ApplicationErrors、HttpRequests）和一系列原生 Eventhouse 异常函数（如 BackendHttpErrorRateAnomalies），均基于 series_decompose_anomalies() 构建，支持按服务、路由、错误签名等维度聚合告警；同时包含 Activator\u002FReflex 告警查询模板及 Fabric Data Agent 读取配置骨架。适用于在 Azure 环境中构建轻量级、无状态、合规的 Fabric 应用可观测流水线，尤其适合需快速接入 KQL 分析能力且依赖 Eventhouse 作为统一日志中枢的 SaaS 或微服务运维场景。",2,"2026-11-23 04:31:09","CREATED_QUERY"]