Repository navigation
feat(flutter): add setAttributes and removeAttributes - #858
Open
abelonogov-ld wants to merge 4 commits into
Open
abelonogov-ld wants to merge 4 commits into
abelonogov-ld wants to merge 4 commits into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3b0ee45. Configure here.
This was referenced Oct 28, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Vadman97
approved these changes
Oct 29, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds global attributes to the Flutter observability SDK. This is one of a set of matching PRs across SDKs that share the same semantics (see #859, #860, #861, #856, #863, launchdarkly/swift-launchdarkly-observability#290).
LDObserve.setAttributes(Map<String, Object?> attributes)merges by key into one process-wide, in-memory map;LDObserve.removeAttributes(List<String> keys)removes keys.LDObserve.recordLogand captureddebugPrint/printoutput.propertiesof track, screen-view and click events forwarded to the native SDK.session.idandhighlight.session_idare ignored, as are values that can't be attributes (includingnull).setAttributesto native once feat(android): add setAttributes and removeAttributes #860 and feat: add setAttributes and removeAttributes swift-launchdarkly-observability#290 ship.How did you test this change?
test/global_attributes_test.dart: merge and remove, reserved keys and invalid values ignored, immutable snapshot, fill precedence.test/global_attributes_pipeline_test.dartrunsOtel.setupagainst a mocked native bridge:span.setAttributewin over globals;test/web_exporters_test.dart: web track, screen-view, click and log spans carry globals without overriding the SDK'sevent.*keys.test/public_api_test.dartcovers the newLDObservesignatures.dart format,flutter analyze(clean) andflutter test(292 tests) pass.Are there any deployment considerations?
None. Two static methods are added to
LDObserve; nothing changes unless an app calls them.Note
Overview
Adds process-wide global attributes to the Flutter observability SDK via
LDObserve.setAttributesandLDObserve.removeAttributes, aligned with matching SDK work elsewhere.Globals merge in memory (safe before
init), ignore reserved session keys and invalid values, and attach to Dart-recorded telemetry: spans get them at start through a newGlobalAttributesSpanProcessor; logs and native-forwarded track/screen-view/clickpropertiesare filled so per-call keys win. README documents precedence and limits (no Dart metrics API; native-only crash/lifecycle telemetry unchanged).The example app gains
repro.dartto demo UTM-style globals and expected LaunchDarkly row attributes. Coverage includes store/unit tests, a full pipeline test against the mocked native bridge, and web exporter assertions.Reviewed by Cursor Bugbot for commit 7afd0f7. Bugbot is set up for automated code reviews on this repo. Configure here.