Added base prometheus config + fast clean-up
This commit is contained in:
parent
6042f81c35
commit
bd38c66fda
@ -7,22 +7,6 @@ services:
|
|||||||
hostname: egommerce.pbiernat.dev
|
hostname: egommerce.pbiernat.dev
|
||||||
environment:
|
environment:
|
||||||
- APP_DOMAIN=egommerce.pbiernat.dev
|
- APP_DOMAIN=egommerce.pbiernat.dev
|
||||||
# labels:
|
|
||||||
# - "traefik.enable=true"
|
|
||||||
# - "traefik.http.routers.api-gateway-dashboard.rule=PathPrefix(`/`)"
|
|
||||||
# - "traefik.http.routers.api-gateway-dashboard.service=dashboard@internal"
|
|
||||||
# - "traefik.http.routers.api-gateway-dashboard.middlewares=dashboard_redirect@internal,dashboard_stripprefix@internal"
|
|
||||||
# - "traefik.http.routers.api-gateway-api.rule=PathPrefix(`/api`)"
|
|
||||||
# - "traefik.http.routers.api-gateway-api.service=api@internal"
|
|
||||||
# - "traefik.http.routers.api-gateway-api.middlewares=PathPrefix(`/`)"
|
|
||||||
# - "traefik.http.routers.api-gateway.rule=Headers(`X-API-SERVICE`, `admin-gateway`)"
|
|
||||||
# - "traefik.http.routers.api-gateway.tls=true"
|
|
||||||
# - "traefik.http.routers.api-gateway.entryPoints=https"
|
|
||||||
# - "traefik.http.services.api-gateway.loadbalancer.server.scheme=http"
|
|
||||||
# - "traefik.http.services.api-gateway.loadbalancer.server.port=8080"
|
|
||||||
# - "traefik.http.middlewares.gateway-stripprefix.stripprefix.prefixes=/admin/gateway"
|
|
||||||
# - "traefik.tls.certificates.certfile=/etc/traefik/certs/client.cert"
|
|
||||||
# - "traefik.tls.certificates.keyfile=/etc/traefik/certs/client.key"
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./certs/api-gateway:/etc/traefik/certs
|
- ./certs/api-gateway:/etc/traefik/certs
|
||||||
|
|
||||||
@ -32,22 +16,6 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
- APP_DOMAIN=registry.egommerce.pbiernat.dev
|
- APP_DOMAIN=registry.egommerce.pbiernat.dev
|
||||||
- CONSUL_HTTP_TOKEN=devop
|
- CONSUL_HTTP_TOKEN=devop
|
||||||
# labels:
|
|
||||||
# - "traefik.enable=true"
|
|
||||||
# - "traefik.http.routers.api-registry.rule=PathPrefix(`/admin/registry`)"
|
|
||||||
# - "traefik.http.routers.api-registry.rule=Headers(`X-API-SERVICE`, `admin-registry`)"
|
|
||||||
# - "traefik.http.routers.api-registry.tls=true"
|
|
||||||
# - "traefik.http.routers.api-registry.tls.domains[0].main=egommerce.pbiernat.dev"
|
|
||||||
# - "traefik.http.routers.api-registry.entryPoints=https"
|
|
||||||
# - "traefik.http.routers.api-registry.service=api-registry"
|
|
||||||
# - "traefik.http.routers.api-registry.middlewares=registry-stripprefix"
|
|
||||||
# - "traefik.http.services.api-registry.loadbalancer.server.scheme=http"
|
|
||||||
# - "traefik.http.services.api-registry.loadbalancer.server.port=8500"
|
|
||||||
# - "traefik.http.middlewares.registry-stripprefix.stripprefix.prefixes=/admin/registry"
|
|
||||||
# - "traefik.tls.certificates.certfile=/certs/client.cert"
|
|
||||||
# - "traefik.tls.certificates.keyfile=/certs/client.key"
|
|
||||||
# volumes:
|
|
||||||
# - ./certs/api-gateway:/certs
|
|
||||||
|
|
||||||
api-eventbus:
|
api-eventbus:
|
||||||
image: git.pbiernat.dev/egommerce/api-eventbus:dev
|
image: git.pbiernat.dev/egommerce/api-eventbus:dev
|
||||||
@ -57,21 +25,6 @@ services:
|
|||||||
- RABBITMQ_NODENAME=api-eventbus
|
- RABBITMQ_NODENAME=api-eventbus
|
||||||
# - RABBITMQ_DEFAULT_USER = admin
|
# - RABBITMQ_DEFAULT_USER = admin
|
||||||
# - RABBITMQ_DEFAULT_PASS = passw123
|
# - RABBITMQ_DEFAULT_PASS = passw123
|
||||||
# labels:
|
|
||||||
# - "traefik.enable=true"
|
|
||||||
# - "traefik.http.routers.api-eventbus.rule=PathPrefix(`/admin/eventbus`)"
|
|
||||||
# - "traefik.http.routers.api-eventbus.tls=true"
|
|
||||||
# - "traefik.http.routers.api-eventbus.tls.domains[0].main=egommerce.pbiernat.dev"
|
|
||||||
# - "traefik.http.routers.api-eventbus.entryPoints=https"
|
|
||||||
# - "traefik.http.routers.api-eventbus.service=api-eventbus"
|
|
||||||
# - "traefik.http.routers.api-eventbus.middlewares=eventbus-stripprefix"
|
|
||||||
# - "traefik.http.services.api-eventbus.loadbalancer.server.scheme=http"
|
|
||||||
# - "traefik.http.services.api-eventbus.loadbalancer.server.port=15672"
|
|
||||||
# - "traefik.http.middlewares.eventbus-stripprefix.stripprefix.prefixes=/admin/eventbus"
|
|
||||||
# # - "traefik.tls.certificates.certfile=/certs/client.cert"
|
|
||||||
# # - "traefik.tls.certificates.keyfile=/certs/client.key"
|
|
||||||
# volumes:
|
|
||||||
# - ./certs/api-gateway:/certs
|
|
||||||
|
|
||||||
api-cache:
|
api-cache:
|
||||||
image: git.pbiernat.dev/egommerce/api-cache:dev
|
image: git.pbiernat.dev/egommerce/api-cache:dev
|
||||||
@ -83,8 +36,18 @@ services:
|
|||||||
hostname: logger.egommerce.pbiernat.dev
|
hostname: logger.egommerce.pbiernat.dev
|
||||||
environment:
|
environment:
|
||||||
- APP_DOMAIN=logger.egommerce.pbiernat.dev
|
- APP_DOMAIN=logger.egommerce.pbiernat.dev
|
||||||
# ports:
|
|
||||||
# - 24224:24224
|
api-prometheus:
|
||||||
|
# image: prom/prometheus:latest # FIXME: create private image(prod/dev)...
|
||||||
|
hostname: prometheus.egommerce.pbiernat.dev
|
||||||
|
environment:
|
||||||
|
- APP_DOMAIN=prometheus.egommerce.pbiernat.dev
|
||||||
|
|
||||||
|
api-grafana:
|
||||||
|
# image: grafana/grafana-oss:latest # FIXME: create private image(prod/dev)...
|
||||||
|
hostname: grafana.egommerce.pbiernat.dev
|
||||||
|
environment:
|
||||||
|
- APP_DOMAIN=grafana.egommerce.pbiernat.dev
|
||||||
|
|
||||||
postgres-db:
|
postgres-db:
|
||||||
hostname: db.egommerce.pbiernat.dev
|
hostname: db.egommerce.pbiernat.dev
|
||||||
@ -93,18 +56,12 @@ services:
|
|||||||
- POSTGRES_PASSWORD=12345678
|
- POSTGRES_PASSWORD=12345678
|
||||||
# ports:
|
# ports:
|
||||||
# - '5432:5432'
|
# - '5432:5432'
|
||||||
# volumes:
|
|
||||||
# - ./certs/postgres-db:/certs
|
|
||||||
|
|
||||||
mongo-db:
|
mongo-db:
|
||||||
hostname: mongodb.egommerce.pbiernat.dev
|
hostname: mongodb.egommerce.pbiernat.dev
|
||||||
environment:
|
environment:
|
||||||
- APP_DOMAIN=mongodb.egommerce.pbiernat.dev
|
- APP_DOMAIN=mongodb.egommerce.pbiernat.dev
|
||||||
- MONGO_INITDB_ROOT_PASSWORD=12345678
|
- MONGO_INITDB_ROOT_PASSWORD=12345678
|
||||||
# ports:
|
|
||||||
# - '27017:27017'
|
|
||||||
# volumes:
|
|
||||||
# - ./certs/mongo-db:/certs
|
|
||||||
|
|
||||||
# API micro-services
|
# API micro-services
|
||||||
identity-svc:
|
identity-svc:
|
||||||
@ -160,8 +117,6 @@ services:
|
|||||||
# Workers (EventBus)
|
# Workers (EventBus)
|
||||||
basket-worker:
|
basket-worker:
|
||||||
image: git.pbiernat.dev/egommerce/basket-worker:dev
|
image: git.pbiernat.dev/egommerce/basket-worker:dev
|
||||||
# deploy:
|
|
||||||
# replicas: 2
|
|
||||||
environment:
|
environment:
|
||||||
- DATABASE_URL=postgres://postgres:12345678@db.egommerce.pbiernat.dev:5432/egommerce
|
- DATABASE_URL=postgres://postgres:12345678@db.egommerce.pbiernat.dev:5432/egommerce
|
||||||
- MONGODB_URL=mongodb://mongodb:12345678@mongodb.egommerce.pbiernat.dev:27017
|
- MONGODB_URL=mongodb://mongodb:12345678@mongodb.egommerce.pbiernat.dev:27017
|
||||||
@ -169,8 +124,6 @@ services:
|
|||||||
|
|
||||||
catalog-worker:
|
catalog-worker:
|
||||||
image: git.pbiernat.dev/egommerce/catalog-worker:dev
|
image: git.pbiernat.dev/egommerce/catalog-worker:dev
|
||||||
# deploy:
|
|
||||||
# replicas: 2
|
|
||||||
environment:
|
environment:
|
||||||
- DATABASE_URL=postgres://postgres:12345678@db.egommerce.pbiernat.dev:5432/egommerce
|
- DATABASE_URL=postgres://postgres:12345678@db.egommerce.pbiernat.dev:5432/egommerce
|
||||||
- MONGODB_URL=mongodb://mongodb:12345678@mongodb.egommerce.pbiernat.dev:27017
|
- MONGODB_URL=mongodb://mongodb:12345678@mongodb.egommerce.pbiernat.dev:27017
|
||||||
@ -178,8 +131,6 @@ services:
|
|||||||
|
|
||||||
pricing-worker:
|
pricing-worker:
|
||||||
image: git.pbiernat.dev/egommerce/pricing-worker:dev
|
image: git.pbiernat.dev/egommerce/pricing-worker:dev
|
||||||
# deploy:
|
|
||||||
# replicas: 2
|
|
||||||
environment:
|
environment:
|
||||||
- DATABASE_URL=postgres://postgres:12345678@db.egommerce.pbiernat.dev:5432/egommerce
|
- DATABASE_URL=postgres://postgres:12345678@db.egommerce.pbiernat.dev:5432/egommerce
|
||||||
- MONGODB_URL=mongodb://mongodb:12345678@mongodb.egommerce.pbiernat.dev:27017
|
- MONGODB_URL=mongodb://mongodb:12345678@mongodb.egommerce.pbiernat.dev:27017
|
||||||
@ -187,8 +138,6 @@ services:
|
|||||||
|
|
||||||
order-worker:
|
order-worker:
|
||||||
image: git.pbiernat.dev/egommerce/order-worker:dev
|
image: git.pbiernat.dev/egommerce/order-worker:dev
|
||||||
# deploy:
|
|
||||||
# replicas: 2
|
|
||||||
environment:
|
environment:
|
||||||
- DATABASE_URL=postgres://postgres:12345678@db.egommerce.pbiernat.dev:5432/egommerce
|
- DATABASE_URL=postgres://postgres:12345678@db.egommerce.pbiernat.dev:5432/egommerce
|
||||||
- MONGODB_URL=mongodb://mongodb:12345678@mongodb.egommerce.pbiernat.dev:27017
|
- MONGODB_URL=mongodb://mongodb:12345678@mongodb.egommerce.pbiernat.dev:27017
|
||||||
|
@ -4,14 +4,16 @@ services:
|
|||||||
api-gateway:
|
api-gateway:
|
||||||
image: git.pbiernat.dev/egommerce/api-gateway:latest
|
image: git.pbiernat.dev/egommerce/api-gateway:latest
|
||||||
# command:
|
# command:
|
||||||
# - '--providers.consulcatalog.refreshinterval=5s' # FIXME only on config option: static/env/cli must be selected
|
# - '--providers.consulcatalog.refreshinterval=5s'
|
||||||
|
# FIXME ^^ only on config option: static/env/cli must be selected
|
||||||
environment:
|
environment:
|
||||||
- APP_NAME=api-gateway
|
- APP_NAME=api-gateway
|
||||||
- APP_DOMAIN
|
- APP_DOMAIN
|
||||||
- API_REGISTRY_REFRESH_INTERVAL=5s
|
- API_REGISTRY_REFRESH_INTERVAL=5s
|
||||||
networks:
|
networks:
|
||||||
- api-gateway-network
|
- api-gateway-network
|
||||||
# - api-logger-network # TODO
|
- api-registry-network
|
||||||
|
- api-logger-network
|
||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
|
||||||
@ -25,8 +27,7 @@ services:
|
|||||||
- registry_data:/consul/data
|
- registry_data:/consul/data
|
||||||
networks:
|
networks:
|
||||||
- api-registry-network
|
- api-registry-network
|
||||||
# - api-logger-network # TODO
|
- api-logger-network
|
||||||
- api-gateway-network
|
|
||||||
|
|
||||||
api-eventbus:
|
api-eventbus:
|
||||||
image: git.pbiernat.dev/egommerce/api-eventbus:latest
|
image: git.pbiernat.dev/egommerce/api-eventbus:latest
|
||||||
@ -37,12 +38,6 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- eventbus_data:/var/lib/rabbitmq
|
- eventbus_data:/var/lib/rabbitmq
|
||||||
- eventbus_logs:/var/log/rabbitmq
|
- eventbus_logs:/var/log/rabbitmq
|
||||||
# labels:
|
|
||||||
# - "traefik.enable=true"
|
|
||||||
# - "traefik.tcp.routers.eventbus-svc.rule=HostSNI(`*`)"
|
|
||||||
# - "traefik.tcp.routers.eventbus-svc.service=eventbus-svc"
|
|
||||||
# - "traefik.tcp.routers.eventbus-svc.entryPoints=eventbus"
|
|
||||||
# - "traefik.tcp.services.eventbus-svc.loadbalancer.server.port=5672"
|
|
||||||
networks:
|
networks:
|
||||||
- api-eventbus-network
|
- api-eventbus-network
|
||||||
- api-registry-network
|
- api-registry-network
|
||||||
@ -64,6 +59,34 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- api-logger-network
|
- api-logger-network
|
||||||
|
|
||||||
|
api-prometheus:
|
||||||
|
image: prom/prometheus:latest # FIXME: create private image(prod/dev)...
|
||||||
|
environment:
|
||||||
|
- APP_NAME=api-prometheus
|
||||||
|
- APP_DOMAIN
|
||||||
|
volumes:
|
||||||
|
- ./etc/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
|
||||||
|
networks:
|
||||||
|
- api-prometheus-network
|
||||||
|
- api-grafana-network
|
||||||
|
- api-gateway-network
|
||||||
|
- api-registry-network
|
||||||
|
- api-eventbus-network
|
||||||
|
- api-cache-network
|
||||||
|
- api-logger-network
|
||||||
|
- catalog-svc-network
|
||||||
|
- catalog-worker-network
|
||||||
|
|
||||||
|
api-grafana:
|
||||||
|
image: grafana/grafana-oss:latest # FIXME: create private image(prod/dev)...
|
||||||
|
environment:
|
||||||
|
- APP_NAME=api-grafana
|
||||||
|
- APP_DOMAIN
|
||||||
|
volumes:
|
||||||
|
- grafana-db:/var/lib/grafana
|
||||||
|
networks:
|
||||||
|
- api-grafana-network
|
||||||
|
|
||||||
postgres-db:
|
postgres-db:
|
||||||
image: postgres:14.1-alpine
|
image: postgres:14.1-alpine
|
||||||
environment:
|
environment:
|
||||||
@ -71,11 +94,6 @@ services:
|
|||||||
- APP_DOMAIN
|
- APP_DOMAIN
|
||||||
- POSTGRES_USER=postgres
|
- POSTGRES_USER=postgres
|
||||||
- POSTGRES_PASSWORD
|
- POSTGRES_PASSWORD
|
||||||
# labels:
|
|
||||||
# - "traefik.enable=true"
|
|
||||||
# - "traefik.tcp.routers.postgres-svc.service=postgres-svc"
|
|
||||||
# - "traefik.tcp.routers.postgres-svc.entryPoints=db"
|
|
||||||
# - "traefik.tcp.services.postgres-svc.loadbalancer.server.port=5432"
|
|
||||||
volumes:
|
volumes:
|
||||||
- postgres_data:/var/lib/postgresql/data
|
- postgres_data:/var/lib/postgresql/data
|
||||||
networks:
|
networks:
|
||||||
@ -89,11 +107,6 @@ services:
|
|||||||
- APP_DOMAIN
|
- APP_DOMAIN
|
||||||
- MONGO_INITDB_ROOT_USERNAME=mongodb
|
- MONGO_INITDB_ROOT_USERNAME=mongodb
|
||||||
- MONGO_INITDB_ROOT_PASSWORD
|
- MONGO_INITDB_ROOT_PASSWORD
|
||||||
# labels:
|
|
||||||
# - "traefik.enable=true"
|
|
||||||
# - "traefik.tcp.routers.mongodb-svc.service=mongodb-svc"
|
|
||||||
# - "traefik.tcp.routers.mongodb-svc.entryPoints=mongodb"
|
|
||||||
# - "traefik.tcp.services.mongodb-svc.loadbalancer.server.port=27017"
|
|
||||||
volumes:
|
volumes:
|
||||||
- mongodb_data:/data/db
|
- mongodb_data:/data/db
|
||||||
networks:
|
networks:
|
||||||
@ -276,6 +289,7 @@ volumes:
|
|||||||
registry_data: ~
|
registry_data: ~
|
||||||
eventbus_data: ~
|
eventbus_data: ~
|
||||||
eventbus_logs: ~
|
eventbus_logs: ~
|
||||||
|
grafana-db: ~
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
api-gateway-network:
|
api-gateway-network:
|
||||||
@ -298,6 +312,14 @@ networks:
|
|||||||
driver: overlay
|
driver: overlay
|
||||||
internal: true
|
internal: true
|
||||||
|
|
||||||
|
api-prometheus-network:
|
||||||
|
driver: overlay
|
||||||
|
internal: true
|
||||||
|
|
||||||
|
api-grafana-network:
|
||||||
|
driver: overlay
|
||||||
|
internal: true
|
||||||
|
|
||||||
postgres-db-network:
|
postgres-db-network:
|
||||||
driver: overlay
|
driver: overlay
|
||||||
internal: true
|
internal: true
|
||||||
|
23
deploy/etc/prometheus/prometheus.yml
Normal file
23
deploy/etc/prometheus/prometheus.yml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
global:
|
||||||
|
scrape_interval: 15s
|
||||||
|
evaluation_interval: 15s
|
||||||
|
|
||||||
|
rule_files:
|
||||||
|
# - "first.rules"
|
||||||
|
# - "second.rules"
|
||||||
|
|
||||||
|
scrape_configs:
|
||||||
|
- job_name: prometheus
|
||||||
|
static_configs:
|
||||||
|
- targets: ['localhost:9090']
|
||||||
|
|
||||||
|
- job_name: 'api-gateway'
|
||||||
|
static_configs:
|
||||||
|
- targets: ['api-gateway:8084']
|
||||||
|
- job_name: 'api-eventbus'
|
||||||
|
static_configs:
|
||||||
|
- targets: ['api-eventbus:8084']
|
||||||
|
|
||||||
|
- job_name: 'catalog-svc'
|
||||||
|
static_configs:
|
||||||
|
- targets: ['catalog-svc:8084']
|
Loading…
Reference in New Issue
Block a user