Hi Team,
I am using Telegraf + Prometheus + Grafana to build Nginx log’s graphs on Grafana. I am using below prometheus recording rule with default time to pull the data ( not sure what is the default time, I guess 15 sec).
bitnami@XYZ@ more rules.yml
groups:
- name: nodejs
rules:- record: node_api:request_time:avg_
expr: avg by (host, request) (nginx_access_log_request_time{request =~ “/api.*”}) - record: node_api:api_wise:count_
expr: count by (host, request) (nginx_access_log_response{request =~ “/api.*”}) - record: node_api:response:count_
expr: count_values(“response”, nginx_access_log_response) by (host)
bitnami@mylo-grafana:~/prometheus-2.17.1.linux-amd64$
- record: node_api:request_time:avg_
15 seconds interval is getting reflected by using metrics-name " node_api:response:count_"
Then I want to see the graphs based on 5m, 15m , 30m aggregation.
I have tried all options in grafna templale of Promql query, however not able to achieve it. Could you please help here?