Skip to content

Commit 28861aa

Browse files
committed
updated opentelemetry-proto to v1.5.0
1 parent 342452f commit 28861aa

14 files changed

+2539
-465
lines changed

Sources/Exporters/OpenTelemetryProtocolCommon/proto/common.pb.swift

Lines changed: 7 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// DO NOT EDIT.
22
// swift-format-ignore-file
3+
// swiftlint:disable all
34
//
45
// Generated by the Swift generator plugin for the protocol buffer compiler.
56
// Source: opentelemetry/proto/common/v1/common.proto
@@ -37,7 +38,7 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP
3738
/// AnyValue is used to represent any type of attribute value. AnyValue may contain a
3839
/// primitive value such as a string or integer or it may contain an arbitrary nested
3940
/// object containing arrays, key-value lists and primitives.
40-
public struct Opentelemetry_Proto_Common_V1_AnyValue {
41+
public struct Opentelemetry_Proto_Common_V1_AnyValue: @unchecked Sendable {
4142
// SwiftProtobuf.Message conformance is added in an extension below. See the
4243
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
4344
// methods supported on all messages.
@@ -106,7 +107,7 @@ public struct Opentelemetry_Proto_Common_V1_AnyValue {
106107

107108
/// The value is one of the listed fields. It is valid for all values to be unspecified
108109
/// in which case this AnyValue is considered to be "empty".
109-
public enum OneOf_Value: Equatable {
110+
public enum OneOf_Value: Equatable, @unchecked Sendable {
110111
case stringValue(String)
111112
case boolValue(Bool)
112113
case intValue(Int64)
@@ -115,52 +116,14 @@ public struct Opentelemetry_Proto_Common_V1_AnyValue {
115116
case kvlistValue(Opentelemetry_Proto_Common_V1_KeyValueList)
116117
case bytesValue(Data)
117118

118-
#if !swift(>=4.1)
119-
public static func ==(lhs: Opentelemetry_Proto_Common_V1_AnyValue.OneOf_Value, rhs: Opentelemetry_Proto_Common_V1_AnyValue.OneOf_Value) -> Bool {
120-
// The use of inline closures is to circumvent an issue where the compiler
121-
// allocates stack space for every case branch when no optimizations are
122-
// enabled. https://github.com/apple/swift-protobuf/issues/1034
123-
switch (lhs, rhs) {
124-
case (.stringValue, .stringValue): return {
125-
guard case .stringValue(let l) = lhs, case .stringValue(let r) = rhs else { preconditionFailure() }
126-
return l == r
127-
}()
128-
case (.boolValue, .boolValue): return {
129-
guard case .boolValue(let l) = lhs, case .boolValue(let r) = rhs else { preconditionFailure() }
130-
return l == r
131-
}()
132-
case (.intValue, .intValue): return {
133-
guard case .intValue(let l) = lhs, case .intValue(let r) = rhs else { preconditionFailure() }
134-
return l == r
135-
}()
136-
case (.doubleValue, .doubleValue): return {
137-
guard case .doubleValue(let l) = lhs, case .doubleValue(let r) = rhs else { preconditionFailure() }
138-
return l == r
139-
}()
140-
case (.arrayValue, .arrayValue): return {
141-
guard case .arrayValue(let l) = lhs, case .arrayValue(let r) = rhs else { preconditionFailure() }
142-
return l == r
143-
}()
144-
case (.kvlistValue, .kvlistValue): return {
145-
guard case .kvlistValue(let l) = lhs, case .kvlistValue(let r) = rhs else { preconditionFailure() }
146-
return l == r
147-
}()
148-
case (.bytesValue, .bytesValue): return {
149-
guard case .bytesValue(let l) = lhs, case .bytesValue(let r) = rhs else { preconditionFailure() }
150-
return l == r
151-
}()
152-
default: return false
153-
}
154-
}
155-
#endif
156119
}
157120

158121
public init() {}
159122
}
160123

161124
/// ArrayValue is a list of AnyValue messages. We need ArrayValue as a message
162125
/// since oneof in AnyValue does not allow repeated fields.
163-
public struct Opentelemetry_Proto_Common_V1_ArrayValue {
126+
public struct Opentelemetry_Proto_Common_V1_ArrayValue: Sendable {
164127
// SwiftProtobuf.Message conformance is added in an extension below. See the
165128
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
166129
// methods supported on all messages.
@@ -178,7 +141,7 @@ public struct Opentelemetry_Proto_Common_V1_ArrayValue {
178141
/// a list of KeyValue messages (e.g. in Span) we use `repeated KeyValue` directly to
179142
/// avoid unnecessary extra wrapping (which slows down the protocol). The 2 approaches
180143
/// are semantically equivalent.
181-
public struct Opentelemetry_Proto_Common_V1_KeyValueList {
144+
public struct Opentelemetry_Proto_Common_V1_KeyValueList: Sendable {
182145
// SwiftProtobuf.Message conformance is added in an extension below. See the
183146
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
184147
// methods supported on all messages.
@@ -196,7 +159,7 @@ public struct Opentelemetry_Proto_Common_V1_KeyValueList {
196159

197160
/// KeyValue is a key-value pair that is used to store Span attributes, Link
198161
/// attributes, etc.
199-
public struct Opentelemetry_Proto_Common_V1_KeyValue {
162+
public struct Opentelemetry_Proto_Common_V1_KeyValue: Sendable {
200163
// SwiftProtobuf.Message conformance is added in an extension below. See the
201164
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
202165
// methods supported on all messages.
@@ -221,7 +184,7 @@ public struct Opentelemetry_Proto_Common_V1_KeyValue {
221184

222185
/// InstrumentationScope is a message representing the instrumentation scope information
223186
/// such as the fully qualified name and version.
224-
public struct Opentelemetry_Proto_Common_V1_InstrumentationScope {
187+
public struct Opentelemetry_Proto_Common_V1_InstrumentationScope: Sendable {
225188
// SwiftProtobuf.Message conformance is added in an extension below. See the
226189
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
227190
// methods supported on all messages.
@@ -243,15 +206,6 @@ public struct Opentelemetry_Proto_Common_V1_InstrumentationScope {
243206
public init() {}
244207
}
245208

246-
#if swift(>=5.5) && canImport(_Concurrency)
247-
extension Opentelemetry_Proto_Common_V1_AnyValue: @unchecked Sendable {}
248-
extension Opentelemetry_Proto_Common_V1_AnyValue.OneOf_Value: @unchecked Sendable {}
249-
extension Opentelemetry_Proto_Common_V1_ArrayValue: @unchecked Sendable {}
250-
extension Opentelemetry_Proto_Common_V1_KeyValueList: @unchecked Sendable {}
251-
extension Opentelemetry_Proto_Common_V1_KeyValue: @unchecked Sendable {}
252-
extension Opentelemetry_Proto_Common_V1_InstrumentationScope: @unchecked Sendable {}
253-
#endif // swift(>=5.5) && canImport(_Concurrency)
254-
255209
// MARK: - Code below here is support for the SwiftProtobuf runtime.
256210

257211
fileprivate let _protobuf_package = "opentelemetry.proto.common.v1"

Sources/Exporters/OpenTelemetryProtocolCommon/proto/logs.pb.swift

Lines changed: 44 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// DO NOT EDIT.
22
// swift-format-ignore-file
3+
// swiftlint:disable all
34
//
45
// Generated by the Swift generator plugin for the protocol buffer compiler.
56
// Source: opentelemetry/proto/logs/v1/logs.proto
@@ -35,7 +36,7 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP
3536
}
3637

3738
/// Possible values for LogRecord.SeverityNumber.
38-
public enum Opentelemetry_Proto_Logs_V1_SeverityNumber: SwiftProtobuf.Enum {
39+
public enum Opentelemetry_Proto_Logs_V1_SeverityNumber: SwiftProtobuf.Enum, Swift.CaseIterable {
3940
public typealias RawValue = Int
4041

4142
/// UNSPECIFIED is the default SeverityNumber, it MUST NOT be used.
@@ -132,13 +133,8 @@ public enum Opentelemetry_Proto_Logs_V1_SeverityNumber: SwiftProtobuf.Enum {
132133
}
133134
}
134135

135-
}
136-
137-
#if swift(>=4.2)
138-
139-
extension Opentelemetry_Proto_Logs_V1_SeverityNumber: CaseIterable {
140136
// The compiler won't synthesize support with the UNRECOGNIZED case.
141-
public static var allCases: [Opentelemetry_Proto_Logs_V1_SeverityNumber] = [
137+
public static let allCases: [Opentelemetry_Proto_Logs_V1_SeverityNumber] = [
142138
.unspecified,
143139
.trace,
144140
.trace2,
@@ -165,16 +161,17 @@ extension Opentelemetry_Proto_Logs_V1_SeverityNumber: CaseIterable {
165161
.fatal3,
166162
.fatal4,
167163
]
168-
}
169164

170-
#endif // swift(>=4.2)
165+
}
171166

172-
/// LogRecordFlags is defined as a protobuf 'uint32' type and is to be used as
173-
/// bit-fields. Each non-zero value defined in this enum is a bit-mask.
174-
/// To extract the bit-field, for example, use an expression like:
167+
/// LogRecordFlags represents constants used to interpret the
168+
/// LogRecord.flags field, which is protobuf 'fixed32' type and is to
169+
/// be used as bit-fields. Each non-zero value defined in this enum is
170+
/// a bit-mask. To extract the bit-field, for example, use an
171+
/// expression like:
175172
///
176173
/// (logRecord.flags & LOG_RECORD_FLAGS_TRACE_FLAGS_MASK)
177-
public enum Opentelemetry_Proto_Logs_V1_LogRecordFlags: SwiftProtobuf.Enum {
174+
public enum Opentelemetry_Proto_Logs_V1_LogRecordFlags: SwiftProtobuf.Enum, Swift.CaseIterable {
178175
public typealias RawValue = Int
179176

180177
/// The zero value for the enum. Should not be used for comparisons.
@@ -205,19 +202,13 @@ public enum Opentelemetry_Proto_Logs_V1_LogRecordFlags: SwiftProtobuf.Enum {
205202
}
206203
}
207204

208-
}
209-
210-
#if swift(>=4.2)
211-
212-
extension Opentelemetry_Proto_Logs_V1_LogRecordFlags: CaseIterable {
213205
// The compiler won't synthesize support with the UNRECOGNIZED case.
214-
public static var allCases: [Opentelemetry_Proto_Logs_V1_LogRecordFlags] = [
206+
public static let allCases: [Opentelemetry_Proto_Logs_V1_LogRecordFlags] = [
215207
.doNotUse,
216208
.traceFlagsMask,
217209
]
218-
}
219210

220-
#endif // swift(>=4.2)
211+
}
221212

222213
/// LogsData represents the logs data that can be stored in a persistent storage,
223214
/// OR can be embedded by other protocols that transfer OTLP logs data but do not
@@ -229,7 +220,7 @@ extension Opentelemetry_Proto_Logs_V1_LogRecordFlags: CaseIterable {
229220
///
230221
/// When new fields are added into this message, the OTLP request MUST be updated
231222
/// as well.
232-
public struct Opentelemetry_Proto_Logs_V1_LogsData {
223+
public struct Opentelemetry_Proto_Logs_V1_LogsData: Sendable {
233224
// SwiftProtobuf.Message conformance is added in an extension below. See the
234225
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
235226
// methods supported on all messages.
@@ -247,7 +238,7 @@ public struct Opentelemetry_Proto_Logs_V1_LogsData {
247238
}
248239

249240
/// A collection of ScopeLogs from a Resource.
250-
public struct Opentelemetry_Proto_Logs_V1_ResourceLogs {
241+
public struct Opentelemetry_Proto_Logs_V1_ResourceLogs: Sendable {
251242
// SwiftProtobuf.Message conformance is added in an extension below. See the
252243
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
253244
// methods supported on all messages.
@@ -266,6 +257,10 @@ public struct Opentelemetry_Proto_Logs_V1_ResourceLogs {
266257
/// A list of ScopeLogs that originate from a resource.
267258
public var scopeLogs: [Opentelemetry_Proto_Logs_V1_ScopeLogs] = []
268259

260+
/// The Schema URL, if known. This is the identifier of the Schema that the resource data
261+
/// is recorded in. Notably, the last part of the URL path is the version number of the
262+
/// schema: http[s]://server[:port]/path/<version>. To learn more about Schema URL see
263+
/// https://opentelemetry.io/docs/specs/otel/schemas/#schema-url
269264
/// This schema_url applies to the data in the "resource" field. It does not apply
270265
/// to the data in the "scope_logs" field which have their own schema_url field.
271266
public var schemaURL: String = String()
@@ -278,7 +273,7 @@ public struct Opentelemetry_Proto_Logs_V1_ResourceLogs {
278273
}
279274

280275
/// A collection of Logs produced by a Scope.
281-
public struct Opentelemetry_Proto_Logs_V1_ScopeLogs {
276+
public struct Opentelemetry_Proto_Logs_V1_ScopeLogs: Sendable {
282277
// SwiftProtobuf.Message conformance is added in an extension below. See the
283278
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
284279
// methods supported on all messages.
@@ -298,6 +293,10 @@ public struct Opentelemetry_Proto_Logs_V1_ScopeLogs {
298293
/// A list of log records.
299294
public var logRecords: [Opentelemetry_Proto_Logs_V1_LogRecord] = []
300295

296+
/// The Schema URL, if known. This is the identifier of the Schema that the log data
297+
/// is recorded in. Notably, the last part of the URL path is the version number of the
298+
/// schema: http[s]://server[:port]/path/<version>. To learn more about Schema URL see
299+
/// https://opentelemetry.io/docs/specs/otel/schemas/#schema-url
301300
/// This schema_url applies to all logs in the "logs" field.
302301
public var schemaURL: String = String()
303302

@@ -310,7 +309,7 @@ public struct Opentelemetry_Proto_Logs_V1_ScopeLogs {
310309

311310
/// A log record according to OpenTelemetry Log Data Model:
312311
/// https://github.com/open-telemetry/oteps/blob/main/text/logs/0097-log-data-model.md
313-
public struct Opentelemetry_Proto_Logs_V1_LogRecord {
312+
public struct Opentelemetry_Proto_Logs_V1_LogRecord: @unchecked Sendable {
314313
// SwiftProtobuf.Message conformance is added in an extension below. See the
315314
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
316315
// methods supported on all messages.
@@ -398,22 +397,27 @@ public struct Opentelemetry_Proto_Logs_V1_LogRecord {
398397
/// - the field contains an invalid value.
399398
public var spanID: Data = Data()
400399

400+
/// A unique identifier of event category/type.
401+
/// All events with the same event_name are expected to conform to the same
402+
/// schema for both their attributes and their body.
403+
///
404+
/// Recommended to be fully qualified and short (no longer than 256 characters).
405+
///
406+
/// Presence of event_name on the log record identifies this record
407+
/// as an event.
408+
///
409+
/// [Optional].
410+
///
411+
/// Status: [Development]
412+
public var eventName: String = String()
413+
401414
public var unknownFields = SwiftProtobuf.UnknownStorage()
402415

403416
public init() {}
404417

405418
fileprivate var _body: Opentelemetry_Proto_Common_V1_AnyValue? = nil
406419
}
407420

408-
#if swift(>=5.5) && canImport(_Concurrency)
409-
extension Opentelemetry_Proto_Logs_V1_SeverityNumber: @unchecked Sendable {}
410-
extension Opentelemetry_Proto_Logs_V1_LogRecordFlags: @unchecked Sendable {}
411-
extension Opentelemetry_Proto_Logs_V1_LogsData: @unchecked Sendable {}
412-
extension Opentelemetry_Proto_Logs_V1_ResourceLogs: @unchecked Sendable {}
413-
extension Opentelemetry_Proto_Logs_V1_ScopeLogs: @unchecked Sendable {}
414-
extension Opentelemetry_Proto_Logs_V1_LogRecord: @unchecked Sendable {}
415-
#endif // swift(>=5.5) && canImport(_Concurrency)
416-
417421
// MARK: - Code below here is support for the SwiftProtobuf runtime.
418422

419423
fileprivate let _protobuf_package = "opentelemetry.proto.logs.v1"
@@ -596,6 +600,7 @@ extension Opentelemetry_Proto_Logs_V1_LogRecord: SwiftProtobuf.Message, SwiftPro
596600
8: .same(proto: "flags"),
597601
9: .standard(proto: "trace_id"),
598602
10: .standard(proto: "span_id"),
603+
12: .standard(proto: "event_name"),
599604
]
600605

601606
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
@@ -614,6 +619,7 @@ extension Opentelemetry_Proto_Logs_V1_LogRecord: SwiftProtobuf.Message, SwiftPro
614619
case 9: try { try decoder.decodeSingularBytesField(value: &self.traceID) }()
615620
case 10: try { try decoder.decodeSingularBytesField(value: &self.spanID) }()
616621
case 11: try { try decoder.decodeSingularFixed64Field(value: &self.observedTimeUnixNano) }()
622+
case 12: try { try decoder.decodeSingularStringField(value: &self.eventName) }()
617623
default: break
618624
}
619625
}
@@ -654,6 +660,9 @@ extension Opentelemetry_Proto_Logs_V1_LogRecord: SwiftProtobuf.Message, SwiftPro
654660
if self.observedTimeUnixNano != 0 {
655661
try visitor.visitSingularFixed64Field(value: self.observedTimeUnixNano, fieldNumber: 11)
656662
}
663+
if !self.eventName.isEmpty {
664+
try visitor.visitSingularStringField(value: self.eventName, fieldNumber: 12)
665+
}
657666
try unknownFields.traverse(visitor: &visitor)
658667
}
659668

@@ -668,6 +677,7 @@ extension Opentelemetry_Proto_Logs_V1_LogRecord: SwiftProtobuf.Message, SwiftPro
668677
if lhs.flags != rhs.flags {return false}
669678
if lhs.traceID != rhs.traceID {return false}
670679
if lhs.spanID != rhs.spanID {return false}
680+
if lhs.eventName != rhs.eventName {return false}
671681
if lhs.unknownFields != rhs.unknownFields {return false}
672682
return true
673683
}

Sources/Exporters/OpenTelemetryProtocolCommon/proto/logs_service.pb.swift

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// DO NOT EDIT.
22
// swift-format-ignore-file
3+
// swiftlint:disable all
34
//
45
// Generated by the Swift generator plugin for the protocol buffer compiler.
56
// Source: opentelemetry/proto/collector/logs/v1/logs_service.proto
@@ -21,7 +22,6 @@
2122
// See the License for the specific language governing permissions and
2223
// limitations under the License.
2324

24-
import Foundation
2525
import SwiftProtobuf
2626

2727
// If the compiler emits an error on this type, it is because this file
@@ -34,7 +34,7 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP
3434
typealias Version = _2
3535
}
3636

37-
public struct Opentelemetry_Proto_Collector_Logs_V1_ExportLogsServiceRequest {
37+
public struct Opentelemetry_Proto_Collector_Logs_V1_ExportLogsServiceRequest: Sendable {
3838
// SwiftProtobuf.Message conformance is added in an extension below. See the
3939
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
4040
// methods supported on all messages.
@@ -51,7 +51,7 @@ public struct Opentelemetry_Proto_Collector_Logs_V1_ExportLogsServiceRequest {
5151
public init() {}
5252
}
5353

54-
public struct Opentelemetry_Proto_Collector_Logs_V1_ExportLogsServiceResponse {
54+
public struct Opentelemetry_Proto_Collector_Logs_V1_ExportLogsServiceResponse: Sendable {
5555
// SwiftProtobuf.Message conformance is added in an extension below. See the
5656
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
5757
// methods supported on all messages.
@@ -87,7 +87,7 @@ public struct Opentelemetry_Proto_Collector_Logs_V1_ExportLogsServiceResponse {
8787
fileprivate var _partialSuccess: Opentelemetry_Proto_Collector_Logs_V1_ExportLogsPartialSuccess? = nil
8888
}
8989

90-
public struct Opentelemetry_Proto_Collector_Logs_V1_ExportLogsPartialSuccess {
90+
public struct Opentelemetry_Proto_Collector_Logs_V1_ExportLogsPartialSuccess: Sendable {
9191
// SwiftProtobuf.Message conformance is added in an extension below. See the
9292
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
9393
// methods supported on all messages.
@@ -112,12 +112,6 @@ public struct Opentelemetry_Proto_Collector_Logs_V1_ExportLogsPartialSuccess {
112112
public init() {}
113113
}
114114

115-
#if swift(>=5.5) && canImport(_Concurrency)
116-
extension Opentelemetry_Proto_Collector_Logs_V1_ExportLogsServiceRequest: @unchecked Sendable {}
117-
extension Opentelemetry_Proto_Collector_Logs_V1_ExportLogsServiceResponse: @unchecked Sendable {}
118-
extension Opentelemetry_Proto_Collector_Logs_V1_ExportLogsPartialSuccess: @unchecked Sendable {}
119-
#endif // swift(>=5.5) && canImport(_Concurrency)
120-
121115
// MARK: - Code below here is support for the SwiftProtobuf runtime.
122116

123117
fileprivate let _protobuf_package = "opentelemetry.proto.collector.logs.v1"

0 commit comments

Comments
 (0)