litellm icon indicating copy to clipboard operation
litellm copied to clipboard

feat(grafana_dashboard): enable datasource selection via templating

Open minatoaquaMK2 opened this issue 10 months ago • 6 comments

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: image

After: image

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 $datasource template variable on a local Grafana instance.
  • Verified that dashboard panels correctly display data after selecting different datasources via the template variable.

minatoaquaMK2 avatar Apr 24 '25 03:04 minatoaquaMK2

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

vercel[bot] avatar Apr 24 '25 03:04 vercel[bot]

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Apr 24 '25 03:04 CLAassistant

@ishaan-jaff image

minatoaquaMK2 avatar Apr 24 '25 05:04 minatoaquaMK2

image

minatoaquaMK2 avatar Apr 24 '25 05:04 minatoaquaMK2

@minatoaquaMK2 please sign the CLA so we can merge

ishaan-jaff avatar Apr 24 '25 14:04 ishaan-jaff

@ishaan-jaff Thank you for the review. I have signed the CLA.

minatoaquaMK2 avatar Apr 25 '25 08:04 minatoaquaMK2