Missing metrics for namespace (only batch_parse_errors_total 0 relative metrics appears for it) #346
Unanswered
Kumoservices
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello
i have setup nginxlog prometheus exporter as well as following the documentation, but i don't see any metrics associated with my namespace/log :
Nginx default log format configuration for access log:
log_format custom '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log custom;
Prometheus nginx log config file :
listen:
port: 4040
address: "0.0.0.0"
consul:
enable: false
namespaces:
format: "$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for""
source:
files:
- /var/log/nginx/access.log
labels:
service: "batch"
env: "preprod"
histogram_buckets: [.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10]
print_log: true
Prometheus nginxlog systemd service status:
prometheus_exporter-nginx.service - nginx prometheus exporter
Loaded: loaded (/etc/systemd/system/prometheus_exporter-nginx.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2023-09-18 12:30:39 CEST; 8min ago
Main PID: 398002 (prometheus-ngin)
Tasks: 8 (limit: 9346)
Memory: 5.6M
CPU: 32ms
CGroup: /system.slice/prometheus_exporter-nginx.service
└─398002 /opt/prometheus_exporter/prometheus-nginxlog-exporter/prometheus-nginxlog-exporter -config-file /etc/prometheus_exporter/config.yml
Sep 18 12:30:39 slcbatch104 systemd[1]: Started nginx prometheus exporter.
Sep 18 12:30:39 slcbatch104 prometheus-nginxlog-exporter[398002]: loading configuration file /etc/prometheus_exporter/config.yml
Sep 18 12:30:39 slcbatch104 prometheus-nginxlog-exporter[398002]: using configuration {Listen:{Port:4040 Address:0.0.0.0} Consul:{Enable:false Address: Datacenter: Scheme: Token: Service>
Sep 18 12:30:39 slcbatch104 prometheus-nginxlog-exporter[398002]: starting listener for namespace batch
Sep 18 12:30:39 slcbatch104 prometheus-nginxlog-exporter[398002]: running HTTP server on address 0.0.0.0:4040
As you see my log has not been seeked ! like this example :
Apr 25 00:50:06 nginx-log-exporter systemd[1]: Started Prometheus Log Exporter.
Apr 25 00:50:06 nginx-log-exporter prometheus-nginxlog-exporter[4561]: loading configuration file /etc/prometheus/nginxlog_exporter.yml
Apr 25 00:50:06 nginx-log-exporter prometheus-nginxlog-exporter[4561]: using configuration {Listen:{Port:4040 Address:0.0.0.0} Consul:{Enable:false Address: Datacenter: Scheme: Toke
Apr 25 00:50:06 nginx-log-exporter prometheus-nginxlog-exporter[4561]: starting listener for namespace myapp
Apr 25 00:50:06 nginx-log-exporter prometheus-nginxlog-exporter[4561]: running HTTP server on address 0.0.0.0:4040
Apr 25 00:50:06 nginx-log-exporter prometheus-nginxlog-exporter[4561]: 2020/04/25 00:50:06 Seeked /var/log/nginx/access.log - &{Offset:0 Whence:2}
When i call the exporter url, i see nothing about "batch" namespace than this :
HELP batch_parse_errors_total Total number of log file lines that could not be parsed
TYPE batch_parse_errors_total counter
batch_parse_errors_total 0
Note too, i try the parm print_log = true in my yaml config file, and seems do nothing...
Has anyone can help me to understand what happened ?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions