openfga / openfga/java-sdk

telemetry attributes not sent on token exchange request

Open
#149 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
54
Forks
26
Avg merge
2d 7h
Merged PRs (30d)
9

Description

Checklist
  • I have looked into the README and have not found a suitable solution or answer.
  • I have looked into the documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have upgraded to the latest version of OpenFGA and the issue still persists.
  • I have searched the Slack community and have not found a suitable solution or answer.
  • I agree to the terms within the OpenFGA Code of Conduct.
Description

When recording the counter for the credentials request, no attributes are sent.

Notice the empty attributes map sent on to record the metric: https://github.com/openfga/java-sdk/blob/main/src/main/java/dev/openfga/sdk/api/auth/OAuth2Client.java#L69

Attributes are created in HttpRequestAttempt, but they are not sent back to exchangeToken() and included in the call to record the counter.

Expectation

Any configured attributes, or the default attributes if not configured, should be sent with the credentials request.

Reproduction

Given the default telemetry configuration
When a credentials exchange request is executed
No attributes are sent with the fga-client.credentials.request counter metric

OpenFGA SDK version

0.8.0

OpenFGA version

any

SDK Configuration

no config

Logs

No response

References

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/main/java/dev/openfga/sdk/api/auth/OAuth2Client.java around line 69, then trace how HttpRequestAttempt creates attributes and how exchangeToken() records the counter. Verify the credentials request with the default telemetry configuration and confirm that configured or default attributes reach the fga-client.credentials.request metric.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
authentication, observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.