Bug: No telemetry recorded for failed requests
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 54
- Forks
- 26
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 9
Description
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
- PR #290 (telemetry instance sharing fix)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/main/java/dev/openfga/sdk/api/client/HttpRequestAttempt.java, focusing on the success-path metric recording around lines 211-221 and the terminal failure paths for exhausted retries and non-retryable errors. Ensure requestDuration and queryDuration are recorded for failed requests as well as successful ones, while preserving the existing status-code distinction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100