@@ -63,40 +63,84 @@ Usage of pyth_exporter:
6363 Solana WebSocket RPC URL
6464```
6565
66- ## Metrics
66+ ## Deployment
6767
68+ [ ./docker-compose.yml] ( ./docker-compose.yml ) defines a reference [ Docker Compose] ( https://docs.docker.com/compose/ ) deployment on a single host.
69+
70+ The compose config includes the following services:
71+ - pyth_exporter (this repo)
72+ - Prometheus monitoring agent
73+ - Grafana monitoring UI
74+
75+ ### Requirements
76+
77+ The reference deployment requires Docker Compose: [ Compose installation guide] ( https://docs.docker.com/compose/install/ )
78+
79+ ### Configuration
80+
81+ The env vars file contains deployment-specific config.
82+ Copy the example config and adjust it.
83+
84+ ``` shell
85+ cp docker.example.env docker.env
86+ $EDITOR docker.env
87+ ```
88+
89+ - ` *_IMAGE ` : Docker image strings
90+ - ` SOLANA_RPC ` : Solana RPC access
91+ - ` SOLANA_WS ` : Solana WebSocket access
92+ - ` SOLANA_ENV ` : Environment name (devnet, testnet, mainnet)
93+
94+ ### Operations
95+
96+ Start all services
97+
98+ ``` shell
99+ docker-compose --env-file docker.env up -d
100+ ```
101+
102+ Stop all services
103+
104+ ``` shell
105+ docker-compose down
68106```
69- % curl http://localhost:8080/metrics
70-
71- # HELP pyth_exporter_rpc_requests_total Number of outgoing RPC requests from pyth_exporter to RPC nodes
72- # TYPE pyth_exporter_rpc_requests_total counter
73- pyth_exporter_rpc_requests_total 24
74- # HELP pyth_exporter_ws_active_conns Number of active WebSockets between pyth_exporter and RPC nodes
75- # TYPE pyth_exporter_ws_active_conns gauge
76- pyth_exporter_ws_active_conns 1
77- # HELP pyth_exporter_ws_events_total Number of WebSocket events delivered from RPC nodes to pyth_exporter
78- # TYPE pyth_exporter_ws_events_total counter
79- pyth_exporter_ws_events_total 14408
80- # HELP pyth_oracle_aggregated_conf_amount Last aggregated conf of Pyth product
81- # TYPE pyth_oracle_aggregated_conf_amount gauge
82- pyth_oracle_aggregated_conf_amount{pyth_product="EWxGfxoPQSNA2744AYdAKmsQZ8F9o9M7oKkvL3VM1dko"} 2e-05
83- # HELP pyth_oracle_aggregated_price Last aggregated price of Pyth product
84- # TYPE pyth_oracle_aggregated_price gauge
85- pyth_oracle_aggregated_price{pyth_product="EWxGfxoPQSNA2744AYdAKmsQZ8F9o9M7oKkvL3VM1dko"} 1.1326100000000001
86- # HELP pyth_oracle_publisher_conf_amount Last published product confidence by Pyth publisher
87- # TYPE pyth_oracle_publisher_conf_amount gauge
88- pyth_oracle_publisher_conf_amount{pyth_product="EWxGfxoPQSNA2744AYdAKmsQZ8F9o9M7oKkvL3VM1dko",pyth_publisher="AKPWGLY5KpxbTx7DaVp4Pve8JweMjKbb1A19MyL2nrYT"} 0.00014000000000000001
89- # HELP pyth_oracle_publisher_price Last published product price by Pyth publisher
90- # TYPE pyth_oracle_publisher_price gauge
91- pyth_oracle_publisher_price{pyth_product="EWxGfxoPQSNA2744AYdAKmsQZ8F9o9M7oKkvL3VM1dko",pyth_publisher="AKPWGLY5KpxbTx7DaVp4Pve8JweMjKbb1A19MyL2nrYT"} 1.1326500000000002
92- # HELP pyth_oracle_publisher_slot Last observed slot for Pyth publisher
93- # TYPE pyth_oracle_publisher_slot gauge
94- pyth_oracle_publisher_slot{pyth_product="EWxGfxoPQSNA2744AYdAKmsQZ8F9o9M7oKkvL3VM1dko",pyth_publisher="AKPWGLY5KpxbTx7DaVp4Pve8JweMjKbb1A19MyL2nrYT"} 1.16427278e+08
95- # HELP pyth_solana_publish_account_balance SOL balance of Pyth publish account in lamports
96- # TYPE pyth_solana_publish_account_balance gauge
97- pyth_solana_publish_account_balance{pyth_publisher="AKPWGLY5KpxbTx7DaVp4Pve8JweMjKbb1A19MyL2nrYT"} 4.950539e+10
98- # HELP pyth_txs_total Approximate number of Pyth transactions sent
99- # TYPE pyth_txs_total counter
100- pyth_txs_total{pyth_publisher="AKPWGLY5KpxbTx7DaVp4Pve8JweMjKbb1A19MyL2nrYT",tx_status="failed"} 10
101- pyth_txs_total{pyth_publisher="AKPWGLY5KpxbTx7DaVp4Pve8JweMjKbb1A19MyL2nrYT",tx_status="success"} 67
107+
108+ Stop all services and delete all data (!)
109+
110+ ``` shell
111+ docker-compose down -v --remove-orphans
102112```
113+
114+ View service status
115+
116+ ``` shell
117+ docker-compose ps
118+ ```
119+
120+ View service logs
121+
122+ ``` shell
123+ docker-compose logs
124+ ```
125+
126+ ## Screenshots
127+
128+ ** Overview**
129+
130+ ![ Overview] ( ./docs/grafana-overview.png )
131+
132+ ** Status Matrix**
133+
134+ ![ Status Matrix] ( ./docs/grafana-status-matrix.png )
135+
136+ ** Aggregated Price**
137+
138+ ![ Aggregated Price] ( ./docs/grafana-price.png )
139+
140+ ** Multiple Price Components**
141+
142+ ![ Multiple Price Components] ( ./docs/grafana-price-components.png )
143+
144+ ** Single Price Component**
145+
146+ ![ Single Price Component] ( ./docs/grafana-price-published.png )
0 commit comments