# Copyright (c) Abstract Machines # SPDX-License-Identifier: Apache-2.0 # This docker-compose file contains optional Prometheus and Grafana service for Magistrala platform. # Since this service is optional, this file is dependent of docker-compose.yml file # from /docker. In order to run this service, execute command: # docker compose -f docker/addons/prometheus/docker-compose.yml up # from project root. networks: magistrala-base-net: volumes: magistrala-prometheus-volume: services: promethues: image: prom/prometheus:v2.49.1 container_name: magistrala-prometheus restart: on-failure ports: - ${MG_PROMETHEUS_PORT}:${MG_PROMETHEUS_PORT} networks: - magistrala-base-net volumes: - type: bind source: ./metrics/prometheus.yml target: /etc/prometheus/prometheus.yml - magistrala-prometheus-volume:/prometheus grafana: image: grafana/grafana:10.2.3 container_name: magistrala-grafana depends_on: - promethues restart: on-failure ports: - ${MG_GRAFANA_PORT}:${MG_GRAFANA_PORT} environment: - GF_SECURITY_ADMIN_USER=${MG_GRAFANA_ADMIN_USER} - GF_SECURITY_ADMIN_PASSWORD=${MG_GRAFANA_ADMIN_PASSWORD} networks: - magistrala-base-net volumes: - type: bind source: ./grafana/datasource.yml target: /etc/grafana/provisioning/datasources/datasource.yml - type: bind source: ./grafana/dashboard.yml target: /etc/grafana/provisioning/dashboards/main.yaml - type: bind source: ./grafana/example-dashboard.json target: /var/lib/grafana/dashboards/example-dashboard.json