Skip to content

Commit

Permalink
updated Lock -> NIOLock
Browse files Browse the repository at this point in the history
  • Loading branch information
bryce-b committed Dec 19, 2023
1 parent 79cc70e commit dd146f4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import Foundation
import OpenTelemetrySdk
import OpenTelemetryProtocolExporterCommon
import NIO

Check failure on line 9 in Sources/Exporters/OpenTelemetryProtocolHttp/logs/OtlpHttpLogExporter.swift

View workflow job for this annotation

GitHub Actions / tvOS

no such module 'NIO'

Check failure on line 9 in Sources/Exporters/OpenTelemetryProtocolHttp/logs/OtlpHttpLogExporter.swift

View workflow job for this annotation

GitHub Actions / tvOS

no such module 'NIO'

Check failure on line 9 in Sources/Exporters/OpenTelemetryProtocolHttp/logs/OtlpHttpLogExporter.swift

View workflow job for this annotation

GitHub Actions / watchOS

no such module 'NIO'

Check failure on line 9 in Sources/Exporters/OpenTelemetryProtocolHttp/logs/OtlpHttpLogExporter.swift

View workflow job for this annotation

GitHub Actions / iOS

no such module 'NIO'

Check failure on line 9 in Sources/Exporters/OpenTelemetryProtocolHttp/logs/OtlpHttpLogExporter.swift

View workflow job for this annotation

GitHub Actions / watchOS

no such module 'NIO'

Check failure on line 9 in Sources/Exporters/OpenTelemetryProtocolHttp/logs/OtlpHttpLogExporter.swift

View workflow job for this annotation

GitHub Actions / iOS

no such module 'NIO'
import NIOConcurrencyHelpers

public func defaultOltpHttpLoggingEndpoint() -> URL {
Expand All @@ -15,7 +16,7 @@ public func defaultOltpHttpLoggingEndpoint() -> URL {
public class OtlpHttpLogExporter : OtlpHttpExporterBase, LogRecordExporter {

var pendingLogRecords: [ReadableLogRecord] = []
private let exporterLock = Lock()
private let exporterLock = NIOLock()
override public init(endpoint: URL = defaultOltpHttpLoggingEndpoint(),
config: OtlpConfiguration = OtlpConfiguration(),
useSession: URLSession? = nil,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import OpenTelemetrySdk
import OpenTelemetryProtocolExporterCommon
import Foundation
import NIO
import NIOConcurrencyHelpers


Expand All @@ -15,7 +16,7 @@ public func defaultOltpHTTPMetricsEndpoint() -> URL {

public class OtlpHttpMetricExporter: OtlpHttpExporterBase, MetricExporter {
var pendingMetrics: [Metric] = []
private let exporterLock = Lock()
private let exporterLock = NIOLock()

override
public init(endpoint: URL = defaultOltpHTTPMetricsEndpoint(), config : OtlpConfiguration = OtlpConfiguration(), useSession: URLSession? = nil, envVarHeaders: [(String,String)]? = EnvVarHeaders.attributes) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import Foundation
import OpenTelemetrySdk
import OpenTelemetryProtocolExporterCommon
import NIO
import NIOConcurrencyHelpers

public func defaultStableOtlpHTTPMetricsEndpoint() -> URL {
Expand All @@ -17,7 +18,7 @@ public class StableOtlpHTTPMetricExporter: StableOtlpHTTPExporterBase, StableMet
var defaultAggregationSelector: DefaultAggregationSelector

var pendingMetrics: [StableMetricData] = []
private let exporterLock = Lock()
private let exporterLock = NIOLock()

// MARK: - Init

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import Foundation
import OpenTelemetrySdk
import OpenTelemetryProtocolExporterCommon
import NIO
import NIOConcurrencyHelpers

public func defaultOltpHttpTracesEndpoint() -> URL {
Expand All @@ -16,7 +17,7 @@ public class OtlpHttpTraceExporter: OtlpHttpExporterBase, SpanExporter {


var pendingSpans: [SpanData] = []
private let exporterLock = Lock()
private let exporterLock = NIOLock()
override
public init(endpoint: URL = defaultOltpHttpTracesEndpoint(), config: OtlpConfiguration = OtlpConfiguration(),
useSession: URLSession? = nil, envVarHeaders: [(String,String)]? = EnvVarHeaders.attributes) {
Expand Down

0 comments on commit dd146f4

Please sign in to comment.