dunglas / mercure

🪽 An open, easy, fast, reliable and battery-efficient solution for real-time communications
https://mercure.rocks
GNU Affero General Public License v3.0
3.98k stars 296 forks source link

Mercure 0.12 metrics api config option #540

Closed priyank780 closed 3 years ago

priyank780 commented 3 years ago

Can someone help me to configure the metrics api with the Docker configuration file. I have a docker-compose.yml file like,

mercure: image: dunglas/mercure:v0.12 environment: MERCURE_EXTRA_DIRECTIVES: | heartbeat 40s cors_origins * admin 0.0.0.0:2019 { metrics /metrics }

I tried directly adding metrics /metrics line in MERCURE_EXTRA_DIRECTIVES as well but HTTP://localhost://2019/metrics URL is giving an empty response.

Can someone help me configure metrics API. I'm happy to contribute to your documentations but I need some expert advise on this CaddyServer configuration.

dunglas commented 3 years ago

Hi, this doesn't look related to Mercure but to Caddy directly (Mercure just adds its metrics to the endpoint provided by Caddy).

According to the docs, what you try doesn't look currently possible:

Note that a /metrics endpoint is also attached to the admin API, which is not configurable, and is not available when the admin API is disabled.

https://caddyserver.com/docs/caddyfile/directives/metrics

Maybe should you try to ask on Caddy's forum if changing the default URL doesn't work for you.