Skip to content

Commit

Permalink
Merge pull request #20 from hawkw/eliza/grafana
Browse files Browse the repository at this point in the history
  • Loading branch information
hdevalence committed Sep 6, 2021
2 parents 4c9baf2 + 1eec662 commit bc5ef8c
Show file tree
Hide file tree
Showing 6 changed files with 133 additions and 34 deletions.
14 changes: 14 additions & 0 deletions config/grafana/grafana.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[paths]
provisioning = /etc/grafana/provisioning

# grafana config for local development. don't enable accounts & auth, just let
# me look at the dashboards!
[auth]
# this doesn't seem to work but you can just navigate to other URLs...
disable_login_form = true

[auth.anonymous]
# enable anonymous access
enabled = true
org_name = Main Org.
org_role = Editor
6 changes: 6 additions & 0 deletions config/grafana/provisioning/dashboards/all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- name: 'default'
org_id: 1
folder: ''
type: 'file'
options:
folder: '/var/lib/grafana/dashboards'
7 changes: 7 additions & 0 deletions config/grafana/provisioning/datasources/all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
datasources:
- name: 'Prometheus'
type: 'prometheus'
access: 'browser'
url: 'http://prometheus:9090'
is_default: true
editable: false
15 changes: 15 additions & 0 deletions config/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
scrape_configs:
- job_name: 'Tendermint Node'
scrape_interval: 10s
scheme: http
metrics_path: metrics
static_configs:
- targets: ['tendermint:26660']
# NOTE: `pd` doesn't actually expose metrics yet, so this doesn't actually do
# anything interesting...
- job_name: 'Penumbra Daemon'
scrape_interval: 10s
scheme: http
metrics_path: metrics
static_configs:
- targets: ['pd:9096']
54 changes: 54 additions & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# docker-compose oerrides for local development.
#
# this modifies the docker-compose configuration for locally testing and
# debugging the Penumbra daemon. these configurations may not be desirable when
# running in production, so the main `docker-compose.yml` defines a canonical
# configuration for prod deployments.
services:
# for local development, configure the penumbra daemon with more logging.
pd:
environment:
- RUST_LOG=${RUST_LOG:-info,pd=debug,penumbra=debug}

# add prometheus and grafana
#
# in production, users will want to bring their own monitoring stack, rather
# than running a separate prometheus and grafana instance on every node.
prometheus:
image: "prom/prometheus:latest"
ports:
- '9090:9090'
volumes:
- "./config/prometheus.yml:/etc/prometheus/prometheus.yml:ro"
- "prometheus_data:/prometheus"
networks:
# prometheus needs to be on the local network for scraping metrics from
# tendermint and penumbra.
- localnet
- monitoring

grafana:
image: "grafana/grafana:latest"
ports:
- '3000:3000'
volumes:
# this grafana config is intended for local development and disables auth
# etc. in production, users will generally want to configure a centralized
# grafana instance...
- "./config/grafana/provisioning:/etc/grafana/provisioning:ro"
- "./config/grafana.ini:/etc/grafana/config.ini:ro"
# mount the dashboards dir as read-write so we can add new dashboards
# using the Grafana web UI.
- "./config/grafana/dashboards:/var/lib/grafana/dashboards:rw"
networks:
- monitoring
depends_on:
# don't start grafana until prometheus is up
- prometheus

volumes:
prometheus_data: {}

networks:
# add a separate network for grafana and prometheus to talk to each other.
monitoring: {}
71 changes: 37 additions & 34 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,42 @@
version: "3.9"
services:
# The Penumbra daemon
pd:
container_name: penumbra
build: "."
environment:
- RUST_LOG=${RUST_LOG:-warn,pd=info,penumbra=info}
command:
pd --host 0.0.0.0
networks:
localnet:
ipv4_address: 192.167.10.6
# The Penumbra daemon
pd:
container_name: penumbra
build: "."
environment:
- RUST_LOG=${RUST_LOG:-warn,pd=info,penumbra=info}
command:
pd --host 0.0.0.0
networks:
localnet:
ipv4_address: 192.167.10.6

# The Tendermint node
tendermint:
container_name: tendermint
image: "tendermint/tendermint"
ports:
- "26656-26657:26656-26657"
- "6060:6060"
- "27000:26660"
volumes:
- "/tmp:/tendermint"
command: node --proxy-app=tcp://pd:26658
depends_on:
- pd
networks:
localnet:
ipv4_address: 192.167.10.2
# The Tendermint node
tendermint:
container_name: tendermint
image: "tendermint/tendermint"
ports:
- "26656-26657:26656-26657"
- "6060:6060"
- "27000:26660"
volumes:
- "tendermint_data:/tendermint"
command: node --proxy-app=tcp://pd:26658
depends_on:
- pd
networks:
localnet:
ipv4_address: 192.167.10.2

networks:
localnet:
driver: bridge
ipam:
driver: default
config:
-
subnet: 192.167.10.0/16
localnet:
driver: bridge
ipam:
driver: default
config:
-
subnet: 192.167.10.0/16

volumes:
tendermint_data: {}

0 comments on commit bc5ef8c

Please sign in to comment.