0
0
Nginxdevops~20 mins

Prometheus exporter in Nginx - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Prometheus Exporter Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
Prometheus Nginx Exporter Metrics Endpoint Output
You have configured the Prometheus Nginx exporter to expose metrics at http://localhost:9113/metrics. What is the expected output when you curl this endpoint?
Nginx
curl http://localhost:9113/metrics
AA binary file download containing compressed metrics data
BA JSON object with keys 'active_connections' and 'total_requests' showing numeric values
CA plain text list of metrics including lines like 'nginx_connections_active 5' and 'nginx_http_requests_total 12345'
DAn HTML page showing graphs of Nginx metrics
Attempts:
2 left
💡 Hint
Prometheus exporters expose metrics in a simple text format for scraping.
Configuration
intermediate
2:00remaining
Configuring Nginx for Prometheus Exporter
Which Nginx configuration snippet correctly enables the stub_status module at /nginx_status for Prometheus exporter scraping?
Alocation /nginx_status { stub_status; allow 127.0.0.1; deny all; }
Blocation /nginx_status { return 404; }
Clocation /nginx_status { proxy_pass http://localhost:9113; }
Dlocation /nginx_status { autoindex on; }
Attempts:
2 left
💡 Hint
The stub_status directive provides basic Nginx metrics.
Troubleshoot
advanced
2:00remaining
Prometheus Exporter Fails to Scrape Nginx Metrics
You configured Prometheus to scrape Nginx metrics from http://localhost:9113/metrics, but no data appears in Prometheus. What is the most likely cause?
AThe Nginx stub_status endpoint is not enabled or accessible
BPrometheus server is not running on port 9113
CNginx is running on a different server than Prometheus exporter
DPrometheus uses JSON format but exporter provides plain text
Attempts:
2 left
💡 Hint
Check if Nginx exposes metrics for the exporter to collect.
🔀 Workflow
advanced
3:00remaining
Steps to Add Nginx Metrics to Prometheus Monitoring
What is the correct order of steps to add Nginx metrics to Prometheus using the Prometheus Nginx exporter?
A1,4,2,3
B1,2,4,3
C2,1,3,4
D1,2,3,4
Attempts:
2 left
💡 Hint
Think about enabling metrics first, then running exporter, then configuring Prometheus.
Best Practice
expert
2:30remaining
Securing Nginx Metrics Endpoint for Prometheus Exporter
Which method is the best practice to secure the Nginx stub_status endpoint exposed for Prometheus scraping?
AUse basic authentication with a username and password
BAllow access only from Prometheus server IP and deny all others
CExpose the endpoint publicly without restrictions for easy access
DDisable stub_status and rely on logs for metrics
Attempts:
2 left
💡 Hint
Limit access to trusted sources only.