faas_attributes.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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 faas
  16. {
  17. /**
  18. A boolean that is true if the serverless function is executed for the first time (aka cold-start).
  19. */
  20. static constexpr const char *kFaasColdstart = "faas.coldstart";
  21. /**
  22. A string containing the schedule period as <a
  23. href="https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm">Cron
  24. Expression</a>.
  25. */
  26. static constexpr const char *kFaasCron = "faas.cron";
  27. /**
  28. The name of the source on which the triggering operation was performed. For example, in Cloud
  29. Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name.
  30. */
  31. static constexpr const char *kFaasDocumentCollection = "faas.document.collection";
  32. /**
  33. The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the
  34. name of the file, and in Cosmos DB the table name.
  35. */
  36. static constexpr const char *kFaasDocumentName = "faas.document.name";
  37. /**
  38. Describes the type of the operation that was performed on the data.
  39. */
  40. static constexpr const char *kFaasDocumentOperation = "faas.document.operation";
  41. /**
  42. A string containing the time when the data was accessed in the <a
  43. href="https://www.iso.org/iso-8601-date-and-time-format.html">ISO 8601</a> format expressed in <a
  44. href="https://www.w3.org/TR/NOTE-datetime">UTC</a>.
  45. */
  46. static constexpr const char *kFaasDocumentTime = "faas.document.time";
  47. /**
  48. The execution environment ID as a string, that will be potentially reused for other invocations to
  49. the same function/function version. <ul> <li><strong>AWS Lambda:</strong> Use the (full) log
  50. stream name.</li>
  51. </ul>
  52. */
  53. static constexpr const char *kFaasInstance = "faas.instance";
  54. /**
  55. The invocation ID of the current function invocation.
  56. */
  57. static constexpr const char *kFaasInvocationId = "faas.invocation_id";
  58. /**
  59. The name of the invoked function.
  60. <p>
  61. SHOULD be equal to the @code faas.name @endcode resource attribute of the invoked function.
  62. */
  63. static constexpr const char *kFaasInvokedName = "faas.invoked_name";
  64. /**
  65. The cloud provider of the invoked function.
  66. <p>
  67. SHOULD be equal to the @code cloud.provider @endcode resource attribute of the invoked function.
  68. */
  69. static constexpr const char *kFaasInvokedProvider = "faas.invoked_provider";
  70. /**
  71. The cloud region of the invoked function.
  72. <p>
  73. SHOULD be equal to the @code cloud.region @endcode resource attribute of the invoked function.
  74. */
  75. static constexpr const char *kFaasInvokedRegion = "faas.invoked_region";
  76. /**
  77. The amount of memory available to the serverless function converted to Bytes.
  78. <p>
  79. It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS
  80. Lambda function from working correctly. On AWS Lambda, the environment variable @code
  81. AWS_LAMBDA_FUNCTION_MEMORY_SIZE @endcode provides this information (which must be multiplied by
  82. 1,048,576).
  83. */
  84. static constexpr const char *kFaasMaxMemory = "faas.max_memory";
  85. /**
  86. The name of the single function that this runtime instance executes.
  87. <p>
  88. This is the name of the function as configured/deployed on the FaaS
  89. platform and is usually different from the name of the callback
  90. function (which may be stored in the
  91. <a href="/docs/general/attributes.md#source-code-attributes">@code code.namespace @endcode/@code
  92. code.function.name @endcode</a> span attributes). <p> For some cloud providers, the above
  93. definition is ambiguous. The following definition of function name MUST be used for this attribute
  94. (and consequently the span name) for the listed cloud providers/products:
  95. <ul>
  96. <li><strong>Azure:</strong> The full name @code <FUNCAPP>/<FUNC> @endcode, i.e., function app
  97. name followed by a forward slash followed by the function name (this form can also be seen in the
  98. resource JSON for the function). This means that a span attribute MUST be used, as an Azure
  99. function app can host multiple functions that would usually share a TracerProvider (see also the
  100. @code cloud.resource_id @endcode attribute).</li>
  101. </ul>
  102. */
  103. static constexpr const char *kFaasName = "faas.name";
  104. /**
  105. A string containing the function invocation time in the <a
  106. href="https://www.iso.org/iso-8601-date-and-time-format.html">ISO 8601</a> format expressed in <a
  107. href="https://www.w3.org/TR/NOTE-datetime">UTC</a>.
  108. */
  109. static constexpr const char *kFaasTime = "faas.time";
  110. /**
  111. Type of the trigger which caused this function invocation.
  112. */
  113. static constexpr const char *kFaasTrigger = "faas.trigger";
  114. /**
  115. The immutable version of the function being executed.
  116. <p>
  117. Depending on the cloud provider and platform, use:
  118. <ul>
  119. <li><strong>AWS Lambda:</strong> The <a
  120. href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html">function
  121. version</a> (an integer represented as a decimal string).</li> <li><strong>Google Cloud Run
  122. (Services):</strong> The <a
  123. href="https://cloud.google.com/run/docs/managing/revisions">revision</a> (i.e., the function name
  124. plus the revision suffix).</li> <li><strong>Google Cloud Functions:</strong> The value of the <a
  125. href="https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically">@code
  126. K_REVISION @endcode environment variable</a>.</li> <li><strong>Azure Functions:</strong> Not
  127. applicable. Do not set this attribute.</li>
  128. </ul>
  129. */
  130. static constexpr const char *kFaasVersion = "faas.version";
  131. namespace FaasDocumentOperationValues
  132. {
  133. /**
  134. When a new object is created.
  135. */
  136. static constexpr const char *kInsert = "insert";
  137. /**
  138. When an object is modified.
  139. */
  140. static constexpr const char *kEdit = "edit";
  141. /**
  142. When an object is deleted.
  143. */
  144. static constexpr const char *kDelete = "delete";
  145. } // namespace FaasDocumentOperationValues
  146. namespace FaasInvokedProviderValues
  147. {
  148. /**
  149. Alibaba Cloud
  150. */
  151. static constexpr const char *kAlibabaCloud = "alibaba_cloud";
  152. /**
  153. Amazon Web Services
  154. */
  155. static constexpr const char *kAws = "aws";
  156. /**
  157. Microsoft Azure
  158. */
  159. static constexpr const char *kAzure = "azure";
  160. /**
  161. Google Cloud Platform
  162. */
  163. static constexpr const char *kGcp = "gcp";
  164. /**
  165. Tencent Cloud
  166. */
  167. static constexpr const char *kTencentCloud = "tencent_cloud";
  168. } // namespace FaasInvokedProviderValues
  169. namespace FaasTriggerValues
  170. {
  171. /**
  172. A response to some data source operation such as a database or filesystem read/write
  173. */
  174. static constexpr const char *kDatasource = "datasource";
  175. /**
  176. To provide an answer to an inbound HTTP request
  177. */
  178. static constexpr const char *kHttp = "http";
  179. /**
  180. A function is set to be executed when messages are sent to a messaging system
  181. */
  182. static constexpr const char *kPubsub = "pubsub";
  183. /**
  184. A function is scheduled to be executed regularly
  185. */
  186. static constexpr const char *kTimer = "timer";
  187. /**
  188. If none of the others apply
  189. */
  190. static constexpr const char *kOther = "other";
  191. } // namespace FaasTriggerValues
  192. } // namespace faas
  193. } // namespace semconv
  194. OPENTELEMETRY_END_NAMESPACE