- Notifications
You must be signed in to change notification settings - Fork1k
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
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
7 commits Select commitHold shift + click to select a range
ab736e2
feat: add example grafana dashboard for aibridge
matifali802c236
Add example dashboard image to README
matifali65889d0
typo
matifali66f74ee
link grafan dashboard
matifalicbd03c1
move images to repo
matifali698d736
address reveiw suggestions
matifaliac12041
link dashboard
matifaliFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
8 changes: 5 additions & 3 deletionsdocs/ai-coder/ai-bridge.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Binary file addeddocs/images/aibridge/aibridge_diagram.png
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file addeddocs/images/aibridge/grafana_user_leaderboard.png
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff 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. | ||
matifali marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page.
matifali marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
 | ||
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) |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.