@@ -14,7 +14,9 @@ export class PricePusherMetrics {
14
14
public lastPublishedTime : Gauge < string > ;
15
15
public priceUpdateAttempts : Counter < string > ;
16
16
public priceFeedsTotal : Gauge < string > ;
17
- public priceUpdateDelay : Gauge < string > ;
17
+ public sourceTimestamp : Gauge < string > ;
18
+ public targetTimestamp : Gauge < string > ;
19
+ public configuredTimeDifference : Gauge < string > ;
18
20
// Wallet metrics
19
21
public walletBalance : Gauge < string > ;
20
22
@@ -47,9 +49,23 @@ export class PricePusherMetrics {
47
49
registers : [ this . registry ] ,
48
50
} ) ;
49
51
50
- this . priceUpdateDelay = new Gauge ( {
51
- name : "pyth_price_update_delay" ,
52
- help : "Delay between source and target timestamps relative to configured threshold (positive means over threshold)" ,
52
+ this . sourceTimestamp = new Gauge ( {
53
+ name : "pyth_source_timestamp" ,
54
+ help : "Latest source chain price publish timestamp" ,
55
+ labelNames : [ "price_id" , "alias" ] ,
56
+ registers : [ this . registry ] ,
57
+ } ) ;
58
+
59
+ this . targetTimestamp = new Gauge ( {
60
+ name : "pyth_target_timestamp" ,
61
+ help : "Latest target chain price publish timestamp" ,
62
+ labelNames : [ "price_id" , "alias" ] ,
63
+ registers : [ this . registry ] ,
64
+ } ) ;
65
+
66
+ this . configuredTimeDifference = new Gauge ( {
67
+ name : "pyth_configured_time_difference" ,
68
+ help : "Configured time difference threshold between source and target chains" ,
53
69
labelNames : [ "price_id" , "alias" ] ,
54
70
registers : [ this . registry ] ,
55
71
} ) ;
@@ -141,19 +157,25 @@ export class PricePusherMetrics {
141
157
this . priceFeedsTotal . set ( count ) ;
142
158
}
143
159
144
- // Update price delay relative to threshold
145
- public updatePriceDelay (
160
+ // Update source, target and configured time difference timestamps
161
+ public updateTimestamps (
146
162
priceId : string ,
147
163
alias : string ,
148
164
targetLatestPricePublishTime : number ,
149
165
sourceLatestPricePublishTime : number ,
150
166
priceConfigTimeDifference : number ,
151
167
) : void {
152
- this . priceUpdateDelay . set (
168
+ this . sourceTimestamp . set (
169
+ { price_id : priceId , alias } ,
170
+ sourceLatestPricePublishTime ,
171
+ ) ;
172
+ this . targetTimestamp . set (
173
+ { price_id : priceId , alias } ,
174
+ targetLatestPricePublishTime ,
175
+ ) ;
176
+ this . configuredTimeDifference . set (
153
177
{ price_id : priceId , alias } ,
154
- sourceLatestPricePublishTime -
155
- targetLatestPricePublishTime -
156
- priceConfigTimeDifference ,
178
+ priceConfigTimeDifference ,
157
179
) ;
158
180
}
159
181
0 commit comments