Syntropy.ClusterMonitor (syntropy v0.1.0)

Copy Markdown

Event-driven cluster health and incident monitor for Syntropy.

The monitor does not rebalance or retry work. It tracks expected peers, connected peers, and fail-visible abandoned task incidents when a peer disappears while it still owned active work.

Summary

Functions

Returns a specification to start this module under a supervisor.

Types

abandoned_task_incident()

@type abandoned_task_incident() :: %{
  task_id: String.t(),
  node_id: String.t(),
  node_name: String.t(),
  coordinator_node_id: String.t(),
  started_at: DateTime.t() | nil,
  last_seen_at: DateTime.t() | nil,
  lost_at: DateTime.t(),
  selected_agents: [Syntropy.ClusterInventory.agent_ref()]
}

report()

@type report() :: %{
  status: String.t(),
  local_node_id: String.t(),
  local_node_name: String.t(),
  expected_peers: [String.t()],
  connected_peers: [String.t()],
  nodes: [Syntropy.ClusterInventory.node_export()],
  unavailable_nodes: [unavailable_node()],
  abandoned_task_incidents: [abandoned_task_incident()]
}

unavailable_node()

@type unavailable_node() :: %{
  node_id: String.t(),
  node_name: String.t(),
  status: String.t(),
  reason: String.t(),
  last_seen_at: DateTime.t() | nil,
  lost_at: DateTime.t() | nil
}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

refresh()

@spec refresh() :: :ok

report()

@spec report() :: report()

reset()

@spec reset() :: :ok

start_link(opts \\ [])

@spec start_link(keyword()) :: GenServer.on_start()