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

Implement heartbeat check-ins #962

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

unflxw
Copy link
Contributor

@unflxw unflxw commented Sep 13, 2024

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.

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.
@backlog-helper

This comment has been minimized.

@backlog-helper

This comment has been minimized.

4 similar comments
@backlog-helper

This comment has been minimized.

@backlog-helper

This comment has been minimized.

@backlog-helper

This comment has been minimized.

@backlog-helper
Copy link


This is a message from the daily scheduled checks.

New issue guide | Backlog management | Rules | Feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants