Skip to content

[azure monitor opentelemetry] Adding Browser SDK Loader functionality#42904

Merged
hectorhdzg merged 26 commits intoAzure:mainfrom
hectorhdzg:hectorhdzg/websnippet-final
Mar 5, 2026
Merged

[azure monitor opentelemetry] Adding Browser SDK Loader functionality#42904
hectorhdzg merged 26 commits intoAzure:mainfrom
hectorhdzg:hectorhdzg/websnippet-final

Conversation

@hectorhdzg
Copy link
Copy Markdown
Member

@hectorhdzg hectorhdzg commented Sep 8, 2025

Description

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@github-actions github-actions bot added the Monitor - Distro Monitor OpenTelemetry Distro label Sep 8, 2025
@github-actions
Copy link
Copy Markdown

github-actions bot commented Sep 8, 2025

API Change Check

APIView identified API level changes in this PR and created the following API reviews

azure-monitor-opentelemetry

@hectorhdzg hectorhdzg marked this pull request as ready for review September 25, 2025 23:19
Copilot AI review requested due to automatic review settings September 25, 2025 23:19
Copy link
Copy Markdown
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 pull request adds Browser SDK Loader functionality to the Azure Monitor OpenTelemetry Python package. The feature enables automatic injection of Application Insights JavaScript SDK snippets into HTML responses for supported web frameworks, starting with Django middleware support.

Key changes include:

  • Implementation of web snippet injection logic with compression support
  • Django middleware for automatic snippet injection
  • Configuration system for browser SDK settings
  • Integration with the main configure_azure_monitor function

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/browserSdkLoader/test_snippet_injector.py Comprehensive test suite for WebSnippetInjector class covering injection logic, compression handling, and content detection
tests/browserSdkLoader/test_integration.py Integration tests for browser SDK loader with configure_azure_monitor function
tests/browserSdkLoader/test_django_middleware.py Test suite for Django middleware functionality including configuration and response processing
tests/browserSdkLoader/test_config.py Tests for BrowserSDKConfig configuration class
tests/browserSdkLoader/__init__.py Empty test package initialization file
dev_requirements.txt Added brotli dependency for compression support
_utils/configurations.py Updated configuration utilities to support browser SDK loader settings
_constants.py Added browser SDK loader configuration constant
_configure.py Integration of browser SDK loader setup into main configuration function
snippet_injector.py Core implementation of web snippet injection with compression support
django_middleware.py Django middleware implementation for automatic snippet injection
_config.py Configuration class for browser SDK settings
__init__.py Browser SDK loader module initialization and framework setup

@hectorhdzg hectorhdzg force-pushed the hectorhdzg/websnippet-final branch from ce675ea to fae0613 Compare November 25, 2025 23:16
Copy link
Copy Markdown
Member

@JacksonWeber JacksonWeber left a comment

Choose a reason for hiding this comment

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

LGTM

@hectorhdzg hectorhdzg merged commit cc1be6d into Azure:main Mar 5, 2026
20 checks passed
singankit pushed a commit that referenced this pull request Mar 16, 2026
…#42904)

* Adding Browser SDK Loader

* Update

* Addressing comments

* Lint

* Add SDKStats feature for browser sdk loader

* Format

* Format

* Update changelog

* Update

---------

Co-authored-by: Jackson Weber <47067795+JacksonWeber@users.noreply.github.com>
Copilot AI mentioned this pull request Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Monitor - Distro Monitor OpenTelemetry Distro

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants