fix(portal): fix false-positive cluster errors (#9351)

Fixes the following issues after learning they're still a problem:

- We need to include our own node when checking for connected node count
- Need to match against the `formatted` key inside message when
filtering Sentry events
This commit is contained in:
Jamil
2025-06-01 17:56:19 -07:00
committed by GitHub
parent 8bbc7e2960
commit 37ae1a4e92
2 changed files with 4 additions and 3 deletions

View File

@@ -171,7 +171,7 @@ defmodule Domain.Cluster.GoogleComputeLabelsStrategy do
end
defp enough_nodes_connected?(state) do
connected_nodes = state.connected_nodes
connected_nodes = state.connected_nodes ++ [Node.self()]
expected_api_node_count = Keyword.fetch!(state.config, :api_node_count)
expected_domain_node_count = Keyword.fetch!(state.config, :domain_node_count)
expected_web_node_count = Keyword.fetch!(state.config, :web_node_count)

View File

@@ -3,9 +3,10 @@ defmodule Domain.Telemetry.Sentry do
nil
end
def before_send(%{message: message} = event) when is_binary(message) do
def before_send(%{message: %{formatted: formatted_message}} = event)
when is_binary(formatted_message) do
if String.contains?(
message,
formatted_message,
"Node ~p not responding **~n** Removing (timedout) connection"
) do
# This happens when libcluster loses connection to a node, which is normal during deploys.