feat: Implement OpenTelemetry telemetry for backend with Application Insights and Azure Monitor Private Link#361
Open
Harmanpreet-Microsoft wants to merge 6 commits intomainfrom
Open
feat: Implement OpenTelemetry telemetry for backend with Application Insights and Azure Monitor Private Link#361Harmanpreet-Microsoft wants to merge 6 commits intomainfrom
Harmanpreet-Microsoft wants to merge 6 commits intomainfrom
Conversation
…tor for improved event tracking
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 comprehensive Application Insights (Azure Monitor) integration for backend telemetry and observability, with a focus on using OpenTelemetry for selective and non-intrusive instrumentation. The changes ensure that FastAPI HTTP requests, Python logs, and custom/manual spans are sent to Application Insights, while avoiding interference with async operations (such as those in Semantic Kernel). Additionally, helper utilities are added for easy manual tracing of Azure SDK operations, and infrastructure changes are made to support Azure Monitor Private Link for secure telemetry ingestion.
The most important changes are:
Backend Telemetry Integration and Instrumentation:
src/backend/app.py,src/backend/requirements.txt) [1] [2] [3] [4]src/backend/app.py)Telemetry Utilities and Custom Event Tracking:
common.telemetrypackage with decorators and context managers for easy manual tracing of operations (async and sync) and adding attributes to spans, enabling detailed telemetry for Azure SDK calls and business logic. (src/backend/common/telemetry/__init__.py,src/backend/common/telemetry/telemetry_helper.py) [1] [2]src/backend/api/event_utils.py)Infrastructure: Secure Azure Monitor Private Link Support:
infra/main.bicep) [1] [2] [3] [4] [5]Cleanup and Refactoring:
src/backend/api/api_routes.py) [1] [2]These changes significantly improve observability, security, and maintainability of telemetry in the backend, while providing flexible tools for developers to add custom tracing where needed.
Does this introduce a breaking change?
Golden Path Validation
Deployment Validation
What to Check
Verify that the following are valid
Other Information