Skip to content

fix: codeql issue fix - add function to determine if span name contains a Cosmos DB host#825

Merged
Avijit-Microsoft merged 1 commit into
devfrom
psl-pk-copilotcomments
Mar 20, 2026
Merged

fix: codeql issue fix - add function to determine if span name contains a Cosmos DB host#825
Avijit-Microsoft merged 1 commit into
devfrom
psl-pk-copilotcomments

Conversation

@Pavan-Microsoft

Copy link
Copy Markdown
Contributor

Purpose

This pull request introduces a more robust method for detecting Cosmos DB spans in the logging span filter logic. The main improvement is the addition of a dedicated function to safely parse and identify Cosmos DB hosts, replacing less reliable string matching. This enhances the accuracy and maintainability of span filtering.

Improvements to Cosmos DB span detection:

  • Added the _is_cosmos_host function to safely parse span names and determine if they reference a Cosmos DB host, using urlparse for improved reliability.
  • Updated the span filtering logic in DropASGIResponseBodySpanProcessor.on_end to use _is_cosmos_host instead of direct string matching, ensuring more accurate identification of Cosmos DB spans.

Dependency and import updates:

  • Imported urlparse from urllib.parse to support robust span name parsing.

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.

@Avijit-Microsoft Avijit-Microsoft merged commit c8e4905 into dev Mar 20, 2026
5 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.19.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@Pavan-Microsoft Pavan-Microsoft deleted the psl-pk-copilotcomments branch March 24, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants