template.yaml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. ---
  2. kind: compose
  3. metadata:
  4. icon:
  5. provider: selfh
  6. id: prometheus
  7. name: Prometheus
  8. description: |
  9. Prometheus is an open-source systems monitoring and alerting toolkit originally built at SoundCloud.
  10. It is designed for reliability and scalability, making it suitable for monitoring dynamic cloud environments.
  11. Prometheus collects and stores metrics as time series data, providing powerful querying capabilities and integration with various visualization tools.
  12. ## Swarm Deployment Warning
  13. Prometheus uses local TSDB storage and does NOT support running multiple replicas.
  14. This template enforces a single replica with node placement constraints. For true HA, consider remote storage solutions (Thanos, Cortex, VictoriaMetrics).
  15. Project: https://prometheus.io/
  16. Documentation: https://prometheus.io/docs/
  17. GitHub: https://github.com/prometheus/prometheus
  18. version: v3.8.1
  19. author: Christian Lempa
  20. date: '2025-12-16'
  21. tags:
  22. - traefik
  23. - swarm
  24. - authentik
  25. next_steps: |
  26. {% if swarm_enabled -%}
  27. 1. Deploy to Docker Swarm:
  28. docker stack deploy -c compose.yaml {{ service_name }}
  29. 2. Access Prometheus:
  30. {%- if traefik_enabled %} https://{{ traefik_host }}
  31. {%- else %} http://<swarm-node-ip>:{{ ports_http }}{%- endif %}
  32. {% else -%}
  33. 1. Start Prometheus with Docker Compose:
  34. docker compose up -d
  35. 2. Access Prometheus:
  36. {%- if traefik_enabled %} https://{{ traefik_host }}
  37. {%- else %} http://localhost:{{ ports_http }}{%- endif %}
  38. {% endif -%}
  39. 3. Edit config/prometheus.yaml to add scrape targets
  40. 4. Reload configuration: docker exec {{ container_name if not swarm_enabled else service_name }} kill -HUP 1
  41. spec:
  42. general:
  43. vars:
  44. service_name:
  45. default: prometheus
  46. metrics:
  47. title: Metrics & Storage
  48. description: Configure data retention and storage settings
  49. vars:
  50. metrics_retention_time:
  51. type: str
  52. description: "How long to retain samples (e.g., 15d, 30d, 1y)"
  53. default: "15d"
  54. extra: "Older data will be deleted. Use 'h', 'd', 'w', 'y' for time units."
  55. metrics_retention_size:
  56. type: str
  57. description: "Maximum storage size (e.g., 5GB, 10GB, 1TB)"
  58. default: "0"
  59. extra: "Set to 0 for unlimited. Triggers deletion when exceeded."
  60. metrics_enable_remote_write:
  61. type: bool
  62. description: "Enable remote write receiver (allows pushing metrics via /api/v1/write)"
  63. default: false
  64. extra: "Caution: Intended for low-volume use cases only. Not efficient for general ingestion."
  65. ports:
  66. vars:
  67. ports_http:
  68. default: 9090
  69. traefik:
  70. vars:
  71. traefik_host:
  72. default: prometheus