|
| 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 | +##Setup |
| 6 | + |
| 7 | +1.**Install the Infinity plugin**:`grafana-cli plugins install yesoreyeram-infinity-datasource` |
| 8 | + |
| 9 | +2.**Configure data sources**: |
| 10 | +-**PostgreSQL datasource** (`coder-observability-ro`): Connect to your Coder database with read access to`aibridge_token_usages`,`aibridge_interceptions`, and`users` tables |
| 11 | +-**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 |
| 12 | + |
| 13 | +3.**Import**: Download`dashboard.json` from this directory, then in Grafana navigate to**Dashboards** →**Import** →**Upload JSON file**. Map the data sources when prompted. |
| 14 | + |
| 15 | +##Features |
| 16 | + |
| 17 | +- Token usage leaderboards by user, provider, and model |
| 18 | +- Filterable by time range, username, provider, and model (regex supported) |