[[inputs.sqlserver]]## your sqlserver host ,example ip:porthost=""## your sqlserver user,passworduser=""password=""## (optional) collection interval, default is 10sinterval="10s"## by default, support TLS 1.2 and above.## set to true if server side uses TLS 1.0 or TLS 1.1allow_tls10=false## Set true to enable electionelection=true## Database name to query. Default is master.database="master"## configure db_filter to filter out metrics from certain databases according to their database_name tag.## If leave blank, no metric from any database is filtered out.# db_filter = ["some_db_instance_name", "other_db_instance_name"]## Run a custom SQL query and collect corresponding metrics.## [[inputs.sqlserver.custom_queries]]# sql = '''# select counter_name,cntr_type,cntr_value# from sys.dm_os_performance_counters# '''# metric = "sqlserver_custom_stat"# tags = ["counter_name","cntr_type"]# fields = ["cntr_value"]# [inputs.sqlserver.log]# files = []# #grok pipeline script path# pipeline = "sqlserver.p"[inputs.sqlserver.tags]# some_tag = "some_value"# more_tag = "some_other_value"
The amount of memory committed to the memory manager
int
B
cpu_count
Specifies the number of logical CPUs on the system. Not nullable
int
count
db_offline
num of database state in offline
int
count
db_online
num of database state in online
int
count
db_recovering
num of database state in recovering
int
count
db_recovery_pending
num of database state in recovery_pending
int
count
db_restoring
num of database state in restoring
int
count
db_suspect
num of database state in suspect
int
count
physical_memory
Total physical memory on the machine
int
B
server_memory
memory used
int
B
target_memory
Amount of memory that can be consumed by the memory manager. When this value is larger than the committed memory, then the memory manager will try to obtain more memory. When it is smaller, the memory manager will try to shrink the amount of memory committed.
int
B
uptime
Total time elapsed since the last computer restart
int
ms
virtual_memory
Amount of virtual memory available to the process in user mode.
Name of the counter. To get more information about a counter, this is the name of the topic to select from the list of counters in Use SQL Server Objects.
ID of the scheduler. All schedulers that are used to run regular queries have ID numbers less than 1048576. Those schedulers that have IDs greater than or equal to 1048576 are used internally by SQL Server, such as the dedicated administrator connection scheduler. Is not nullable.
sqlserver_host
host name which installed SQLServer
字段列表
Metric
Description
Type
Unit
active_workers_count
Number of workers that are active. An active worker is never preemptive, must have an associated task, and is either running, runnable, or suspended. Is not nullable.
int
count
context_switches_count
Number of context switches that have occurred on this scheduler
int
count
current_tasks_count
Number of current tasks that are associated with this scheduler.
int
count
current_workers_count
Number of workers that are associated with this scheduler. This count includes workers that are not assigned any task. Is not nullable.
int
count
is_idle
Scheduler is idle. No workers are currently running
bool
-
is_online
If SQL Server is configured to use only some of the available processors on the server, this configuration can mean that some schedulers are mapped to processors that are not in the affinity mask. If that is the case, this column returns 0. This value means that the scheduler is not being used to process queries or batches.
bool
-
load_factor
Internal value that indicates the perceived load on this scheduler
int
count
pending_disk_io_count
Number of pending I/Os that are waiting to be completed.
int
count
preemptive_switches_count
Number of times that workers on this scheduler have switched to the preemptive mode
int
count
runnable_tasks_count
Number of workers, with tasks assigned to them, that are waiting to be scheduled on the runnable queue.
int
count
total_cpu_usage_ms
Applies to: SQL Server 2016 (13.x) and laterTotal CPU consumed by this scheduler as reported by non-preemptive workers.
int
ms
total_scheduler_delay_ms
Applies to: SQL Server 2016 (13.x) and laterThe time between one worker switching out and another one switching in
int
ms
work_queue_count
Number of tasks in the pending queue. These tasks are waiting for a worker to pick them up
int
count
yield_count
Internal value that is used to indicate progress on this scheduler. This value is used by the Scheduler Monitor to determine whether a worker on the scheduler is not yielding to other workers on time.