Skip to content

Commit

Permalink
RUMM-2759 PR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejburda committed Dec 2, 2022
1 parent 16bc14f commit 8e2e35b
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- [IMPROVEMENT] Add a method for sending error attributes on logs as strings.
- [IMPROVEMENT] Add manual Open Telemetry b3 headers injection. See [#1057][]
- [IMPROVEMENT] Add automatic Open Telemetry b3 headers injection. See [#1061][]
- [IMPROVEMENT] Add manual and automatic W3C traceparent header injection. See [#1071][]

# 1.13.0 / 08-11-2022

Expand Down Expand Up @@ -418,6 +419,7 @@
[#1045]: https://github.com/DataDog/dd-sdk-ios/pull/1045
[#1057]: https://github.com/DataDog/dd-sdk-ios/pull/1057
[#1061]: https://github.com/DataDog/dd-sdk-ios/pull/1061
[#1071]: https://github.com/DataDog/dd-sdk-ios/pull/1071
[@00fa9a]: https://github.com/00FA9A
[@britton-earnin]: https://github.com/Britton-Earnin
[@hengyu]: https://github.com/Hengyu
Expand Down
2 changes: 1 addition & 1 deletion Sources/Datadog/Core/FeaturesConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ internal struct FeaturesConfiguration {
let userDefinedFirstPartyHosts: Set<String>

/// First party hosts defined by the user with custom tracing header types.
let userDefinedHostsWithHeaderTypes: Dictionary<String, Set<TracingHeaderType>>
let userDefinedHostsWithHeaderTypes: [String: Set<TracingHeaderType>]

/// URLs used internally by the SDK - they are not instrumented.
let sdkInternalURLs: Set<String>
Expand Down
4 changes: 2 additions & 2 deletions Sources/Datadog/DatadogConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ extension Datadog {

private(set) var serviceName: String?
private(set) var firstPartyHosts: Set<String>?
private(set) var firstPartyHostsWithHeaderTypes: Dictionary<String, Set<TracingHeaderType>>?
private(set) var firstPartyHostsWithHeaderTypes: [String: Set<TracingHeaderType>]?
private(set) var logEventMapper: LogEventMapper?
private(set) var spanEventMapper: SpanEventMapper?
private(set) var loggingSamplingRate: Float
Expand Down Expand Up @@ -537,7 +537,7 @@ extension Datadog {
return self
}

public func trackURLSession(firstPartyHostsWithHeaderTypes: Dictionary<String, Set<TracingHeaderType>>) -> Builder {
public func trackURLSession(firstPartyHostsWithHeaderTypes: [String: Set<TracingHeaderType>]) -> Builder {
configuration.firstPartyHostsWithHeaderTypes = firstPartyHostsWithHeaderTypes
configuration.firstPartyHosts = Set(firstPartyHostsWithHeaderTypes.keys)
return self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
import Foundation

internal struct TracingHeaderTypesProvider {
private let hostsWithHeaderTypes: Dictionary<String, Set<TracingHeaderType>>
private let hostsWithHeaderTypes: [String: Set<TracingHeaderType>]
private let defaultValue: TracingHeaderType = .dd

init(
hostsWithHeaderTypes: Dictionary<String, Set<TracingHeaderType>>
hostsWithHeaderTypes: [String: Set<TracingHeaderType>]
) {
self.hostsWithHeaderTypes = hostsWithHeaderTypes
}
Expand Down
6 changes: 3 additions & 3 deletions Tests/DatadogTests/Datadog/Mocks/CoreMocks.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1121,11 +1121,11 @@ class MockHostsSanitizer: HostsSanitizing {
return hosts
}

private(set) var sanitizationsWithHeaderTypes = [(hostsWithHeaderTypes: [String : Set<TracingHeaderType>], warningMessage: String)]()
private(set) var sanitizationsWithHeaderTypes = [(hostsWithHeaderTypes: [String: Set<TracingHeaderType>], warningMessage: String)]()
func sanitized(
hostsWithHeaderTypes: [String : Set<TracingHeaderType>],
hostsWithHeaderTypes: [String: Set<TracingHeaderType>],
warningMessage: String
) -> [String : Set<TracingHeaderType>] {
) -> [String: Set<TracingHeaderType>] {
sanitizationsWithHeaderTypes.append((hostsWithHeaderTypes: hostsWithHeaderTypes, warningMessage: warningMessage))
return hostsWithHeaderTypes
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import XCTest
@testable import Datadog

class TracingHeaderTypesProviderTests: XCTestCase {
let hostsWithHeaderTypes: Dictionary<String, Set<TracingHeaderType>> = [
let hostsWithHeaderTypes: [String: Set<TracingHeaderType>] = [
"http://first-party.com/": .init(arrayLiteral: .w3c, .b3s),
"https://first-party.com/": .init(arrayLiteral: .w3c, .b3s),
"https://api.first-party.com/v2/users": .init(arrayLiteral: .w3c, .b3s),
Expand Down

0 comments on commit 8e2e35b

Please sign in to comment.