@@ -6,10 +6,11 @@ import (
66)
77
88const (
9- promNamespace = "pyth"
9+ Namespace = "pyth"
1010
11- promSubsystemExporter = "exporter"
12- promSubsystemOracle = "oracle"
11+ SubsystemExporter = "exporter"
12+ SubsystemSolana = "solana"
13+ SubsystemOracle = "oracle"
1314)
1415
1516// Prometheus metric labels.
@@ -31,69 +32,70 @@ const (
3132var (
3233 // RPC request stats
3334 rpcRequestsTotal = factory .NewCounterVec (prometheus.CounterOpts {
34- Namespace : promNamespace ,
35- Subsystem : promSubsystemExporter ,
35+ Namespace : Namespace ,
36+ Subsystem : SubsystemExporter ,
3637 Name : "rpc_requests_total" ,
3738 Help : "Number of outgoing RPC requests from pyth_exporter to RPC nodes" ,
3839 }, []string {})
3940 WsActiveConns = factory .NewGauge (prometheus.GaugeOpts {
40- Namespace : promNamespace ,
41- Subsystem : promSubsystemExporter ,
41+ Namespace : Namespace ,
42+ Subsystem : SubsystemExporter ,
4243 Name : "ws_active_conns" ,
4344 Help : "Number of active WebSockets between pyth_exporter and RPC nodes" ,
4445 })
4546 WsEventsTotal = factory .NewCounter (prometheus.CounterOpts {
46- Namespace : promNamespace ,
47- Subsystem : promSubsystemExporter ,
47+ Namespace : Namespace ,
48+ Subsystem : SubsystemExporter ,
4849 Name : "ws_events_total" ,
4950 Help : "Number of WebSocket events delivered from RPC nodes to pyth_exporter" ,
5051 })
5152
52- // Publisher Observables
53- publisherBalances = prometheus . NewGaugeVec (prometheus. GaugeOpts {
54- Namespace : promNamespace ,
53+ PublisherBalances = prometheus . NewGaugeVec (prometheus. GaugeOpts {
54+ Namespace : Namespace ,
55+ Subsystem : SubsystemSolana ,
5556 Name : "publish_account_balance" ,
5657 Help : "SOL balance of Pyth publish account in lamports" ,
5758 }, []string {labelPublisher })
59+
5860 AggPrice = factory .NewGaugeVec (prometheus.GaugeOpts {
59- Namespace : promNamespace ,
60- Subsystem : promSubsystemOracle ,
61+ Namespace : Namespace ,
62+ Subsystem : SubsystemOracle ,
6163 Name : "aggregated_price" ,
6264 Help : "Last aggregated price of Pyth product" ,
6365 }, []string {labelProduct })
6466 AggConf = factory .NewGaugeVec (prometheus.GaugeOpts {
65- Namespace : promNamespace ,
66- Subsystem : promSubsystemOracle ,
67+ Namespace : Namespace ,
68+ Subsystem : SubsystemOracle ,
6769 Name : "aggregated_conf_amount" ,
6870 Help : "Last aggregated conf of Pyth product" ,
6971 }, []string {labelProduct })
7072 PublisherPrice = factory .NewGaugeVec (prometheus.GaugeOpts {
71- Namespace : promNamespace ,
72- Subsystem : promSubsystemOracle ,
73+ Namespace : Namespace ,
74+ Subsystem : SubsystemOracle ,
7375 Name : "publisher_price" ,
7476 Help : "Last published product price by Pyth publisher" ,
7577 }, []string {labelProduct , labelPublisher })
7678 PublisherConf = factory .NewGaugeVec (prometheus.GaugeOpts {
77- Namespace : promNamespace ,
78- Subsystem : promSubsystemOracle ,
79+ Namespace : Namespace ,
80+ Subsystem : SubsystemOracle ,
7981 Name : "publisher_conf_amount" ,
8082 Help : "Last published product confidence by Pyth publisher" ,
8183 }, []string {labelProduct , labelPublisher })
8284 PublisherSlot = factory .NewGaugeVec (prometheus.GaugeOpts {
83- Namespace : promNamespace ,
84- Subsystem : promSubsystemOracle ,
85+ Namespace : Namespace ,
86+ Subsystem : SubsystemOracle ,
8587 Name : "publisher_slot" ,
8688 Help : "Last observed slot for Pyth publisher" ,
8789 }, []string {labelProduct , labelPublisher })
8890
8991 // Publisher Observers
9092 metricTxFeesTotal = factory .NewCounterVec (prometheus.CounterOpts {
91- Namespace : promNamespace ,
93+ Namespace : Namespace ,
9294 Name : "tx_fees_total" ,
9395 Help : "Approximate amount of SOL in lamports spent on Pyth publishing" ,
9496 }, []string {labelPublisher })
9597 metricTxCount = factory .NewCounterVec (prometheus.CounterOpts {
96- Namespace : promNamespace ,
98+ Namespace : Namespace ,
9799 Name : "txs_total" ,
98100 Help : "Approximate number of Pyth transactions sent" ,
99101 }, []string {labelPublisher , labelTxStatus })
0 commit comments