{"id":23811,"library":"grafana-foundation-sdk","title":"Grafana Foundation SDK","description":"A set of tools, types and libraries for building and manipulating Grafana objects (e.g., dashboards, alerts) in Python. Current version: 10.1.0 (pre-release versioning). Released irregularly alongside Grafana versions.","status":"active","version":"1769699998!10.1.0","language":"python","source_language":"en","source_url":"https://github.com/grafana/grafana-foundation-sdk","tags":["grafana","dashboard","monitoring","sdk","observability"],"install":[{"cmd":"pip install grafana-foundation-sdk","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Top-level exports do not include models; must import from the specific submodule.","wrong":"from grafana_foundation_sdk import Dashboard","symbol":"Dashboard","correct":"from grafana_foundation_sdk.models.dashboard import Dashboard"},{"note":"The library uses builders, not a single class. Common mistake to look for a 'GrafanaDashboard' class.","wrong":"from grafana_foundation_sdk import GrafanaDashboard","symbol":"GrafanaDashboard","correct":"from grafana_foundation_sdk.builders.dashboard import DashboardBuilder"}],"quickstart":{"code":"from grafana_foundation_sdk.builders.dashboard import DashboardBuilder\nfrom grafana_foundation_sdk.models.dashboard import Dashboard\n\nbuilder = DashboardBuilder(\n    title=\"My Dashboard\",\n    tags=[\"generated\"]\n)\npanel = builder.add_panel(\n    title=\"CPU Usage\",\n    type=\"timeseries\",\n    datasource={\"type\": \"prometheus\", \"uid\": \"prometheus_default\"}\n)\ndashboard: Dashboard = builder.build()\nprint(dashboard.model_dump_json(indent=2))","lang":"python","description":"Build a minimal dashboard with one panel and export as JSON."},"warnings":[{"fix":"Use `pip install grafana-foundation-sdk==1769699998!10.1.0` to pin.","message":"The SDK versioning uses a epoch-like timestamp prefix (e.g., 1769699998!10.1.0). This is non-standard and may break tools that parse version numbers like PEP 440. Pin to exact version.","severity":"breaking","affected_versions":"All versions (e.g., 1769699998!10.1.0)"},{"fix":"Import from the correct submodule: `from grafana_foundation_sdk.models.dashboard import Dashboard`.","message":"Models are not re-exported at the top-level `grafana_foundation_sdk` package. Attempting `from grafana_foundation_sdk import Dashboard` will fail with ImportError.","severity":"gotcha","affected_versions":"All"},{"fix":"Migrate imports to `grafana_foundation_sdk.models.*` and `grafana_foundation_sdk.builders.*`.","message":"The `grafana-foundation-sdk` package pre-10.0 used different model paths and builders. Version 10.0+ introduced a new model hierarchy and deprecated old imports like `grafana_foundation_sdk.schema`.","severity":"deprecated","affected_versions":"<10.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install grafana-foundation-sdk` (note the hyphens in the package name).","cause":"Package not installed in current environment.","error":"ModuleNotFoundError: No module named 'grafana_foundation_sdk'"},{"fix":"Use `from grafana_foundation_sdk.models.dashboard import Dashboard`.","cause":"Trying to import model from package root, but models are in submodules.","error":"ImportError: cannot import name 'Dashboard' from 'grafana_foundation_sdk'"},{"fix":"Use `DashboardBuilder().add_panel(...)` or the appropriate builder class.","cause":"Trying to create a panel by directly instantiating `Panel()` model class instead of using builder.","error":"TypeError: Panel() takes no arguments"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}