messaging_attributes.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  1. /*
  2. * Copyright The OpenTelemetry Authors
  3. * SPDX-License-Identifier: Apache-2.0
  4. */
  5. /*
  6. * DO NOT EDIT, this is an Auto-generated file from:
  7. * buildscripts/semantic-convention/templates/registry/semantic_attributes-h.j2
  8. */
  9. #pragma once
  10. #include "opentelemetry/common/macros.h"
  11. #include "opentelemetry/version.h"
  12. OPENTELEMETRY_BEGIN_NAMESPACE
  13. namespace semconv
  14. {
  15. namespace messaging
  16. {
  17. /**
  18. The number of messages sent, received, or processed in the scope of the batching operation.
  19. <p>
  20. Instrumentations SHOULD NOT set @code messaging.batch.message_count @endcode on spans that operate
  21. with a single message. When a messaging client library supports both batch and single-message API
  22. for the same operation, instrumentations SHOULD use @code messaging.batch.message_count @endcode
  23. for batching APIs and SHOULD NOT use it for single-message APIs.
  24. */
  25. static constexpr const char *kMessagingBatchMessageCount = "messaging.batch.message_count";
  26. /**
  27. A unique identifier for the client that consumes or produces a message.
  28. */
  29. static constexpr const char *kMessagingClientId = "messaging.client.id";
  30. /**
  31. The name of the consumer group with which a consumer is associated.
  32. <p>
  33. Semantic conventions for individual messaging systems SHOULD document whether @code
  34. messaging.consumer.group.name @endcode is applicable and what it means in the context of that
  35. system.
  36. */
  37. static constexpr const char *kMessagingConsumerGroupName = "messaging.consumer.group.name";
  38. /**
  39. A boolean that is true if the message destination is anonymous (could be unnamed or have
  40. auto-generated name).
  41. */
  42. static constexpr const char *kMessagingDestinationAnonymous = "messaging.destination.anonymous";
  43. /**
  44. The message destination name
  45. <p>
  46. Destination name SHOULD uniquely identify a specific queue, topic or other entity within the
  47. broker. If the broker doesn't have such notion, the destination name SHOULD uniquely identify the
  48. broker.
  49. */
  50. static constexpr const char *kMessagingDestinationName = "messaging.destination.name";
  51. /**
  52. The identifier of the partition messages are sent to or received from, unique within the @code
  53. messaging.destination.name @endcode.
  54. */
  55. static constexpr const char *kMessagingDestinationPartitionId =
  56. "messaging.destination.partition.id";
  57. /**
  58. The name of the destination subscription from which a message is consumed.
  59. <p>
  60. Semantic conventions for individual messaging systems SHOULD document whether @code
  61. messaging.destination.subscription.name @endcode is applicable and what it means in the context of
  62. that system.
  63. */
  64. static constexpr const char *kMessagingDestinationSubscriptionName =
  65. "messaging.destination.subscription.name";
  66. /**
  67. Low cardinality representation of the messaging destination name
  68. <p>
  69. Destination names could be constructed from templates. An example would be a destination name
  70. involving a user name or product id. Although the destination name in this case is of high
  71. cardinality, the underlying template is of low cardinality and can be effectively used for
  72. grouping and aggregation.
  73. */
  74. static constexpr const char *kMessagingDestinationTemplate = "messaging.destination.template";
  75. /**
  76. A boolean that is true if the message destination is temporary and might not exist anymore after
  77. messages are processed.
  78. */
  79. static constexpr const char *kMessagingDestinationTemporary = "messaging.destination.temporary";
  80. /**
  81. Deprecated, no replacement at this time.
  82. @deprecated
  83. {"note": "Removed. No replacement at this time.", "reason": "obsoleted"}
  84. */
  85. OPENTELEMETRY_DEPRECATED static constexpr const char *kMessagingDestinationPublishAnonymous =
  86. "messaging.destination_publish.anonymous";
  87. /**
  88. Deprecated, no replacement at this time.
  89. @deprecated
  90. {"note": "Removed. No replacement at this time.", "reason": "obsoleted"}
  91. */
  92. OPENTELEMETRY_DEPRECATED static constexpr const char *kMessagingDestinationPublishName =
  93. "messaging.destination_publish.name";
  94. /**
  95. Deprecated, use @code messaging.consumer.group.name @endcode instead.
  96. @deprecated
  97. {"note": "Replaced by @code messaging.consumer.group.name @endcode.", "reason": "renamed",
  98. "renamed_to": "messaging.consumer.group.name"}
  99. */
  100. OPENTELEMETRY_DEPRECATED static constexpr const char *kMessagingEventhubsConsumerGroup =
  101. "messaging.eventhubs.consumer.group";
  102. /**
  103. The UTC epoch seconds at which the message has been accepted and stored in the entity.
  104. */
  105. static constexpr const char *kMessagingEventhubsMessageEnqueuedTime =
  106. "messaging.eventhubs.message.enqueued_time";
  107. /**
  108. The ack deadline in seconds set for the modify ack deadline request.
  109. */
  110. static constexpr const char *kMessagingGcpPubsubMessageAckDeadline =
  111. "messaging.gcp_pubsub.message.ack_deadline";
  112. /**
  113. The ack id for a given message.
  114. */
  115. static constexpr const char *kMessagingGcpPubsubMessageAckId =
  116. "messaging.gcp_pubsub.message.ack_id";
  117. /**
  118. The delivery attempt for a given message.
  119. */
  120. static constexpr const char *kMessagingGcpPubsubMessageDeliveryAttempt =
  121. "messaging.gcp_pubsub.message.delivery_attempt";
  122. /**
  123. The ordering key for a given message. If the attribute is not present, the message does not have
  124. an ordering key.
  125. */
  126. static constexpr const char *kMessagingGcpPubsubMessageOrderingKey =
  127. "messaging.gcp_pubsub.message.ordering_key";
  128. /**
  129. Deprecated, use @code messaging.consumer.group.name @endcode instead.
  130. @deprecated
  131. {"note": "Replaced by @code messaging.consumer.group.name @endcode.", "reason": "renamed",
  132. "renamed_to": "messaging.consumer.group.name"}
  133. */
  134. OPENTELEMETRY_DEPRECATED static constexpr const char *kMessagingKafkaConsumerGroup =
  135. "messaging.kafka.consumer.group";
  136. /**
  137. Deprecated, use @code messaging.destination.partition.id @endcode instead.
  138. @deprecated
  139. {"note": "Replaced by @code messaging.destination.partition.id @endcode.", "reason": "renamed",
  140. "renamed_to": "messaging.destination.partition.id"}
  141. */
  142. OPENTELEMETRY_DEPRECATED static constexpr const char *kMessagingKafkaDestinationPartition =
  143. "messaging.kafka.destination.partition";
  144. /**
  145. Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same
  146. partition. They differ from @code messaging.message.id @endcode in that they're not unique. If the
  147. key is @code null @endcode, the attribute MUST NOT be set. <p> If the key type is not string, it's
  148. string representation has to be supplied for the attribute. If the key has no unambiguous,
  149. canonical string form, don't include its value.
  150. */
  151. static constexpr const char *kMessagingKafkaMessageKey = "messaging.kafka.message.key";
  152. /**
  153. Deprecated, use @code messaging.kafka.offset @endcode instead.
  154. @deprecated
  155. {"note": "Replaced by @code messaging.kafka.offset @endcode.", "reason": "renamed", "renamed_to":
  156. "messaging.kafka.offset"}
  157. */
  158. OPENTELEMETRY_DEPRECATED static constexpr const char *kMessagingKafkaMessageOffset =
  159. "messaging.kafka.message.offset";
  160. /**
  161. A boolean that is true if the message is a tombstone.
  162. */
  163. static constexpr const char *kMessagingKafkaMessageTombstone = "messaging.kafka.message.tombstone";
  164. /**
  165. The offset of a record in the corresponding Kafka partition.
  166. */
  167. static constexpr const char *kMessagingKafkaOffset = "messaging.kafka.offset";
  168. /**
  169. The size of the message body in bytes.
  170. <p>
  171. This can refer to both the compressed or uncompressed body size. If both sizes are known, the
  172. uncompressed body size should be used.
  173. */
  174. static constexpr const char *kMessagingMessageBodySize = "messaging.message.body.size";
  175. /**
  176. The conversation ID identifying the conversation to which the message belongs, represented as a
  177. string. Sometimes called "Correlation ID".
  178. */
  179. static constexpr const char *kMessagingMessageConversationId = "messaging.message.conversation_id";
  180. /**
  181. The size of the message body and metadata in bytes.
  182. <p>
  183. This can refer to both the compressed or uncompressed size. If both sizes are known, the
  184. uncompressed size should be used.
  185. */
  186. static constexpr const char *kMessagingMessageEnvelopeSize = "messaging.message.envelope.size";
  187. /**
  188. A value used by the messaging system as an identifier for the message, represented as a string.
  189. */
  190. static constexpr const char *kMessagingMessageId = "messaging.message.id";
  191. /**
  192. Deprecated, use @code messaging.operation.type @endcode instead.
  193. @deprecated
  194. {"note": "Replaced by @code messaging.operation.type @endcode.", "reason": "renamed",
  195. "renamed_to": "messaging.operation.type"}
  196. */
  197. OPENTELEMETRY_DEPRECATED static constexpr const char *kMessagingOperation = "messaging.operation";
  198. /**
  199. The system-specific name of the messaging operation.
  200. */
  201. static constexpr const char *kMessagingOperationName = "messaging.operation.name";
  202. /**
  203. A string identifying the type of the messaging operation.
  204. <p>
  205. If a custom value is used, it MUST be of low cardinality.
  206. */
  207. static constexpr const char *kMessagingOperationType = "messaging.operation.type";
  208. /**
  209. RabbitMQ message routing key.
  210. */
  211. static constexpr const char *kMessagingRabbitmqDestinationRoutingKey =
  212. "messaging.rabbitmq.destination.routing_key";
  213. /**
  214. RabbitMQ message delivery tag
  215. */
  216. static constexpr const char *kMessagingRabbitmqMessageDeliveryTag =
  217. "messaging.rabbitmq.message.delivery_tag";
  218. /**
  219. Deprecated, use @code messaging.consumer.group.name @endcode instead.
  220. @deprecated
  221. {"note": "Replaced by @code messaging.consumer.group.name @endcode on the consumer spans. No
  222. replacement for producer spans.\n", "reason": "uncategorized"}
  223. */
  224. OPENTELEMETRY_DEPRECATED static constexpr const char *kMessagingRocketmqClientGroup =
  225. "messaging.rocketmq.client_group";
  226. /**
  227. Model of message consumption. This only applies to consumer spans.
  228. */
  229. static constexpr const char *kMessagingRocketmqConsumptionModel =
  230. "messaging.rocketmq.consumption_model";
  231. /**
  232. The delay time level for delay message, which determines the message delay time.
  233. */
  234. static constexpr const char *kMessagingRocketmqMessageDelayTimeLevel =
  235. "messaging.rocketmq.message.delay_time_level";
  236. /**
  237. The timestamp in milliseconds that the delay message is expected to be delivered to consumer.
  238. */
  239. static constexpr const char *kMessagingRocketmqMessageDeliveryTimestamp =
  240. "messaging.rocketmq.message.delivery_timestamp";
  241. /**
  242. It is essential for FIFO message. Messages that belong to the same message group are always
  243. processed one by one within the same consumer group.
  244. */
  245. static constexpr const char *kMessagingRocketmqMessageGroup = "messaging.rocketmq.message.group";
  246. /**
  247. Key(s) of message, another way to mark message besides message id.
  248. */
  249. static constexpr const char *kMessagingRocketmqMessageKeys = "messaging.rocketmq.message.keys";
  250. /**
  251. The secondary classifier of message besides topic.
  252. */
  253. static constexpr const char *kMessagingRocketmqMessageTag = "messaging.rocketmq.message.tag";
  254. /**
  255. Type of message.
  256. */
  257. static constexpr const char *kMessagingRocketmqMessageType = "messaging.rocketmq.message.type";
  258. /**
  259. Namespace of RocketMQ resources, resources in different namespaces are individual.
  260. */
  261. static constexpr const char *kMessagingRocketmqNamespace = "messaging.rocketmq.namespace";
  262. /**
  263. Deprecated, use @code messaging.destination.subscription.name @endcode instead.
  264. @deprecated
  265. {"note": "Replaced by @code messaging.destination.subscription.name @endcode.", "reason":
  266. "renamed", "renamed_to": "messaging.destination.subscription.name"}
  267. */
  268. OPENTELEMETRY_DEPRECATED static constexpr const char
  269. *kMessagingServicebusDestinationSubscriptionName =
  270. "messaging.servicebus.destination.subscription_name";
  271. /**
  272. Describes the <a
  273. href="https://learn.microsoft.com/azure/service-bus-messaging/message-transfers-locks-settlement#peeklock">settlement
  274. type</a>.
  275. */
  276. static constexpr const char *kMessagingServicebusDispositionStatus =
  277. "messaging.servicebus.disposition_status";
  278. /**
  279. Number of deliveries that have been attempted for this message.
  280. */
  281. static constexpr const char *kMessagingServicebusMessageDeliveryCount =
  282. "messaging.servicebus.message.delivery_count";
  283. /**
  284. The UTC epoch seconds at which the message has been accepted and stored in the entity.
  285. */
  286. static constexpr const char *kMessagingServicebusMessageEnqueuedTime =
  287. "messaging.servicebus.message.enqueued_time";
  288. /**
  289. The messaging system as identified by the client instrumentation.
  290. <p>
  291. The actual messaging system may differ from the one known by the client. For example, when using
  292. Kafka client libraries to communicate with Azure Event Hubs, the @code messaging.system @endcode
  293. is set to @code kafka @endcode based on the instrumentation's best knowledge.
  294. */
  295. static constexpr const char *kMessagingSystem = "messaging.system";
  296. namespace MessagingOperationTypeValues
  297. {
  298. /**
  299. A message is created. "Create" spans always refer to a single message and are used to provide a
  300. unique creation context for messages in batch sending scenarios.
  301. */
  302. static constexpr const char *kCreate = "create";
  303. /**
  304. One or more messages are provided for sending to an intermediary. If a single message is sent, the
  305. context of the "Send" span can be used as the creation context and no "Create" span needs to be
  306. created.
  307. */
  308. static constexpr const char *kSend = "send";
  309. /**
  310. One or more messages are requested by a consumer. This operation refers to pull-based scenarios,
  311. where consumers explicitly call methods of messaging SDKs to receive messages.
  312. */
  313. static constexpr const char *kReceive = "receive";
  314. /**
  315. One or more messages are processed by a consumer.
  316. */
  317. static constexpr const char *kProcess = "process";
  318. /**
  319. One or more messages are settled.
  320. */
  321. static constexpr const char *kSettle = "settle";
  322. /**
  323. Deprecated. Use @code process @endcode instead.
  324. */
  325. static constexpr const char *kDeliver = "deliver";
  326. /**
  327. Deprecated. Use @code send @endcode instead.
  328. */
  329. static constexpr const char *kPublish = "publish";
  330. } // namespace MessagingOperationTypeValues
  331. namespace MessagingRocketmqConsumptionModelValues
  332. {
  333. /**
  334. Clustering consumption model
  335. */
  336. static constexpr const char *kClustering = "clustering";
  337. /**
  338. Broadcasting consumption model
  339. */
  340. static constexpr const char *kBroadcasting = "broadcasting";
  341. } // namespace MessagingRocketmqConsumptionModelValues
  342. namespace MessagingRocketmqMessageTypeValues
  343. {
  344. /**
  345. Normal message
  346. */
  347. static constexpr const char *kNormal = "normal";
  348. /**
  349. FIFO message
  350. */
  351. static constexpr const char *kFifo = "fifo";
  352. /**
  353. Delay message
  354. */
  355. static constexpr const char *kDelay = "delay";
  356. /**
  357. Transaction message
  358. */
  359. static constexpr const char *kTransaction = "transaction";
  360. } // namespace MessagingRocketmqMessageTypeValues
  361. namespace MessagingServicebusDispositionStatusValues
  362. {
  363. /**
  364. Message is completed
  365. */
  366. static constexpr const char *kComplete = "complete";
  367. /**
  368. Message is abandoned
  369. */
  370. static constexpr const char *kAbandon = "abandon";
  371. /**
  372. Message is sent to dead letter queue
  373. */
  374. static constexpr const char *kDeadLetter = "dead_letter";
  375. /**
  376. Message is deferred
  377. */
  378. static constexpr const char *kDefer = "defer";
  379. } // namespace MessagingServicebusDispositionStatusValues
  380. namespace MessagingSystemValues
  381. {
  382. /**
  383. Apache ActiveMQ
  384. */
  385. static constexpr const char *kActivemq = "activemq";
  386. /**
  387. Amazon Simple Queue Service (SQS)
  388. */
  389. static constexpr const char *kAwsSqs = "aws_sqs";
  390. /**
  391. Azure Event Grid
  392. */
  393. static constexpr const char *kEventgrid = "eventgrid";
  394. /**
  395. Azure Event Hubs
  396. */
  397. static constexpr const char *kEventhubs = "eventhubs";
  398. /**
  399. Azure Service Bus
  400. */
  401. static constexpr const char *kServicebus = "servicebus";
  402. /**
  403. Google Cloud Pub/Sub
  404. */
  405. static constexpr const char *kGcpPubsub = "gcp_pubsub";
  406. /**
  407. Java Message Service
  408. */
  409. static constexpr const char *kJms = "jms";
  410. /**
  411. Apache Kafka
  412. */
  413. static constexpr const char *kKafka = "kafka";
  414. /**
  415. RabbitMQ
  416. */
  417. static constexpr const char *kRabbitmq = "rabbitmq";
  418. /**
  419. Apache RocketMQ
  420. */
  421. static constexpr const char *kRocketmq = "rocketmq";
  422. /**
  423. Apache Pulsar
  424. */
  425. static constexpr const char *kPulsar = "pulsar";
  426. } // namespace MessagingSystemValues
  427. } // namespace messaging
  428. } // namespace semconv
  429. OPENTELEMETRY_END_NAMESPACE