# abinithishkumarprabakaran/grafana architecture

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

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

## Overview

Grafana is an observability platform whose user-facing loop is to query data sources, inspect results in dashboards or Explore, and configure alerts that notify external systems. The repository also includes platform services for dashboards, search, folders, and resource storage. The README documents the product capabilities; source-index references and excerpts support the narrower internal relationships shown. Several major frontend modules are indexed but not excerpted, so their implementation details and wiring are represented only at subsystem level.

Main entry points: [`packages/grafana-runtime/src/utils/publicDashboardQueryHandler.ts`](https://github.com/abinithishkumarprabakaran/grafana/blob/main/packages/grafana-runtime/src/utils/publicDashboardQueryHandler.ts) (Query runtime), [`public/app/features/alerting/unified/components/rule-editor/notificaton-preview/useAlertmanagerNotificationRoutingPreview.ts`](https://github.com/abinithishkumarprabakaran/grafana/blob/main/public/app/features/alerting/unified/components/rule-editor/notificaton-preview/useAlertmanagerNotificationRoutingPreview.ts) (Notification route preview), [`public/app/features/browse-dashboards/api/useRecentlyDeletedStateManager.ts`](https://github.com/abinithishkumarprabakaran/grafana/blob/main/public/app/features/browse-dashboards/api/useRecentlyDeletedStateManager.ts) (Deleted dashboard state), [`public/app/features/alerting/unified/api/alertmanagerApi.ts`](https://github.com/abinithishkumarprabakaran/grafana/blob/main/public/app/features/alerting/unified/api/alertmanagerApi.ts) (Alerting interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_query["Query and Explore"]
  node_datasources["Data sources"]
  node_query_runtime["Query runtime"]
  node_backend_srv["Backend service<br/>[backendSrv.ts]"]
  node_query_response["Query response<br/>[queryResponse.ts]"]
  node_query_types["Query type registry"]
  node_visualizations["Visualizations"]
end

subgraph group_dashboards["Dashboards and Search"]
  node_dashboards["Dashboard definitions<br/>[dashboard_spec.go]"]
  node_folder_picker["Folder browsing"]
  node_folder_service["Folder service"]
  node_deleted_state["Deleted dashboard state"]
  node_deleted_cache["Deleted dashboard cache"]
  node_search_state["Search state"]
end

subgraph group_alerting["Alerting"]
  node_alert_ui["Alerting interface<br/>[alertmanagerApi.ts]"]
  node_alert_sources["Alert data sources<br/>[datasource.ts]"]
  node_alert_source_hook["Source permission hook"]
  node_route_preview["Notification route preview"]
  node_route_matcher["Route group matcher"]
  node_route_utils["Route utilities<br/>[amroutes.ts]"]
  node_notification_policies["Notification policies"]
  node_alert_rules["Alert rules<br/>[rules.ts]"]
  node_notification_service["Notification services"]
end

subgraph group_platform["Platform Services"]
  node_resource_storage[("Unified resource storage<br/>[storage_backend.go]")]
  node_storage_config["Storage configuration"]
  node_folder_cascade["Folder cascade deletion"]
end

node_user(("Grafana user"))
node_grafana["Grafana experience"]

node_user -->|"uses"| node_grafana
node_grafana -->|"queries"| node_datasources
node_datasources -.->|"provides data"| node_query_runtime
node_grafana -->|"views results"| node_visualizations
node_grafana -->|"creates and shares"| node_dashboards
node_grafana -->|"configures alerts"| node_alert_ui
node_alert_ui -.->|"defines rules"| node_alert_rules
node_alert_rules -->|"sends notifications"| node_notification_service
node_grafana -.->|"queries public panels"| node_query_runtime
node_query_runtime -->|"fetches"| node_backend_srv
node_query_runtime -->|"converts response"| node_query_response
node_grafana -.->|"browses folders"| node_folder_picker
node_folder_picker -.->|"lists folder content"| node_dashboards
node_grafana -.->|"browses deleted"| node_deleted_state
node_deleted_state -->|"searches"| node_deleted_cache
node_deleted_state -->|"updates"| node_search_state
node_alert_ui -.->|"uses sources"| node_alert_sources
node_alert_source_hook -->|"selects sources"| node_alert_sources
node_route_preview -->|"matches routes"| node_route_matcher
node_route_preview -->|"adds route identity"| node_route_utils
node_route_preview -->|"normalizes route"| node_notification_policies
node_storage_config -.->|"configures"| node_resource_storage
node_folder_service -->|"uses storage"| node_resource_storage
node_folder_cascade -.->|"uses storage"| node_resource_storage

click node_query_runtime "https://github.com/abinithishkumarprabakaran/grafana/blob/main/packages/grafana-runtime/src/utils/publicDashboardQueryHandler.ts"
click node_backend_srv "https://github.com/abinithishkumarprabakaran/grafana/blob/main/packages/grafana-runtime/src/services/backendSrv.ts"
click node_query_response "https://github.com/abinithishkumarprabakaran/grafana/blob/main/packages/grafana-runtime/src/utils/queryResponse.ts"
click node_query_types "https://github.com/abinithishkumarprabakaran/grafana/blob/main/pkg/registry/apis/query/queryschema/query_type_storage.go"
click node_dashboards "https://github.com/abinithishkumarprabakaran/grafana/blob/main/apps/dashboard/pkg/apis/dashboard/v0alpha1/dashboard_spec.go"
click node_folder_picker "https://github.com/abinithishkumarprabakaran/grafana/blob/main/public/app/core/components/NestedFolderPicker/useFoldersQueryAppPlatform.ts"
click node_folder_service "https://github.com/abinithishkumarprabakaran/grafana/blob/main/pkg/services/folder/folderimpl/folder_unifiedstorage.go"
click node_deleted_state "https://github.com/abinithishkumarprabakaran/grafana/blob/main/public/app/features/browse-dashboards/api/useRecentlyDeletedStateManager.ts"
click node_deleted_cache "https://github.com/abinithishkumarprabakaran/grafana/blob/main/public/app/features/search/service/deletedDashboardsCache.ts"
click node_search_state "https://github.com/abinithishkumarprabakaran/grafana/blob/main/public/app/features/search/state/SearchStateManager.ts"
click node_alert_ui "https://github.com/abinithishkumarprabakaran/grafana/blob/main/public/app/features/alerting/unified/api/alertmanagerApi.ts"
click node_alert_sources "https://github.com/abinithishkumarprabakaran/grafana/blob/main/public/app/features/alerting/unified/utils/datasource.ts"
click node_alert_source_hook "https://github.com/abinithishkumarprabakaran/grafana/blob/main/public/app/features/alerting/unified/hooks/useAlertManagerSources.ts"
click node_route_preview "https://github.com/abinithishkumarprabakaran/grafana/blob/main/public/app/features/alerting/unified/components/rule-editor/notificaton-preview/useAlertmanagerNotificationRoutingPreview.ts"
click node_route_matcher "https://github.com/abinithishkumarprabakaran/grafana/blob/main/public/app/features/alerting/unified/useRouteGroupsMatcher.ts"
click node_route_utils "https://github.com/abinithishkumarprabakaran/grafana/blob/main/public/app/features/alerting/unified/utils/amroutes.ts"
click node_notification_policies "https://github.com/abinithishkumarprabakaran/grafana/blob/main/public/app/features/alerting/unified/utils/notification-policies.ts"
click node_alert_rules "https://github.com/abinithishkumarprabakaran/grafana/blob/main/public/app/features/alerting/unified/utils/rules.ts"
click node_resource_storage "https://github.com/abinithishkumarprabakaran/grafana/blob/main/pkg/storage/unified/resource/storage_backend.go"
click node_storage_config "https://github.com/abinithishkumarprabakaran/grafana/blob/main/pkg/setting/setting_unified_storage.go"
click node_folder_cascade "https://github.com/abinithishkumarprabakaran/grafana/blob/main/pkg/registry/apis/folders/cascade_delete_storage.go"

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_datasources,node_query_runtime,node_backend_srv,node_query_response,node_query_types,node_visualizations,node_user toneBlue
class node_dashboards,node_folder_picker,node_folder_service,node_deleted_state,node_deleted_cache,node_search_state toneAmber
class node_alert_ui,node_alert_sources,node_alert_source_hook,node_route_preview,node_route_matcher,node_route_utils,node_notification_policies,node_alert_rules,node_notification_service toneMint
class node_resource_storage,node_storage_config,node_folder_cascade toneRose
class node_grafana toneIndigo
```

## Components

### Query and Explore

- **Data sources**
- [Query runtime](https://github.com/abinithishkumarprabakaran/grafana/blob/main/packages/grafana-runtime/src/utils/publicDashboardQueryHandler.ts): `packages/grafana-runtime/src/utils/publicDashboardQueryHandler.ts`
- [Backend service](https://github.com/abinithishkumarprabakaran/grafana/blob/main/packages/grafana-runtime/src/services/backendSrv.ts): `packages/grafana-runtime/src/services/backendSrv.ts`
- [Query response](https://github.com/abinithishkumarprabakaran/grafana/blob/main/packages/grafana-runtime/src/utils/queryResponse.ts): `packages/grafana-runtime/src/utils/queryResponse.ts`
- [Query type registry](https://github.com/abinithishkumarprabakaran/grafana/blob/main/pkg/registry/apis/query/queryschema/query_type_storage.go): `pkg/registry/apis/query/queryschema/query_type_storage.go`
- **Visualizations**

### Dashboards and Search

- [Dashboard definitions](https://github.com/abinithishkumarprabakaran/grafana/blob/main/apps/dashboard/pkg/apis/dashboard/v0alpha1/dashboard_spec.go): `apps/dashboard/pkg/apis/dashboard/v0alpha1/dashboard_spec.go`
- [Folder browsing](https://github.com/abinithishkumarprabakaran/grafana/blob/main/public/app/core/components/NestedFolderPicker/useFoldersQueryAppPlatform.ts): `public/app/core/components/NestedFolderPicker/useFoldersQueryAppPlatform.ts`
- [Folder service](https://github.com/abinithishkumarprabakaran/grafana/blob/main/pkg/services/folder/folderimpl/folder_unifiedstorage.go): `pkg/services/folder/folderimpl/folder_unifiedstorage.go`
- [Deleted dashboard state](https://github.com/abinithishkumarprabakaran/grafana/blob/main/public/app/features/browse-dashboards/api/useRecentlyDeletedStateManager.ts): `public/app/features/browse-dashboards/api/useRecentlyDeletedStateManager.ts`
- [Deleted dashboard cache](https://github.com/abinithishkumarprabakaran/grafana/blob/main/public/app/features/search/service/deletedDashboardsCache.ts): `public/app/features/search/service/deletedDashboardsCache.ts`
- [Search state](https://github.com/abinithishkumarprabakaran/grafana/blob/main/public/app/features/search/state/SearchStateManager.ts): `public/app/features/search/state/SearchStateManager.ts`

### Alerting

- [Alerting interface](https://github.com/abinithishkumarprabakaran/grafana/blob/main/public/app/features/alerting/unified/api/alertmanagerApi.ts): `public/app/features/alerting/unified/api/alertmanagerApi.ts`
- [Alert data sources](https://github.com/abinithishkumarprabakaran/grafana/blob/main/public/app/features/alerting/unified/utils/datasource.ts): `public/app/features/alerting/unified/utils/datasource.ts`
- [Source permission hook](https://github.com/abinithishkumarprabakaran/grafana/blob/main/public/app/features/alerting/unified/hooks/useAlertManagerSources.ts): `public/app/features/alerting/unified/hooks/useAlertManagerSources.ts`
- [Notification route preview](https://github.com/abinithishkumarprabakaran/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`
- [Route group matcher](https://github.com/abinithishkumarprabakaran/grafana/blob/main/public/app/features/alerting/unified/useRouteGroupsMatcher.ts): `public/app/features/alerting/unified/useRouteGroupsMatcher.ts`
- [Route utilities](https://github.com/abinithishkumarprabakaran/grafana/blob/main/public/app/features/alerting/unified/utils/amroutes.ts): `public/app/features/alerting/unified/utils/amroutes.ts`
- [Notification policies](https://github.com/abinithishkumarprabakaran/grafana/blob/main/public/app/features/alerting/unified/utils/notification-policies.ts): `public/app/features/alerting/unified/utils/notification-policies.ts`
- [Alert rules](https://github.com/abinithishkumarprabakaran/grafana/blob/main/public/app/features/alerting/unified/utils/rules.ts): `public/app/features/alerting/unified/utils/rules.ts`
- **Notification services**

### Platform Services

- [Unified resource storage](https://github.com/abinithishkumarprabakaran/grafana/blob/main/pkg/storage/unified/resource/storage_backend.go): `pkg/storage/unified/resource/storage_backend.go`
- [Storage configuration](https://github.com/abinithishkumarprabakaran/grafana/blob/main/pkg/setting/setting_unified_storage.go): `pkg/setting/setting_unified_storage.go`
- [Folder cascade deletion](https://github.com/abinithishkumarprabakaran/grafana/blob/main/pkg/registry/apis/folders/cascade_delete_storage.go): `pkg/registry/apis/folders/cascade_delete_storage.go`

### Other components

- **Grafana user**
- **Grafana experience**

## Connections

- Grafana user → Grafana experience: uses
- Grafana experience → Data sources: queries
- Data sources → Query runtime: provides data
- Grafana experience → Visualizations: views results
- Grafana experience → Dashboard definitions: creates and shares
- Grafana experience → Alerting interface: configures alerts
- Alerting interface → Alert rules: defines rules
- Alert rules → Notification services: sends notifications
- Grafana experience → Query runtime: queries public panels
- Query runtime → Backend service: fetches (evidence: `packages/grafana-runtime/src/utils/publicDashboardQueryHandler.ts`)
- Query runtime → Query response: converts response (evidence: `packages/grafana-runtime/src/utils/publicDashboardQueryHandler.ts`)
- Grafana experience → Folder browsing: browses folders
- Folder browsing → Dashboard definitions: lists folder content
- Grafana experience → Deleted dashboard state: browses deleted
- Deleted dashboard state → Deleted dashboard cache: searches (evidence: `public/app/features/browse-dashboards/api/useRecentlyDeletedStateManager.ts`)
- Deleted dashboard state → Search state: updates (evidence: `public/app/features/browse-dashboards/api/useRecentlyDeletedStateManager.ts`)
- Alerting interface → Alert data sources: uses sources (evidence: `public/app/features/alerting/unified/utils/datasource.ts`)
- Source permission hook → Alert data sources: selects sources (evidence: `public/app/features/alerting/unified/hooks/useAlertManagerSources.ts`)
- Notification route preview → Route group matcher: matches routes (evidence: `public/app/features/alerting/unified/components/rule-editor/notificaton-preview/useAlertmanagerNotificationRoutingPreview.ts`)
- Notification route preview → Route utilities: adds route identity (evidence: `public/app/features/alerting/unified/components/rule-editor/notificaton-preview/useAlertmanagerNotificationRoutingPreview.ts`)
- Notification route preview → Notification policies: normalizes route (evidence: `public/app/features/alerting/unified/components/rule-editor/notificaton-preview/useAlertmanagerNotificationRoutingPreview.ts`)
- Storage configuration → Unified resource storage: configures
- Folder service → Unified resource storage: uses storage (evidence: `pkg/services/folder/folderimpl/folder_unifiedstorage.go`)
- Folder cascade deletion → Unified resource storage: uses storage
