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

log PA message create and update #570

Merged
merged 2 commits into from
Nov 26, 2024
Merged

log PA message create and update #570

merged 2 commits into from
Nov 26, 2024

Conversation

panentheos
Copy link
Collaborator

Asana task: Add log entry to capture PA message create/update

This adds log entries for PA message create/update actions, as specified

@panentheos panentheos requested a review from a team as a code owner November 25, 2024 23:32
Copy link
Contributor

@cmaddox5 cmaddox5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just one non-blocking question and a potential suggestion.

@@ -56,4 +58,17 @@ defmodule ScreenplayWeb.PaMessagesApiController do
|> json(%{error: "not_found"})
end
end

defp log_pa_message(event, message, conn) do
Screenplay.Util.log(event,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it isn't called out in the task, but should we include alert_id? Just want to mention it in case it was an oversight.

@@ -30,14 +30,16 @@ defmodule ScreenplayWeb.PaMessagesApiController do
end

def create(conn, params) do
with {:ok, _} <- PaMessages.create_message(params) do
with {:ok, message} <- PaMessages.create_message(params) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it's worth it to log failures that make it to the FallbackController? We may not specifically know which even failed but would be notified when they happen.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, since those don't result in any actual changes, and it sounds like the purpose of this logging is to monitor operational changes being made.

@panentheos panentheos merged commit 6233344 into main Nov 26, 2024
2 checks passed
@panentheos panentheos deleted the bhw/log branch November 26, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants