Skip to content

Commit 8ad268e

Browse files
committed
chore: update sample configuration files and README for Grafana and Prometheus
1 parent 0b5f597 commit 8ad268e

File tree

8 files changed

+938
-10
lines changed

8 files changed

+938
-10
lines changed

apps/price_pusher/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ docker-compose.yaml
22
price-config.yaml
33
lib
44
mnemonic
5-
grafana-dashboard.json

apps/price_pusher/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -300,14 +300,14 @@ docker-compose -f docker-compose.metrics.sample.yaml up
300300
```
301301

302302
This will start:
303-
- Prometheus server on port 9090 with the alerts configured in alerts.yml
303+
- Prometheus server on port 9090 with the alerts configured in alerts.sample.yml
304304
- Grafana server on port 3000 with default credentials (admin/admin)
305305

306-
The docker-compose.metrics.sample.yaml file also includes commented examples of price_pusher services for different blockchains that you can uncomment and customize for your specific needs.
306+
The docker-compose.metrics.sample.yaml file includes a pre-configured Grafana dashboard that displays all the metrics mentioned above. You can check this dashboard to see charts for wallet balance, price update statistics, errors, and other key metrics. The dashboard is automatically provisioned when you start the stack with docker-compose.
307307

308308
Alternatively, if you prefer to set up the monitoring stack manually:
309309

310-
1. Create a `prometheus.yml` file:
310+
1. Create a `prometheus.sample.yml` file:
311311

312312
```yaml
313313
global:
@@ -323,8 +323,8 @@ scrape_configs:
323323

324324
```bash
325325
docker run -d --name prometheus -p 9090:9090 \
326-
-v $(pwd)/prometheus.yml:/etc/prometheus/prometheus.yml \
327-
-v $(pwd)/alerts.yml:/etc/prometheus/alerts.yml \
326+
-v $(pwd)/prometheus.sample.yml:/etc/prometheus/prometheus.yml \
327+
-v $(pwd)/alerts.sample.yml:/etc/prometheus/alerts.yml \
328328
prom/prometheus
329329
```
330330

@@ -378,7 +378,7 @@ pyth_wallet_balance < 0.1
378378

379379
### Alerting
380380

381-
The price pusher includes pre-configured Prometheus alerting rules in the `alerts.yml` file. These rules monitor various aspects of the price pusher's operation, including:
381+
The price pusher includes pre-configured Prometheus alerting rules in the `alerts.sample.yml` file. These rules monitor various aspects of the price pusher's operation, including:
382382

383383
- Price feeds not being updated for an extended period (>1 hour)
384384
- High error rates in price updates
File renamed without changes.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: 1
2+
3+
providers:
4+
- name: 'Pyth Price Pusher'
5+
orgId: 1
6+
folder: ''
7+
type: file
8+
disableDeletion: false
9+
editable: true
10+
options:
11+
path: /var/lib/grafana/dashboards
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: 1
2+
3+
datasources:
4+
- name: Prometheus
5+
type: prometheus
6+
access: proxy
7+
url: http://prometheus:9090
8+
isDefault: true

apps/price_pusher/docker-compose.metrics.sample.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ services:
77
ports:
88
- "9090:9090"
99
volumes:
10-
- ./prometheus.yml:/etc/prometheus/prometheus.yml
11-
- ./alerts.yml:/etc/prometheus/alerts.yml
10+
- ./prometheus.sample.yml:/etc/prometheus/prometheus.yml
11+
- ./alerts.sample.yml:/etc/prometheus/alerts.yml
1212
command:
1313
- "--config.file=/etc/prometheus/prometheus.yml"
1414
- "--storage.tsdb.path=/prometheus"
@@ -24,6 +24,9 @@ services:
2424
- "3000:3000"
2525
volumes:
2626
- grafana-storage:/var/lib/grafana
27+
- ./grafana-dashboard.sample.json:/var/lib/grafana/dashboards/pyth-price-pusher-dashboard.json
28+
- ./dashboard.sample.yml:/etc/grafana/provisioning/dashboards/dashboard.yml
29+
- ./datasource.sample.yml:/etc/grafana/provisioning/datasources/datasource.yml
2730
environment:
2831
- GF_SECURITY_ADMIN_USER=admin
2932
- GF_SECURITY_ADMIN_PASSWORD=admin

0 commit comments

Comments
 (0)