Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions docs/rfcs/0041-dashboard-datasource-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,3 +373,34 @@ the plugin builds on.
[frontend data proxy](https://grafana.com/developers/plugin-tools/how-to-guides/data-source-plugins/fetch-data-from-frontend).
- Perses — [plugin creation](https://perses.dev/perses/docs/plugins/creation/);
the bundled `Loki` plugin is the reference for a `LogQuery` implementation.

## 9. Verification record

### 9.1 RFC0041.1–.5 — plugin repository (2026-07-27)

Delivered in [`ourios-perses-plugin`](https://github.com/jensholdgaard/ourios-perses-plugin)
PRs #1–#6: `OuriosDatasource` + `OuriosLogQuery` (.1/.2, unit + container
e2e with the RFC 0026 auth matrix — 401 and 403 classified distinctly),
`OuriosTimeSeriesQuery` (.3 — bucket detection positional, NULL scalar
renders as a gap and never zero, series identity keyed on the group tuple),
runtime schema suggestions over the MCP resource (.4, degrading to a plain
field when unreachable). `.5` is deliberately partial: `0.5.0` is the
declared minimum and is what CI exercises; the `latest` leg and wire-level
`sum` e2e land with the next server release, which is the first to carry
RFC 0042 typed columns.

### 9.2 RFC0041.6 — the committed dashboard renders (2026-07-27)

`examples/perses/agent-finops.json` imported unmodified (`percli`-shaped
API upsert) into Perses 0.53.1 with the built plugin archive installed,
against the live dogfood capture (tenant `agent-dogfood`, RFC 0042
promotions from `dogfood-config.yaml`). All four panels rendered from the
capture with no edits to the definition: spend by model
(`sum(attr.cost_usd) by attr.model, bucket(1h)` — two series,
`claude-fable-5` plus `claude-haiku-4-5`, ~$391 across the day's buckets),
output-token throughput (Int64 class, ~40K/h peaks), tool-decision mix,
and the event log (RFC0002.21 floor admitting unspecified-severity GenAI
events). Idle hours draw as gaps, not zeros — the RFC 0042
null-propagation contract on screen. The panel time range arrives as a
DSL `range(...)` stage (the request body carries only the `query`
field), confirming the §3.2 mapping.
36 changes: 36 additions & 0 deletions examples/perses/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Perses FinOps dashboard (RFC 0041)

The committed dashboard definition required by RFC0041.6: agent spend by
model over time (`sum(attr.cost_usd)`), token throughput, tool-decision
mix, and a raw event log — all against a dogfood capture of Claude Code's
own telemetry.

## Prerequisites

- A running Ourios querier with the RFC 0042 typed promotions configured
(the repo's `dogfood-config.yaml` promotes `cost_usd` as `f64` and
`input_tokens`/`output_tokens` as `i64`).
- A Perses instance (≥ 0.53) with the
[`ourios-perses-plugin`](https://github.com/jensholdgaard/ourios-perses-plugin)
archive installed — it provides `OuriosDatasource`, `OuriosLogQuery`,
and `OuriosTimeSeriesQuery`.

## Import

```sh
# from the repository root; adjust url + tenant header for your deployment first
percli apply -f examples/perses/datasource.example.json
percli apply -f examples/perses/agent-finops.json
```
Comment thread
coderabbitai[bot] marked this conversation as resolved.

`datasource.example.json` proxies `POST /v1/query` (panel queries) and
`POST /mcp` (the query editor's schema suggestions, RFC 0032) to the
querier, injecting the tenant header server-side so the browser never
handles credentials.

## What to expect

Every panel renders from the capture with no edits to this definition
(the RFC0041.6 clause). Hours where the agent was idle produce no bucket,
and NULL aggregates render as gaps, never zeros — that is the RFC 0042
null-propagation contract made visible.
189 changes: 189 additions & 0 deletions examples/perses/agent-finops.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
{
"kind": "Dashboard",
"metadata": {
"name": "agent-finops",
"project": "ourios"
},
"spec": {
"display": {
"name": "Agent FinOps \u2014 Ourios dogfood"
},
"duration": "24h",
"panels": {
"spend": {
"kind": "Panel",
"spec": {
"display": {
"name": "Spend by model (USD)",
"description": "sum(attr.cost_usd) from the RFC 0042 typed Float64 column; NULL aggregates render as gaps, never zeros"
},
"plugin": {
"kind": "TimeSeriesChart",
"spec": {
"legend": {
"position": "bottom"
},
"visual": {
"connectNulls": false
}
}
},
"queries": [
{
"kind": "TimeSeriesQuery",
"spec": {
"plugin": {
"kind": "OuriosTimeSeriesQuery",
"spec": {
"query": "scope == \"com.anthropic.claude_code.events\" | sum(attr.cost_usd) by attr.model, bucket(1h)"
}
}
}
}
]
}
},
"tokens": {
"kind": "Panel",
"spec": {
"display": {
"name": "Output tokens",
"description": "sum(attr.output_tokens) from the typed Int64 column"
},
"plugin": {
"kind": "TimeSeriesChart",
"spec": {
"legend": {
"position": "bottom"
},
"visual": {
"connectNulls": false
}
}
},
"queries": [
{
"kind": "TimeSeriesQuery",
"spec": {
"plugin": {
"kind": "OuriosTimeSeriesQuery",
"spec": {
"query": "scope == \"com.anthropic.claude_code.events\" | sum(attr.output_tokens) by bucket(1h)"
}
}
}
}
]
}
},
"decisions": {
"kind": "Panel",
"spec": {
"display": {
"name": "Tool decisions",
"description": "count by the promoted decision attribute"
},
"plugin": {
"kind": "TimeSeriesChart",
"spec": {
"legend": {
"position": "bottom"
},
"visual": {
"connectNulls": false
}
}
},
"queries": [
{
"kind": "TimeSeriesQuery",
"spec": {
"plugin": {
"kind": "OuriosTimeSeriesQuery",
"spec": {
"query": "scope == \"com.anthropic.claude_code.events\" | count by attr.decision, bucket(1h)"
}
}
}
}
]
}
},
"events": {
"kind": "Panel",
"spec": {
"display": {
"name": "Recent agent events",
"description": "RFC0002.21: the severity floor admits unspecified-severity GenAI events"
},
"plugin": {
"kind": "LogsTable",
"spec": {
"allowWrap": true,
"enableDetails": true,
"showTime": true
}
},
"queries": [
{
"kind": "LogQuery",
"spec": {
"plugin": {
"kind": "OuriosLogQuery",
"spec": {
"query": "scope == \"com.anthropic.claude_code.events\" and severity >= trace | limit 100"
}
}
}
}
]
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}
}
},
"layouts": [
{
"kind": "Grid",
"spec": {
"items": [
{
"x": 0,
"y": 0,
"width": 12,
"height": 10,
"content": {
"$ref": "#/spec/panels/spend"
}
},
{
"x": 12,
"y": 0,
"width": 12,
"height": 10,
"content": {
"$ref": "#/spec/panels/tokens"
}
},
{
"x": 0,
"y": 10,
"width": 12,
"height": 10,
"content": {
"$ref": "#/spec/panels/decisions"
}
},
{
"x": 12,
"y": 10,
"width": 12,
"height": 10,
"content": {
"$ref": "#/spec/panels/events"
}
}
]
}
}
]
}
}
34 changes: 34 additions & 0 deletions examples/perses/datasource.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"kind": "Datasource",
"metadata": {
"name": "ourios-ds",
"project": "ourios"
},
"spec": {
"default": true,
"plugin": {
"kind": "OuriosDatasource",
"spec": {
"proxy": {
"kind": "HTTPProxy",
"spec": {
"allowedEndpoints": [
{
"endpointPattern": "/v1/query",
"method": "POST"
},
{
"endpointPattern": "/mcp",
"method": "POST"
}
],
"headers": {
"x-ourios-tenant": "agent-dogfood"
},
"url": "http://127.0.0.1:4319"
}
}
}
}
}
}