Skip to content

Bug: No telemetry recorded for failed requests #293

@jimmyjames

Description

@jimmyjames

Summary

In src/main/java/dev/openfga/sdk/api/client/HttpRequestAttempt.java, when a request fails permanently (max retries exceeded, non-retryable error), requestDuration and queryDuration metrics are never recorded. Only the success path (~line 211-221) records metrics.

Impact

  • Error rates are invisible via telemetry
  • Request duration for failed calls is not tracked
  • Users cannot build alerting/dashboards on error patterns
  • Failed requests are a silent gap in observability

Proposed Fix

Record requestDuration on all terminal paths (success and failure), not just success. The http.response.status_code attribute already distinguishes success from failure, so existing dashboards filtering by status code will continue to work correctly.

This could be done with a try/finally pattern or by recording metrics just before throwing in the error paths.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Intake

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions