prometheus.py 1021 B

1234567891011121314151617181920212223242526272829303132
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. from materialize import MZ_ROOT
  10. from materialize.mzcompose.service import (
  11. Service,
  12. )
  13. class Prometheus(Service):
  14. def __init__(self, name: str = "prometheus") -> None:
  15. super().__init__(
  16. name=name,
  17. config={
  18. "image": "prom/prometheus:v2.41.0",
  19. "ports": ["9090"],
  20. "volumes": [
  21. str(
  22. MZ_ROOT / "misc" / "mzcompose" / "prometheus" / "prometheus.yml"
  23. )
  24. + ":/etc/prometheus/prometheus.yml",
  25. "mzdata:/mnt/mzdata",
  26. ],
  27. },
  28. )