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

Refactoring express route project structure #99

Closed
wants to merge 5 commits into from

Conversation

azerella
Copy link
Contributor

Fixes #98

Copy link
Contributor

@chevdor chevdor left a comment

Choose a reason for hiding this comment

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

Beware that @AndreiEres is bringing changes in parts you touched and I think his code should be merged first. There will likely be a few conflicts afterwards.


export const metrics: MetricsDefinition = {
data: {
balance: 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is a good idea to initialize the balance with 0.
It will lead to prometheus potentially reporting this and trigger alerts about the balance being 0 whereas it currently is not empty.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah this was simply copied from what it already is, I'm not too confident in what else this should be? Might need @AndreiEres to weigh in here

Copy link
Contributor

Choose a reason for hiding this comment

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

The current code skips retuning the metrics at all until a real value is known (it does not return 0 unless it is really 0).
Not sure what Prometheus' defaults are but null or undefined would be better.

Copy link
Contributor Author

@azerella azerella Oct 15, 2021

Choose a reason for hiding this comment

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

Beware that @AndreiEres is bringing changes in parts you touched and I think his code should be merged first. There will likely be a few conflicts afterwards.

I'll wait until these changes are in before working on this restructure further. I'm also sure that @AndreiEres would prefer that the Prometheus defaults are modified in a separate PR

Copy link
Contributor

Choose a reason for hiding this comment

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

I would disagree with that, becaue if we merge this PR with the balance initializing at 0, we will get false alarms about the balance being too low. We do not have the issue today so the PR in the current state would introduce a regression.

We don't really need another PR to fix regressions introduced in a PR if we are aware of them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do not have the issue today so the PR in the current state would introduce a regression.

I don't understand that considering this is what the existing code already does? Are you saying we haven't deployed this code yet?

Copy link
Contributor

@chevdor chevdor left a comment

Choose a reason for hiding this comment

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

Initializing the balance at 0 is not good IMO

Copy link
Contributor

@AndreiEres AndreiEres left a comment

Choose a reason for hiding this comment

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

LGTM, but double check before merging please

@mordamax
Copy link
Contributor

Closing in favor of #145, as this is outdated

@mordamax mordamax closed this Apr 20, 2022
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.

Refactor routes and organise server project structure
4 participants