Open-Source Wikis

/

Grafana

/

How to contribute

/

Tooling

grafana/grafana

Tooling

The build, lint, and codegen toolchain that surrounds Grafana's source code.

Build orchestration

Tool Used for Config
GNU Make Top-level build/test/run Makefile
Go workspace Multi-module Go build go.work
Yarn 4 (Corepack) JS dependency management package.json, yarn.lock
Nx Affected/cached JS task runs nx.json and per-package project.json
Lerna Coordinated @grafana/* versioning + packing lerna.json
Webpack JS bundling (dev & prod) scripts/webpack/

make orchestrates everything end-to-end: make build, make test, make run, make lint-go, make gen-cue, make gen-go, make gen-feature-toggles, etc.

Linters and formatters

Tool Scope Trigger
ESLint TypeScript/JavaScript yarn lint:ts
Stylelint SCSS yarn lint:sass
Prettier TS/JS/MD/SCSS formatting yarn prettier:write
tsc Type check yarn typecheck
golangci-lint Go static analysis make lint-go. Config: .golangci.yml
go vet, gofmt, goimports Standard Go hygiene called from make lint-go
madge Circular import detection yarn lint:circular
vale Prose linting for docs .vale.ini

Custom rules

Codegen entry points

Command What it generates Inputs
make gen-go Wire DI graph (pkg/server/wire_gen.go) pkg/server/wire.go
make gen-cue Go + TS types from CUE schemas kinds/
make gen-apps Per-app App SDK code apps/<name>/kinds/
make swagger-gen OpenAPI specs (api-merged.json) Swagger annotations on handlers
make gen-feature-toggles Feature flag tables (Go, JSON, CSV, TS) pkg/services/featuremgmt/registry.go
make i18n-extract i18n message catalogs All <Trans> / t() usages
yarn generate:openapi / yarn generate-apis TypeScript API clients OpenAPI specs

After running any make gen-* command, commit the regenerated files alongside the source change. CI re-runs codegen and fails if it produces a diff.

CI

  • CI is dominated by GitHub Actions workflows in .github/workflows/. The repo also hosts policy/release automation: see .policy.yml.
  • Backend tests are sharded with SHARD/SHARDS.
  • Frontend tests are sharded by Jest's built-in --shard flag (yarn test:ci).
  • Code-owners reviews are enforced via GitHub branch protection plus per-team manifests generated by yarn codeowners-manifest.

Plugin tooling (datasource & panel)

  • Build a single workspace plugin: yarn workspace @grafana-plugins/<name> dev.
  • Build all plugins: yarn plugin:build (Nx-orchestrated).
  • Test plugins (used in e2e): under e2e-playwright/test-plugins/ and built via yarn e2e:plugin:build.

Storybook and design system

  • @grafana/ui's Storybook: yarn storybook. Built artifacts via yarn storybook:build.
  • Storybook visual tests: yarn e2e:playwright:storybook.

Devenv

devenv/ holds Docker-Compose stacks for backing services (Postgres, MySQL, Loki, Tempo, InfluxDB, …) plus seed data.

make devenv sources=postgres,loki,tempo
make devenv-down

For dashboards-as-fixtures, devenv/ includes provisioned dashboards for testing layout and data flows.

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

Tooling – Grafana wiki | Factory