-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: return btc price in stats endpoint #167
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, amazing work
internal/services/stats.go
Outdated
price, err := s.GetLatestBtcPriceUsd(ctx) | ||
if err != nil { | ||
log.Ctx(ctx).Error().Err(err).Msg("error while fetching latest btc price") | ||
return nil, types.NewInternalServiceError(err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not fail the whole request due to this. We should emit a metric and have alert based on this, but silently fail by fall back to empty value for the additional field we added in the stats response.
FE will handle it gracefully.
Fixes - #166
This pr
When fetched first time
After TTL (currently 3 seconds in local config)
in /v1/stats