@@ -133,6 +133,17 @@ public interface IAttributeDefinitions
133
133
AttributeDefinition < TypeAttributeValue , string > GetTypeAttribute ( TypeAttributeValue destination ) ;
134
134
135
135
AttributeDefinition < bool , bool > LlmTransaction { get ; }
136
+
137
+ AttributeDefinition < string , string > CloudAccountId { get ; }
138
+ AttributeDefinition < string , string > CloudRegion { get ; }
139
+ AttributeDefinition < string , string > MessagingSystemName { get ; }
140
+ AttributeDefinition < string , string > MessagingDestinationName { get ; }
141
+ AttributeDefinition < string , string > BrokerServerAddress { get ; }
142
+ AttributeDefinition < int , int > BrokerServerPort { get ; }
143
+ AttributeDefinition < string , string > MessageQueueName { get ; }
144
+ AttributeDefinition < string , string > MessageRoutingKey { get ; }
145
+ AttributeDefinition < string , string > MessagingRabbitMqDestinationRoutingKey { get ; }
146
+ AttributeDefinition < string , string > MessagingDestinationPublishName { get ; }
136
147
}
137
148
138
149
@@ -177,7 +188,7 @@ public AttributeDefinitions(IAttributeFilter attribFilter)
177
188
private readonly ConcurrentDictionary < string , AttributeDefinition < string , string > > _requestParameterAttributes = new ConcurrentDictionary < string , AttributeDefinition < string , string > > ( ) ;
178
189
private readonly ConcurrentDictionary < string , AttributeDefinition < string , string > > _requestHeadersAttributes = new ConcurrentDictionary < string , AttributeDefinition < string , string > > ( ) ;
179
190
private readonly ConcurrentDictionary < string , AttributeDefinition < object , object > > _lambdaAttributes = new ConcurrentDictionary < string , AttributeDefinition < object , object > > ( ) ;
180
-
191
+
181
192
private readonly ConcurrentDictionary < TypeAttributeValue , AttributeDefinition < TypeAttributeValue , string > > _typeAttributes = new ConcurrentDictionary < TypeAttributeValue , AttributeDefinition < TypeAttributeValue , string > > ( ) ;
182
193
183
194
@@ -1079,5 +1090,73 @@ private static string IgnoreEmptyAndWhitespaceErrorGroupValues(string errorGroup
1079
1090
. AppliesTo ( AttributeDestinations . TransactionEvent )
1080
1091
. AppliesTo ( AttributeDestinations . TransactionTrace )
1081
1092
. Build ( _attribFilter ) ) ;
1093
+
1094
+ private AttributeDefinition < string , string > _cloudAccountId ;
1095
+ public AttributeDefinition < string , string > CloudAccountId => _cloudAccountId ?? ( _cloudAccountId =
1096
+ AttributeDefinitionBuilder . CreateString ( "cloud.account.id" , AttributeClassification . AgentAttributes )
1097
+ . AppliesTo ( AttributeDestinations . SpanEvent )
1098
+ . AppliesTo ( AttributeDestinations . TransactionTrace )
1099
+ . Build ( _attribFilter ) ) ;
1100
+
1101
+ private AttributeDefinition < string , string > _cloudRegion ;
1102
+ public AttributeDefinition < string , string > CloudRegion => _cloudRegion ?? ( _cloudRegion =
1103
+ AttributeDefinitionBuilder . CreateString ( "cloud.region" , AttributeClassification . AgentAttributes )
1104
+ . AppliesTo ( AttributeDestinations . SpanEvent )
1105
+ . AppliesTo ( AttributeDestinations . TransactionTrace )
1106
+ . Build ( _attribFilter ) ) ;
1107
+
1108
+ private AttributeDefinition < string , string > _messagingSystem ;
1109
+ public AttributeDefinition < string , string > MessagingSystemName => _messagingSystem ?? ( _messagingSystem =
1110
+ AttributeDefinitionBuilder . CreateString ( "messaging.system" , AttributeClassification . AgentAttributes )
1111
+ . AppliesTo ( AttributeDestinations . SpanEvent )
1112
+ . AppliesTo ( AttributeDestinations . TransactionTrace )
1113
+ . Build ( _attribFilter ) ) ;
1114
+
1115
+ private AttributeDefinition < string , string > _messagingDestinationName ;
1116
+ public AttributeDefinition < string , string > MessagingDestinationName => _messagingDestinationName ?? ( _messagingDestinationName =
1117
+ AttributeDefinitionBuilder . CreateString ( "messaging.destination.name" , AttributeClassification . AgentAttributes )
1118
+ . AppliesTo ( AttributeDestinations . SpanEvent )
1119
+ . AppliesTo ( AttributeDestinations . TransactionTrace )
1120
+ . Build ( _attribFilter ) ) ;
1121
+
1122
+ // new attribute for MessageBrokers - same name as the Externals attribute, but in Agent attributes.
1123
+ // From messaging api spec.
1124
+ private AttributeDefinition < string , string > _brokerServerAddress ;
1125
+ public AttributeDefinition < string , string > BrokerServerAddress => _brokerServerAddress ?? ( _brokerServerAddress =
1126
+ AttributeDefinitionBuilder . CreateString ( "server.address" , AttributeClassification . AgentAttributes )
1127
+ . AppliesTo ( AttributeDestinations . SpanEvent )
1128
+ . AppliesTo ( AttributeDestinations . TransactionTrace )
1129
+ . Build ( _attribFilter ) ) ;
1130
+
1131
+ private AttributeDefinition < int , int > _brokerServerPort ;
1132
+ public AttributeDefinition < int , int > BrokerServerPort => _brokerServerPort ?? ( _brokerServerPort =
1133
+ AttributeDefinitionBuilder . CreateInt ( "server.port" , AttributeClassification . AgentAttributes )
1134
+ . AppliesTo ( AttributeDestinations . SpanEvent )
1135
+ . AppliesTo ( AttributeDestinations . TransactionTrace )
1136
+ . Build ( _attribFilter ) ) ;
1137
+
1138
+ private AttributeDefinition < string , string > _messageQueueName ;
1139
+ public AttributeDefinition < string , string > MessageQueueName => _messageQueueName ?? ( _messageQueueName =
1140
+ AttributeDefinitionBuilder . CreateString ( "message.queueName" , AttributeClassification . AgentAttributes )
1141
+ . AppliesTo ( AttributeDestinations . All )
1142
+ . Build ( _attribFilter ) ) ;
1143
+
1144
+ private AttributeDefinition < string , string > _messageRoutingKey ;
1145
+ public AttributeDefinition < string , string > MessageRoutingKey => _messageRoutingKey ?? ( _messageRoutingKey =
1146
+ AttributeDefinitionBuilder . CreateString ( "message.routingKey" , AttributeClassification . AgentAttributes )
1147
+ . AppliesTo ( AttributeDestinations . All )
1148
+ . Build ( _attribFilter ) ) ;
1149
+
1150
+ private AttributeDefinition < string , string > _messagingRabbitMqDestinationRoutingKey ;
1151
+ public AttributeDefinition < string , string > MessagingRabbitMqDestinationRoutingKey => _messagingRabbitMqDestinationRoutingKey ?? ( _messagingRabbitMqDestinationRoutingKey =
1152
+ AttributeDefinitionBuilder . CreateString ( "messaging.rabbitmq.destination.routing_key" , AttributeClassification . AgentAttributes )
1153
+ . AppliesTo ( AttributeDestinations . SpanEvent )
1154
+ . Build ( _attribFilter ) ) ;
1155
+
1156
+ private AttributeDefinition < string , string > _messagingDestinationPublishName ;
1157
+ public AttributeDefinition < string , string > MessagingDestinationPublishName => _messagingDestinationPublishName ?? ( _messagingDestinationPublishName =
1158
+ AttributeDefinitionBuilder . CreateString ( "messaging.destination_publish.name" , AttributeClassification . AgentAttributes )
1159
+ . AppliesTo ( AttributeDestinations . SpanEvent )
1160
+ . Build ( _attribFilter ) ) ;
1082
1161
}
1083
1162
}
0 commit comments