I installed nginx and nginx exporter successfully using https://sysdig.com/blog/monitor-nginx-prometheus/
Now I want to enable stub stat metrics,
Here is the config map :
apiVersion: v1
data:
nginx.conf: |
events {}
http {
server {
listen 80;
location / {
return 200 "hello worldn";
}
location /stub_status {
stub_status;
allow 127.0.0.1; # Only allow local access
deny all; # Deny all other access
}
}
}
kind: ConfigMap
metadata:
creationTimestamp: "2024-07-31T07:30:42Z"
name: nginx-config
namespace: rda-dev
resourceVersion: "450759929"
uid: a84a8da8-90c1-4619-b972-e60b1a32a784
Here is the K8s deployment :
spec:
containers:
- image: nginx:latest
imagePullPolicy: Always
name: nginx
ports:
- containerPort: 80
protocol: TCP
- containerPort: 443
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /etc/nginx/nginx.conf
name: nginx-config
subPath: nginx.conf
- args:
- --nginx.scrape-uri=http://localhost/stub_status
- --nginx.plus
image: nginx/nginx-prometheus-exporter:latest
imagePullPolicy: IfNotPresent
name: nginx-exporter
ports:
- containerPort: 9113
protocol: TCP
resources:
limits:
cpu: 500m
memory: 128Mi
I am able to see common metrics on my Prometheus but not able to see the stub stat metrics.
What configuration I am missing here?