-
Notifications
You must be signed in to change notification settings - Fork 0
feat: refactor instrumentation options #77
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
feat: refactor instrumentation options #77
Conversation
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.
Bug: User Taps Instrumentation Ignores Disable
The UserInteractionManager is unconditionally created and started, ignoring the options.instrumentation.userTaps configuration. All other instrumentation types (memory, cpu, urlSession, launchTimes, memoryWarnings) were refactored to check their corresponding instrumentation flags, but userTaps was missed. This causes user tap tracking to run even when disabled via instrumentation.userTaps = .disabled.
Sources/Observability/Client/ObservabilityClientFactory.swift#L112-L116
swift-launchdarkly-observability/Sources/Observability/Client/ObservabilityClientFactory.swift
Lines 112 to 116 in 5d7862c
| let userInteractionManager = UserInteractionManager(options: options) { interaction in | |
| interaction.startEndSpan(tracer: tracerDecorator) | |
| } | |
| userInteractionManager.start() |
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.
Bug: User interaction tracking cannot be disabled.
The UserInteractionManager is always created and started unconditionally, ignoring the options.instrumentation.userTaps setting. While other instrumentation types were refactored to check their respective instrumentation flags, userTaps was missed. This causes user tap tracking to run even when disabled, inconsistent with the refactored instrumentation options pattern.
Sources/Observability/Client/ObservabilityClientFactory.swift#L112-L116
swift-launchdarkly-observability/Sources/Observability/Client/ObservabilityClientFactory.swift
Lines 112 to 116 in dfd4291
| let userInteractionManager = UserInteractionManager(options: options) { interaction in | |
| interaction.startEndSpan(tracer: tracerDecorator) | |
| } | |
| userInteractionManager.start() |
🤖 I have created a release *beep* *boop* --- ## [0.10.0](0.9.2...0.10.0) (2025-11-15) ### Features * ignore masking ([#80](#80)) ([1372064](1372064)) * options refactor ([#75](#75)) ([b442cbc](b442cbc)) * refactor instrumentation options ([#77](#77)) ([ebc2e24](ebc2e24)) ### Bug Fixes * touch throttle ([#81](#81)) ([6d1cd15](6d1cd15)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Bumps SDK to 0.10.0 and updates the changelog with new features and a bug fix. > > - **Release**: bump version to `0.10.0` > - Update `.` version in `.release-please-manifest.json` > - Update `sdkVersion` in `Sources/LaunchDarklyObservability/Version.swift` > - **Docs**: refresh `CHANGELOG.md` with features (ignore masking, options refactor, instrumentation options refactor) and a bug fix (touch throttle) > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 1bf72a3. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
Note
Adds an
Options.Instrumentationconfig with per-instrument FeatureFlags and updates client factory to use it, with ExampleApp enabling specific instruments.FeatureFlag.isEnabledhelper.Options.Instrumentationwith flags forurlSession,userTaps,memory,memoryWarnings,cpu,launchTimes.Optionswith newinstrumentationproperty and initializer parameter (default.init()).autoInstrumentation.contains(...)checks withoptions.instrumentation.<instrument>.isEnabledformemoryWarnings,urlSession,launchTimes,memory, andcpu.options.instrumentationto enableurlSession,userTaps,memory,memoryWarnings,launchTimesand disablecpu.Written by Cursor Bugbot for commit dfd4291. This will update automatically on new commits. Configure here.