Fix telemetry "Unknown" errors: wrap string exceptions, add missing instrumentation, and catch-all decorato - #53
Merged
Conversation
ashnanze
requested review from
anagg929,
bavneetsingh16 and
bgriddaluru
as code owners
June 24, 2026 07:33
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
…d catch-all decorator
- Replace all exception='string' calls with exception=Exception('string') across
custom.py, _utils.py, and _precheckutils.py so that ExceptionName in telemetry
shows 'Exception' instead of 'str'
- Add _telemetry_catch_all decorator to top-level command functions
(create, delete, update, upgrade) to catch unhandled exceptions, log them
to telemetry with proper ExceptionName/FaultType, and re-raise as
CLIInternalError instead of letting them become 'UnknownError'
bgriddaluru
approved these changes
Jul 1, 2026
jmccormick7
approved these changes
Jul 1, 2026
…ator and fix import sorting
ashnanze
added a commit
that referenced
this pull request
Jul 8, 2026
ashnanze
added a commit
that referenced
this pull request
Jul 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The "Arc K8s Agent Activity" telemetry dashboard shows "Unknown" as a top error category due to three root causes:
ExceptionName = "str"—telemetry.set_exception(exception="some string", ...)records the type namestrinstead of a meaningful exception class name.FinalState = Unknown— Severalraisestatements had no precedingtelemetry.set_exception()call, so the CLI framework logged a failure with no fault context.ErrorType = UnknownError— UnhandledAzureExceptionsubclasses that bypass our telemetry instrumentation get classified asUnknownErrorby the CLI framework's default handler.Fix
1. Wrap string
exception=arguments inException()(~27 instances)Across
custom.py,_utils.py, and_precheckutils.py, changed: