Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita81845f

Browse files
authored
docs: add example grafana dashboard for aibridge (#20197)
1 parentaa8a75c commita81845f

File tree

7 files changed

+1457
-3
lines changed

7 files changed

+1457
-3
lines changed

‎docs/ai-coder/ai-bridge.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
>[!NOTE]
44
>AI Bridge is currently an_experimental_ feature.
55
6-
![AI bridge diagram](https://i.imgur.com/wIQiLHv.png)
6+
![AI bridge diagram](../images/aibridge/aibridge_diagram.png)
77

88
AI Bridge is a smart proxy for AI. It acts as a man-in-the-middle between your users' coding agents / IDEs
99
and AI providers like OpenAI and Anthropic. By intercepting all the AI traffic between these clients and
@@ -90,14 +90,16 @@ AI Bridge collects:
9090

9191
All of these records are associated to an "interception" record, which maps 1:1 with requests received from clients but may involve several interactions with upstream providers. Interceptions are associated with a Coder identity, allowing you to map consumption and cost with teams or individuals in your organization:
9292

93-
![User Prompt logging](https://i.imgur.com/TZLgkLy.png)
93+
![User Prompt logging](../images/aibridge/grafana_user_prompts_logging.png)
9494

9595

9696
These logs can be used to determine usage patterns, track costs, and evaluate tooling adoption.
9797

9898
This data is currently accessible through the API and CLI (experimental), which we advise administrators export to their observability platform of choice. We've configured a Grafana dashboard to display Claude Code usage internally which can be imported as a starting point for your tooling adoption metrics.
9999

100-
![Grafana Dashboard](https://i.imgur.com/kyWqES5.png)
100+
![User Leaderboard](../images/aibridge/grafana_user_leaderboard.png)
101+
102+
We provide an example Grafana dashboard that you can import as a starting point for your tooling adoption metrics. See[here](../examples/monitoring/dashboards/grafana/aibridge/README.md).
101103

102104
##Implementation Details
103105

179 KB
Loading
50.7 KB
Loading
217 KB
Loading
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#AI Bridge Grafana Dashboard
2+
3+
A sample Grafana dashboard for monitoring AI Bridge token usage, costs, and cache hit rates in Coder.
4+
5+
![AI Bridge example Grafana Dashboard](./grafana_dashboard.png)
6+
7+
The dashboard includes three main sections with multiple visualization panels:
8+
9+
**Usage Leaderboards** - Track token consumption across your organization:
10+
- Bar chart showing input, output, cache read, and cache write tokens per user
11+
- Total usage statistics with breakdowns by token type
12+
13+
**Approximate Cost Table** - Estimate AI spending by joining token usage with live pricing data from LiteLLM:
14+
- Per-provider and per-model cost breakdown
15+
- Input, output, cache read, and cache write costs
16+
- Total cost calculations with footer summaries
17+
18+
**Interceptions** - Monitor AI API calls over time:
19+
- Time-series bar chart of interceptions by user
20+
- Total interception count
21+
22+
**Prompts & Tool Calls Details** - Inspect actual AI interactions:
23+
- User Prompts table showing all prompts sent to AI models with timestamps
24+
- Tool Calls table displaying MCP tool invocations, inputs, and errors (color-coded for failures)
25+
26+
All panels support filtering by time range, username, provider (Anthropic, OpenAI, etc.), and model using regex patterns.
27+
28+
##Setup
29+
30+
1.**Install the Infinity plugin**:`grafana-cli plugins install yesoreyeram-infinity-datasource`
31+
32+
2.**Configure data sources**:
33+
-**PostgreSQL datasource** (`coder-observability-ro`): Connect to your Coder database with read access to`aibridge_interceptions`,`aibridge_token_usages`,`aibridge_user_prompts`,`aibridge_tool_usages` and`users`
34+
-**Infinity datasource** (`litellm-pricing-data`): Point to`https://raw.githubusercontent.com/BerriAI/litellm/refs/heads/main/model_prices_and_context_window.json` for model pricing data
35+
36+
3.**Import**: Download[`dashboard.json`](https://raw.githubusercontent.com/coder/coder/main/examples/monitoring/dashboards/grafana/aibridge/dashboard.json) from this directory, then in Grafana navigate to**Dashboards****Import****Upload JSON file**. Map the data sources when prompted.
37+
38+
##Features
39+
40+
- Token usage leaderboards by user, provider, and model
41+
- Filterable by time range, username, provider, and model (regex supported)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp