Skip to content

[FEATURE REQ] Hedging RU cost not reported accurately for ThresholdBasedAvailabilityStrategy in Cosmos DB #49128

@TheovanKraay

Description

@TheovanKraay

Is your feature request related to a problem? Please describe.
CosmosItemResponse.getRequestCharge() only returns the RU charge from the winning response. When hedging fires a parallel request to a second region, that request also executes server-side and consumes RUs - but those charges are invisible to the caller. The result is that users undercount their actual spend when using hedging (availability strategies). There is no convenient way to get the total cost without parsing CosmosDiagnostics JSON for individual requestCharge fields in responseStatisticsList.

Describe the solution you'd like
Expose a getTotalRequestCharge() (or similar) that aggregates charges from all attempts, including hedged requests that completed server-side.

Describe alternatives you've considered
N/N

Additional context
N/N

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Description Added
  • Expected solution specified

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClientThis issue points to a problem in the data-plane of the library.CosmosService AttentionWorkflow: This issue is responsible by Azure service team.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions