2
0

db_attributes.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  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 db
  16. {
  17. /**
  18. The name of a collection (table, container) within the database.
  19. <p>
  20. It is RECOMMENDED to capture the value as provided by the application
  21. without attempting to do any case normalization.
  22. <p>
  23. The collection name SHOULD NOT be extracted from @code db.query.text @endcode,
  24. when the database system supports query text with multiple collections
  25. in non-batch operations.
  26. <p>
  27. For batch operations, if the individual operations are known to have the same
  28. collection name then that collection name SHOULD be used.
  29. */
  30. static constexpr const char *kDbCollectionName = "db.collection.name";
  31. /**
  32. The name of the database, fully qualified within the server address and port.
  33. <p>
  34. If a database system has multiple namespace components, they SHOULD be concatenated from the most
  35. general to the most specific namespace component, using @code | @endcode as a separator between
  36. the components. Any missing components (and their associated separators) SHOULD be omitted.
  37. Semantic conventions for individual database systems SHOULD document what @code db.namespace
  38. @endcode means in the context of that system. It is RECOMMENDED to capture the value as provided
  39. by the application without attempting to do any case normalization.
  40. */
  41. static constexpr const char *kDbNamespace = "db.namespace";
  42. /**
  43. The number of queries included in a batch operation.
  44. <p>
  45. Operations are only considered batches when they contain two or more operations, and so @code
  46. db.operation.batch.size @endcode SHOULD never be @code 1 @endcode.
  47. */
  48. static constexpr const char *kDbOperationBatchSize = "db.operation.batch.size";
  49. /**
  50. The name of the operation or command being executed.
  51. <p>
  52. It is RECOMMENDED to capture the value as provided by the application
  53. without attempting to do any case normalization.
  54. <p>
  55. The operation name SHOULD NOT be extracted from @code db.query.text @endcode,
  56. when the database system supports query text with multiple operations
  57. in non-batch operations.
  58. <p>
  59. If spaces can occur in the operation name, multiple consecutive spaces
  60. SHOULD be normalized to a single space.
  61. <p>
  62. For batch operations, if the individual operations are known to have the same operation name
  63. then that operation name SHOULD be used prepended by @code BATCH @endcode,
  64. otherwise @code db.operation.name @endcode SHOULD be @code BATCH @endcode or some other database
  65. system specific term if more applicable.
  66. */
  67. static constexpr const char *kDbOperationName = "db.operation.name";
  68. /**
  69. Low cardinality summary of a database query.
  70. <p>
  71. The query summary describes a class of database queries and is useful
  72. as a grouping key, especially when analyzing telemetry for database
  73. calls involving complex queries.
  74. <p>
  75. Summary may be available to the instrumentation through
  76. instrumentation hooks or other means. If it is not available, instrumentations
  77. that support query parsing SHOULD generate a summary following
  78. <a href="/docs/database/database-spans.md#generating-a-summary-of-the-query">Generating query
  79. summary</a> section.
  80. */
  81. static constexpr const char *kDbQuerySummary = "db.query.summary";
  82. /**
  83. The database query being executed.
  84. <p>
  85. For sanitization see <a
  86. href="/docs/database/database-spans.md#sanitization-of-dbquerytext">Sanitization of @code
  87. db.query.text @endcode</a>. For batch operations, if the individual operations are known to have
  88. the same query text then that query text SHOULD be used, otherwise all of the individual query
  89. texts SHOULD be concatenated with separator @code ; @endcode or some other database system
  90. specific separator if more applicable. Parameterized query text SHOULD NOT be sanitized. Even
  91. though parameterized query text can potentially have sensitive data, by using a parameterized
  92. query the user is giving a strong signal that any sensitive data will be passed as parameter
  93. values, and the benefit to observability of capturing the static part of the query text by default
  94. outweighs the risk.
  95. */
  96. static constexpr const char *kDbQueryText = "db.query.text";
  97. /**
  98. Database response status code.
  99. <p>
  100. The status code returned by the database. Usually it represents an error code, but may also
  101. represent partial success, warning, or differentiate between various types of successful outcomes.
  102. Semantic conventions for individual database systems SHOULD document what @code
  103. db.response.status_code @endcode means in the context of that system.
  104. */
  105. static constexpr const char *kDbResponseStatusCode = "db.response.status_code";
  106. /**
  107. The name of a stored procedure within the database.
  108. <p>
  109. It is RECOMMENDED to capture the value as provided by the application
  110. without attempting to do any case normalization.
  111. <p>
  112. For batch operations, if the individual operations are known to have the same
  113. stored procedure name then that stored procedure name SHOULD be used.
  114. */
  115. static constexpr const char *kDbStoredProcedureName = "db.stored_procedure.name";
  116. /**
  117. The database management system (DBMS) product as identified by the client instrumentation.
  118. <p>
  119. The actual DBMS may differ from the one identified by the client. For example, when using
  120. PostgreSQL client libraries to connect to a CockroachDB, the @code db.system.name @endcode is set
  121. to @code postgresql @endcode based on the instrumentation's best knowledge.
  122. */
  123. static constexpr const char *kDbSystemName = "db.system.name";
  124. namespace DbSystemNameValues
  125. {
  126. /**
  127. Some other SQL database. Fallback only.
  128. */
  129. static constexpr const char *kOtherSql = "other_sql";
  130. /**
  131. <a href="https://documentation.softwareag.com/?pf=adabas">Adabas (Adaptable Database System)</a>
  132. */
  133. static constexpr const char *kSoftwareagAdabas = "softwareag.adabas";
  134. /**
  135. <a href="https://www.actian.com/databases/ingres/">Actian Ingres</a>
  136. */
  137. static constexpr const char *kActianIngres = "actian.ingres";
  138. /**
  139. <a href="https://aws.amazon.com/pm/dynamodb/">Amazon DynamoDB</a>
  140. */
  141. static constexpr const char *kAwsDynamodb = "aws.dynamodb";
  142. /**
  143. <a href="https://aws.amazon.com/redshift/">Amazon Redshift</a>
  144. */
  145. static constexpr const char *kAwsRedshift = "aws.redshift";
  146. /**
  147. <a href="https://learn.microsoft.com/azure/cosmos-db">Azure Cosmos DB</a>
  148. */
  149. static constexpr const char *kAzureCosmosdb = "azure.cosmosdb";
  150. /**
  151. <a href="https://www.intersystems.com/products/cache/">InterSystems Caché</a>
  152. */
  153. static constexpr const char *kIntersystemsCache = "intersystems.cache";
  154. /**
  155. <a href="https://cassandra.apache.org/">Apache Cassandra</a>
  156. */
  157. static constexpr const char *kCassandra = "cassandra";
  158. /**
  159. <a href="https://clickhouse.com/">ClickHouse</a>
  160. */
  161. static constexpr const char *kClickhouse = "clickhouse";
  162. /**
  163. <a href="https://www.cockroachlabs.com/">CockroachDB</a>
  164. */
  165. static constexpr const char *kCockroachdb = "cockroachdb";
  166. /**
  167. <a href="https://www.couchbase.com/">Couchbase</a>
  168. */
  169. static constexpr const char *kCouchbase = "couchbase";
  170. /**
  171. <a href="https://couchdb.apache.org/">Apache CouchDB</a>
  172. */
  173. static constexpr const char *kCouchdb = "couchdb";
  174. /**
  175. <a href="https://db.apache.org/derby/">Apache Derby</a>
  176. */
  177. static constexpr const char *kDerby = "derby";
  178. /**
  179. <a href="https://www.elastic.co/elasticsearch">Elasticsearch</a>
  180. */
  181. static constexpr const char *kElasticsearch = "elasticsearch";
  182. /**
  183. <a href="https://www.firebirdsql.org/">Firebird</a>
  184. */
  185. static constexpr const char *kFirebirdsql = "firebirdsql";
  186. /**
  187. <a href="https://cloud.google.com/spanner">Google Cloud Spanner</a>
  188. */
  189. static constexpr const char *kGcpSpanner = "gcp.spanner";
  190. /**
  191. <a href="https://geode.apache.org/">Apache Geode</a>
  192. */
  193. static constexpr const char *kGeode = "geode";
  194. /**
  195. <a href="https://h2database.com/">H2 Database</a>
  196. */
  197. static constexpr const char *kH2database = "h2database";
  198. /**
  199. <a href="https://hbase.apache.org/">Apache HBase</a>
  200. */
  201. static constexpr const char *kHbase = "hbase";
  202. /**
  203. <a href="https://hive.apache.org/">Apache Hive</a>
  204. */
  205. static constexpr const char *kHive = "hive";
  206. /**
  207. <a href="https://hsqldb.org/">HyperSQL Database</a>
  208. */
  209. static constexpr const char *kHsqldb = "hsqldb";
  210. /**
  211. <a href="https://www.ibm.com/db2">IBM Db2</a>
  212. */
  213. static constexpr const char *kIbmDb2 = "ibm.db2";
  214. /**
  215. <a href="https://www.ibm.com/products/informix">IBM Informix</a>
  216. */
  217. static constexpr const char *kIbmInformix = "ibm.informix";
  218. /**
  219. <a href="https://www.ibm.com/products/netezza">IBM Netezza</a>
  220. */
  221. static constexpr const char *kIbmNetezza = "ibm.netezza";
  222. /**
  223. <a href="https://www.influxdata.com/">InfluxDB</a>
  224. */
  225. static constexpr const char *kInfluxdb = "influxdb";
  226. /**
  227. <a href="https://www.instantdb.com/">Instant</a>
  228. */
  229. static constexpr const char *kInstantdb = "instantdb";
  230. /**
  231. <a href="https://mariadb.org/">MariaDB</a>
  232. */
  233. static constexpr const char *kMariadb = "mariadb";
  234. /**
  235. <a href="https://memcached.org/">Memcached</a>
  236. */
  237. static constexpr const char *kMemcached = "memcached";
  238. /**
  239. <a href="https://www.mongodb.com/">MongoDB</a>
  240. */
  241. static constexpr const char *kMongodb = "mongodb";
  242. /**
  243. <a href="https://www.microsoft.com/sql-server">Microsoft SQL Server</a>
  244. */
  245. static constexpr const char *kMicrosoftSqlServer = "microsoft.sql_server";
  246. /**
  247. <a href="https://www.mysql.com/">MySQL</a>
  248. */
  249. static constexpr const char *kMysql = "mysql";
  250. /**
  251. <a href="https://neo4j.com/">Neo4j</a>
  252. */
  253. static constexpr const char *kNeo4j = "neo4j";
  254. /**
  255. <a href="https://opensearch.org/">OpenSearch</a>
  256. */
  257. static constexpr const char *kOpensearch = "opensearch";
  258. /**
  259. <a href="https://www.oracle.com/database/">Oracle Database</a>
  260. */
  261. static constexpr const char *kOracleDb = "oracle.db";
  262. /**
  263. <a href="https://www.postgresql.org/">PostgreSQL</a>
  264. */
  265. static constexpr const char *kPostgresql = "postgresql";
  266. /**
  267. <a href="https://redis.io/">Redis</a>
  268. */
  269. static constexpr const char *kRedis = "redis";
  270. /**
  271. <a href="https://www.sap.com/products/technology-platform/hana/what-is-sap-hana.html">SAP HANA</a>
  272. */
  273. static constexpr const char *kSapHana = "sap.hana";
  274. /**
  275. <a href="https://maxdb.sap.com/">SAP MaxDB</a>
  276. */
  277. static constexpr const char *kSapMaxdb = "sap.maxdb";
  278. /**
  279. <a href="https://www.sqlite.org/">SQLite</a>
  280. */
  281. static constexpr const char *kSqlite = "sqlite";
  282. /**
  283. <a href="https://www.teradata.com/">Teradata</a>
  284. */
  285. static constexpr const char *kTeradata = "teradata";
  286. /**
  287. <a href="https://trino.io/">Trino</a>
  288. */
  289. static constexpr const char *kTrino = "trino";
  290. } // namespace DbSystemNameValues
  291. } // namespace db
  292. } // namespace semconv
  293. OPENTELEMETRY_END_NAMESPACE