Bug: All telemetry attributes exported as strings instead of correct OTel types
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 65/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- java
- Domain
- observability
Research direction
Start at src/main/java/dev/openfga/sdk/telemetry/Attributes.java:130 and inspect how Attributes.prepare() converts values for OTel export. Compare the two named HTTP attributes with the OpenFGA telemetry spec and Python SDK PR #177; done means those attributes use numeric OTel types while the internal string map remains unchanged.
Written by the indexing model from the issue text.
Description
Summary
Attributes.prepare() in src/main/java/dev/openfga/sdk/telemetry/Attributes.java:130 uses AttributeKey.stringKey() for every attribute. Per the OpenFGA telemetry spec and OTel conventions, some attributes should be numeric:
http.response.status_codeshould beint→AttributeKey.longKey()http.request.resend_countshould beint→AttributeKey.longKey()
Impact
Downstream OTel pipelines (dashboards, alerts) that expect numeric types for these attributes will either fail or treat them incorrectly. For example, queries like status_code >= 400 won't work on string-typed values.
Proposed Fix
In Attributes.prepare(), use AttributeKey.longKey() for known numeric attributes, parsing the string value to long. The internal Map<Attribute, String> representation can stay as strings — only the OTel export needs correct types.
Prior Art
The Python SDK already fixed this same issue in PR #177.
Related
- PR #290 (telemetry instance sharing fix)
- Dominant language
- Java
- Stars
- 54
- Forks
- 26
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 9
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.
More from openfga/java-sdk
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
enhancement needs-discussion
Difficulty 5/5 Over a week Newbie friendliness 20/100
All issues in openfga/java-sdk
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
checkstyle/test-configs#263 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
[BUG]茶杯方块在取茶时会引发崩溃 Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
1.0.0-alpha2 Type/Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
wso2/dpdp-accelerator#272 ·