0
0
Nginxdevops~10 mins

Prometheus exporter in Nginx - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to enable the Prometheus exporter in the Nginx configuration.

Nginx
location /metrics {
    [1];
}
Drag options to blanks, or click blank then click option'
Aprometheus_metrics on
Bstub_status on
Cexporter_metrics on
Dmetrics_exporter on
Attempts:
3 left
💡 Hint
Common Mistakes
Using a non-existent directive like 'prometheus_metrics on'
Confusing the exporter directive with other modules
2fill in blank
medium

Complete the code to allow Prometheus to access the metrics endpoint.

Nginx
location /metrics {
    stub_status on;
    allow [1];
    deny all;
}
Drag options to blanks, or click blank then click option'
A127.0.0.1
Ball
C0.0.0.0/0
Dany
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'all' which would allow everyone
Using '0.0.0.0/0' which is too broad
3fill in blank
hard

Fix the error in the Prometheus exporter configuration snippet.

Nginx
location /metrics {
    stub_status [1];
    allow 127.0.0.1;
    deny all;
}
Drag options to blanks, or click blank then click option'
Aon
Benable
Ctrue
Dactive
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'enable' or 'true' which are invalid values
Using 'active' which is not recognized
4fill in blank
hard

Fill both blanks to configure Nginx to expose Prometheus metrics with proper access control.

Nginx
location /metrics {
    stub_status [1];
    allow [2];
    deny all;
}
Drag options to blanks, or click blank then click option'
Aon
B127.0.0.1
C192.168.1.0/24
Doff
Attempts:
3 left
💡 Hint
Common Mistakes
Turning stub_status off
Allowing '127.0.0.1' when network access is needed
5fill in blank
hard

Fill all three blanks to create a Prometheus exporter config that enables metrics, allows local access, and denies others.

Nginx
location /metrics {
    stub_status [1];
    allow [2];
    deny [3];
}
Drag options to blanks, or click blank then click option'
Aon
B127.0.0.1
Call
Doff
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'off' instead of 'on'
Allowing 'all' instead of just localhost
Denying '127.0.0.1' which blocks local access