File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -85,14 +85,14 @@ The container `HEALTHCHECK` script validates:
8585- ` gpg-agent ` control socket responsiveness (` gpg-connect-agent /bye ` )
8686- listening state for SMTP/IMAP container ports
8787- lightweight SMTP and IMAP banner-level handshake probes on local forwarded ports
88- - metrics endpoint HTTP readiness (` /cgi-bin/ metrics ` )
88+ - metrics endpoint HTTP readiness (` /metrics ` )
8989
9090## Metrics
9191
9292The image now exposes Prometheus-formatted metrics from inside the container.
9393
9494- listen port: ` ${CONTAINER_METRICS_PORT} ` (default ` 9154 ` )
95- - scrape path: ` /cgi-bin/metrics `
95+ - scrape path: ` /metrics ` ( ` / cgi-bin/metrics` also supported)
9696
9797Current metrics include:
9898
Original file line number Diff line number Diff line change @@ -13,6 +13,6 @@ netstat -ltn 2>/dev/null | grep -q "[.:]${CONTAINER_METRICS_PORT}[[:space:]]"
1313
1414printf ' QUIT\r\n' | nc -w 3 127.0.0.1 " ${CONTAINER_SMTP_PORT} " | grep -Eq ' ^220 '
1515printf ' a1 LOGOUT\r\n' | nc -w 3 127.0.0.1 " ${CONTAINER_IMAP_PORT} " | grep -Eq ' ^\* (OK|PREAUTH|BYE) '
16- printf ' GET /cgi-bin /metrics HTTP/1.0\r\nHost: localhost\r\n\r\n' \
17- | nc -w 3 127.0.0.1 " ${CONTAINER_METRICS_PORT} " \
18- | grep -Eq ' ^HTTP/[0-9.]+ 200 '
16+ metrics_resp= " $( printf ' GET /metrics HTTP/1.0\r\nHost: localhost\r\n\r\n' \
17+ | nc -w 3 127.0.0.1 " ${CONTAINER_METRICS_PORT} " ) "
18+ printf ' %s\n ' " ${metrics_resp} " | grep -Eq ' ^HTTP/[0-9.]+ 200 '
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ while IFS= read -r header; do
1414 esac
1515done
1616
17- if [ " ${method} " = " GET" ] && [ " ${path} " = " /cgi-bin/metrics" ]; then
17+ if [ " ${method} " = " GET" ] && { [ " ${path} " = " /metrics " ] || [ " ${path} " = " / cgi-bin/metrics" ]; } ; then
1818 printf ' HTTP/1.1 200 OK\r\n'
1919 printf ' Content-Type: text/plain; version=0.0.4\r\n'
2020 printf ' Connection: close\r\n'
You can’t perform that action at this time.
0 commit comments