Skip to content

Conversation

@Priyanka-Microsoft
Copy link
Contributor

Purpose

This pull request introduces several changes to enhance telemetry, streamline configuration, and update dependencies across the infrastructure and application code. The key updates include enabling Application Insights integration, adding telemetry tracking for critical events, and updating API versions for Azure services. Below is a categorized summary of the most important changes:

Telemetry Enhancements:

  • Integrated Application Insights into the application by adding a connection string parameter, configuring the monitor, and logging relevant events. (infra/deploy_ai_foundry.bicep, infra/deploy_app_service.bicep, src/App/app.py) [1] [2] [3] [4] [5]
  • Added telemetry tracking for key events, such as client initialization, data source selection, query type determination, and error handling. (src/App/app.py) [1] [2] [3] [4] [5]

Infrastructure Configuration Updates:

  • Added applicationInsightsConnectionString as an output in deploy_ai_foundry.bicep and passed it through the deployment pipeline to deploy_app_service.bicep. (infra/deploy_ai_foundry.bicep, infra/deploy_app_service.bicep, infra/main.bicep) [1] [2] [3]
  • Updated infra/main.json to include the Application Insights connection string and propagate it to the application. (infra/main.json) [1] [2] [3]

Azure Service API Updates:

  • Upgraded the API version for Azure Cognitive Services from 2021-10-01 to 2024-04-01-preview to leverage the latest features. (infra/main.json) [1] [2] [3] [4] [5] [6] [7]

Logging Improvements:

  • Centralized logging configuration to suppress unnecessary logs from Azure SDKs and OpenTelemetry exporters. (src/App/app.py)

These changes enhance observability, improve the maintainability of the infrastructure, and ensure compatibility with the latest Azure services.

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • ...

Other Information

@Roopan-Microsoft Roopan-Microsoft requested a review from Copilot May 20, 2025 09:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds OpenTelemetry-based logging and Application Insights telemetry to track key application events, updates environment variable handling, and propagates the new connection string through the infrastructure deployment.

  • Introduces track_event_if_configured utility and invokes it across request handlers and service initializations.
  • Configures Azure Monitor in the application startup based on the APPLICATIONINSIGHTS_CONNECTION_STRING environment variable.
  • Extends Bicep templates (deploy_ai_foundry.bicep, main.bicep, deploy_app_service.bicep) and JSON ARM (main.json) to output and consume the Application Insights connection string.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/App/backend/event_utils.py New helper for conditional telemetry event tracking
src/App/app.py Multiple calls to track_event_if_configured, OpenTelemetry setup, exception spans
infra/main.json ARM template updates: API version bumps and new outputs
infra/main.bicep Bicep pipeline injection of connection string output
infra/deploy_app_service.bicep Adds APPLICATIONINSIGHTS_CONNECTION_STRING env var
infra/deploy_ai_foundry.bicep Outputs applicationInsightsConnectionString

@Roopan-Microsoft Roopan-Microsoft merged commit 72eb23a into dev May 21, 2025
5 checks passed
@Roopan-Microsoft Roopan-Microsoft deleted the feature/add-opentelemetry-logs branch May 21, 2025 11:36
@github-actions
Copy link

github-actions bot commented Jun 6, 2025

🎉 This PR is included in version 1.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

3 participants