Azure / Azure/azure-sdk-for-rust

Provide detailed request diagnostics

Open
#5,290 2 comments 1 reaction 0 assignees View on GitHub
Client Cosmos customer-reported needs-team-attention Service Attention
Dominant language
Rust
Stars
884
Forks
365
Avg merge
2d 19h
Merged PRs (30d)
109

Description

### Feature Summary

With the introduction of the new CosmosTransportClient the ability to extract a significant amount of diagnostic data has been lost. We would like to get a similar level of detail via the SDK.

### Feature Description

Before the introduction of the CosmosTransportClient we were required to provide our own HTTP client and so we had direct access to it. That allowed us to extract detailed diagnostic information about the requests and responses. With the introduction of the CosmosTransportClient we no longer have direct access to the HTTP client and so must rely on the information available from the SDK.

While we can extract some information from the `.headers()` and `.diagnostics()` functions, it would be really helpful to get the request headers and body as well. In the past we've hit subtle bugs that have only been identified using detailed diagnostics like this.

### Use Case

Spotting missing or incorrect request headers, such as `x-ms-session-token` which result in stale data being returned. Identifying invalid serialization in a request that results in a 400 response for certain values.

### Alternatives

We've considered placing the HTTP client with our own but that would result in losing support which is a non-starter. We've also thought about turning on diagnostic settings and retrieving data using Log Analytics but that gets expensive very quickly at scale.

### Additional Context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by tracing CosmosTransportClient and the existing headers() and diagnostics() APIs to understand what request and response information the SDK currently exposes. Define how request headers and bodies should be made available without requiring a custom HTTP client, then verify that the resulting diagnostics support investigating missing headers, stale data, and invalid serialization.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, rust
Domain
api, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.