I have a chart created that exposes the nginx workers and it works just fine. However I wanted to create an alert that cross references two charts in the calculation
Here is my alert -
template: nginx_connection_alert
on: nginx.connections
every: 5s
calc: $active * 100 / ${chart:nginx_worker_connections.worker_connections:max_connections}
warn: $this > 0.1
crit: $this > 0.2
info: Nginx connection usage: $this% (Active: $active, Worker Limit: ${chart:nginx_worker_connections.worker_connections:max_connections})
to: sysadmin
Here is the created chart.
localhost:19999/api/v1/data?chart=nginx_worker_connections.worker_connections
{
"labels":["time","max_connections"],
"data":[
[1753475078,1024],
[1753475077,1024],
I’ve set the threshold too low just for testing. Normally it will only have 1 to 2 active nginx connections
Calculation does not seem to work. What am missing?