feat(grafana_dashboard): enable datasource selection via templating
This commit updates the Grafana dashboard configuration to include a datasource template variable. This allows users to dynamically select the datasource directly within the Grafana dashboard, improving flexibility and user experience.
Title
Enable datasource selection via templating
Relevant issues
N/A (This introduces a new feature)
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
- [ ] I have Added testing in the
tests/litellm/directory, Adding at least 1 test is a hard requirement - see details - [x] I have added a screenshot of my new test passing locally
- [x] My PR passes all unit tests on (
make test-unit)[https://docs.litellm.ai/docs/extras/contributing_code] - [x] My PR's scope is as isolated as possible, it only solves 1 specific problem
Type
🆕 New Feature
Changes
This Pull Request introduces a new feature to the Grafana dashboard configuration, enabling users to dynamically select the datasource directly within the dashboard. This is achieved by adding a datasource template variable (e.g., $datasource) to the dashboard configuration. Subsequently, the panel configurations that utilize the datasource are updated to reference this template variable.
Before:
After:
Benefits:
- Increased Flexibility: Users can now switch between datasources on the dashboard without modifying configuration files, improving adaptability across different environments (development, testing, production).
- Improved User Experience: The ability to select datasources via a user-friendly dropdown menu enhances the overall experience.
- Simplified Management: This reduces the need to maintain multiple dashboard configurations tailored to specific datasources.
Testing:
- Successfully tested the addition of the
$datasourcetemplate variable on a local Grafana instance. - Verified that dashboard panels correctly display data after selecting different datasources via the template variable.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| litellm | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 24, 2025 3:30am |
@ishaan-jaff
@minatoaquaMK2 please sign the CLA so we can merge
@ishaan-jaff Thank you for the review. I have signed the CLA.