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

docs: add example grafana dashboard for aibridge#20197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
matifali merged 7 commits intodk/bridge-docsfromaibridge-grafana-dashboard
Oct 7, 2025
Merged
Show file tree
Hide file tree
Changes fromall 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
8 changes: 5 additions & 3 deletionsdocs/ai-coder/ai-bridge.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@
>[!NOTE]
>AI Bridge is currently an_experimental_ feature.
![AI bridge diagram](https://i.imgur.com/wIQiLHv.png)
![AI bridge diagram](../images/aibridge/aibridge_diagram.png)

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

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:

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


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

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.

![Grafana Dashboard](https://i.imgur.com/kyWqES5.png)
![User Leaderboard](../images/aibridge/grafana_user_leaderboard.png)

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).

##Implementation Details

Expand Down
Binary file addeddocs/images/aibridge/aibridge_diagram.png
View file
Open in desktop
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View file
Open in desktop
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View file
Open in desktop
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletionsexamples/monitoring/dashboards/grafana/aibridge/README.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
#AI Bridge Grafana Dashboard

A sample Grafana dashboard for monitoring AI Bridge token usage, costs, and cache hit rates in Coder.

![AI Bridge example Grafana Dashboard](./grafana_dashboard.png)

The dashboard includes three main sections with multiple visualization panels:

**Usage Leaderboards** - Track token consumption across your organization:
- Bar chart showing input, output, cache read, and cache write tokens per user
- Total usage statistics with breakdowns by token type

**Approximate Cost Table** - Estimate AI spending by joining token usage with live pricing data from LiteLLM:
- Per-provider and per-model cost breakdown
- Input, output, cache read, and cache write costs
- Total cost calculations with footer summaries

**Interceptions** - Monitor AI API calls over time:
- Time-series bar chart of interceptions by user
- Total interception count

**Prompts & Tool Calls Details** - Inspect actual AI interactions:
- User Prompts table showing all prompts sent to AI models with timestamps
- Tool Calls table displaying MCP tool invocations, inputs, and errors (color-coded for failures)

All panels support filtering by time range, username, provider (Anthropic, OpenAI, etc.), and model using regex patterns.

##Setup

1.**Install the Infinity plugin**:`grafana-cli plugins install yesoreyeram-infinity-datasource`

2.**Configure data sources**:
-**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`
-**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

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.

##Features

- Token usage leaderboards by user, provider, and model
- Filterable by time range, username, provider, and model (regex supported)
Loading
Loading

[8]ページ先頭

©2009-2025 Movatter.jp