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

Azure Log Alert #1484

Merged
merged 8 commits into from
Oct 24, 2024
Merged

Azure Log Alert #1484

merged 8 commits into from
Oct 24, 2024

Conversation

jherrflexion
Copy link
Contributor

Updated the Azure Logs Alert to include more information.

Issue

#1395

@jherrflexion jherrflexion marked this pull request as ready for review October 24, 2024 16:32
Copy link

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

1395 - Partially compliant

Fully compliant requirements:

  • Create alert in TI

Not compliant requirements:

  • Create alert in SFTP
  • Documentation and diagrams created or updated
  • Code refactored for clarity and no design/technical debt
  • Load tests passed
  • Additional e2e tests created
  • Build process updated
  • API(s) are versioned
  • Feature toggles created and/or deleted
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Query Optimization
The query modification in the alert configuration might need further optimization to ensure it captures all necessary error logs efficiently.

| project columnifexists("ResultDescription", 'default_value')
| project JsonResult = parse_json(ResultDescription)
| evaluate bag_unpack(JsonResult) : (level:string)
| evaluate bag_unpack(JsonResult) : (level: string, message: string)

Choose a reason for hiding this comment

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

Consider adding a time filter to the query to ensure it only processes recent logs, which can improve performance and relevance of the alert. [important]

Copy link

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Score
Possible bug
Ensure data types are correctly handled in the bag_unpack function to avoid runtime errors

Ensure that the bag_unpack function correctly handles the data types for the level
and message fields. If the types are not consistently strings in the source data,
consider adding a type check or conversion to avoid runtime errors.

operations/template/alert.tf [265]

-| evaluate bag_unpack(JsonResult) : (level: string, message: string)
+| evaluate bag_unpack(JsonResult) : (level: tostring(level), message: tostring(message))
Suggestion importance[1-10]: 7

Why: The suggestion to ensure correct data type handling in the bag_unpack function is relevant and could prevent potential runtime errors if the data types are not consistent. The suggested code modification explicitly converts the fields to strings, which aligns well with the existing code's requirements and enhances robustness.

7

Copy link

Copy link
Member

@halprin halprin left a comment

Choose a reason for hiding this comment

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

Approved, but I want to see this resolve.

@jherrflexion jherrflexion merged commit d1f00d6 into main Oct 24, 2024
20 checks passed
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