Open andreevgrisha opened 2 months ago
CDP needs control of the admin endpoint because it does managed config reloads.
You can serve metrics from any port with the metrics
directive: https://caddyserver.com/docs/caddyfile/directives/metrics
Just add labels to your Caddy container to produce config like this:
:2020 {
metrics
}
thanks for answer! can you help with label example of this? have not idea how do it right way... may be or wrong?
labels:
caddy.handle_path: /metrics
caddy.handle_path.0_reverse_proxy: {{upstreams 2020}}
No, you need to define a site (like if you used a domain) but with :2020
instead. No reverse_proxy
.
clear!
labels:
caddy_0:
caddy_0.servers:
caddy_0.servers.metrics:
caddy_1: ":2020"
caddy_1.metrics: "/metrics"
caddy_1.metrics.disable_openmetrics:
thank a lot
inside caddy-proxy container config/caddy/autosave.json show
{"admin":{"listen":"tcp/localhost:2019"}
but with exposed 2019 port on docker-compose file, i can't connect to 2019, responce is:Connection reset by peer
need advice - how change this settings to
{"admin":{"listen":":2019"}
or any other way to expose hostip:2019/metrics with lucaslorentz/caddy-docker-proxy and docker-compose ?