Skip to content
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

RUM-3470 feat: Head-based sampling #1794

Merged
merged 10 commits into from
Apr 26, 2024
Merged
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Unreleased

- [FEATURE] `DatadogTrace` now supports head-based sampling. See [#1794][]
- [FEATURE] Support WebView recording in Session Replay. See [#1776][]

# 2.10.0 / 23-04-2024
Expand Down Expand Up @@ -640,6 +641,7 @@ Release `2.0` introduces breaking changes. Follow the [Migration Guide](MIGRATIO
[#1742]: https://github.com/DataDog/dd-sdk-ios/pull/1742
[#1746]: https://github.com/DataDog/dd-sdk-ios/pull/1746
[#1747]: https://github.com/DataDog/dd-sdk-ios/pull/1747
[#1794]: https://github.com/DataDog/dd-sdk-ios/pull/1794
[#1774]: https://github.com/DataDog/dd-sdk-ios/pull/1774
[#1763]: https://github.com/DataDog/dd-sdk-ios/pull/1763
[#1767]: https://github.com/DataDog/dd-sdk-ios/pull/1767
Expand Down
24 changes: 24 additions & 0 deletions Datadog/Datadog.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@
614CADD72510BAC000B93D2D /* Environment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 614CADD62510BAC000B93D2D /* Environment.swift */; };
614E9EB3244719FA007EE3E1 /* BundleType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 614E9EB2244719FA007EE3E1 /* BundleType.swift */; };
614ED36C260352DC00C8C519 /* CrashReporter.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 614ED36B260352DC00C8C519 /* CrashReporter.xcframework */; };
615192CD2BD6948B0005A782 /* HTTPHeadersWriterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615192CC2BD6948B0005A782 /* HTTPHeadersWriterTests.swift */; };
615192CE2BD6948B0005A782 /* HTTPHeadersWriterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615192CC2BD6948B0005A782 /* HTTPHeadersWriterTests.swift */; };
615192D02BD6B7C90005A782 /* DatadogTracer+InjectAndExtract.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615192CF2BD6B7C90005A782 /* DatadogTracer+InjectAndExtract.swift */; };
615192D12BD6B7C90005A782 /* DatadogTracer+InjectAndExtract.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615192CF2BD6B7C90005A782 /* DatadogTracer+InjectAndExtract.swift */; };
61570005246AADFA00E96950 /* DatadogObjc.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 61133BF0242397DA00786299 /* DatadogObjc.framework */; };
615A4A8324A3431600233986 /* Trace+objc.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615A4A8224A3431600233986 /* Trace+objc.swift */; };
615A4A8924A34FD700233986 /* DDTracerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 615A4A8824A34FD700233986 /* DDTracerTests.swift */; };
Expand Down Expand Up @@ -352,6 +356,8 @@
6167E72A2B84C11900C3CA2D /* DDCrashReportMocks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6167E7282B84C11900C3CA2D /* DDCrashReportMocks.swift */; };
6167E72C2B84C72B00C3CA2D /* UIKitHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6167E72B2B84C72B00C3CA2D /* UIKitHelpers.swift */; };
6167E72D2B84C72B00C3CA2D /* UIKitHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6167E72B2B84C72B00C3CA2D /* UIKitHelpers.swift */; };
616AAA6D2BDA674C00AB9DAD /* TraceSamplingStrategy+objc.swift in Sources */ = {isa = PBXBuildFile; fileRef = 616AAA6C2BDA674C00AB9DAD /* TraceSamplingStrategy+objc.swift */; };
616AAA6E2BDA674C00AB9DAD /* TraceSamplingStrategy+objc.swift in Sources */ = {isa = PBXBuildFile; fileRef = 616AAA6C2BDA674C00AB9DAD /* TraceSamplingStrategy+objc.swift */; };
616B668E259CC28E00968EE8 /* DDRUMMonitorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 616B668D259CC28E00968EE8 /* DDRUMMonitorTests.swift */; };
616F8C272BB1CD990061EA53 /* ProcessIdentifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 616F8C262BB1CD990061EA53 /* ProcessIdentifier.swift */; };
616F8C282BB1CD990061EA53 /* ProcessIdentifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 616F8C262BB1CD990061EA53 /* ProcessIdentifier.swift */; };
Expand All @@ -361,6 +367,8 @@
617247B825DAB0E2007085B3 /* DDCrashReportBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 617247B725DAB0E2007085B3 /* DDCrashReportBuilder.swift */; };
6175922B2A6FA8EE0073F431 /* DatadogSessionReplay.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6133D1F52A6ED9E100384BEF /* DatadogSessionReplay.framework */; };
6175922D2A6FADDD0073F431 /* DatadogSessionReplay.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6133D1F52A6ED9E100384BEF /* DatadogSessionReplay.framework */; };
6175C3512BCE66DB006FAAB0 /* TraceContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6175C3502BCE66DB006FAAB0 /* TraceContext.swift */; };
6175C3522BCE66DB006FAAB0 /* TraceContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6175C3502BCE66DB006FAAB0 /* TraceContext.swift */; };
617699182A860D9D0030022B /* HTTPClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 617699172A860D9D0030022B /* HTTPClient.swift */; };
617699192A860D9D0030022B /* HTTPClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 617699172A860D9D0030022B /* HTTPClient.swift */; };
6176991B2A86121B0030022B /* HTTPClientMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6176991A2A86121B0030022B /* HTTPClientMock.swift */; };
Expand Down Expand Up @@ -2247,6 +2255,8 @@
614CADD62510BAC000B93D2D /* Environment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Environment.swift; sourceTree = "<group>"; };
614E9EB2244719FA007EE3E1 /* BundleType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BundleType.swift; sourceTree = "<group>"; };
614ED36B260352DC00C8C519 /* CrashReporter.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = CrashReporter.xcframework; path = ../Carthage/Build/CrashReporter.xcframework; sourceTree = "<group>"; };
615192CC2BD6948B0005A782 /* HTTPHeadersWriterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPHeadersWriterTests.swift; sourceTree = "<group>"; };
615192CF2BD6B7C90005A782 /* DatadogTracer+InjectAndExtract.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "DatadogTracer+InjectAndExtract.swift"; sourceTree = "<group>"; };
6152C84224BE2165006A1679 /* MockServerAddress.local.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = MockServerAddress.local.xcconfig; sourceTree = "<group>"; };
615519252461BCE7002A85CF /* Datadog.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Datadog.xcconfig; sourceTree = "<group>"; };
615519262461BCE7002A85CF /* Datadog.local.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Datadog.local.xcconfig; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2291,6 +2301,7 @@
6167E7222B837FF100C3CA2D /* BinaryImageMocks.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BinaryImageMocks.swift; sourceTree = "<group>"; };
6167E7282B84C11900C3CA2D /* DDCrashReportMocks.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DDCrashReportMocks.swift; sourceTree = "<group>"; };
6167E72B2B84C72B00C3CA2D /* UIKitHelpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIKitHelpers.swift; sourceTree = "<group>"; };
616AAA6C2BDA674C00AB9DAD /* TraceSamplingStrategy+objc.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TraceSamplingStrategy+objc.swift"; sourceTree = "<group>"; };
616B668D259CC28E00968EE8 /* DDRUMMonitorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DDRUMMonitorTests.swift; sourceTree = "<group>"; };
616C0A9D28573DFF00C13264 /* RUMOperatingSystemInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RUMOperatingSystemInfo.swift; sourceTree = "<group>"; };
616C0AA028573F6300C13264 /* RUMOperatingSystemInfoTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RUMOperatingSystemInfoTests.swift; sourceTree = "<group>"; };
Expand All @@ -2304,6 +2315,7 @@
617247AD25DA9BEA007085B3 /* CrashReportingObjcHelpers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CrashReportingObjcHelpers.h; sourceTree = "<group>"; };
617247AE25DA9BEA007085B3 /* CrashReportingObjcHelpers.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CrashReportingObjcHelpers.m; sourceTree = "<group>"; };
617247B725DAB0E2007085B3 /* DDCrashReportBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DDCrashReportBuilder.swift; sourceTree = "<group>"; };
6175C3502BCE66DB006FAAB0 /* TraceContext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TraceContext.swift; sourceTree = "<group>"; };
617699172A860D9D0030022B /* HTTPClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPClient.swift; sourceTree = "<group>"; };
6176991A2A86121B0030022B /* HTTPClientMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPClientMock.swift; sourceTree = "<group>"; };
6176991D2A8791880030022B /* Datadog+MultipleInstancesIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Datadog+MultipleInstancesIntegrationTests.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -4264,6 +4276,7 @@
6132BF4A24A49C7200D7BD17 /* Propagation */ = {
isa = PBXGroup;
children = (
616AAA6C2BDA674C00AB9DAD /* TraceSamplingStrategy+objc.swift */,
6132BF4B24A49C8F00D7BD17 /* HTTPHeadersWriter+objc.swift */,
A79B0F5E292BA435008742B3 /* B3HTTPHeadersWriter+objc.swift */,
A728ADAA2934EA2100397996 /* W3CHTTPHeadersWriter+objc.swift */,
Expand Down Expand Up @@ -5747,6 +5760,7 @@
619CE75D2A458CE1005588CB /* TraceConfigurationTests.swift */,
61AD4E172451C7FF006E34EA /* TracingFeatureMocks.swift */,
61F3E3622BC5556D00C7881E /* DatadogTracer+SamplingTests.swift */,
615192CF2BD6B7C90005A782 /* DatadogTracer+InjectAndExtract.swift */,
61C5A89824509C1100DA608C /* DDSpanTests.swift */,
61F1A620249A45E400075390 /* DDSpanContextTests.swift */,
D2F1B81426D8E5FF009F3293 /* DDNoopTracerTests.swift */,
Expand Down Expand Up @@ -6040,6 +6054,7 @@
children = (
D2160C9829C0DE5700FAA9A5 /* NetworkInstrumentationFeature.swift */,
D2160CEC29C0E0E600FAA9A5 /* DatadogURLSessionHandler.swift */,
6175C3502BCE66DB006FAAB0 /* TraceContext.swift */,
D2EBEDCC29B893D800B15732 /* TraceID.swift */,
3C9B27242B9F174700569C07 /* SpanID.swift */,
D2160C9429C0DE5600FAA9A5 /* FirstPartyHosts.swift */,
Expand Down Expand Up @@ -6068,6 +6083,7 @@
61B558D32469CDD8001460D3 /* TraceIDGeneratorTests.swift */,
3CCECDAE2BC688120013C125 /* SpanIDGeneratorTests.swift */,
61F3E3652BC595F600C7881E /* HTTPHeadersReaderTests.swift */,
615192CC2BD6948B0005A782 /* HTTPHeadersWriterTests.swift */,
A79B0F5A292B7C06008742B3 /* B3HTTPHeadersWriterTests.swift */,
A79B0F60292BB071008742B3 /* B3HTTPHeadersReaderTests.swift */,
A728ADA22934DB5000397996 /* W3CHTTPHeadersWriterTests.swift */,
Expand Down Expand Up @@ -7877,6 +7893,7 @@
6132BF4C24A49C8F00D7BD17 /* HTTPHeadersWriter+objc.swift in Sources */,
6132BF4724A498D800D7BD17 /* DDSpan+objc.swift in Sources */,
615A4A8B24A3568900233986 /* OTSpan+objc.swift in Sources */,
616AAA6D2BDA674C00AB9DAD /* TraceSamplingStrategy+objc.swift in Sources */,
611720D52524D9FB00634D9E /* DDURLSessionDelegate+objc.swift in Sources */,
9E55407C25812D1C00F6E3AD /* RUM+objc.swift in Sources */,
D2A434AA2A8E40A20028E329 /* SessionReplay+objc.swift in Sources */,
Expand Down Expand Up @@ -8243,6 +8260,7 @@
D2EBEE2A29BA160F00B15732 /* TracingHTTPHeaders.swift in Sources */,
D21A94F22B8397CA00AC4256 /* WebViewMessage.swift in Sources */,
D23039EC298D5236001A1FA3 /* LaunchTime.swift in Sources */,
6175C3512BCE66DB006FAAB0 /* TraceContext.swift in Sources */,
D23039EE298D5236001A1FA3 /* FeatureMessageReceiver.swift in Sources */,
D23039DE298D5235001A1FA3 /* Writer.swift in Sources */,
D23039FA298D5236001A1FA3 /* Telemetry.swift in Sources */,
Expand Down Expand Up @@ -8584,6 +8602,7 @@
61F3E3632BC5556D00C7881E /* DatadogTracer+SamplingTests.swift in Sources */,
D2C1A51C29C4C75700946C31 /* ContextMessageReceiverTests.swift in Sources */,
619CE7612A458D66005588CB /* TraceTests.swift in Sources */,
615192D02BD6B7C90005A782 /* DatadogTracer+InjectAndExtract.swift in Sources */,
D2C1A52029C4C75700946C31 /* DDSpanTests.swift in Sources */,
D2C1A51B29C4C75700946C31 /* DDSpanContextTests.swift in Sources */,
D2C1A52729C4C7D000946C31 /* TracingFeatureMocks.swift in Sources */,
Expand Down Expand Up @@ -8787,6 +8806,7 @@
61F3E3642BC5556D00C7881E /* DatadogTracer+SamplingTests.swift in Sources */,
D2C1A56529C4F2E800946C31 /* ContextMessageReceiverTests.swift in Sources */,
619CE7622A458D66005588CB /* TraceTests.swift in Sources */,
615192D12BD6B7C90005A782 /* DatadogTracer+InjectAndExtract.swift in Sources */,
D2C1A56629C4F2E800946C31 /* DDSpanTests.swift in Sources */,
D2C1A56729C4F2E800946C31 /* DDSpanContextTests.swift in Sources */,
D2C1A56829C4F2E800946C31 /* TracingFeatureMocks.swift in Sources */,
Expand Down Expand Up @@ -9042,6 +9062,7 @@
3CCCA5C52ABAF0F80029D7BD /* DDURLSessionInstrumentation+objc.swift in Sources */,
D2CB6FA027C5217A00A62B57 /* Trace+objc.swift in Sources */,
D2CB6FA127C5217A00A62B57 /* HTTPHeadersWriter+objc.swift in Sources */,
616AAA6E2BDA674C00AB9DAD /* TraceSamplingStrategy+objc.swift in Sources */,
D2CB6FA227C5217A00A62B57 /* DDSpan+objc.swift in Sources */,
D2CB6FA327C5217A00A62B57 /* OTSpan+objc.swift in Sources */,
D2CB6FA427C5217A00A62B57 /* DDURLSessionDelegate+objc.swift in Sources */,
Expand Down Expand Up @@ -9125,6 +9146,7 @@
D2EBEE3829BA161100B15732 /* TracingHTTPHeaders.swift in Sources */,
D21A94F32B8397CA00AC4256 /* WebViewMessage.swift in Sources */,
D2DA2364298D57AA00C6C7E6 /* LaunchTime.swift in Sources */,
6175C3522BCE66DB006FAAB0 /* TraceContext.swift in Sources */,
D2DA2365298D57AA00C6C7E6 /* FeatureMessageReceiver.swift in Sources */,
D2DA2366298D57AA00C6C7E6 /* Writer.swift in Sources */,
D2DA2367298D57AA00C6C7E6 /* Telemetry.swift in Sources */,
Expand Down Expand Up @@ -9215,6 +9237,7 @@
D2160CE929C0E00200FAA9A5 /* MethodSwizzlerTests.swift in Sources */,
D2216EC32A96649500ADAEC8 /* FeatureBaggageTests.swift in Sources */,
D2160CDC29C0DF6700FAA9A5 /* HostsSanitizerTests.swift in Sources */,
615192CD2BD6948B0005A782 /* HTTPHeadersWriterTests.swift in Sources */,
D2F44FB8299AA1DA0074B0D9 /* DataCompressionTests.swift in Sources */,
D2160CE029C0DF6700FAA9A5 /* URLSessionDelegateAsSuperclassTests.swift in Sources */,
D2EBEE3B29BA163E00B15732 /* B3HTTPHeadersReaderTests.swift in Sources */,
Expand Down Expand Up @@ -9261,6 +9284,7 @@
D2EBEE4229BA163F00B15732 /* W3CHTTPHeadersReaderTests.swift in Sources */,
D2216EC42A96649700ADAEC8 /* FeatureBaggageTests.swift in Sources */,
D2160CDD29C0DF6700FAA9A5 /* HostsSanitizerTests.swift in Sources */,
615192CE2BD6948B0005A782 /* HTTPHeadersWriterTests.swift in Sources */,
D2F44FB9299AA1DB0074B0D9 /* DataCompressionTests.swift in Sources */,
D2160CE129C0DF6700FAA9A5 /* URLSessionDelegateAsSuperclassTests.swift in Sources */,
D2EBEE3F29BA163F00B15732 /* B3HTTPHeadersReaderTests.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,22 +198,16 @@
</BuildableReference>
<SkippedTests>
<Test
Identifier = "HeadBasedSamplingTests/testSamplingLocalTrace()">
Identifier = "HeadBasedSamplingTests/testSendingDroppedDistributedTraceWithNoParent_throughTracerAPI()">
</Test>
<Test
Identifier = "HeadBasedSamplingTests/testSamplingLocalTraceWithImplicitParent()">
Identifier = "HeadBasedSamplingTests/testSendingDroppedDistributedTraceWithNoParent_throughURLSessionInstrumentationAPI()">
</Test>
<Test
Identifier = "HeadBasedSamplingTests/testSendingDroppedDistributedTraceWithNoParent()">
Identifier = "HeadBasedSamplingTests/testSendingDroppedDistributedTraceWithParent_throughTracerAPI()">
</Test>
<Test
Identifier = "HeadBasedSamplingTests/testSendingDroppedDistributedTraceWithParent()">
</Test>
<Test
Identifier = "HeadBasedSamplingTests/testSendingSampledDistributedTraceWithNoParent()">
</Test>
<Test
Identifier = "HeadBasedSamplingTests/testSendingSampledDistributedTraceWithParent()">
Identifier = "HeadBasedSamplingTests/testSendingDroppedDistributedTraceWithParent_throughURLSessionInstrumentationAPI()">
</Test>
</SkippedTests>
</TestableReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,22 +184,22 @@
</BuildableReference>
<SkippedTests>
<Test
Identifier = "HeadBasedSamplingTests/testSamplingLocalTrace()">
Identifier = "HeadBasedSamplingTests/testSendingDroppedDistributedTraceWithNoParent_throughTracerAPI()">
</Test>
<Test
Identifier = "HeadBasedSamplingTests/testSamplingLocalTraceWithImplicitParent()">
Identifier = "HeadBasedSamplingTests/testSendingDroppedDistributedTraceWithNoParent_throughURLSessionInstrumentationAPI()">
</Test>
<Test
Identifier = "HeadBasedSamplingTests/testSendingDroppedDistributedTraceWithNoParent()">
Identifier = "HeadBasedSamplingTests/testSendingDroppedDistributedTraceWithParent_throughTracerAPI()">
</Test>
<Test
Identifier = "HeadBasedSamplingTests/testSendingDroppedDistributedTraceWithParent()">
Identifier = "HeadBasedSamplingTests/testSendingDroppedDistributedTraceWithParent_throughURLSessionInstrumentationAPI()">
</Test>
<Test
Identifier = "HeadBasedSamplingTests/testSendingSampledDistributedTraceWithNoParent()">
Identifier = "HeadBasedSamplingTests/testSendingSampledDistributedTraceWithNoParent_throughTracerAPI()">
</Test>
<Test
Identifier = "HeadBasedSamplingTests/testSendingSampledDistributedTraceWithParent()">
Identifier = "HeadBasedSamplingTests/testSendingSampledDistributedTraceWithParent_throughTracerAPI()">
</Test>
</SkippedTests>
</TestableReference>
Expand Down Expand Up @@ -232,11 +232,6 @@
BlueprintName = "DatadogTraceTests tvOS"
ReferencedContainer = "container:Datadog.xcodeproj">
</BuildableReference>
<SkippedTests>
<Test
Identifier = "DatadogTracer_SamplingTests/testWhenRootSpanIsSampled_thenAllChildSpansMustBeSampledTheSameWay()">
</Test>
</SkippedTests>
</TestableReference>
<TestableReference
skipped = "NO">
Expand Down
Loading