forked from open-telemetry/opentelemetry-swift
-
Notifications
You must be signed in to change notification settings - Fork 0
223 lines (221 loc) · 12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
// swift-tools-version:5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "opentelemetry-swift",
platforms: [
.macOS(.v10_15),
.iOS(.v13),
.tvOS(.v13),
.watchOS(.v5)
],
products: [
.library(name: "OpenTelemetryApi", type: .static, targets: ["OpenTelemetryApi"]),
.library(name: "OpenTelemetrySdk", type: .static, targets: ["OpenTelemetrySdk"]),
.library(name: "ResourceExtension", type: .static, targets: ["ResourceExtension"]),
.library(name: "URLSessionInstrumentation", type: .static, targets: ["URLSessionInstrumentation"]),
.library(name: "SignPostIntegration", type: .static, targets: ["SignPostIntegration"]),
.library(name: "OpenTracingShim-experimental", type: .static, targets: ["OpenTracingShim"]),
.library(name: "SwiftMetricsShim", type: .static, targets: ["SwiftMetricsShim"]),
.library(name: "JaegerExporter", type: .static, targets: ["JaegerExporter"]),
.library(name: "ZipkinExporter", type: .static, targets: ["ZipkinExporter"]),
.library(name: "StdoutExporter", type: .static, targets: ["StdoutExporter"]),
.library(name: "PrometheusExporter", type: .static, targets: ["PrometheusExporter"]),
.library(name: "OpenTelemetryProtocolExporter", type: .static, targets: ["OpenTelemetryProtocolExporterGrpc"]),
.library(name: "OpenTelemetryProtocolExporterHTTP", type: .static, targets: ["OpenTelemetryProtocolExporterHttp"]),
.library(name: "PersistenceExporter", type: .static, targets: ["PersistenceExporter"]),
.library(name: "InMemoryExporter", type: .static, targets: ["InMemoryExporter"]),
.library(name: "DatadogExporter", type: .static, targets: ["DatadogExporter"]),
.library(name: "NetworkStatus", type: .static, targets: ["NetworkStatus"]),
.executable(name: "simpleExporter", targets: ["SimpleExporter"]),
.executable(name: "OTLPExporter", targets: ["OTLPExporter"]),
.executable(name: "OTLPHTTPExporter", targets: ["OTLPHTTPExporter"]),
.executable(name: "loggingTracer", targets: ["LoggingTracer"])
],
dependencies: [
.package(url: "https://github.com/undefinedlabs/opentracing-objc", from: "0.5.2"),
.package(url: "https://github.com/undefinedlabs/Thrift-Swift", from: "1.1.1"),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.0.0"),
.package(url: "https://github.com/grpc/grpc-swift.git", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-protobuf.git", from: "1.20.2"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.4.4"),
.package(url: "https://github.com/apple/swift-metrics.git", from: "2.1.1"),
],
targets: [
.target(name: "OpenTelemetryApi",
dependencies: []),
.target(name: "OpenTelemetrySdk",
dependencies: ["OpenTelemetryApi"]),
.target(name: "ResourceExtension",
dependencies: ["OpenTelemetrySdk"],
path: "Sources/Instrumentation/SDKResourceExtension",
exclude: ["README.md"]),
.target(name: "URLSessionInstrumentation",
dependencies: ["OpenTelemetrySdk", "NetworkStatus"],
path: "Sources/Instrumentation/URLSession",
exclude: ["README.md"]),
.target(name: "NetworkStatus",
dependencies: [
"OpenTelemetryApi",
],
path: "Sources/Instrumentation/NetworkStatus",
linkerSettings: [.linkedFramework("CoreTelephony", .when(platforms: [.iOS], configuration: nil))]),
.target(name: "SignPostIntegration",
dependencies: ["OpenTelemetrySdk"],
path: "Sources/Instrumentation/SignPostIntegration",
exclude: ["README.md"]),
.target(name: "OpenTracingShim",
dependencies: [
"OpenTelemetrySdk",
.product(name: "Opentracing", package: "opentracing-objc")
],
path: "Sources/Importers/OpenTracingShim",
exclude: ["README.md"]),
.target(name: "SwiftMetricsShim",
dependencies: ["OpenTelemetrySdk",
.product(name: "CoreMetrics", package: "swift-metrics")],
path: "Sources/Importers/SwiftMetricsShim",
exclude: ["README.md"]),
.target(name: "JaegerExporter",
dependencies: [
"OpenTelemetrySdk",
.product(name: "Thrift", package: "Thrift-Swift", condition: .when(platforms: [.iOS, .macOS, .tvOS, .macCatalyst, .linux]))
],
path: "Sources/Exporters/Jaeger"),
.target(name: "ZipkinExporter",
dependencies: ["OpenTelemetrySdk"],
path: "Sources/Exporters/Zipkin"),
.target(name: "PrometheusExporter",
dependencies: ["OpenTelemetrySdk",
.product(name: "NIO", package: "swift-nio"),
.product(name: "NIOHTTP1", package: "swift-nio")],
path: "Sources/Exporters/Prometheus"),
.target(name: "OpenTelemetryProtocolExporterCommon",
dependencies: ["OpenTelemetrySdk",
.product(name: "Logging", package: "swift-log"),
.product(name: "SwiftProtobuf", package: "swift-protobuf")],
path: "Sources/Exporters/OpenTelemetryProtocolCommon"),
.target(name: "OpenTelemetryProtocolExporterHttp",
dependencies: ["OpenTelemetrySdk",
"OpenTelemetryProtocolExporterCommon"],
path: "Sources/Exporters/OpenTelemetryProtocolHttp"),
.target(name: "OpenTelemetryProtocolExporterGrpc",
dependencies: ["OpenTelemetrySdk",
"OpenTelemetryProtocolExporterCommon",
.product(name: "GRPC", package: "grpc-swift")],
path: "Sources/Exporters/OpenTelemetryProtocolGrpc"),
.target(name: "StdoutExporter",
dependencies: ["OpenTelemetrySdk"],
path: "Sources/Exporters/Stdout"),
.target(name: "InMemoryExporter",
dependencies: ["OpenTelemetrySdk"],
path: "Sources/Exporters/InMemory"),
.target(name: "DatadogExporter",
dependencies: ["OpenTelemetrySdk"],
path: "Sources/Exporters/DatadogExporter",
exclude: ["NOTICE", "README.md"]),
.target(name: "PersistenceExporter",
dependencies: ["OpenTelemetrySdk"],
path: "Sources/Exporters/Persistence"),
.testTarget(name: "NetworkStatusTests",
dependencies: [
"NetworkStatus",
],
path: "Tests/InstrumentationTests/NetworkStatusTests"),
.testTarget(name: "OpenTelemetryApiTests",
dependencies: ["OpenTelemetryApi"],
path: "Tests/OpenTelemetryApiTests"),
.testTarget(name: "OpenTelemetrySdkTests",
dependencies: ["OpenTelemetryApi",
"OpenTelemetrySdk"],
path: "Tests/OpenTelemetrySdkTests"),
.testTarget(name: "ResourceExtensionTests",
dependencies: ["ResourceExtension", "OpenTelemetrySdk"],
path: "Tests/InstrumentationTests/SDKResourceExtensionTests"),
.testTarget(name: "URLSessionInstrumentationTests",
dependencies: ["URLSessionInstrumentation",
.product(name: "NIO", package: "swift-nio"),
.product(name: "NIOHTTP1", package: "swift-nio")],
path: "Tests/InstrumentationTests/URLSessionTests"),
.testTarget(name: "OpenTracingShimTests",
dependencies: ["OpenTracingShim",
"OpenTelemetrySdk"],
path: "Tests/ImportersTests/OpenTracingShim"),
.testTarget(name: "SwiftMetricsShimTests",
dependencies: ["SwiftMetricsShim",
"OpenTelemetrySdk"],
path: "Tests/ImportersTests/SwiftMetricsShim"),
.testTarget(name: "JaegerExporterTests",
dependencies: ["JaegerExporter"],
path: "Tests/ExportersTests/Jaeger"),
.testTarget(name: "ZipkinExporterTests",
dependencies: ["ZipkinExporter"],
path: "Tests/ExportersTests/Zipkin"),
.testTarget(name: "PrometheusExporterTests",
dependencies: ["PrometheusExporter"],
path: "Tests/ExportersTests/Prometheus"),
.testTarget(name: "OpenTelemetryProtocolExporterTests",
dependencies: ["OpenTelemetryProtocolExporterGrpc",
"OpenTelemetryProtocolExporterHttp",
.product(name: "NIO", package: "swift-nio"),
.product(name: "NIOHTTP1", package: "swift-nio"),
.product(name: "NIOTestUtils", package: "swift-nio")],
path: "Tests/ExportersTests/OpenTelemetryProtocol"),
.testTarget(name: "InMemoryExporterTests",
dependencies: ["InMemoryExporter"],
path: "Tests/ExportersTests/InMemory"),
.testTarget(name: "DatadogExporterTests",
dependencies: ["DatadogExporter",
.product(name: "NIO", package: "swift-nio"),
.product(name: "NIOHTTP1", package: "swift-nio")],
path: "Tests/ExportersTests/DatadogExporter"),
.testTarget(name: "PersistenceExporterTests",
dependencies: ["PersistenceExporter"],
path: "Tests/ExportersTests/PersistenceExporter"),
.executableTarget(
name: "LoggingTracer",
dependencies: ["OpenTelemetryApi"],
path: "Examples/Logging Tracer"
),
.executableTarget(
name: "SimpleExporter",
dependencies: ["OpenTelemetrySdk", "JaegerExporter", "StdoutExporter", "ZipkinExporter", "ResourceExtension", "SignPostIntegration"],
path: "Examples/Simple Exporter",
exclude: ["README.md"]
),
.executableTarget(
name: "OTLPExporter",
dependencies: ["OpenTelemetrySdk", "OpenTelemetryProtocolExporterGrpc", "StdoutExporter", "ZipkinExporter", "ResourceExtension", "SignPostIntegration"],
path: "Examples/OTLP Exporter",
exclude: ["README.md"]
),
.executableTarget(
name: "OTLPHTTPExporter",
dependencies: ["OpenTelemetrySdk", "OpenTelemetryProtocolExporterHttp", "StdoutExporter", "ZipkinExporter", "ResourceExtension", "SignPostIntegration"],
path: "Examples/OTLP HTTP Exporter",
exclude: ["README.md"]
),
.executableTarget(
name: "PrometheusSample",
dependencies: ["OpenTelemetrySdk", "PrometheusExporter"],
path: "Examples/Prometheus Sample",
exclude: ["README.md"]
),
.executableTarget(
name: "DatadogSample",
dependencies: ["DatadogExporter"],
path: "Examples/Datadog Sample",
exclude: ["README.md"]
),
.executableTarget(
name: "LogsSample",
dependencies: ["OpenTelemetrySdk", "OpenTelemetryProtocolExporterGrpc", .product(name: "GRPC", package: "grpc-swift")],
path: "Examples/Logs Sample"),
.executableTarget(
name: "NetworkSample",
dependencies: ["URLSessionInstrumentation", "StdoutExporter"],
path: "Examples/Network Sample",
exclude: ["README.md"]
)
]
)