Skip to content

feat(storage): add http.client.request.duration metric for HTTP requests - #14744

Draft
nidhiii-27 wants to merge 2 commits into
feat/storage-rpc-call-durationfrom
feat/storage-http-request-duration
Draft

nidhiii-27 wants to merge 2 commits into
feat/storage-rpc-call-durationfrom
feat/storage-http-request-duration

Conversation

@nidhiii-27

@nidhiii-27 nidhiii-27 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Instruments HTTP/JSON storage requests to record http.client.request.duration OpenTelemetry histogram metrics.

  • Adds StorageHttpMetricsInterceptor to measure per-request duration and attach rpc.system.name, http.request.method, http.response.status_code, network.path, url.template, server.address, and error.type attributes across normal responses and IOException failures.
  • Wires StorageHttpMetricsInterceptor via StorageOptions.decorateWithMetrics and HttpStorageRpc.
  • Adds unit tests in StorageHttpMetricsInterceptorTest.

Stacked on #14743.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the StorageHttpMetricsInterceptor class to record HTTP client metrics, such as request duration, using OpenTelemetry. It integrates this interceptor into StorageOptions and HttpStorageRpc to decorate request initializers, and adds comprehensive unit tests. Feedback on the changes suggests initializing the recorded AtomicBoolean to true instead of false to prevent recording metrics for requests that fail before execution begins.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant