Factory.ai

Open-Source Wikis

/

Grafana

/

Lore

grafana/grafana

Lore

Grafana started as a Kibana 3 fork in early 2013 and has grown into a sprawling observability platform. This page sketches the major eras of the codebase as visible in git history.

Eras

The Kibana fork (Jan 2013 – Sep 2014)

The first commit landed on 2013-01-25. Early Grafana was a JavaScript SPA built on Backbone/Angular and intended primarily for Graphite. The Go backend did not exist yet — Grafana was served as static files plus an Elasticsearch metadata store. The project's PHP-era roots are still visible in the gulpfile.js/grunt-flavored build scripts referenced from older docs.

The Go server (Sep 2014 – 2016)

Grafana 2 introduced a Go backend. The early pkg/cmd/grafana-server/, pkg/api/, and pkg/services/sqlstore/ directories date from this era. Many of the foundational service patterns — interface-per-domain, sqlstore as a single SQL gateway, route registration in pkg/api/api.go — were established here and are still in use.

Plugins and Angular (2016 – 2019)

Grafana 3 and 4 grew the plugin model. Datasource and panel plugins shipped as Angular controllers; the plugin SDK didn't exist yet. The public/app/plugins/ tree was much larger and more organic. Many of the long-lived built-ins (Graphite, OpenTSDB, MySQL/Postgres) trace back to this period. Alerting in this era was the "legacy alerting" engine, eventually replaced.

The React migration (Q4 2018 – ~2021)

Grafana 6 (Mar 2019) shipped the first wave of React panels and replaced the old Explore prototype with the modern React Explore view. Over the next two years the dashboard chrome, panels, and admin pages were rewritten away from Angular. This era introduced the @grafana/data, @grafana/ui, and @grafana/runtime packages so that plugin authors could share Grafana's primitives.

Backend plugin SDK and gRPC plugins (2019 – 2021)

The Go plugin SDK (grafana-plugin-sdk-go) and the gRPC-based plugin host let datasources have a Go backend alongside their TS frontend. This unlocked CloudWatch, Azure Monitor, and Tempo as rich first-party integrations. The pkg/tsdb/<name>/ tree grew sharply during this period.

Unified Alerting (Apr 2021 –)

Grafana 8 (Jun 2021) shipped Unified Alerting — a complete rewrite of the alerting engine that adopted Prometheus/Alertmanager's data model. The old engine was removed in subsequent releases. The current implementation lives in pkg/services/ngalert/ and the unified frontend in public/app/features/alerting/unified/. Alerting remains one of the most actively developed areas.

RBAC and identity (2021 – 2023)

Fine-grained role-based access control arrived in Grafana 8 and matured across 9 and 10. The pkg/services/accesscontrol/ tree was added in this era, replacing the simpler "Viewer / Editor / Admin" check that previously lived in middleware. Service accounts (pkg/services/serviceaccounts/) replaced legacy API keys. SSO settings became dynamic and storable in pkg/services/ssosettings/.

Kubernetes-style API and the App SDK (2023 –)

Starting around Grafana 10/11 the codebase began exposing resources through Kubernetes-style APIs. The apps/ tree, the pkg/storage/ unified storage layer, and the apps/dashboard/ split that powers dashboard-as-resource all date from this period. make gen-cue and make gen-apps are the codegen entry points that drive this layer. Dashboards in particular have multiple coexisting schema versions (v0alpha1, v1, v2alpha1, v2beta1) that this layer manages.

Scenes and the new dashboard runtime (2023 –)

The @grafana/scenes external package and public/app/features/dashboard-scene/ are the long-term replacement for the legacy dashboard model. Scenes is a reactive runtime built on top of rxjs + React; dashboards are progressively moving over.

Longest-standing features

  • Graphite datasource — present since the first commits in 2013, still maintained in public/app/plugins/datasource/graphite/.
  • The pkg/api/ route registration modelRegisterAPIEndpoints patterns date back to ~2014 and still wire most legacy REST endpoints.
  • pkg/services/sqlstore/ — the xorm-based SQL layer is one of the oldest packages still under active maintenance, although new code is moving to unified storage.
  • scripts/build/ — release tooling has been incrementally refactored but the directory has existed for nearly the whole project lifetime.

Deprecated / replaced features

Removed Replaced by Notes
Legacy alerting Unified alerting (pkg/services/ngalert/) Removed across Grafana 9 → 10.
Angular panels and panel editor React panels + dashboard-scene Mostly removed; Angular runtime kept for plugin compatibility behind a feature flag.
API keys Service account tokens API keys still resolve but new tokens are issued as service-account tokens.
Old "OAuth providers" config ssosettings + database storage Static [auth.<provider>] INI sections still work for backwards compatibility.
kindsv2 generator Per-app codegen via make gen-apps Removed in commit 7348764b7ab (Apr 2026).
Gulp/grunt frontend build Webpack + Yarn workspaces + Nx Migration finished by Grafana 7.

Major rewrites

  • Dashboard chrome (2019 – 2021) — Angular → React. Trace this through commits in public/app/features/dashboard/.
  • Alerting (2021 – 2022) — Legacy → Unified. New code is in pkg/services/ngalert/ and the old paths were progressively deleted.
  • Plugin runtime (2019 – 2022) — Angular plugins → React + gRPC backend. The public/app/features/plugins/ loader was rewritten for ESM-style plugins.
  • Storage (2023 –) — Sql-store → unified storage / app-platform. In progress; both layers coexist.

Growth trajectory

The repo grew from a few thousand lines in 2013 to over half a million lines of source today (combined Go + TS, excluding generated code). New apps/<name>/ modules have been the dominant new directories in the last 18 months — most of them appear in commits from 2024–2026 with make gen-apps-flavored CI metadata.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Lore – Grafana wiki | Factory