Hello all,
Hoping someone can help me with this, I have a Telegraf > Influx > Grafana setup, Telegraf is configured to send metrics for server and sqlserver properties
[[inputs.sqlserver]]
servers = [
"Server=localhost;Port=1433;User Id=telegraf;Password=>StrongPassword<;app name=telegraf;log=1;",
]
database_type = “SQLServer”
include_query =
[[inputs.win_perf_counters.object]]
Processor usage, alternative to native, reports on a per core.
ObjectName = “Processor”
Instances = ["“]
Counters = [”% Idle Time", “% Interrupt Time”, “% Privileged Time”, “% User Time”, “% Processor Time”]
Measurement = “sql_cpu”
#IncludeTotal=false #Set to true to include _Total instance when querying for all ().
[[inputs.win_perf_counters.object]]
ObjectName = “LogicalDisk”
Instances = [““]
Counters = [”% Free Space",“Free Megabytes”,“Avg. Disk Read Queue Length”,“Avg. Disk Write Queue Length”,“Avg. Disk sec/Read”,“Avg. Disk sec/Write”]
Measurement = “sql_disk”
[[inputs.win_perf_counters.object]]
ObjectName = “SQLServer:Query Store”
Instances = ["”]
Counters = [“Query Store CPU Usage”, “Query Store logical reads”, “Query Store logical writes”, “Query Store physical reads”]
Measurement = “sql_qs”
The panel is a graph panel
Query
Blockquote
from(bucket: “mssql”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“_field”] == “Percent_Processor_Time”)
|> filter(fn: (r) => r[“objectname”] == “Processor”)
|> filter(fn: (r) => r[“_measurement”] == “sql_cpu”)
|> group(columns: [“_field”])
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> yield(name: “mean”)
Blockquote
Alert is setup and works as expected but does not show the hostname, I have setup another panel which is based upon the actual server CPU and when that alerts it posts the actual server name within the alert email - any ideas?