AI-Generated Onboarding Guide

I turned the Grafana codebase
into an onboarding guide

Millions of lines of code, hundreds of services, dozens of packages — distilled into a single page that gets you productive on day one.

Built with Claude Code. This page was auto-generated by analyzing the Grafana repository — its file structure, architecture, entry points, and patterns. It's a starting point for onboarding, not a substitute for reading the code.
I'm joining as a...
Showing all sections. Pick your role to see a focused view.
TL;DR
What: Open-source platform for dashboards, metrics, logs, and alerting
Backend: Go monolith with Wire DI, xorm ORM, 200+ API endpoints
Frontend: React SPA with Redux Toolkit, Emotion CSS, Yarn workspaces
Data: SQLite/Postgres/MySQL for config; proxies to Prometheus, Loki, etc. for metrics
Plugins: Backend (gRPC) + frontend (JS bundles) for extensibility
Pattern: Modular monolith migrating to Kubernetes-style App SDK

System architecture in 30 seconds

How the entire system fits together — from browser to data source.

graph TB
    subgraph Client["Browser"]
        UI["React SPA
(public/app/)"] end subgraph Server["Go Backend (pkg/)"] API["HTTP API Layer
pkg/api/"] MW["Middleware
(Auth, CSRF, Logging)"] SVC["Service Layer
pkg/services/"] APPS["Modular Apps
apps/"] PLUG["Plugin Host
pkg/plugins/"] end subgraph Data["Data Layer"] DB["SQL Database
(SQLite / Postgres / MySQL)"] CACHE["Cache
(In-memory / Redis)"] end subgraph External["External"] DS["Data Sources
(Prometheus, Loki, etc.)"] BP["Backend Plugins
(gRPC)"] end UI -- "HTTP / WebSocket" --> MW MW --> API API --> SVC API --> APPS SVC --> DB SVC --> CACHE SVC --> PLUG PLUG -- "gRPC" --> BP API -- "Proxy" --> DS style Client fill:#1a2332,stroke:#3b82f6,color:#e0e0e6 style Server fill:#1a2520,stroke:#10b981,color:#e0e0e6 style Data fill:#2a2518,stroke:#fbbf24,color:#e0e0e6 style External fill:#2a1a24,stroke:#f472b6,color:#e0e0e6
Reading this diagram: Arrows show data flow. The browser talks to the backend through middleware (auth, CSRF). The backend either queries the database (for stored config like dashboards) or proxies to external data sources (for live metrics and logs).

What is Grafana?

The big picture in 30 seconds.

📊

Think of it like this

Grafana is a universal dashboard for your infrastructure. Imagine you have 10 different databases, monitoring tools, and log systems. Instead of checking each one separately, Grafana connects to all of them and lets you build visual dashboards, set up alerts ("tell me if the server CPU goes above 90%"), and explore data interactively.

Users connect data sources (Prometheus, Loki, PostgreSQL, etc.), build dashboards with visual panels (graphs, tables, gauges), and create alerting rules that fire notifications when thresholds are crossed.

Go 1.25 TypeScript React Redux Toolkit Wire DI xorm ORM SQLite / Postgres / MySQL gRPC (plugins) Yarn 4 Workspaces

Mental Model

How to think about this codebase without panicking.

This repo has millions of lines of code. That's OK.

You are not expected to understand all of it. Most engineers work in one area at a time. The codebase is a modular monolith: many independent services in the same repository. Think of it like an apartment building — you live in one apartment, you share hallways and utilities, but you don't need to know what's inside every unit.

Your first task will probably touch 2-5 files. Start there. Expand outward only when you need to.

🏠

Frontend = the apartment

What users see and interact with. React components, pages, forms. Lives in public/app/.

⚙️

Backend = the plumbing

Handles data, auth, and business logic. Go services in pkg/.

🔌

Plugins = appliances

Self-contained pieces for specific data sources or panel types. In public/app/plugins/ and pkg/tsdb/.

Product Manager Guide PM

What you need to know about the product — no code required.

You don't need to read code. You need to read the product.

As a PM, your job is to understand what the product does, who uses it, how features are shipped, and where to find what you need. This section gives you that map.

Core Product Areas

Dashboards

The core experience. Users build visual dashboards with panels (graphs, tables, gauges). Each panel queries a data source. Dashboards are saved as JSON. This is what most users interact with daily.

Explore

Ad-hoc querying without dashboards. Engineers use this to investigate incidents, debug issues, and explore metrics/logs/traces. It's the "search engine" for infrastructure data.

Alerting

Rules that fire when conditions are met ("CPU > 90% for 5 min"). Notifications go to Slack, email, PagerDuty, etc. This is what wakes people up at 3 AM.

Data Sources

Connections to external systems. Grafana supports 100+ data sources through plugins. Each has its own query editor UI. This is the "integration layer."

Plugins

Extend Grafana without modifying core. Plugin types: panels (new visualizations), data sources (new integrations), apps (full sub-applications). Community + internal plugins.

Admin & Auth

User management, orgs, teams, RBAC permissions. Supports SSO (SAML, OAuth, LDAP). Organizations isolate tenants. Roles: Viewer, Editor, Admin.

How Features Get Shipped

graph LR
    A["Feature flag
created in code"] --> B["Dev builds behind
flag (off by default)"] B --> C["Flag enabled for
internal/canary"] C --> D["Gradual rollout
to users"] D --> E["Flag removed,
feature is GA"] style A fill:#201a2e,stroke:#a78bfa,color:#e0e0e6 style E fill:#1a2c2a,stroke:#10b981,color:#e0e0e6
Feature flags are your friend. Every feature can be toggled on/off per-instance. Flags are defined in pkg/services/featuremgmt/. When you want to know "is feature X shipped?" — check if its flag is still behind a toggle or if it's been removed (meaning it's GA).

Where to Find Product Context

What you needWhere to look
List of all feature flagspkg/services/featuremgmt/ — every flag with name and description
What the UI looks likeRun the app locally (make run + yarn start) or check staging
What API endpoints existpkg/api/api.go — every HTTP endpoint registered
What data we storepkg/services/sqlstore/migrations/ — database schema history
User-facing configurationconf/defaults.ini — every setting with defaults and comments
Frontend routes / pagespublic/app/routes/routes.tsx — URL to page mapping
User docsdocs/ directory — user-facing documentation source

Key Product Concepts

OSS vs. Enterprise vs. Cloud

OSS = open-source, free. Enterprise = on-prem paid features (RBAC, SAML, reporting). Cloud = Grafana-hosted SaaS. The codebase uses build tags (oss, enterprise) to separate features.

Provisioning

Loading dashboards, data sources, and alerts from YAML files instead of the UI. Used for "infrastructure as code" — teams version-control their Grafana setup alongside their app code.

Scenes

The next-generation dashboard engine. Replaces the older rendering system with a more composable, flexible framework. Active migration — new dashboards use Scenes, old ones are being ported.

Key Concepts Explained SWE

If you're new to backend development or these specific technologies, start here.

Concept

What is an API?

A set of URLs ("endpoints") the frontend calls to get or send data. Example: GET /api/dashboards/uid/abc123 returns a dashboard as JSON.

Concept

What is Middleware?

Code that runs before your request reaches the handler. Like airport checkpoints: identity (auth), luggage scan (CSRF), then logging.

Concept

What is Dependency Injection?

Instead of a service building its own dependencies, they're passed in from outside. Makes testing and swapping easier. Grafana uses Google Wire.

Concept

What is an ORM?

Lets you work with database tables using Go structs instead of raw SQL. Grafana uses xorm.

Concept

What is gRPC?

An efficient way for two programs to talk. Backend plugins run as separate processes and communicate with the main server over gRPC.

Concept

What is Redux?

Central state store for the frontend. Instead of passing data through 15 component levels, components read/write to one shared store.

Concept

What is a Monorepo?

One Git repo containing multiple projects — backend, frontend, packages, plugins, docs, and tests together. Cross-cutting changes in one PR.

Concept

What are Feature Toggles?

On/off switches for features. Code gets merged to main but only activates when the flag is on. Defined in pkg/services/featuremgmt/.

Concept

What are Migrations?

Versioned database schema changes. On startup, Grafana checks which migrations ran and applies new ones. Keeps every instance's DB in sync.

Architecture

High-level system design — how the pieces fit together.

graph TB
    subgraph Client["Browser"]
        UI["React SPA
(public/app/)"] end subgraph Server["Go Backend (pkg/)"] API["HTTP API Layer
pkg/api/"] MW["Middleware
(Auth, CSRF, Logging)"] SVC["Service Layer
pkg/services/"] APPS["Modular Apps
apps/"] PLUG["Plugin Host
pkg/plugins/"] end subgraph Data["Data Layer"] DB["SQL Database
(SQLite / Postgres / MySQL)"] CACHE["Cache
(In-memory / Redis)"] end subgraph External["External"] DS["Data Sources
(Prometheus, Loki, etc.)"] BP["Backend Plugins
(gRPC)"] end UI -- "HTTP / WebSocket" --> MW MW --> API API --> SVC API --> APPS SVC --> DB SVC --> CACHE SVC --> PLUG PLUG -- "gRPC" --> BP API -- "Proxy" --> DS style Client fill:#1a2332,stroke:#3b82f6,color:#e0e0e6 style Server fill:#1a2520,stroke:#10b981,color:#e0e0e6 style Data fill:#2a2518,stroke:#fbbf24,color:#e0e0e6 style External fill:#2a1a24,stroke:#f472b6,color:#e0e0e6
Reading this diagram: Arrows show data flow direction. The browser talks to the backend through middleware. The backend either queries the database (for stored data like dashboards) or proxies to external data sources (for metrics/logs).
Key insight: Grafana is a modular monolith. Services in pkg/services/ are wired together via Google Wire in pkg/server/wire.go. Newer services are being extracted into apps/ using the Grafana App SDK.

Core Components

The major building blocks.

Go

HTTP API

200+ RESTful endpoints under /api. Routes in pkg/api/api.go, handlers in pkg/api/.

Go

Service Layer

Domain services in pkg/services/ — dashboards, users, alerting, data sources. Each exposes an interface, injected via Wire.

Go

Plugin System

Backend plugins (gRPC), frontend plugins (JS bundles). Management in pkg/plugins/.

Go

Modular Apps

Newer services in apps/ with Kubernetes-style APIs. Dashboard, folder, alerting, IAM.

React

Frontend SPA

React app in public/app/. Redux Toolkit, React Router, Emotion CSS-in-JS.

TypeScript

Shared Packages

@grafana/ui, @grafana/data, @grafana/runtime, @grafana/scenes.

Infra

Database

xorm ORM — SQLite (default), PostgreSQL, MySQL. Auto-migrations on startup.

Config

Configuration

INI-based in conf/defaults.ini. Env var overrides. Parsed by pkg/setting/.

Data Flow SWE

How a user request travels through the system — follow the numbers.

sequenceDiagram
    participant B as Browser (React)
    participant M as Middleware
    participant A as API Handler
    participant S as Service Layer
    participant DB as SQL Database
    participant P as Plugin / Data Source

    B->>M: 1. HTTP Request (e.g. POST /api/ds/query)
    M->>M: 2. Auth check, CSRF, logging
    M->>A: 3. Route to handler (pkg/api/)
    A->>S: 4. Call domain service
    S->>DB: 5. Read config (data source settings)
    DB-->>S: 6. Config response
    S->>P: 7. Forward query (gRPC / HTTP proxy)
    P-->>S: 8. Query results (data frames)
    S-->>A: 9. Return data frames
    A-->>B: 10. JSON response → rendered as panels
        

What happens when you view a dashboard?

Step 1-3: Your browser sends a request. Middleware checks "is this user logged in?" and "is this request safe?" If yes, it reaches the API handler.

Step 4-6: The handler asks the service layer for the data. The service checks the database for settings (like which Prometheus server to query).

Step 7-10: The service forwards the data query to the external data source, gets back time series, and returns it as JSON to the browser for rendering.

Development Loop SWE

How your daily edit-build-test cycle works.

graph LR
    A["Edit code"] --> B{"Frontend
or Backend?"} B -->|Frontend| C["Webpack auto-reloads
(yarn start)"] B -->|Backend| D["Air auto-rebuilds
(make run)"] C --> E["Check browser
localhost:3000"] D --> E E --> F["Run tests"] F --> G{"Tests pass?"} G -->|Yes| H["Commit & push"] G -->|No| A style A fill:#1a2332,stroke:#3b82f6,color:#e0e0e6 style H fill:#1a2c2a,stroke:#10b981,color:#e0e0e6

Frontend changes

Edit a .tsx file. Webpack detects the change and reloads your browser automatically. Results in seconds.

Backend changes

Edit a .go file. Air detects the change, recompiles, and restarts the server. Takes 10-30 seconds.

Both at once

You need two terminals. Terminal 1: make run. Terminal 2: yarn start. The backend proxies frontend requests.

Engineering Manager Guide EM

Team structure, code ownership, PR patterns, and deployment — what you need to lead here.

Your job is to understand boundaries, not every function.

You need to know: which teams own which parts of the code, how changes flow from PR to production, where risk concentrates, and what your engineers' daily experience looks like. You don't need to write Go.

Service Ownership Map

The codebase is divided into domain areas. Each area typically maps to a squad or team. Here's the territory:

Domain AreaBackend CodeFrontend Code
Dashboardsapps/dashboard/, pkg/services/dashboards/public/app/features/dashboard/
Alertingapps/alerting/, pkg/services/ngalert/public/app/features/alerting/
Data Sourcespkg/tsdb/, pkg/plugins/public/app/features/datasources/
Explorepkg/services/explore/public/app/features/explore/
Auth & IAMapps/iam/, pkg/services/auth*/public/app/features/auth/
Admin / Userspkg/services/user/, org/public/app/features/admin/
Pluginspkg/plugins/public/app/features/plugins/
Infrastructurepkg/infra/ (logging, DB, cache)packages/ (@grafana/*)

What to Look for in PRs

Scope creep across domains

If a dashboard PR touches alerting code, it's a red flag. Services should be independent. Cross-domain changes need extra review and coordination.

Feature flag discipline

New features should be behind a toggle. Check that risky changes can be turned off without a deploy. Look for featuremgmt.Flag* usage.

Migration risk

Database migrations are irreversible in production. PRs touching sqlstore/migrations/ deserve careful review. Ask: can this be rolled back?

Wire changes

Changes to pkg/server/wire.go affect service startup order and dependencies. They impact everyone. Make sure make gen-go was run.

Deployment & Release Model

Frontend and backend deploy independently. The backend is a Go binary, the frontend is a webpack bundle. They're versioned together but can be deployed at different cadences. This is why cross-cutting PRs should be split: one for backend, one for frontend.
Build tags separate editions. oss (open-source), enterprise (paid on-prem), and pro (additional features). Enterprise features compile only when the tag is active. Most dev work is oss.

Technical Health Indicators

Test coverage

Backend: go test ./... with coverage flags. Frontend: yarn jest --coverage. CI runs tests on every PR. No merge without green CI.

Linting & types

Go: make lint-go. TypeScript: yarn typecheck + yarn lint. These catch common bugs before review. Pre-commit hooks available via make lefthook-install.

Where Do I Look? SWE

Common tasks mapped to the files you need.

I want to change what a page looks like
public/app/features/{feature}/
I want to add a new API endpoint
pkg/api/api.go + pkg/api/{handler}.go
I want to change business logic
pkg/services/{domain}/
I want to add a database column
pkg/services/sqlstore/migrations/
I want to fix a data source query
pkg/tsdb/{datasource}/ or plugin repo
I want to modify a UI component
packages/grafana-ui/src/
I want to add a feature flag
pkg/services/featuremgmt/ + make gen-feature-toggles
I want to change the default config
conf/defaults.ini + pkg/setting/
I want to change frontend-backend communication
public/app/core/services/backend_srv.ts
I want to understand how a service is created
pkg/server/wire.go

Common Recipes SWE

Step-by-step for the tasks you'll do most often.

Add a new backend API endpoint
1.Define the route in pkg/api/api.go
2.Create a handler function in pkg/api/
3.If needed, add a new service in pkg/services/{domain}/
4.Inject into HTTPServer in pkg/api/http_server.go
5.Run make gen-go to regenerate Wire
6.Write a test in pkg/api/{handler}_test.go
Add a new frontend page
1.Create a component in public/app/features/{feature}/
2.Register a route in public/app/routes/routes.tsx
3.Use useStyles2 for Emotion CSS-in-JS styling
4.Fetch data using getBackendSrv().fetch() or RTK Query
5.Write tests with React Testing Library
Add a feature toggle
1.Add your flag in pkg/services/featuremgmt/
2.Run make gen-feature-toggles
3.Backend: features.IsEnabled(ctx, featuremgmt.FlagMyFeature)
4.Frontend: config.featureToggles.myFeature
5.Enable in conf/custom.ini under [feature_toggles]
Add a database migration
1.Go to pkg/services/sqlstore/migrations/
2.Add a new migration function following existing patterns
3.Register it in the migration list
4.Test with make devenv sources=postgres

Key Folders

Where to find things.

PathWhat lives here
pkg/api/HTTP route registration and API handlers
pkg/services/Backend domain services (dashboards, users, alerting, auth, etc.)
pkg/server/Server bootstrap and Wire dependency injection
pkg/tsdb/Built-in time series data source query backends
pkg/plugins/Plugin system — loader, registry, gRPC host
pkg/infra/Infrastructure — logging, metrics, DB access, caching
apps/Modular backend services (App SDK pattern)
public/app/features/Frontend feature code — dashboard, explore, alerting, etc.
public/app/core/Shared frontend services, components, and utilities
packages/Shared npm packages (@grafana/ui, @grafana/data, etc.)
conf/Default and custom configuration files

Important Files SWE

Start here when you need to understand something specific.

Getting Started SWE

Your first day — follow these steps to get up and running.

1

Set up your environment

Node.js v24 (nvm use), Go 1.25, GCC, Corepack (corepack enable). Then yarn install --immutable.

2

Start the backend

make run — builds and starts on localhost:3000. Login: admin / admin. First build ~3 min.

3

Start the frontend

Second terminal: yarn start. Webpack dev server with hot reload. First compile ~45s.

4

Explore the UI

Open localhost:3000, create a dashboard, add a panel, try Explore. Map code to features.

5

Read the key files

pkg/server/wire.go, pkg/api/api.go, public/app/routes/routes.tsx. Get a feel for the patterns.

6

Run the tests

Backend: go test ./pkg/services/xxx/. Frontend: yarn jest --no-watch path/to/file.

7

Make a small change

Find something safe — a label, tooltip, log message. Build, test, see it work. Build confidence before big tasks.

# Quick reference — common commands
make run                                    # Backend with hot reload
yarn start                                  # Frontend dev server
go test -run TestName ./pkg/services/xxx/   # Run specific backend test
yarn jest --no-watch path/to/file           # Run specific frontend test
make lint-go                                # Go linter
yarn lint:fix                               # ESLint auto-fix
yarn typecheck                              # TypeScript type checking
make gen-go                                 # Regenerate Wire DI
make gen-cue                                # Regenerate CUE schemas
make gen-feature-toggles                    # Regenerate feature flag code
make devenv sources=postgres,loki           # Start backing services

Your First Week

A checklist for getting oriented without drowning in code.

Engineering Manager EM

  • Run Grafana locally (make run + yarn start) and explore the UI for 30 min
  • Read the Architecture and Components sections above — understand the layered structure
  • Identify which domain area(s) your team owns — map to the Service Ownership table
  • Review 3-5 recent PRs from your team to understand change patterns and review norms
  • Understand the deploy pipeline — how do PRs reach production? What gates exist?
  • Set up the linting pre-commit hooks: make lefthook-install
  • Read pkg/server/wire.go — not every line, but notice how services are registered. This is the dependency map.
  • Talk to your engineers about pain points: slow builds? flaky tests? unclear ownership?

Product Manager PM

  • Run Grafana locally or get access to a staging instance
  • Create a dashboard from scratch — add panels, pick data sources, experiment with visualizations
  • Set up an alert rule and see it fire (use TestData data source for easy testing)
  • Use Explore to run ad-hoc queries — understand the "investigation" workflow
  • Read the feature flags list in pkg/services/featuremgmt/ — which features are behind toggles?
  • Browse conf/defaults.ini — understand what's configurable and what the defaults are
  • Read user-facing docs in docs/ — these are the docs your users see
  • Understand the OSS vs Enterprise vs Cloud distinction and what features live where
  • Identify which product area you own — map to feature directories in the Product Map above

Debugging Guide SWE

When something breaks, here's where to look.

SymptomWhere to lookWhat to try
Backend won't compile Terminal (make run) Read the Go error — it gives file and line number. Common: missing import or typo.
Frontend won't compile Terminal (yarn start) Webpack shows the error. Also try yarn typecheck.
API returns 401/403 pkg/middleware/ Check auth. Logged in? API key valid? Check middleware logs.
API returns 500 Backend terminal logs Search for "error" in the Go output — full stack trace.
Blank page / JS errors Browser DevTools Console F12 > Console for JS errors, Network tab for failed API calls.
Data source query fails pkg/tsdb/{datasource}/ Use the Query Inspector in the Grafana UI (panel title > Inspect > Query).
Wire generation fails pkg/server/wire.go Usually a circular dependency. Wire's error message shows the cycle.
Test fails unexpectedly The test file itself Run with -v for verbose. Snapshot test? Try yarn test -u.
Pro tip: The two most useful tools are the backend terminal (logs every request with errors) and browser DevTools Network tab (shows every API call). When in doubt, check both.

Glossary

Terms you'll encounter in conversation and in the codebase.

Data Source
A connection to an external system that provides data (Prometheus, Loki, PostgreSQL, etc.).
Dashboard
A page with one or more panels. Saved as JSON in the database. The core product experience.
Panel
A single visualization — graph, table, gauge, stat. Has a data source, query, and display settings.
Data Frame
Internal table-like data structure. All data sources return results in this format.
Wire
Google's compile-time DI tool for Go. Generates code that connects all services. Run make gen-go.
xorm
Go ORM library — maps Go structs to SQL tables. Like ActiveRecord (Ruby) or SQLAlchemy (Python).
CUE
Configuration language for schema definitions. Generates Go + TypeScript types. Run make gen-cue.
Scenes
Newer dashboard rendering framework (@grafana/scenes). Replacing the legacy dashboard engine.
Provisioning
Loading config from YAML files on disk instead of the UI. "Infrastructure as code" for Grafana.
Alerting
Evaluates rules and sends notifications. In pkg/services/ngalert/.
RBAC
Role-Based Access Control. Roles: Viewer, Editor, Admin. Controls who can do what.
App SDK / Modular Apps
Newer backend service pattern in apps/. Kubernetes-style APIs. The architectural direction.
Feature Toggle
On/off switch for a feature. Defined in featuremgmt. Enables gradual rollout without deploys.
OSS / Enterprise / Cloud
Three editions. OSS = free open-source. Enterprise = paid on-prem. Cloud = hosted SaaS.

Frequently Asked Questions

Questions every new hire asks in the first week.

Technically yes (yarn start will run), but most pages will show errors because they need API data. You almost always need both make run (backend) and yarn start (frontend) running simultaneously in two terminals.
Not for basic development. Grafana uses embedded SQLite by default, so no external database is needed. You only need Docker if you want to test with PostgreSQL or MySQL: make devenv sources=postgres.
Delete the SQLite file at data/grafana.db (relative to the repo root) and restart the server. It will recreate a fresh database with migrations applied. Login resets to admin / admin.
The first make run compiles the entire Go binary with debug symbols (-gcflags all=-N -l), which takes ~3 minutes. Subsequent rebuilds via hot-reload (Air) only recompile changed packages and are much faster. Frontend first compile (yarn start) takes ~45 seconds.
Create or edit conf/custom.ini and add:

[feature_toggles]
myFeatureName = true

Then restart the backend. The feature flag names are in pkg/services/featuremgmt/.
Look at the URL. For example, /explore maps to public/app/features/explore/. Routes are defined in public/app/routes/routes.tsx — search for the URL path and it will point you to the component.
Search in pkg/api/api.go for the URL path (e.g., /api/dashboards). The route registration points to the handler function. The handler lives in pkg/api/.
No. Only run codegen when you change specific things:
make gen-go — after changing service constructors or Wire dependencies
make gen-cue — after changing CUE schemas in kinds/
make gen-feature-toggles — after adding/changing feature flags

Most day-to-day changes don't require any codegen.
pkg/services/ is the original pattern — services wired together in one process via Google Wire. apps/ is the newer pattern using the Grafana App SDK with Kubernetes-style APIs. New services go in apps/, but most existing code is still in pkg/services/. Both coexist.

AI Limitations

This guide was generated by AI. Here's what that means.

Use this as a starting point, not absolute truth.

Claude Code analyzed the repository structure, file contents, and code patterns to produce this guide. It's a best-effort interpretation — not a reviewed specification.

How to validate: When in doubt, check the actual code, ask a teammate, or look at recent PRs in the area you're working on. This guide gets you oriented — your colleagues get you accurate.

Gotchas & Tips

Things that trip up new engineers.

Wire DI: Changed how a service is initialized? Run make gen-go. Skip it and the code won't compile.
Frontend tests include --watch: yarn test never finishes. Use yarn jest --no-watch path/to/file.
Feature toggles: Run make gen-feature-toggles after adding flags. Enable in conf/custom.ini.
Two servers, not one: You need both make run AND yarn start for the full dev experience.
First build is slow: Backend ~3 min, frontend ~45s. This is normal. Subsequent rebuilds are faster.
Build tags: oss (default), enterprise, pro. You'll mostly work with oss.
Plugin workspaces: Some plugins (Loki, Tempo, etc.) are separate Yarn workspaces. Build individually: yarn workspace @grafana-plugins/<name> dev.
Don't try to understand everything at once. Focus on your feature area. Use grep and "Go to Definition" liberally. Ask teammates about unfamiliar patterns.