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
docs: Document multiple app approach #4393
Merged
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9af7669
Document multiple app approach
kibertoad f98b741
Address feedback
kibertoad 8f90004
Update docs/Guides/Recommendations.md
kibertoad 1a4b973
Merge branch 'main' of https://github.com/fastify/fastify into docs/m…
kibertoad e2ce36b
Merge remote-tracking branch 'master/docs/multiple-instances' into do…
kibertoad 3389f87
Update docs/Guides/Recommendations.md
kibertoad c12d0bd
Update docs/Guides/Recommendations.md
kibertoad af0a4ce
Remove healthcheck use-case
kibertoad 033e321
Make documentation less prescriptive
kibertoad ecbd545
Update docs/Guides/Recommendations.md
kibertoad File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It is not clear to me why this setup is better?
The
metrics
data is calculated from theAPI server
itself.If you are exposing
healthcheck
andmetrics
in a dedicated instance. Does it means that you are create an extra proxy?Then, why don't you setup the metrics handler inside
Reverse Proxy
?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.
At least our situation is that while it is possible to use an elaborate nginx setup to only expose a subset of endpoints, our platform team is asking us to expose metrics on a separate port instead, as that would reduce complexity on their end, and this seems to be a fairly popular practice in the industry.
Would you recommend otherwise?
It would be something close to this: SkeLLLa/fastify-metrics#43 (comment)
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.
For me, two port for a single application certainly increase the complexity (including both server and applications).
Imagine when you try to scale up horizontally, which means the port open is always double and shouldn't be the same.
Moreover, taking nginx as configuration example. It requires to use two different upstream instead of sharing one. It actually duplicating works.
It is completely fine if this is hard requirement for your company. But I wouldn't recommend to others.
I can give out a more solid example for why it only increase complexity in later time.
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.
It's not a hard requirement, it's an open discussion between engineers and platform. If one is preferable over the other, we should clearly document it and then follow it.
@mcollina Can you chime in on this?
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.
Is it? This is the first time I have heard of doing such a thing. In fact, it makes no sense to me. The healthcheck/metrics endpoint, on a different port, is going to give you insight into an instance that is not processing requests.
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.
Exposing a separate port is the recommended approach by prometheus.
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.
I search a bit around and couldn't found any related article about this approach. And it is not on
prometheus
website documentation either.May I know where you read this information?