Skip to content

Conversation

@LarryOsterman
Copy link
Member

  • Re-add the span when converting from Init state on a continuation token;
  • Cleaned up lifetime of MockSpan to have it be dropped when the actual span goes out of scope (also verified that the same "end on drop" behavior occurs with an OpenTelemetry Span).
  • Added a Debug requirement for the C parameter so it can be printed successfully.
  • Added a simple test for verifying the spans coming from an ItemIterator converted immediately to a PageIterator.

Created as Draft so it doesn't conflict with releases of various non-core crates.

@github-actions
Copy link

github-actions bot commented Nov 8, 2025

API Change Check

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

azure_core

@LarryOsterman LarryOsterman marked this pull request as ready for review November 11, 2025 21:16
@LarryOsterman LarryOsterman requested review from a team, RickWinter and heaths as code owners November 11, 2025 21:16
Copilot AI review requested due to automatic review settings November 11, 2025 21:16
Copilot finished reviewing on behalf of LarryOsterman November 11, 2025 21:19
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 fixes issues with tracing/instrumentation when using page iterators in the Azure SDK, particularly when converting from an ItemIterator to a PageIterator or when resuming pagination from a continuation token.

Key changes:

  • Re-added span creation when converting from Init state with a continuation token in the pager logic
  • Refactored MockSpan to properly manage span lifecycle with automatic cleanup on drop
  • Added test coverage for page iterator telemetry scenarios including immediate conversion and rehydration

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
sdk/core/azure_core/src/http/pager.rs Fixed span creation logic to establish public API span when entering Init state (both initial and rehydrated); added custom Debug impl for State<C> using AsRef<str>
sdk/core/azure_core_test/src/tracing.rs Refactored MockSpan into wrapper/inner pattern for proper drop semantics; added documentation for ExpectedInstrumentation fields
sdk/keyvault/azure_security_keyvault_secrets/tests/secret_client.rs Added new test for page iterator telemetry; updated existing tests to use env! macros for package info; removed #[ignore] attribute from rehydration test
sdk/core/azure_core/src/http/mod.rs Added Sanitizer to public exports
sdk/keyvault/assets.json Updated test recording asset tag

LarryOsterman and others added 2 commits November 11, 2025 14:01
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Azure.Core The azure_core crate KeyVault Key Vault

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

1 participant