Skip to content

[Unreal] Add transaction and span set_data documentation #14599

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mujacica
Copy link

@mujacica mujacica commented Aug 8, 2025

Preview: https://sentry-docs-git-unreal-attach-data.sentry.dev/platforms/unreal/tracing/instrumentation/custom-instrumentation/

DESCRIBE YOUR PR

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.):
  • Other deadline:
  • 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

EXTRA RESOURCES

Copy link

vercel bot commented Aug 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 11, 2025 10:31am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
develop-docs ⬜️ Ignored (Inspect) Visit Preview Aug 11, 2025 10:31am

@codeowner-assignment codeowner-assignment bot requested a review from a team August 8, 2025 17:09
Copy link

codecov bot commented Aug 8, 2025

Bundle Report

Changes will increase total bundle size by 1.09kB (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-client-array-push 9.85MB -6 bytes (-0.0%) ⬇️
sentry-docs-server-cjs 12.38MB 1.1kB (0.01%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: sentry-docs-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
static/chunks/pages/_app-*.js -3 bytes 882.71kB -0.0%
static/chunks/8321-*.js -3 bytes 425.87kB -0.0%
static/lOHuiT0HX9Avx-*.js (New) 684 bytes 684 bytes 100.0% 🚀
static/lOHuiT0HX9Avx-*.js (New) 77 bytes 77 bytes 100.0% 🚀
static/c355Na4wp1ikvIwUk4x9y/_buildManifest.js (Deleted) -684 bytes 0 bytes -100.0% 🗑️
static/c355Na4wp1ikvIwUk4x9y/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️
view changes for bundle: sentry-docs-server-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
1729.js -3 bytes 1.77MB -0.0%
../instrumentation.js -3 bytes 1.1MB -0.0%
9523.js -3 bytes 1.08MB -0.0%
../app/[[...path]]/page.js.nft.json 370 bytes 744.89kB 0.05%
../app/platform-redirect/page.js.nft.json 370 bytes 744.8kB 0.05%
../app/sitemap.xml/route.js.nft.json 370 bytes 742.28kB 0.05%

Comment on lines 10 to 14
transaction->SetData(TEXT("key"), {{TEXT("data_key1"), TEXT("value")}});
transaction->SetData(TEXT("key"), {{TEXT("data_key2"), 123}});
transaction->SetData(TEXT("key"), {{TEXT("data_key3"), 123.456f}});
transaction->SetData(TEXT("key"), {{TEXT("data_key4"), TArray<FSentryVariant>{{123, 456}}}});
transaction->SetData(TEXT("key"), {{TEXT("data_key5"), TMap<FString, FSentryVariant>{{TEXT("inner_key1"), 123}}}});
Copy link
Contributor

Choose a reason for hiding this comment

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

Potential bug: The Unreal `SetData` documentation example incorrectly uses the same key for multiple calls, which will cause data to be overwritten, with only the last value being saved.
  • Description: The code examples for SetData in the Unreal documentation repeatedly use the same key, TEXT(&quot;key&quot;), for multiple calls. Standard key-value map behavior, which Unreal's TMap follows, dictates that using the same key overwrites the previous value. Consequently, if a user implements this example, only the data from the final SetData call will be preserved on the transaction, and all previously set attributes will be lost. This contradicts the documentation's stated goal of demonstrating how to add multiple, queryable data attributes and is inconsistent with examples for all other Sentry SDKs.
  • Suggested fix: Update the code examples in the documentation to use a unique key for each SetData call. For instance, use keys like TEXT(&quot;data_key1&quot;), TEXT(&quot;data_key2&quot;), etc., to align with the intended functionality and the pattern established in other Sentry SDK documentation.
    severity: 0.45, confidence: 0.98

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Contributor

@bitsandfoxes bitsandfoxes left a comment

Choose a reason for hiding this comment

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

I'd change the TEXT("key") so the snippet isn't overwriting the data and to avoid copy-pasta user confusion. LGTM!

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.

3 participants