Skip to content

Commit

Permalink
Merge "Support 2 CPS instances in Prometheus/Grafana"
Browse files Browse the repository at this point in the history
  • Loading branch information
mpriyank91 authored and Gerrit Code Review committed Aug 30, 2024
2 parents 4dac130 + fe22688 commit 5b2edb3
Show file tree
Hide file tree
Showing 8 changed files with 3,642 additions and 8 deletions.
3,613 changes: 3,613 additions & 0 deletions docker-compose/config/grafana/jvm-micrometer-dashboard.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: 1

providers:
- name: default
orgId: 1
type: file
options:
path: /var/lib/grafana/dashboards
foldersFromFilesStructure: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: 1

datasources:
- name: Prometheus
type: prometheus
access: proxy
url: http://prometheus:9090
isDefault: true
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ global:
evaluation_interval: 5s

scrape_configs:
- job_name: 'cps-and-ncm'
- job_name: 'cps-and-ncmp'
metrics_path: '/actuator/prometheus'
scrape_interval: 5s
static_configs:
- targets: ['cps-and-ncmp:8080']
- targets:
- 'docker-compose-cps-and-ncmp-1:8080'
- 'docker-compose-cps-and-ncmp-2:8080'
14 changes: 8 additions & 6 deletions docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ services:
POSTGRES_USER: ${DB_USERNAME:-cps}
POSTGRES_PASSWORD: ${DB_PASSWORD:-cps}
volumes:
- ./postgres-init.sql:/docker-entrypoint-initdb.d/postgres-init.sql
- ./config/postgres-init.sql:/docker-entrypoint-initdb.d/postgres-init.sql
deploy:
resources:
reservations:
Expand Down Expand Up @@ -79,8 +79,8 @@ services:
depends_on:
- cps-and-ncmp
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ./proxy_params:/etc/nginx/proxy_params
- ./config/nginx/nginx.conf:/etc/nginx/nginx.conf
- ./config/nginx/proxy_params:/etc/nginx/proxy_params

### if kafka is not required comment out zookeeper and kafka ###
zookeeper:
Expand Down Expand Up @@ -158,26 +158,28 @@ services:
- policy-executor-stub

prometheus:
container_name: prometheus-container
container_name: prometheus
image: prom/prometheus:latest
ports:
- 9090:9090
restart: always
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- ./config/prometheus.yml:/etc/prometheus/prometheus.yml
profiles:
- monitoring

grafana:
image: grafana/grafana-oss:latest
user: ""
container_name: grafana-container
container_name: grafana
depends_on:
prometheus:
condition: service_started
ports:
- 3000:3000
volumes:
- ./config/grafana/provisioning/:/etc/grafana/provisioning/
- ./config/grafana/jvm-micrometer-dashboard.json:/var/lib/grafana/dashboards/jvm-micrometer-dashboard.json
- grafana:/var/lib/grafana
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
Expand Down

0 comments on commit 5b2edb3

Please sign in to comment.