Skip to content

Commit

Permalink
Add more logging on mercury server price query errors (#10644)
Browse files Browse the repository at this point in the history
  • Loading branch information
samsondav authored Sep 15, 2023
1 parent 05f9558 commit 5036be4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/services/relay/evm/mercury/v2/data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ func (ds *datasource) Observe(ctx context.Context, repts ocrtypes.ReportTimestam
obs.LinkPrice.Val = relaymercuryv2.MissingPrice
} else if obs.LinkPrice.Err != nil {
mercurytypes.PriceFeedErrorCount.WithLabelValues(ds.linkFeedID.String()).Inc()
ds.lggr.Errorw("Mercury server returned error querying LINK price feed", "err", obs.LinkPrice.Err, "linkFeedID", ds.linkFeedID)
}
}()
}
Expand All @@ -140,6 +141,7 @@ func (ds *datasource) Observe(ctx context.Context, repts ocrtypes.ReportTimestam
obs.NativePrice.Val = relaymercuryv2.MissingPrice
} else if obs.NativePrice.Err != nil {
mercurytypes.PriceFeedErrorCount.WithLabelValues(ds.nativeFeedID.String()).Inc()
ds.lggr.Errorw("Mercury server returned error querying native price feed", "err", obs.NativePrice.Err, "nativeFeedID", ds.nativeFeedID)
}
}()
}
Expand Down
2 changes: 2 additions & 0 deletions core/services/relay/evm/mercury/v3/data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ func (ds *datasource) Observe(ctx context.Context, repts ocrtypes.ReportTimestam
obs.LinkPrice.Val = relaymercuryv3.MissingPrice
} else if obs.LinkPrice.Err != nil {
mercurytypes.PriceFeedErrorCount.WithLabelValues(ds.linkFeedID.String()).Inc()
ds.lggr.Errorw("Mercury server returned error querying LINK price feed", "err", obs.LinkPrice.Err, "linkFeedID", ds.linkFeedID)
}
}()
}
Expand All @@ -143,6 +144,7 @@ func (ds *datasource) Observe(ctx context.Context, repts ocrtypes.ReportTimestam
obs.NativePrice.Val = relaymercuryv3.MissingPrice
} else if obs.NativePrice.Err != nil {
mercurytypes.PriceFeedErrorCount.WithLabelValues(ds.nativeFeedID.String()).Inc()
ds.lggr.Errorw("Mercury server returned error querying native price feed", "err", obs.NativePrice.Err, "nativeFeedID", ds.nativeFeedID)
}
}()
}
Expand Down

0 comments on commit 5036be4

Please sign in to comment.