@@ -206,6 +206,48 @@ public struct Opentelemetry_Proto_Common_V1_InstrumentationScope: Sendable {
206
206
public init ( ) { }
207
207
}
208
208
209
+ /// A reference to an Entity.
210
+ /// Entity represents an object of interest associated with produced telemetry: e.g spans, metrics, profiles, or logs.
211
+ ///
212
+ /// Status: [Development]
213
+ public struct Opentelemetry_Proto_Common_V1_EntityRef : Sendable {
214
+ // SwiftProtobuf.Message conformance is added in an extension below. See the
215
+ // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
216
+ // methods supported on all messages.
217
+
218
+ /// The Schema URL, if known. This is the identifier of the Schema that the entity data
219
+ /// is recorded in. To learn more about Schema URL see
220
+ /// https://opentelemetry.io/docs/specs/otel/schemas/#schema-url
221
+ ///
222
+ /// This schema_url applies to the data in this message and to the Resource attributes
223
+ /// referenced by id_keys and description_keys.
224
+ /// TODO: discuss if we are happy with this somewhat complicated definition of what
225
+ /// the schema_url applies to.
226
+ ///
227
+ /// This field obsoletes the schema_url field in ResourceMetrics/ResourceSpans/ResourceLogs.
228
+ public var schemaURL : String = String ( )
229
+
230
+ /// Defines the type of the entity. MUST not change during the lifetime of the entity.
231
+ /// For example: "service" or "host". This field is required and MUST not be empty
232
+ /// for valid entities.
233
+ public var type : String = String ( )
234
+
235
+ /// Attribute Keys that identify the entity.
236
+ /// MUST not change during the lifetime of the entity. The Id must contain at least one attribute.
237
+ /// These keys MUST exist in the containing {message}.attributes.
238
+ public var idKeys : [ String ] = [ ]
239
+
240
+ /// Descriptive (non-identifying) attribute keys of the entity.
241
+ /// MAY change over the lifetime of the entity. MAY be empty.
242
+ /// These attribute keys are not part of entity's identity.
243
+ /// These keys MUST exist in the containing {message}.attributes.
244
+ public var descriptionKeys : [ String ] = [ ]
245
+
246
+ public var unknownFields = SwiftProtobuf . UnknownStorage ( )
247
+
248
+ public init ( ) { }
249
+ }
250
+
209
251
// MARK: - Code below here is support for the SwiftProtobuf runtime.
210
252
211
253
fileprivate let _protobuf_package = " opentelemetry.proto.common.v1 "
@@ -500,3 +542,53 @@ extension Opentelemetry_Proto_Common_V1_InstrumentationScope: SwiftProtobuf.Mess
500
542
return true
501
543
}
502
544
}
545
+
546
+ extension Opentelemetry_Proto_Common_V1_EntityRef : SwiftProtobuf . Message , SwiftProtobuf . _MessageImplementationBase , SwiftProtobuf . _ProtoNameProviding {
547
+ public static let protoMessageName : String = _protobuf_package + " .EntityRef "
548
+ public static let _protobuf_nameMap : SwiftProtobuf . _NameMap = [
549
+ 1 : . standard( proto: " schema_url " ) ,
550
+ 2 : . same( proto: " type " ) ,
551
+ 3 : . standard( proto: " id_keys " ) ,
552
+ 4 : . standard( proto: " description_keys " ) ,
553
+ ]
554
+
555
+ public mutating func decodeMessage< D: SwiftProtobuf . Decoder > ( decoder: inout D ) throws {
556
+ while let fieldNumber = try decoder. nextFieldNumber ( ) {
557
+ // The use of inline closures is to circumvent an issue where the compiler
558
+ // allocates stack space for every case branch when no optimizations are
559
+ // enabled. https://github.com/apple/swift-protobuf/issues/1034
560
+ switch fieldNumber {
561
+ case 1 : try { try decoder. decodeSingularStringField ( value: & self . schemaURL) } ( )
562
+ case 2 : try { try decoder. decodeSingularStringField ( value: & self . type) } ( )
563
+ case 3 : try { try decoder. decodeRepeatedStringField ( value: & self . idKeys) } ( )
564
+ case 4 : try { try decoder. decodeRepeatedStringField ( value: & self . descriptionKeys) } ( )
565
+ default : break
566
+ }
567
+ }
568
+ }
569
+
570
+ public func traverse< V: SwiftProtobuf . Visitor > ( visitor: inout V ) throws {
571
+ if !self . schemaURL. isEmpty {
572
+ try visitor. visitSingularStringField ( value: self . schemaURL, fieldNumber: 1 )
573
+ }
574
+ if !self . type. isEmpty {
575
+ try visitor. visitSingularStringField ( value: self . type, fieldNumber: 2 )
576
+ }
577
+ if !self . idKeys. isEmpty {
578
+ try visitor. visitRepeatedStringField ( value: self . idKeys, fieldNumber: 3 )
579
+ }
580
+ if !self . descriptionKeys. isEmpty {
581
+ try visitor. visitRepeatedStringField ( value: self . descriptionKeys, fieldNumber: 4 )
582
+ }
583
+ try unknownFields. traverse ( visitor: & visitor)
584
+ }
585
+
586
+ public static func == ( lhs: Opentelemetry_Proto_Common_V1_EntityRef , rhs: Opentelemetry_Proto_Common_V1_EntityRef ) -> Bool {
587
+ if lhs. schemaURL != rhs. schemaURL { return false }
588
+ if lhs. type != rhs. type { return false }
589
+ if lhs. idKeys != rhs. idKeys { return false }
590
+ if lhs. descriptionKeys != rhs. descriptionKeys { return false }
591
+ if lhs. unknownFields != rhs. unknownFields { return false }
592
+ return true
593
+ }
594
+ }
0 commit comments