chore: dev to main (Improve Logging & Telemetry, Standardize Deployment Parameters)#822
Open
Pavan-Microsoft wants to merge 23 commits intomainfrom
Open
chore: dev to main (Improve Logging & Telemetry, Standardize Deployment Parameters)#822Pavan-Microsoft wants to merge 23 commits intomainfrom
Pavan-Microsoft wants to merge 23 commits intomainfrom
Conversation
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…tivity in script value retrieval
…tivity in script value retrieval
fix: Update AI_FOUNDRY_RESOURCE_ID output and add azd 1.23.9 note
…cluding user identification
…ft/Conversation-Knowledge-Mining-Solution-Accelerator into psl-logging-improvements
…ion Insights tracking
…history and chat services
…oting documentation
feat: improve Application Insights logging and telemetry handling
fix: update default VM size to Standard_D2s_v5 and enhance troubleshooting documentation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves observability across the FastAPI backend by centralizing Application Insights/OpenTelemetry setup, adding richer request/service logging + custom event telemetry, and standardizing deployment parameters/scripts in the infra layer.
Changes:
- Centralizes Azure Monitor/OpenTelemetry configuration in
src/api/app.pyand adds span processors to reduce telemetry noise. - Adds structured logging + Application Insights custom event tracking across chat/history endpoints and services.
- Standardizes infra parameter names and improves deployment output parsing robustness; updates default jumpbox VM size to
Standard_D2s_v5.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tests/api/common/logging/test_event_utils.py | Updates test expectations for new warning message + logger scoping. |
| src/api/services/history_service.py | Adds structured info/exception logging around conversation history operations. |
| src/api/services/chat_service.py | Adds structured logging and emits completion telemetry for chat streams. |
| src/api/helpers/chat_helper.py | Converts log statements to structured logging format. |
| src/api/common/logging/span_filters.py | Adds custom span processors intended to reduce noisy spans in App Insights. |
| src/api/common/logging/event_utils.py | Removes stdout printing and standardizes warning logging for telemetry gating. |
| src/api/app.py | Centralizes Azure Monitor configuration + FastAPI instrumentation and suppresses noisy SDK loggers. |
| src/api/api/history_routes.py | Removes per-module AI config and adds structured logs + error/success telemetry across history endpoints. |
| src/api/api/api_routes.py | Removes per-module AI config; adds structured logs + chat request/user correlation + error telemetry. |
| infra/scripts/run_create_agents_scripts.sh | Makes deployment output parsing case-insensitive. |
| infra/scripts/process_sample_data.sh | Makes deployment output parsing case-insensitive. |
| infra/scripts/process_custom_data.sh | Makes deployment output parsing case-insensitive. |
| infra/modules/virtualNetwork.bicep | Updates VM sizing guidance comments. |
| infra/main_custom.bicep | Changes default jumpbox VM size to Standard_D2s_v5. |
| infra/main.waf.parameters.json | Renames standardized parameters; adds vmSize parameter plumbing. |
| infra/main.parameters.json | Renames standardized parameters for deployment type/capacity. |
| infra/main.json | Regenerated ARM template reflecting VM size default + minor ordering changes. |
| infra/main.bicep | Removes redundant diagnostics assignment and updates default jumpbox VM size. |
| documents/TroubleShootingSteps.md | Expands SKU-not-available guidance and documents the new default VM size. |
| documents/CustomizingAzdParameters.md | Documents new AZURE_ENV_VM_SIZE parameter. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ocessing (fix CodeQL & copilot comments)
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.
Purpose
This pull request introduces improvements to logging, error tracking, and parameter naming consistency across the API and infrastructure scripts. The main focus is on enhancing observability (with more granular logging and event tracking), standardizing parameter names in deployment files, and making script parsing more robust.
Observability & Logging Enhancements:
api_routes.pyandhistory_routes.py, including error events and successful operations, to improve traceability and debugging. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]api_routes.pyandhistory_routes.py, centralizing telemetry setup. [1] [2]Parameter Naming Consistency:
main.parameters.jsonandmain.waf.parameters.jsonfor deployment type, capacity, and VM admin credentials to improve clarity and maintainability. [1] [2] [3] [4] [5]Script Robustness Improvements:
process_custom_data.sh,process_sample_data.sh,run_create_agents_scripts.sh) to use case-insensitive key matching when parsing deployment outputs, reducing potential parsing errors. [1] [2] [3]Infrastructure Configuration:
main.bicepby removing redundant diagnostic settings assignment, streamlining resource deployment logic.These changes collectively improve the reliability, maintainability, and observability of the codebase.
Does this introduce a breaking change?
Golden Path Validation
Deployment Validation