# czantoine/microsoft-sql-server-with-grafana architecture

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

- Interactive diagram: https://gitdiagram.com/czantoine/microsoft-sql-server-with-grafana
- Repository: https://github.com/czantoine/microsoft-sql-server-with-grafana

## Overview

This repository provides a Grafana dashboard for monitoring Microsoft SQL Server with native T-SQL DMV queries, plus a Docker Compose quickstart. The main workflow is to connect Grafana to SQL Server, run dashboard queries, and inspect panels across eight documented monitoring areas. The dashboard and its queries are represented in dashboard.json; docs/metrics.md documents the exported metrics. Source excerpts were unavailable, so relationships below rely on the README; quickstart internals are shown without inferred connections.

Main entry points: [`dashboard.json`](https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/dashboard.json) (Dashboard definition), [`docs/metrics.md`](https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/docs/metrics.md) (Metrics catalog), [`quickstart/README.md`](https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/quickstart/README.md) (Compose quickstart)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard capabilities"]
  node_dashboard_config["Dashboard definition<br/>[dashboard.json]"]
  node_overview["Overview<br/>[dashboard.json]"]
  node_query_performance["Query performance<br/>[dashboard.json]"]
  node_server_waits["Server performance<br/>[dashboard.json]"]
  node_memory_buffer["Memory and buffer<br/>[dashboard.json]"]
  node_index_health["Index health<br/>[dashboard.json]"]
  node_database_space["Database space<br/>[dashboard.json]"]
  node_security_errors["Security and errors<br/>[dashboard.json]"]
  node_metrics_catalog["Metrics catalog<br/>[metrics.md]"]
end

subgraph group_runtime["Monitoring runtime"]
  node_grafana["Grafana"]
  node_sqlserver[("SQL Server")]
end

subgraph group_quickstart["Quickstart setup"]
  node_quickstart["Compose quickstart<br/>[README.md]"]
  node_compose_config["Compose configuration<br/>[docker-compose.yml]"]
  node_database_setup["Database initialization<br/>[init-db.sh]"]
  node_database_schema["Database schema<br/>[create_db.sql]"]
  node_sample_data["Sample data<br/>[insert_data.sql]"]
  node_grafana_provisioning["Grafana provisioning<br/>[datasource.yml]"]
  node_dashboard_provisioning["Dashboard provisioning<br/>[dashboards.yml]"]
end

node_operator(("SQL operator"))

node_operator -->|"views monitoring"| node_grafana
node_grafana -->|"queries directly"| node_sqlserver
node_dashboard_config -->|"provides dashboard"| node_grafana
node_dashboard_config -->|"queries with T-SQL"| node_sqlserver
node_metrics_catalog -->|"documents queries"| node_dashboard_config
node_operator -->|"starts demo"| node_quickstart

click node_dashboard_config "https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/dashboard.json"
click node_overview "https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/dashboard.json"
click node_query_performance "https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/dashboard.json"
click node_server_waits "https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/dashboard.json"
click node_memory_buffer "https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/dashboard.json"
click node_index_health "https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/dashboard.json"
click node_database_space "https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/dashboard.json"
click node_security_errors "https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/dashboard.json"
click node_metrics_catalog "https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/docs/metrics.md"
click node_quickstart "https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/quickstart/README.md"
click node_compose_config "https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/quickstart/docker-compose.yml"
click node_database_setup "https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/quickstart/db/init-db.sh"
click node_database_schema "https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/quickstart/db/create_db.sql"
click node_sample_data "https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/quickstart/db/insert_data.sql"
click node_grafana_provisioning "https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/quickstart/grafana/datasource.yml"
click node_dashboard_provisioning "https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/quickstart/grafana/dashboards.yml"

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_dashboard_config,node_overview,node_query_performance,node_server_waits,node_memory_buffer,node_index_health,node_database_space,node_security_errors,node_metrics_catalog toneBlue
class node_grafana,node_sqlserver toneAmber
class node_quickstart,node_compose_config,node_database_setup,node_database_schema,node_sample_data,node_grafana_provisioning,node_dashboard_provisioning toneMint
class node_operator toneIndigo
```

## Components

### Dashboard capabilities

- [Dashboard definition](https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/dashboard.json): `dashboard.json`
- [Overview](https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/dashboard.json): `dashboard.json`
- [Query performance](https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/dashboard.json): `dashboard.json`
- [Server performance](https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/dashboard.json): `dashboard.json`
- [Memory and buffer](https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/dashboard.json): `dashboard.json`
- [Index health](https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/dashboard.json): `dashboard.json`
- [Database space](https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/dashboard.json): `dashboard.json`
- [Security and errors](https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/dashboard.json): `dashboard.json`
- [Metrics catalog](https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/docs/metrics.md): `docs/metrics.md`

### Monitoring runtime

- **Grafana**
- **SQL Server**

### Quickstart setup

- [Compose quickstart](https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/quickstart/README.md): `quickstart/README.md`
- [Compose configuration](https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/quickstart/docker-compose.yml): `quickstart/docker-compose.yml`
- [Database initialization](https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/quickstart/db/init-db.sh): `quickstart/db/init-db.sh`
- [Database schema](https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/quickstart/db/create_db.sql): `quickstart/db/create_db.sql`
- [Sample data](https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/quickstart/db/insert_data.sql): `quickstart/db/insert_data.sql`
- [Grafana provisioning](https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/quickstart/grafana/datasource.yml): `quickstart/grafana/datasource.yml`
- [Dashboard provisioning](https://github.com/czantoine/microsoft-sql-server-with-grafana/blob/main/quickstart/grafana/dashboards.yml): `quickstart/grafana/dashboards.yml`

### Other components

- **SQL operator**

## Connections

- SQL operator → Grafana: views monitoring (evidence: `README.md`)
- Grafana → SQL Server: queries directly (evidence: `README.md`)
- Dashboard definition → Grafana: provides dashboard (evidence: `README.md`)
- Dashboard definition → SQL Server: queries with T-SQL (evidence: `README.md`)
- Metrics catalog → Dashboard definition: documents queries (evidence: `README.md`)
- SQL operator → Compose quickstart: starts demo (evidence: `README.md`)
