Skip to content

Conversation

@mario-launchdarkly
Copy link
Contributor

@mario-launchdarkly mario-launchdarkly commented Nov 7, 2025

Note

Adds an Options.Instrumentation config with per-instrument FeatureFlags and updates client factory to use it, with ExampleApp enabling specific instruments.

  • API (Options):
    • Add FeatureFlag.isEnabled helper.
    • Introduce Options.Instrumentation with flags for urlSession, userTaps, memory, memoryWarnings, cpu, launchTimes.
    • Extend Options with new instrumentation property and initializer parameter (default .init()).
  • Client Factory:
    • Replace autoInstrumentation.contains(...) checks with options.instrumentation.<instrument>.isEnabled for memoryWarnings, urlSession, launchTimes, memory, and cpu.
  • ExampleApp:
    • Configure options.instrumentation to enable urlSession, userTaps, memory, memoryWarnings, launchTimes and disable cpu.

Written by Cursor Bugbot for commit dfd4291. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a 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

let userInteractionManager = UserInteractionManager(options: options) { interaction in
interaction.startEndSpan(tracer: tracerDecorator)
}
userInteractionManager.start()

Fix in Cursor Fix in Web


Copy link

@cursor cursor bot left a 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

let userInteractionManager = UserInteractionManager(options: options) { interaction in
interaction.startEndSpan(tracer: tracerDecorator)
}
userInteractionManager.start()

Fix in Cursor Fix in Web


@mario-launchdarkly mario-launchdarkly merged commit ebc2e24 into main Nov 10, 2025
5 checks passed
@mario-launchdarkly mario-launchdarkly deleted the refactor/auto-instrumentation-options branch November 10, 2025 21:34
abelonogov-ld added a commit that referenced this pull request Nov 13, 2025
* main:
  chore: prepare folders for binaryframework (#79)
  refactor: get sampling config graphql to poso (#78)
  feat: refactor instrumentation options (#77)
  feat: options refactor (#75)
abelonogov-ld pushed a commit that referenced this pull request Nov 15, 2025
🤖 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 -->
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