Skip to content

Commit

Permalink
RUM-6850: Rollback to have internal exposure of the `configurationTel…
Browse files Browse the repository at this point in the history
…emetrySampleRate`
  • Loading branch information
simaoseica-dd committed Dec 10, 2024
1 parent d3b0a5d commit e625bd5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions DatadogRUM/Sources/RUMConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -397,3 +397,14 @@ extension RUM.Configuration {
}

extension RUM.Configuration: InternalExtended {}
extension InternalExtension where ExtendedType == RUM.Configuration {
/// The sampling rate for configuration telemetry events. When set, it overwrites the value
/// of `configurationTelemetrySampleRate` in `RUM.Configuration`.
///
/// It is used to enable or disable telemetry events on internal plugins (e.g. flutter's `DatadogRumPlugin`) and when running test scenarios.
/// Expects value between `0.0` and `100.0`.
public var configurationTelemetrySampleRate: Float {
get { type.configurationTelemetrySampleRate }
set { type.configurationTelemetrySampleRate = newValue }
}
}
2 changes: 1 addition & 1 deletion DatadogRUM/Tests/RUMTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ class RUMTests: XCTestCase {

func testWhenEnabledWithOverwritingConfigurationTelemetrySampleRate() throws {
// Given
config.configurationTelemetrySampleRate = 42
config._internal_mutation { $0.configurationTelemetrySampleRate = 42 }

// When
RUM.enable(with: config, in: core)
Expand Down

0 comments on commit e625bd5

Please sign in to comment.