Skip to content

Commit 9d974bf

Browse files
Hongyan JiangGitHub Enterprise
authored andcommitted
add to useFeatures list if enableW3CHeaders is set to true (#87)
1 parent c8f1914 commit 9d974bf

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

Sources/InstanaAgent/Beacons/CoreBeacon/CoreBeaconFactory.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ class CoreBeaconFactory {
2626
if session.dropBeaconReporting {
2727
array.append(mobileFeatureDropBeaconReporting)
2828
}
29+
if conf.enableW3CHeaders == true {
30+
array.append(mobileFeatureEnableW3CHeaders)
31+
}
2932
return array.isEmpty ? nil : array.joined(separator: ",")
3033
}
3134

Sources/InstanaAgent/Configuration/Defines.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ let mobileFeaturePerformanceLowMemory = "lm"
6868
let mobileFeaturePerformanceANR = "anr"
6969
let mobileFeatureAutoScreenNameCapture = "sn"
7070
let mobileFeatureDropBeaconReporting = "db"
71+
let mobileFeatureEnableW3CHeaders = "ot"
7172

7273
// OpenTelemetry
7374
let TRACE_PARENT = "traceparent"

Tests/InstanaAgentTests/Beacons/CoreBeacon/CoreBeaconFactoryTests.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,15 +246,16 @@ class CoreBeaconFactoryTests: InstanaTestCase {
246246
// Given
247247
let config = InstanaConfiguration.default(key: "key", reportingURL: URL(string: "http://localhost:3000")!,
248248
enableCrashReporting: true, perfConfig: InstanaPerformanceConfig(enableAppStartTimeReport: true,
249-
enableAnrReport: true, anrThreshold: 4.0, enableLowMemoryReport: true))
249+
enableAnrReport: true, anrThreshold: 4.0, enableLowMemoryReport: true),
250+
enableW3CHeaders: true)
250251
let session = InstanaSession(configuration: config, propertyHandler: InstanaPropertyHandler(),
251252
collectionEnabled: true, autoCaptureScreenNames: true, debugAllScreenNames: true,
252253
dropBeaconReporting: true)
253254
// When
254255
let factory = CoreBeaconFactory(session)
255256

256257
// Then
257-
AssertTrue(factory.mobileFeatures! == "c,lm,anr,sn,db")
258+
AssertTrue(factory.mobileFeatures! == "c,lm,anr,sn,db,ot")
258259
}
259260

260261
func test_create_from_string() {

0 commit comments

Comments
 (0)