Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding/fixing support for Azure SQL Database (singleton database) #6111

Merged
merged 8 commits into from
Jul 12, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated Readme and Sample config
  • Loading branch information
Ubuntu committed Jul 11, 2019
commit 7d0a9bcc3f8a3bda65945563fab0858dfce04ca2
17 changes: 15 additions & 2 deletions plugins/inputs/sqlserver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ GRANT VIEW ANY DEFINITION TO [telegraf];
GO
```

For Azure SQL Database, you require the View Database State permission and can create a user with a password directly in the database.
```sql
CREATE USER [telegraf] WITH PASSWORD = N'mystrongpassword';
GO
GRANT VIEW DATABASE STATE TO [telegraf];
GO
```

### Configuration:

```toml
Expand Down Expand Up @@ -59,7 +67,7 @@ GO
## - Schedulers
## - AzureDBResourceStats
## - AzureDBResourceGovernance
exclude_query = [ 'DatabaseIO' ]
exclude_query = [ 'Schedulers' ]
```

### Metrics:
Expand All @@ -86,7 +94,6 @@ If you are using the original queries all stats have the following tags:

#### Version 2:
The new (version 2) metrics provide:
- *AzureDB*: AzureDB resource utilization from `sys.dm_db_resource_stats` and `sys.dm_user_db_resource_governance`.
- *Database IO*: IO stats from `sys.dm_io_virtual_file_stats`
- *Memory Clerk*: Memory clerk breakdown from `sys.dm_os_memory_clerks`, most clerks have been given a friendly name.
- *Performance Counters*: A select list of performance counters from `sys.dm_os_performance_counters`. Some of the important metrics included:
Expand All @@ -98,6 +105,7 @@ The new (version 2) metrics provide:
- *Resource Governor*: CPU Usage, Requests/sec, Queued Requests, and Blocked tasks per workload group + more
- *Server properties*: Number of databases in all possible states (online, offline, suspect, etc.), cpu count, physical memory, SQL Server service uptime, and SQL Server version. In the case of Azure SQL relevent properties such as Tier, #Vcores, Memory etc.
- *Wait stats*: Wait time in ms, number of waiting tasks, resource wait time, signal wait time, max wait time in ms, wait type, and wait category. The waits are categorized using the same categories used in Query Store.
- *Schedulers* - This captures sys.dm_os_schedulers.
- *Azure Managed Instances*
- Stats from `sys.server_resource_stats`:
- cpu_count
Expand All @@ -108,6 +116,11 @@ The new (version 2) metrics provide:
- total_storage_mb
- available_storage_mb
- uptime
- Resource governance stats from sys.dm_instance_resource_governance
- *Azure SQL Database*
- Stats from sys.dm_db_wait_stats
- Resource governance stats from sys.dm_user_db_resource_governance
- Stats from sys.dm_db_resource_stats

The following metrics can be used directly, with no delta calculations:
- SQLServer:Buffer Manager\Buffer cache hit ratio
Expand Down
5 changes: 4 additions & 1 deletion plugins/inputs/sqlserver/sqlserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ var sampleConfig = `
## - MemoryClerk
## - VolumeSpace
## - PerformanceMetrics
# exclude_query = [ 'DatabaseIO' ]
## - Schedulers
## - AzureDBResourceStats
## - AzureDBResourceGovernance
exclude_query = [ 'Schedulers' ]
`

// SampleConfig return the sample configuration
Expand Down