-
Notifications
You must be signed in to change notification settings - Fork 298
Added ability to test distributed tracing functionality. #2896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 comprehensive distributed tracing testing functionality to the Azure SDK for Rust, allowing developers to easily verify that their client libraries generate correct telemetry data. The implementation includes a new test framework for instrumentation validation and demonstrates its usage with KeyVault Secrets APIs.
- Introduces
test_instrumentation_for_api
function for automated tracing verification - Adds structured data types for defining expected instrumentation behavior
- Provides test examples across multiple Azure service clients
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
sdk/core/azure_core_test/src/tracing.rs |
Core implementation of the tracing test framework with helper types and validation logic |
sdk/keyvault/azure_security_keyvault_secrets/tests/secret_client.rs |
Example test demonstrating distributed tracing verification for KeyVault operations |
sdk/core/azure_core_opentelemetry/tests/telemetry_service_macros.rs |
Additional test examples for HTTP and function-level tracing scenarios |
sdk/core/azure_core/src/http/pipeline.rs |
Comment relocation for better code organization |
sdk/keyvault/assets.json |
Test asset version update |
sdk/core/azure_core_opentelemetry/assets.json |
Test asset version update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think taking a capture that passes the InstrumentationInformation
would be much easier to use for test authors. Happy to debate it further, though.
sdk/keyvault/azure_security_keyvault_secrets/tests/secret_client.rs
Outdated
Show resolved
Hide resolved
sdk/keyvault/azure_security_keyvault_secrets/tests/secret_client.rs
Outdated
Show resolved
Hide resolved
sdk/core/azure_core_opentelemetry/tests/telemetry_service_macros.rs
Outdated
Show resolved
Hide resolved
…to larryo/tracing_tests
Fixes #2769 - Adds ability to easily test distributed tracing.
Also adds a test example for KeyVault Secrets APIs.
This PR introduces a new
azure_core_test
API namedassert_instrumentation_information
whose purpose is to ensure that the distributed tracing information is correctly generated for a given service client implementation.The API takes three pieces of information: A capture which creates a service client with a provided distributed tracing
TracerProvider
, a capture which actually performs the test and anInstrumentationInformation
structure which describes the service calling the API and the particular service client APIs which are expected to have been called during the test.It then analyzes the actual traces generated during the test and verifies that the expected service client calls were made and that the expected distributed tracing attributes have been generated.