Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding error codes as attributes to the Recipe Engine and Driver metr…
…ics (#6205) # Description Adding error codes as attributes to the Recipe Engine and Driver metrics ## Type of change - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: #issue_number ## Auto-generated summary <!-- copilot:all --> ### <samp>🤖 Generated by Copilot at c046059</samp> ### Summary 📊🚚🐛 <!-- 1. 📊 This emoji represents the improvement of the metric recording and reporting by using a more specific and consistent constant. 2. 🚚 This emoji represents the addition of new error codes for different types of failures in the recipes package, which makes them more descriptive and reusable. 3. 🐛 This emoji represents the bug fix in the test case by using the correct error message. --> This pull request improves the error handling and reporting in the `recipes` package by using consistent and descriptive error codes and metrics. It also updates the test cases and the `bicep` and `terraform` drivers to use the new error codes and metrics. > _`engine.go` changes_ > _better errors and metrics_ > _autumn of bugs ends_ ### Walkthrough * Add more descriptive and consistent error codes for recipe failures ([link](https://github.com/radius-project/radius/pull/6205/files?diff=unified&w=0#diff-4811c2c3581e1effba7ad029717fa82713a8e3a58b848b3845cfaf7d6a44fbacR37-R42), [link](https://github.com/radius-project/radius/pull/6205/files?diff=unified&w=0#diff-06702c6df95f9efe532b70614e1341244f575e5cbc030db57af268ecbfcd8c59L72-R79), [link](https://github.com/radius-project/radius/pull/6205/files?diff=unified&w=0#diff-06702c6df95f9efe532b70614e1341244f575e5cbc030db57af268ecbfcd8c59L117-R126), [link](https://github.com/radius-project/radius/pull/6205/files?diff=unified&w=0#diff-3fdb9931c1f2ddfc5b14d87f47b4124f2bdc1da187219fa1ad9cbe79fc326528L276-R276), [link](https://github.com/radius-project/radius/pull/6205/files?diff=unified&w=0#diff-3fdb9931c1f2ddfc5b14d87f47b4124f2bdc1da187219fa1ad9cbe79fc326528L438-R438)) * Use error codes from `GetRecipeErrorDetails` to record metrics in `engine.go` ([link](https://github.com/radius-project/radius/pull/6205/files?diff=unified&w=0#diff-06702c6df95f9efe532b70614e1341244f575e5cbc030db57af268ecbfcd8c59L58-R64), [link](https://github.com/radius-project/radius/pull/6205/files?diff=unified&w=0#diff-06702c6df95f9efe532b70614e1341244f575e5cbc030db57af268ecbfcd8c59L103-R111)) * Use `RecipeDownloadFailed` instead of `FailedOperationState` to record recipe download metrics in `bicep.go` and `execute.go` ([link](https://github.com/radius-project/radius/pull/6205/files?diff=unified&w=0#diff-f12e37706fa75e9e04b8dfa01a45cf9bf2a0463e1962605b2420d0cb343922a0L81-R81), [link](https://github.com/radius-project/radius/pull/6205/files?diff=unified&w=0#diff-41ec31c0ceb8bd50c0329b55a8d27aeba69648059faef4e785302155f4e97482L295-R295))
- Loading branch information