rpc_attributes.h 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  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 rpc
  16. {
  17. /**
  18. The <a href="https://connectrpc.com//docs/protocol/#error-codes">error codes</a> of the Connect
  19. request. Error codes are always string values.
  20. */
  21. static constexpr const char *kRpcConnectRpcErrorCode = "rpc.connect_rpc.error_code";
  22. /**
  23. Connect request metadata, @code <key> @endcode being the normalized Connect Metadata key
  24. (lowercase), the value being the metadata values. <p> Instrumentations SHOULD require an explicit
  25. configuration of which metadata values are to be captured. Including all request metadata values
  26. can be a security risk - explicit configuration helps avoid leaking sensitive information. <p> For
  27. example, a property @code my-custom-key @endcode with value @code ["1.2.3.4", "1.2.3.5"] @endcode
  28. SHOULD be recorded as the @code rpc.connect_rpc.request.metadata.my-custom-key @endcode attribute
  29. with value @code ["1.2.3.4", "1.2.3.5"] @endcode
  30. */
  31. static constexpr const char *kRpcConnectRpcRequestMetadata = "rpc.connect_rpc.request.metadata";
  32. /**
  33. Connect response metadata, @code <key> @endcode being the normalized Connect Metadata key
  34. (lowercase), the value being the metadata values. <p> Instrumentations SHOULD require an explicit
  35. configuration of which metadata values are to be captured. Including all response metadata values
  36. can be a security risk - explicit configuration helps avoid leaking sensitive information. <p> For
  37. example, a property @code my-custom-key @endcode with value @code "attribute_value" @endcode
  38. SHOULD be recorded as the @code rpc.connect_rpc.response.metadata.my-custom-key @endcode attribute
  39. with value @code ["attribute_value"] @endcode
  40. */
  41. static constexpr const char *kRpcConnectRpcResponseMetadata = "rpc.connect_rpc.response.metadata";
  42. /**
  43. gRPC request metadata, @code <key> @endcode being the normalized gRPC Metadata key (lowercase),
  44. the value being the metadata values. <p> Instrumentations SHOULD require an explicit configuration
  45. of which metadata values are to be captured. Including all request metadata values can be a
  46. security risk - explicit configuration helps avoid leaking sensitive information. <p> For example,
  47. a property @code my-custom-key @endcode with value @code ["1.2.3.4", "1.2.3.5"] @endcode SHOULD be
  48. recorded as
  49. @code rpc.grpc.request.metadata.my-custom-key @endcode attribute with value @code ["1.2.3.4",
  50. "1.2.3.5"] @endcode
  51. */
  52. static constexpr const char *kRpcGrpcRequestMetadata = "rpc.grpc.request.metadata";
  53. /**
  54. gRPC response metadata, @code <key> @endcode being the normalized gRPC Metadata key (lowercase),
  55. the value being the metadata values. <p> Instrumentations SHOULD require an explicit configuration
  56. of which metadata values are to be captured. Including all response metadata values can be a
  57. security risk - explicit configuration helps avoid leaking sensitive information. <p> For example,
  58. a property @code my-custom-key @endcode with value @code ["attribute_value"] @endcode SHOULD be
  59. recorded as the @code rpc.grpc.response.metadata.my-custom-key @endcode attribute with value @code
  60. ["attribute_value"] @endcode
  61. */
  62. static constexpr const char *kRpcGrpcResponseMetadata = "rpc.grpc.response.metadata";
  63. /**
  64. The <a href="https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md">numeric status code</a>
  65. of the gRPC request.
  66. */
  67. static constexpr const char *kRpcGrpcStatusCode = "rpc.grpc.status_code";
  68. /**
  69. @code error.code @endcode property of response if it is an error response.
  70. */
  71. static constexpr const char *kRpcJsonrpcErrorCode = "rpc.jsonrpc.error_code";
  72. /**
  73. @code error.message @endcode property of response if it is an error response.
  74. */
  75. static constexpr const char *kRpcJsonrpcErrorMessage = "rpc.jsonrpc.error_message";
  76. /**
  77. @code id @endcode property of request or response. Since protocol allows id to be int, string,
  78. @code null @endcode or missing (for notifications), value is expected to be cast to string for
  79. simplicity. Use empty string in case of @code null @endcode value. Omit entirely if this is a
  80. notification.
  81. */
  82. static constexpr const char *kRpcJsonrpcRequestId = "rpc.jsonrpc.request_id";
  83. /**
  84. Protocol version as in @code jsonrpc @endcode property of request/response. Since JSON-RPC 1.0
  85. doesn't specify this, the value can be omitted.
  86. */
  87. static constexpr const char *kRpcJsonrpcVersion = "rpc.jsonrpc.version";
  88. /**
  89. Compressed size of the message in bytes.
  90. */
  91. static constexpr const char *kRpcMessageCompressedSize = "rpc.message.compressed_size";
  92. /**
  93. MUST be calculated as two different counters starting from @code 1 @endcode one for sent messages
  94. and one for received message. <p> This way we guarantee that the values will be consistent between
  95. different implementations.
  96. */
  97. static constexpr const char *kRpcMessageId = "rpc.message.id";
  98. /**
  99. Whether this is a received or sent message.
  100. */
  101. static constexpr const char *kRpcMessageType = "rpc.message.type";
  102. /**
  103. Uncompressed size of the message in bytes.
  104. */
  105. static constexpr const char *kRpcMessageUncompressedSize = "rpc.message.uncompressed_size";
  106. /**
  107. The name of the (logical) method being called, must be equal to the $method part in the span name.
  108. <p>
  109. This is the logical name of the method from the RPC interface perspective, which can be different
  110. from the name of any implementing method/function. The @code code.function.name @endcode attribute
  111. may be used to store the latter (e.g., method actually executing the call on the server side, RPC
  112. client stub method on the client side).
  113. */
  114. static constexpr const char *kRpcMethod = "rpc.method";
  115. /**
  116. The full (logical) name of the service being called, including its package name, if applicable.
  117. <p>
  118. This is the logical name of the service from the RPC interface perspective, which can be different
  119. from the name of any implementing class. The @code code.namespace @endcode attribute may be used
  120. to store the latter (despite the attribute name, it may include a class name; e.g., class with
  121. method actually executing the call on the server side, RPC client stub class on the client side).
  122. */
  123. static constexpr const char *kRpcService = "rpc.service";
  124. /**
  125. A string identifying the remoting system. See below for a list of well-known identifiers.
  126. */
  127. static constexpr const char *kRpcSystem = "rpc.system";
  128. namespace RpcConnectRpcErrorCodeValues
  129. {
  130. /**
  131. none
  132. */
  133. static constexpr const char *kCancelled = "cancelled";
  134. /**
  135. none
  136. */
  137. static constexpr const char *kUnknown = "unknown";
  138. /**
  139. none
  140. */
  141. static constexpr const char *kInvalidArgument = "invalid_argument";
  142. /**
  143. none
  144. */
  145. static constexpr const char *kDeadlineExceeded = "deadline_exceeded";
  146. /**
  147. none
  148. */
  149. static constexpr const char *kNotFound = "not_found";
  150. /**
  151. none
  152. */
  153. static constexpr const char *kAlreadyExists = "already_exists";
  154. /**
  155. none
  156. */
  157. static constexpr const char *kPermissionDenied = "permission_denied";
  158. /**
  159. none
  160. */
  161. static constexpr const char *kResourceExhausted = "resource_exhausted";
  162. /**
  163. none
  164. */
  165. static constexpr const char *kFailedPrecondition = "failed_precondition";
  166. /**
  167. none
  168. */
  169. static constexpr const char *kAborted = "aborted";
  170. /**
  171. none
  172. */
  173. static constexpr const char *kOutOfRange = "out_of_range";
  174. /**
  175. none
  176. */
  177. static constexpr const char *kUnimplemented = "unimplemented";
  178. /**
  179. none
  180. */
  181. static constexpr const char *kInternal = "internal";
  182. /**
  183. none
  184. */
  185. static constexpr const char *kUnavailable = "unavailable";
  186. /**
  187. none
  188. */
  189. static constexpr const char *kDataLoss = "data_loss";
  190. /**
  191. none
  192. */
  193. static constexpr const char *kUnauthenticated = "unauthenticated";
  194. } // namespace RpcConnectRpcErrorCodeValues
  195. namespace RpcGrpcStatusCodeValues
  196. {
  197. /**
  198. OK
  199. */
  200. static constexpr int kOk = 0;
  201. /**
  202. CANCELLED
  203. */
  204. static constexpr int kCancelled = 1;
  205. /**
  206. UNKNOWN
  207. */
  208. static constexpr int kUnknown = 2;
  209. /**
  210. INVALID_ARGUMENT
  211. */
  212. static constexpr int kInvalidArgument = 3;
  213. /**
  214. DEADLINE_EXCEEDED
  215. */
  216. static constexpr int kDeadlineExceeded = 4;
  217. /**
  218. NOT_FOUND
  219. */
  220. static constexpr int kNotFound = 5;
  221. /**
  222. ALREADY_EXISTS
  223. */
  224. static constexpr int kAlreadyExists = 6;
  225. /**
  226. PERMISSION_DENIED
  227. */
  228. static constexpr int kPermissionDenied = 7;
  229. /**
  230. RESOURCE_EXHAUSTED
  231. */
  232. static constexpr int kResourceExhausted = 8;
  233. /**
  234. FAILED_PRECONDITION
  235. */
  236. static constexpr int kFailedPrecondition = 9;
  237. /**
  238. ABORTED
  239. */
  240. static constexpr int kAborted = 10;
  241. /**
  242. OUT_OF_RANGE
  243. */
  244. static constexpr int kOutOfRange = 11;
  245. /**
  246. UNIMPLEMENTED
  247. */
  248. static constexpr int kUnimplemented = 12;
  249. /**
  250. INTERNAL
  251. */
  252. static constexpr int kInternal = 13;
  253. /**
  254. UNAVAILABLE
  255. */
  256. static constexpr int kUnavailable = 14;
  257. /**
  258. DATA_LOSS
  259. */
  260. static constexpr int kDataLoss = 15;
  261. /**
  262. UNAUTHENTICATED
  263. */
  264. static constexpr int kUnauthenticated = 16;
  265. } // namespace RpcGrpcStatusCodeValues
  266. namespace RpcMessageTypeValues
  267. {
  268. /**
  269. none
  270. */
  271. static constexpr const char *kSent = "SENT";
  272. /**
  273. none
  274. */
  275. static constexpr const char *kReceived = "RECEIVED";
  276. } // namespace RpcMessageTypeValues
  277. namespace RpcSystemValues
  278. {
  279. /**
  280. gRPC
  281. */
  282. static constexpr const char *kGrpc = "grpc";
  283. /**
  284. Java RMI
  285. */
  286. static constexpr const char *kJavaRmi = "java_rmi";
  287. /**
  288. .NET WCF
  289. */
  290. static constexpr const char *kDotnetWcf = "dotnet_wcf";
  291. /**
  292. Apache Dubbo
  293. */
  294. static constexpr const char *kApacheDubbo = "apache_dubbo";
  295. /**
  296. Connect RPC
  297. */
  298. static constexpr const char *kConnectRpc = "connect_rpc";
  299. } // namespace RpcSystemValues
  300. } // namespace rpc
  301. } // namespace semconv
  302. OPENTELEMETRY_END_NAMESPACE