Thank you francislavoie. With your tips, I managed to get OpenMetrics endpoint to feed to Datadog.
I am now trying to figure out how to pull 5xx reply count out from Caddy metrics.
I think this might do it, but I am not sure:
curl http://127.0.0.1:6000/metrics|grep -i caddy_http_request_duration_seconds_count
caddy_http_request_duration_seconds_count{code="200",handler="reverse_proxy",method="GET",server="srv1"} 647
caddy_http_request_duration_seconds_count{code="200",handler="subroute",method="GET",server="srv0"} 255
caddy_http_request_duration_seconds_count{code="200",handler="subroute",method="GET",server="srv1"} 1291
caddy_http_request_duration_seconds_count{code="301",handler="reverse_proxy",method="GET",server="srv1"} 2
caddy_http_request_duration_seconds_count{code="301",handler="subroute",method="GET",server="srv1"} 4
caddy_http_request_duration_seconds_count{code="304",handler="reverse_proxy",method="GET",server="srv1"} 21
caddy_http_request_duration_seconds_count{code="304",handler="subroute",method="GET",server="srv1"} 42
caddy_http_request_duration_seconds_count{code="401",handler="reverse_proxy",method="GET",server="srv1"} 1
caddy_http_request_duration_seconds_count{code="401",handler="subroute",method="GET",server="srv1"} 2
caddy_http_request_duration_seconds_count{code="404",handler="reverse_proxy",method="GET",server="srv1"} 107
caddy_http_request_duration_seconds_count{code="404",handler="reverse_proxy",method="POST",server="srv1"} 23
caddy_http_request_duration_seconds_count{code="404",handler="subroute",method="GET",server="srv1"} 143
caddy_http_request_duration_seconds_count{code="404",handler="subroute",method="POST",server="srv1"} 23
caddy_http_request_duration_seconds_count{code="500",handler="reverse_proxy",method="GET",server="srv1"} 1
caddy_http_request_duration_seconds_count{code="500",handler="subroute",method="GET",server="srv1"} 1
Would there be any way to have a human-readable label for these? I think I should be able to set srv1
to something meaningful, but I have do not know how.
My Caddyfile.