Skip to content
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

Add tip bot balance to metrics #50

Merged
merged 6 commits into from
May 10, 2023
Merged

Add tip bot balance to metrics #50

merged 6 commits into from
May 10, 2023

Conversation

rzadp
Copy link
Contributor

@rzadp rzadp commented May 4, 2023

  • Add the balance to the metrics - progresses Implement Metrics & Healthchecks + Grafana #20
  • Fetch balance for all networks on startup, and update it after tip requests
  • Some necessary refactors around chain config - tipUrl is no longer part of ChainConfig, because it depends on a given tip instance

rzadp added 3 commits May 4, 2023 13:32
Also some necessary refactors - tip url is no longer in chain config.
@rzadp rzadp requested a review from a team as a code owner May 4, 2023 11:55
src/balance.ts Outdated
import { TipNetwork } from "./types";

export const updateAllBalances = async (tipBotAddress: string, log: Probot["log"]): Promise<void> => {
const networks: TipNetwork[] = ["localpolkadot", "localkusama", "kusama", "polkadot"];
Copy link
Contributor

@mordamax mordamax May 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

afaiu this will be running on prod?
therefore 2 dumb questions

  1. do we need on prod to update local* networks?
  2. is the tipBotAddress same for each network?

i guess on prod we will see local* networks failed to check balance

i wonder why we need to update All if we run one instance per its address/network and thus they will run updateBalance for itself?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The answer to (2) should be yes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need on prod to update local* networks?
i guess on prod we will see local* networks failed to check balance

We don't need local*, my idea was to not do anything special for those and just let it fail once to check balance.
But maybe I better change it so we don't have errors every time the app is restarted.


is the tipBotAddress same for each network?
The answer to (2) should be yes.

I believe it is a yes.


if we run one instance per its address/network

My understanding is that we run one instance per all networks (so Polkadot and Kusama in our case), using a single instance and a single seed for accounts on both those networks. So I wanted to update all of those networks on startup.

Copy link
Contributor

@mordamax mordamax May 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah right, if we run all at once for api now, and one address, so then looks like we just need to remove local.* ones 👌

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rzadp rzadp requested a review from mordamax May 10, 2023 09:37
@rzadp rzadp merged commit eab5b4c into master May 10, 2023
@rzadp rzadp deleted the rzadp/balance branch May 10, 2023 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants