Skip to content

[Unreal] Add transaction and span set_data documentation - #14599

Merged
mujacica merged 2 commits into
masterfrom
unreal-attach-data
Aug 12, 2025
Merged

[Unreal] Add transaction and span set_data documentation#14599
mujacica merged 2 commits into
masterfrom
unreal-attach-data

Conversation

@mujacica

@mujacicamujacica commented Aug 8, 2025

Copy link
Copy Markdown
Contributor

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

@vercel

vercelBot commented Aug 8, 2025

Copy link
Copy Markdown

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

NameStatusPreviewCommentsUpdated (UTC)
sentry-docs✅ Ready (Inspect)Visit Preview💬 Add feedbackAug 11, 2025 10:31am
1 Skipped Deployment
NameStatusPreviewCommentsUpdated (UTC)
develop-docs⬜️ Ignored (Inspect)Visit PreviewAug 11, 2025 10:31am

@codeowner-assignment
codeowner-assignmentBot requested a review from a teamAugust 8, 2025 17:09
@codecov

codecovBot commented Aug 8, 2025

Copy link
Copy Markdown

Bundle Report

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

Detailed changes
Bundle nameSizeChange
sentry-docs-client-array-push9.85MB-6 bytes (-0.0%) ⬇️
sentry-docs-server-cjs12.38MB1.1kB (0.01%) ⬆️

Affected Assets, Files, and Routes:

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

Assets Changed:

Asset NameSize ChangeTotal SizeChange (%)
static/chunks/pages/_app-*.js-3 bytes882.71kB-0.0%
static/chunks/8321-*.js-3 bytes425.87kB-0.0%
static/lOHuiT0HX9Avx-*.js(New)684 bytes684 bytes100.0% 🚀
static/lOHuiT0HX9Avx-*.js(New)77 bytes77 bytes100.0% 🚀
static/c355Na4wp1ikvIwUk4x9y/_buildManifest.js(Deleted)-684 bytes0 bytes-100.0% 🗑️
static/c355Na4wp1ikvIwUk4x9y/_ssgManifest.js(Deleted)-77 bytes0 bytes-100.0% 🗑️
view changes for bundle: sentry-docs-server-cjs

Assets Changed:

Asset NameSize ChangeTotal SizeChange (%)
1729.js-3 bytes1.77MB-0.0%
../instrumentation.js-3 bytes1.1MB-0.0%
9523.js-3 bytes1.08MB-0.0%
../app/[[...path]]/page.js.nft.json370 bytes744.89kB0.05%
../app/platform-redirect/page.js.nft.json370 bytes744.8kB0.05%
../app/sitemap.xml/route.js.nft.json370 bytes742.28kB0.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
Copy Markdown
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.

@bitsandfoxesbitsandfoxes left a comment

Copy link
Copy Markdown
Contributor

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!

@codeowner-assignment
codeowner-assignmentBot requested a review from a teamAugust 11, 2025 10:15
@mujacica
mujacica merged commit e29b50b into masterAug 12, 2025
13 checks passed
@mujacica
mujacica deleted the unreal-attach-data branch August 12, 2025 12:31
codyde added a commit that referenced this pull request Aug 13, 2025
* 'master' of https://github.com/getsentry/sentry-docs: (22 commits)
Fix incorrectly placed comma (#14592)
fix(devservices): Typo in devservices docs (#14636)
ref(ourlogs): Add log size limit (#14635)
Document undocumented php prefix option (#14634)
getsentry/relay@7958273
Unreal Engine: Update plugin docs (#14624)
feat: Update min js sdk version for logging and update console logging snippet (#14614)
feat: [Unreal] Add transaction and span set_data documentation (#14599)
feat(js): Add `ignoreSpans` documentation to Options page (#14572)
fix(js/browser): Amend user IP + `sendDefaultPii` change to v10 migration guide (#14609)
fix: Fix broken AI banner due to invalid syntax (#14627)
feat(partners)add-enablement-docs (#14095)
Fix image path issue & add test coverage for new lightbox (#14616)
feat(seer): update GHE setup to work with seer (#14617)
fix(replay): Document searchable properties `screen` and alias `screens` (#14603)
Update image handling (#14564)
Update using-hooks.mdx (#14605)
Godot: Document `disabled-in-editor-play` option (#14438)
fix(Docs) redirect and deprecate old metrics pages (#14602)
fix(relay): Update projects.mdx (#14606)
...
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Aug 28, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@mujacica@cleptric@bitsandfoxes