@@ -15,13 +15,16 @@ import TracingInstrumentation
15
15
16
16
extension SpanAttributeName {
17
17
/// - See: GRPCAttributes
18
- public static let gRPCMessageType = " message.type "
19
- /// - See: GRPCAttributes
20
- public static let gRPCMessageID = " message.id "
21
- /// - See: GRPCAttributes
22
- public static let gRPCMessageCompressedSize = " message.compressed_size "
23
- /// - See: GRPCAttributes
24
- public static let gRPCMessageUncompressedSize = " message.uncompressed_size "
18
+ public enum GRPC {
19
+ /// - See: GRPCAttributes
20
+ public static let messageType = " message.type "
21
+ /// - See: GRPCAttributes
22
+ public static let messageID = " message.id "
23
+ /// - See: GRPCAttributes
24
+ public static let messageCompressedSize = " message.compressed_size "
25
+ /// - See: GRPCAttributes
26
+ public static let messageUncompressedSize = " message.uncompressed_size "
27
+ }
25
28
}
26
29
27
30
#if swift(>=5.2)
@@ -52,19 +55,19 @@ public struct GRPCAttributes: SpanAttributeNamespace {
52
55
public init ( ) { }
53
56
54
57
/// The type of message, e.g. "SENT" or "RECEIVED".
55
- public var messageType : SpanAttributeKey < String > { . init( name: SpanAttributeName . gRPCMessageType ) }
58
+ public var messageType : SpanAttributeKey < String > { . init( name: SpanAttributeName . GRPC . messageType ) }
56
59
57
60
/// The message id calculated as two different counters starting from 1, one for sent messages and one for received messages.
58
- public var messageID : SpanAttributeKey < Int > { . init( name: SpanAttributeName . gRPCMessageID ) }
61
+ public var messageID : SpanAttributeKey < Int > { . init( name: SpanAttributeName . GRPC . messageID ) }
59
62
60
63
/// The compressed message size in bytes.
61
64
public var messageCompressedSize : SpanAttributeKey < Int > {
62
- . init( name: SpanAttributeName . gRPCMessageCompressedSize )
65
+ . init( name: SpanAttributeName . GRPC . messageCompressedSize )
63
66
}
64
67
65
68
/// The uncompressed message size in bytes.
66
69
public var messageUncompressedSize : SpanAttributeKey < Int > {
67
- . init( name: SpanAttributeName . gRPCMessageUncompressedSize )
70
+ . init( name: SpanAttributeName . GRPC . messageUncompressedSize )
68
71
}
69
72
}
70
73
}
0 commit comments