Skip to content

Conversation

JoshuaMoelans
Copy link
Member

@JoshuaMoelans JoshuaMoelans commented Jul 29, 2025

only the new commits added after previous PR was merged


Extracted from #1301 as this is relevant not only to Logs, but also for the read/capture envelopes feature (see comment). We can merge this to main before logs is finished.

The feature is mostly done already, but needs some more testing (e.g. seeing if values end up in the UI)

Also this needs to be tackled:

Looks like sentry__value_from_json also needs some changes to avoid sentry__strtod_c and be able to handle > 2^53.

TODO

@JoshuaMoelans JoshuaMoelans force-pushed the joshua/feat/int64_value_t branch from 84fb966 to 09f46d8 Compare July 29, 2025 09:11
Copy link

github-actions bot commented Jul 29, 2025

Fails
🚫 Please consider adding a changelog entry for the next release.
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

- add `(u)int64 sentry_value_t` type ([#1326](https://github.com/getsentry/sentry-native/pull/1326))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description.

Generated by 🚫 dangerJS against 2fc0baa

Copy link
Collaborator

@jpnurmi jpnurmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding sentry__value_from_json, I'd try to avoid manual integer parsing (is_integer_string). I suppose we need to check for '-' to determine whether unsigned values are allowed but besides that, I'd only operate with strtoxxx together with the appropriate errno and range checks. Can we keep it closer to the original code and basically just add extra checks to the "else" branch where it previously had the double fallback? Also, would one strtoll or strtoull call be enough and then we'll do the cast manually based on the sign and range?

@JoshuaMoelans JoshuaMoelans requested a review from jpnurmi July 29, 2025 15:30
@JoshuaMoelans JoshuaMoelans marked this pull request as ready for review July 29, 2025 15:31
cursor[bot]

This comment was marked as outdated.

Comment on lines 384 to 385
// TODO currently all uint64 values should be sent as strings; update when
// this changes
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happened? what is this needed for? i was't part of the original reviews and might be missing some background context but i tried reverting "always send uint64 as string" and the unit tests pass. :)

Copy link
Member Author

@JoshuaMoelans JoshuaMoelans Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah seems that I forgot to link to the develop docs; basically for Logs it is specified that we cannot ingest unsigned 64-bit integers yet (see this section), and I tried whether this is the case in general by trying to send some transactions with 64-bit unsigned integer data. Turns out we cannot handle this in the Sentry UI (yet), so for now I think it makes sense to send all uint64 values as strings instead.

In the Logs PR we just store the uint64 arguments as string sentry_value_t types, but with this more general change we could have logs store them as uint64, and then we only need to update thesentry__jsonwriter_write_uint64 function once these values can get handled.

Reverting this should make the value_uint64 test fail, since it expects "" around the numbers in the json representation.


To test the UI handling of these values, I added this in the example.c before sending a transaction:

        sentry_transaction_set_data(tx, "bigger", sentry_value_new_int32(INT64_MIN));
        sentry_transaction_set_data(tx, "biggest", sentry_value_new_uint64(UINT64_MAX));

And without the uint64->string conversion, the UI shows this:
Screenshot 2025-07-30 at 10 43 40

Adding the conversion makes it show up correctly.

@JoshuaMoelans
Copy link
Member Author

@sentry review

Copy link
Collaborator

@jpnurmi jpnurmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Only minor changes after already having been thoroughly reviewed in #1301

cursor[bot]

This comment was marked as outdated.

@JoshuaMoelans JoshuaMoelans merged commit 98b3891 into master Jul 31, 2025
67 of 68 checks passed
@JoshuaMoelans JoshuaMoelans deleted the joshua/feat/int64_value_t branch July 31, 2025 10:37
JoshuaMoelans added a commit to getsentry/sentry-docs that referenced this pull request Aug 1, 2025
#14509)

<!-- Use this checklist to make sure your PR is ready for merge. You may
delete any sections you don't need. -->

## DESCRIBE YOUR PR
Related to the changes in
getsentry/sentry-native#1326 , we update our
docs where they explicitly mention the available `sentry_value_t` types.

## IS YOUR CHANGE URGENT?  

Help us prioritize incoming PRs by letting us know when the change needs
to go live.
- [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE -->
- [ ] Other deadline: <!-- ENTER DATE HERE -->
- [x] None: Not urgent, can wait up to 1 week+

## SLA

- Teamwork makes the dream work, so please add a reviewer to your PRs.
- Please give the docs team up to 1 week to review your PR unless you've
added an urgent due date to it.
Thanks in advance for your help!

## PRE-MERGE CHECKLIST

*Make sure you've checked the following before merging your changes:*

- [ ] Checked Vercel preview for correctness, including links
- [ ] PR was reviewed and approved by any necessary SMEs (subject matter
experts)
- [ ] PR was reviewed and approved by a member of the [Sentry docs
team](https://github.com/orgs/getsentry/teams/docs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants