Well to get data from MC you need an exporter. So remove this from your override and implement propper exporter as docs told you.
services:
prometheus-exporter-mailcow:
image: ghcr.io/mailcow/prometheus-exporter:2
ports:
- "9099:9099" # < allow connection from external Prometheus if needed
restart: always
environment:
MAILCOW_EXPORTER_HOST: "<your-mail-domain>" # Replace with your Mailcow hostname
MAILCOW_EXPORTER_API_KEY: "<your-API-Key>" # Replace with your API key
MAILCOW_EXPORTER_SECURITY_TOKEN: "<your-secure-token>" # Replace with your secure key
# MAILCOW_EXPORTER_SECURITY_DISABLE_ACCESS_PROTECTION: "true" # Uncomment only if it is safe to disable token authentication (e.g., internal network only)
dns:
- ${IPV4_NETWORK:-172.22.1}.254
networks:
mailcow-network:
ipv4_address: ${IPV4_NETWORK:-172.22.1}.209
aliases:
- prometheus-exporter
Than I would recommend to get another VPS and make Grafana stack where you configure scraper for this exporter by REAL_IP:9099. Better to not mix those two stack.
Or use rpi at your home, your choice, but keep MC as vanilla as you can to prevent future problems.