-
Notifications
You must be signed in to change notification settings - Fork 81
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
Implement heartbeat check-ins #962
Open
unflxw
wants to merge
1
commit into
main
Choose a base branch
from
implement-heartbeat-checkins
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
unflxw
force-pushed
the
implement-heartbeat-checkins
branch
from
September 13, 2024 12:53
6eed79d
to
60d6f99
Compare
Add an `Appsignal.CheckIn.heartbeat` helper that emits a single heartbeat for the check-in identifier given. When called with `continuous: true` as the second argument, it starts and links a separate Elixir process that emits a heartbeat every thirty seconds. Unlike the equivalent functionality in the Ruby integration, which spawns a thread that will stay alive for the lifetime of the Ruby process, the Elixir process is linked to the process that spawned it, meaning it will be shut down when its parent process is shut down. This allows it to be used to track the lifetime of individual Elixir processes. Additionally, it is also possible to add `Appsignal.CheckIn.Heartbeat` as a child process to a supervisor, meaning its lifetime will be tied to that of the other processes supervised by it. Finally, the functionality seen in the Ruby integration could also be achieved by manually calling `Appsignal.CheckIn.Heartbeat.start/1`, keeping the process unlinked and therefore alive for the entirety of the Elixir node's lifetime, though this is unlikely to be the preferred usage under the Elixir process model.
unflxw
force-pushed
the
implement-heartbeat-checkins
branch
from
September 13, 2024 12:56
60d6f99
to
7b2ff32
Compare
tombruijn
approved these changes
Sep 16, 2024
This comment has been minimized.
This comment has been minimized.
jeffkreeftmeijer
approved these changes
Sep 17, 2024
This comment has been minimized.
This comment has been minimized.
4 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This is a message from the daily scheduled checks. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Part of https://github.com/appsignal/integration-guide/issues/169.
Add an
Appsignal.CheckIn.heartbeat
helper that emits a single heartbeat for the check-in identifier given.When called with
continuous: true
as the second argument, it starts and links a separate Elixir process that emits a heartbeat every thirty seconds.Unlike the equivalent functionality in the Ruby integration, which spawns a thread that will stay alive for the lifetime of the Ruby process, the Elixir process is linked to the process that spawned it, meaning it will be shut down when its parent process is shut down. This allows it to be used to track the lifetime of individual Elixir processes.
Additionally, it is also possible to add
Appsignal.CheckIn.Heartbeat
as a child process to a supervisor, meaning its lifetime will be tied to that of the other processes supervised by it.Finally, the functionality seen in the Ruby integration could also be achieved by manually calling
Appsignal.CheckIn.Heartbeat.start/1
, keeping the process unlinked and therefore alive for the entirety of the Elixir node's lifetime, though this is unlikely to be the preferred usage under the Elixir process model.