# appian/grafana architecture

> Architecture diagram of the GitHub repository appian/grafana, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/appian/grafana
- Repository: https://github.com/appian/grafana

## Overview

Grafana is an observability platform for querying and visualizing metrics, logs, and traces, and for defining alerting workflows. Its user-facing path runs from dashboards or Explore through data-source queries to visualized results; dashboards also support reusable variables, mixed data sources, and sharing. Alerting and notification routing form a distinct capability. The supplied tree supports these product areas, but sampled implementation is sparse, so only the public-dashboard query and Zipkin transformation links are drawn as concrete runtime flows.

Main entry points: [`public/app/features/explore`](https://github.com/appian/grafana/tree/main/public/app/features/explore) (Explore), [`packages/grafana-runtime/src/utils/publicDashboardQueryHandler.ts`](https://github.com/appian/grafana/blob/main/packages/grafana-runtime/src/utils/publicDashboardQueryHandler.ts) (Public query handler), [`apps/dashboard/pkg/apis/dashboard`](https://github.com/appian/grafana/tree/main/apps/dashboard/pkg/apis/dashboard) (Dashboards), [`pkg/tsdb/zipkin/handler_querydata.go`](https://github.com/appian/grafana/blob/main/pkg/tsdb/zipkin/handler_querydata.go) (Zipkin queries)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_dashboards["Dashboards"]
  node_folderbrowse["Folder browsing<br/>[useFoldersQuery.ts]"]
  node_explore["Explore"]
  node_metrics["Metrics exploration"]
  node_logs["Log exploration"]
  node_traces["Trace exploration<br/>[ScrollManager.tsx]"]
end

subgraph group_query["Query and data"]
  node_queryhandler["Public query handler"]
  node_queryservice["Query service"]
  node_datasources["Data sources"]
  node_zipkin["Zipkin queries"]
end

subgraph group_visualization["Visualization"]
  node_frames["Data frames"]
  node_panels["Panels and plugins<br/>[PanelPlugin.ts]"]
end

subgraph group_alerting["Alerting"]
  node_alerts["Alert rules"]
  node_routing["Notification routing"]
  node_receivers["Contact points"]
end

subgraph group_platform["Platform APIs"]
  node_querytypes["Query type registry"]
  node_alertapi["Alerting resources"]
end

node_user(("Grafana user"))
node_backend["Grafana backend API"]
node_zipkinservice["Zipkin service"]

node_user -->|"creates and views"| node_dashboards
node_user -->|"explores data"| node_explore
node_dashboards -->|"browses folders"| node_folderbrowse
node_dashboards -->|"queries panels"| node_queryhandler
node_explore -->|"explores metrics"| node_metrics
node_explore -->|"explores logs"| node_logs
node_explore -->|"views traces"| node_traces
node_queryhandler -->|"posts query"| node_backend
node_queryhandler -->|"converts response"| node_queryhandler
node_queryservice -->|"dispatches queries"| node_datasources
node_zipkin -->|"fetches traces"| node_zipkinservice
node_zipkin -->|"transforms spans"| node_frames
node_frames -->|"supplies data"| node_panels
node_alerts -->|"previews routing"| node_routing
node_routing -->|"matches receivers"| node_receivers
node_querytypes -->|"serves query types"| node_backend
node_alertapi -->|"exposes resources"| node_backend

click node_dashboards "https://github.com/appian/grafana/tree/main/apps/dashboard/pkg/apis/dashboard"
click node_folderbrowse "https://github.com/appian/grafana/blob/main/public/app/core/components/NestedFolderPicker/useFoldersQuery.ts"
click node_explore "https://github.com/appian/grafana/tree/main/public/app/features/explore"
click node_metrics "https://github.com/appian/grafana/blob/main/packages/grafana-prometheus/src/components/usePromQueryFieldEffects.ts"
click node_logs "https://github.com/appian/grafana/tree/main/public/app/features/explore"
click node_traces "https://github.com/appian/grafana/blob/main/public/app/features/explore/TraceView/components/ScrollManager.tsx"
click node_queryhandler "https://github.com/appian/grafana/blob/main/packages/grafana-runtime/src/utils/publicDashboardQueryHandler.ts"
click node_queryservice "https://github.com/appian/grafana/tree/main/pkg/services/query"
click node_datasources "https://github.com/appian/grafana/tree/main/pkg/tsdb"
click node_zipkin "https://github.com/appian/grafana/blob/main/pkg/tsdb/zipkin/handler_querydata.go"
click node_frames "https://github.com/appian/grafana/tree/main/packages/grafana-data/src/dataframe"
click node_panels "https://github.com/appian/grafana/blob/main/packages/grafana-data/src/panel/PanelPlugin.ts"
click node_alerts "https://github.com/appian/grafana/tree/main/public/app/features/alerting/unified"
click node_routing "https://github.com/appian/grafana/blob/main/public/app/features/alerting/unified/components/rule-editor/notificaton-preview/useAlertmanagerNotificationRoutingPreview.ts"
click node_receivers "https://github.com/appian/grafana/tree/main/packages/grafana-alerting/src/grafana/contactPoints"
click node_querytypes "https://github.com/appian/grafana/blob/main/pkg/registry/apis/query/queryschema/query_type_storage.go"
click node_alertapi "https://github.com/appian/grafana/tree/main/apps/alerting/notifications/pkg/apis/alerting/v0alpha1"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dashboards,node_folderbrowse,node_explore,node_metrics,node_logs,node_traces,node_user toneBlue
class node_queryhandler,node_queryservice,node_datasources,node_zipkin toneAmber
class node_frames,node_panels,node_backend toneMint
class node_alerts,node_routing,node_receivers toneRose
class node_querytypes,node_alertapi,node_zipkinservice toneIndigo
```

## Components

### User experience

- [Dashboards](https://github.com/appian/grafana/tree/main/apps/dashboard/pkg/apis/dashboard): `apps/dashboard/pkg/apis/dashboard`
- [Folder browsing](https://github.com/appian/grafana/blob/main/public/app/core/components/NestedFolderPicker/useFoldersQuery.ts): `public/app/core/components/NestedFolderPicker/useFoldersQuery.ts`
- [Explore](https://github.com/appian/grafana/tree/main/public/app/features/explore): `public/app/features/explore`
- [Metrics exploration](https://github.com/appian/grafana/blob/main/packages/grafana-prometheus/src/components/usePromQueryFieldEffects.ts): `packages/grafana-prometheus/src/components/usePromQueryFieldEffects.ts`
- [Log exploration](https://github.com/appian/grafana/tree/main/public/app/features/explore): `public/app/features/explore`
- [Trace exploration](https://github.com/appian/grafana/blob/main/public/app/features/explore/TraceView/components/ScrollManager.tsx): `public/app/features/explore/TraceView/components/ScrollManager.tsx`

### Query and data

- [Public query handler](https://github.com/appian/grafana/blob/main/packages/grafana-runtime/src/utils/publicDashboardQueryHandler.ts): `packages/grafana-runtime/src/utils/publicDashboardQueryHandler.ts`
- [Query service](https://github.com/appian/grafana/tree/main/pkg/services/query): `pkg/services/query`
- [Data sources](https://github.com/appian/grafana/tree/main/pkg/tsdb): `pkg/tsdb`
- [Zipkin queries](https://github.com/appian/grafana/blob/main/pkg/tsdb/zipkin/handler_querydata.go): `pkg/tsdb/zipkin/handler_querydata.go`

### Visualization

- [Data frames](https://github.com/appian/grafana/tree/main/packages/grafana-data/src/dataframe): `packages/grafana-data/src/dataframe`
- [Panels and plugins](https://github.com/appian/grafana/blob/main/packages/grafana-data/src/panel/PanelPlugin.ts): `packages/grafana-data/src/panel/PanelPlugin.ts`

### Alerting

- [Alert rules](https://github.com/appian/grafana/tree/main/public/app/features/alerting/unified): `public/app/features/alerting/unified`
- [Notification routing](https://github.com/appian/grafana/blob/main/public/app/features/alerting/unified/components/rule-editor/notificaton-preview/useAlertmanagerNotificationRoutingPreview.ts): `public/app/features/alerting/unified/components/rule-editor/notificaton-preview/useAlertmanagerNotificationRoutingPreview.ts`
- [Contact points](https://github.com/appian/grafana/tree/main/packages/grafana-alerting/src/grafana/contactPoints): `packages/grafana-alerting/src/grafana/contactPoints`

### Platform APIs

- [Query type registry](https://github.com/appian/grafana/blob/main/pkg/registry/apis/query/queryschema/query_type_storage.go): `pkg/registry/apis/query/queryschema/query_type_storage.go`
- [Alerting resources](https://github.com/appian/grafana/tree/main/apps/alerting/notifications/pkg/apis/alerting/v0alpha1): `apps/alerting/notifications/pkg/apis/alerting/v0alpha1`

### Other components

- **Grafana user**
- **Grafana backend API**
- **Zipkin service**

## Connections

- Grafana user → Dashboards: creates and views
- Grafana user → Explore: explores data
- Dashboards → Folder browsing: browses folders
- Dashboards → Public query handler: queries panels
- Explore → Metrics exploration: explores metrics
- Explore → Log exploration: explores logs
- Explore → Trace exploration: views traces
- Public query handler → Grafana backend API: posts query
- Public query handler → Public query handler: converts response
- Query service → Data sources: dispatches queries
- Zipkin queries → Zipkin service: fetches traces
- Zipkin queries → Data frames: transforms spans
- Data frames → Panels and plugins: supplies data
- Alert rules → Notification routing: previews routing
- Notification routing → Contact points: matches receivers
- Query type registry → Grafana backend API: serves query types
- Alerting resources → Grafana backend API: exposes resources
