-
Notifications
You must be signed in to change notification settings - Fork 197
docs: send numeric event values as strings in quickstart #4747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -39,12 +39,16 @@ curl -X POST http://localhost:48888/api/v1/events \ | |||||||||||
| "data": { | ||||||||||||
| "method": "GET", | ||||||||||||
| "route": "/hello", | ||||||||||||
| "duration_ms": 10 | ||||||||||||
| "duration_ms": "10" | ||||||||||||
| } | ||||||||||||
| } | ||||||||||||
| ' | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| Note that numeric values where precision matters are sent as JSON strings | ||||||||||||
| (`"duration_ms": "10"`) so they are parsed without floating-point precision | ||||||||||||
| loss. | ||||||||||||
|
Comment on lines
+48
to
+50
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Narrow the precision claim. The ingestion parser accepts these strings but ultimately converts them to Suggested wording-Note that numeric values where precision matters are sent as JSON strings
-(`"duration_ms": "10"`) so they are parsed without floating-point precision
-loss.
+Note that numeric values where precision matters are sent as JSON strings
+(`"duration_ms": "10"`) to avoid precision loss during JSON decoding.📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||
|
|
||||||||||||
| Note how ID is different: | ||||||||||||
|
|
||||||||||||
| ```sh | ||||||||||||
|
|
@@ -61,7 +65,7 @@ curl -X POST http://localhost:48888/api/v1/events \ | |||||||||||
| "data": { | ||||||||||||
| "method": "GET", | ||||||||||||
| "route": "/hello", | ||||||||||||
| "duration_ms": 20 | ||||||||||||
| "duration_ms": "20" | ||||||||||||
| } | ||||||||||||
| } | ||||||||||||
| ' | ||||||||||||
|
|
@@ -83,7 +87,7 @@ curl -X POST http://localhost:48888/api/v1/events \ | |||||||||||
| "data": { | ||||||||||||
| "method": "GET", | ||||||||||||
| "route": "/hello", | ||||||||||||
| "duration_ms": 30 | ||||||||||||
| "duration_ms": "30" | ||||||||||||
| } | ||||||||||||
| } | ||||||||||||
| ' | ||||||||||||
|
|
||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a value exceeds float64's exact range, quoting it does not prevent precision loss: numeric strings are parsed with
strconv.ParseFloat(..., 64), and the default query path converts them withtoFloat64OrNull. The note therefore promises protection that the quickstart configuration does not provide.Context Used: AGENTS.md (source)
Prompt To Fix With AI
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!