Skip to content

Commit

Permalink
impr: Track usage of persistingTracesWhenCrashing (#4587)
Browse files Browse the repository at this point in the history
Add enablePersistingTracesWhenCrashing to the list of enabled features
when the option enablePersistingTracesWhenCrashing is enabled.
  • Loading branch information
philipphofmann authored Dec 2, 2024
1 parent cabe995 commit fbcf858
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## Unreleased

### Improvements

- Track adoption of `enablePersistingTracesWhenCrashing` (#4587)

## 8.42.0-beta.1

### Features
Expand Down
4 changes: 4 additions & 0 deletions Sources/Swift/Helper/SentryEnabledFeaturesBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ import Foundation
}
#endif //os(iOS) || os(tvOS) || targetEnvironment(macCatalyst)

if options.enablePersistingTracesWhenCrashing {
features.append("persistingTracesWhenCrashing")
}

return features
}
}
11 changes: 11 additions & 0 deletions Tests/SentryTests/Helper/SentryEnabledFeaturesBuilderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,16 @@ final class SentryEnabledFeaturesBuilderTests: XCTestCase {
#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst)
XCTAssert(features.contains("appHangTrackingV2"))
#endif //os(iOS) || os(tvOS) || targetEnvironment(macCatalyst)

}

func testEnablePersistingTracesWhenCrashing() {
let options = Options()

options.enablePersistingTracesWhenCrashing = true

let features = SentryEnabledFeaturesBuilder.getEnabledFeatures(options: options)

XCTAssert(features.contains("persistingTracesWhenCrashing"))
}
}

0 comments on commit fbcf858

Please sign in to comment.