trace.go 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378
  1. // Copyright The OpenTelemetry Authors
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. // Code generated from semantic convention specification. DO NOT EDIT.
  15. package semconv // import "go.opentelemetry.io/otel/semconv/v1.4.0"
  16. import "go.opentelemetry.io/otel/attribute"
  17. // This document defines the attributes used to perform database client calls.
  18. const (
  19. // An identifier for the database management system (DBMS) product being used. See
  20. // below for a list of well-known identifiers.
  21. //
  22. // Type: Enum
  23. // Required: Always
  24. // Stability: stable
  25. DBSystemKey = attribute.Key("db.system")
  26. // The connection string used to connect to the database. It is recommended to
  27. // remove embedded credentials.
  28. //
  29. // Type: string
  30. // Required: No
  31. // Stability: stable
  32. // Examples: 'Server=(localdb)\\v11.0;Integrated Security=true;'
  33. DBConnectionStringKey = attribute.Key("db.connection_string")
  34. // Username for accessing the database.
  35. //
  36. // Type: string
  37. // Required: No
  38. // Stability: stable
  39. // Examples: 'readonly_user', 'reporting_user'
  40. DBUserKey = attribute.Key("db.user")
  41. // The fully-qualified class name of the [Java Database Connectivity
  42. // (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver
  43. // used to connect.
  44. //
  45. // Type: string
  46. // Required: No
  47. // Stability: stable
  48. // Examples: 'org.postgresql.Driver',
  49. // 'com.microsoft.sqlserver.jdbc.SQLServerDriver'
  50. DBJDBCDriverClassnameKey = attribute.Key("db.jdbc.driver_classname")
  51. // If no [tech-specific attribute](#call-level-attributes-for-specific-
  52. // technologies) is defined, this attribute is used to report the name of the
  53. // database being accessed. For commands that switch the database, this should be
  54. // set to the target database (even if the command fails).
  55. //
  56. // Type: string
  57. // Required: Required, if applicable and no more-specific attribute is defined.
  58. // Stability: stable
  59. // Examples: 'customers', 'main'
  60. // Note: In some SQL databases, the database name to be used is called "schema
  61. // name".
  62. DBNameKey = attribute.Key("db.name")
  63. // The database statement being executed.
  64. //
  65. // Type: string
  66. // Required: Required if applicable and not explicitly disabled via
  67. // instrumentation configuration.
  68. // Stability: stable
  69. // Examples: 'SELECT * FROM wuser_table', 'SET mykey "WuValue"'
  70. // Note: The value may be sanitized to exclude sensitive information.
  71. DBStatementKey = attribute.Key("db.statement")
  72. // The name of the operation being executed, e.g. the [MongoDB command
  73. // name](https://docs.mongodb.com/manual/reference/command/#database-operations)
  74. // such as `findAndModify`, or the SQL keyword.
  75. //
  76. // Type: string
  77. // Required: Required, if `db.statement` is not applicable.
  78. // Stability: stable
  79. // Examples: 'findAndModify', 'HMSET', 'SELECT'
  80. // Note: When setting this to an SQL keyword, it is not recommended to attempt any
  81. // client-side parsing of `db.statement` just to get this property, but it should
  82. // be set if the operation name is provided by the library being instrumented. If
  83. // the SQL statement has an ambiguous operation, or performs more than one
  84. // operation, this value may be omitted.
  85. DBOperationKey = attribute.Key("db.operation")
  86. )
  87. var (
  88. // Some other SQL database. Fallback only. See notes
  89. DBSystemOtherSQL = DBSystemKey.String("other_sql")
  90. // Microsoft SQL Server
  91. DBSystemMSSQL = DBSystemKey.String("mssql")
  92. // MySQL
  93. DBSystemMySQL = DBSystemKey.String("mysql")
  94. // Oracle Database
  95. DBSystemOracle = DBSystemKey.String("oracle")
  96. // IBM DB2
  97. DBSystemDB2 = DBSystemKey.String("db2")
  98. // PostgreSQL
  99. DBSystemPostgreSQL = DBSystemKey.String("postgresql")
  100. // Amazon Redshift
  101. DBSystemRedshift = DBSystemKey.String("redshift")
  102. // Apache Hive
  103. DBSystemHive = DBSystemKey.String("hive")
  104. // Cloudscape
  105. DBSystemCloudscape = DBSystemKey.String("cloudscape")
  106. // HyperSQL DataBase
  107. DBSystemHSQLDB = DBSystemKey.String("hsqldb")
  108. // Progress Database
  109. DBSystemProgress = DBSystemKey.String("progress")
  110. // SAP MaxDB
  111. DBSystemMaxDB = DBSystemKey.String("maxdb")
  112. // SAP HANA
  113. DBSystemHanaDB = DBSystemKey.String("hanadb")
  114. // Ingres
  115. DBSystemIngres = DBSystemKey.String("ingres")
  116. // FirstSQL
  117. DBSystemFirstSQL = DBSystemKey.String("firstsql")
  118. // EnterpriseDB
  119. DBSystemEDB = DBSystemKey.String("edb")
  120. // InterSystems Caché
  121. DBSystemCache = DBSystemKey.String("cache")
  122. // Adabas (Adaptable Database System)
  123. DBSystemAdabas = DBSystemKey.String("adabas")
  124. // Firebird
  125. DBSystemFirebird = DBSystemKey.String("firebird")
  126. // Apache Derby
  127. DBSystemDerby = DBSystemKey.String("derby")
  128. // FileMaker
  129. DBSystemFilemaker = DBSystemKey.String("filemaker")
  130. // Informix
  131. DBSystemInformix = DBSystemKey.String("informix")
  132. // InstantDB
  133. DBSystemInstantDB = DBSystemKey.String("instantdb")
  134. // InterBase
  135. DBSystemInterbase = DBSystemKey.String("interbase")
  136. // MariaDB
  137. DBSystemMariaDB = DBSystemKey.String("mariadb")
  138. // Netezza
  139. DBSystemNetezza = DBSystemKey.String("netezza")
  140. // Pervasive PSQL
  141. DBSystemPervasive = DBSystemKey.String("pervasive")
  142. // PointBase
  143. DBSystemPointbase = DBSystemKey.String("pointbase")
  144. // SQLite
  145. DBSystemSqlite = DBSystemKey.String("sqlite")
  146. // Sybase
  147. DBSystemSybase = DBSystemKey.String("sybase")
  148. // Teradata
  149. DBSystemTeradata = DBSystemKey.String("teradata")
  150. // Vertica
  151. DBSystemVertica = DBSystemKey.String("vertica")
  152. // H2
  153. DBSystemH2 = DBSystemKey.String("h2")
  154. // ColdFusion IMQ
  155. DBSystemColdfusion = DBSystemKey.String("coldfusion")
  156. // Apache Cassandra
  157. DBSystemCassandra = DBSystemKey.String("cassandra")
  158. // Apache HBase
  159. DBSystemHBase = DBSystemKey.String("hbase")
  160. // MongoDB
  161. DBSystemMongoDB = DBSystemKey.String("mongodb")
  162. // Redis
  163. DBSystemRedis = DBSystemKey.String("redis")
  164. // Couchbase
  165. DBSystemCouchbase = DBSystemKey.String("couchbase")
  166. // CouchDB
  167. DBSystemCouchDB = DBSystemKey.String("couchdb")
  168. // Microsoft Azure Cosmos DB
  169. DBSystemCosmosDB = DBSystemKey.String("cosmosdb")
  170. // Amazon DynamoDB
  171. DBSystemDynamoDB = DBSystemKey.String("dynamodb")
  172. // Neo4j
  173. DBSystemNeo4j = DBSystemKey.String("neo4j")
  174. // Apache Geode
  175. DBSystemGeode = DBSystemKey.String("geode")
  176. // Elasticsearch
  177. DBSystemElasticsearch = DBSystemKey.String("elasticsearch")
  178. // Memcached
  179. DBSystemMemcached = DBSystemKey.String("memcached")
  180. // CockroachDB
  181. DBSystemCockroachdb = DBSystemKey.String("cockroachdb")
  182. )
  183. // Connection-level attributes for Microsoft SQL Server
  184. const (
  185. // The Microsoft SQL Server [instance name](https://docs.microsoft.com/en-
  186. // us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15)
  187. // connecting to. This name is used to determine the port of a named instance.
  188. //
  189. // Type: string
  190. // Required: No
  191. // Stability: stable
  192. // Examples: 'MSSQLSERVER'
  193. // Note: If setting a `db.mssql.instance_name`, `net.peer.port` is no longer
  194. // required (but still recommended if non-standard).
  195. DBMSSQLInstanceNameKey = attribute.Key("db.mssql.instance_name")
  196. )
  197. // Call-level attributes for Cassandra
  198. const (
  199. // The name of the keyspace being accessed. To be used instead of the generic
  200. // `db.name` attribute.
  201. //
  202. // Type: string
  203. // Required: Always
  204. // Stability: stable
  205. // Examples: 'mykeyspace'
  206. DBCassandraKeyspaceKey = attribute.Key("db.cassandra.keyspace")
  207. // The fetch size used for paging, i.e. how many rows will be returned at once.
  208. //
  209. // Type: int
  210. // Required: No
  211. // Stability: stable
  212. // Examples: 5000
  213. DBCassandraPageSizeKey = attribute.Key("db.cassandra.page_size")
  214. // The consistency level of the query. Based on consistency values from
  215. // [CQL](https://docs.datastax.com/en/cassandra-
  216. // oss/3.0/cassandra/dml/dmlConfigConsistency.html).
  217. //
  218. // Type: Enum
  219. // Required: No
  220. // Stability: stable
  221. DBCassandraConsistencyLevelKey = attribute.Key("db.cassandra.consistency_level")
  222. // The name of the primary table that the operation is acting upon, including the
  223. // schema name (if applicable).
  224. //
  225. // Type: string
  226. // Required: Recommended if available.
  227. // Stability: stable
  228. // Examples: 'mytable'
  229. // Note: This mirrors the db.sql.table attribute but references cassandra rather
  230. // than sql. It is not recommended to attempt any client-side parsing of
  231. // `db.statement` just to get this property, but it should be set if it is
  232. // provided by the library being instrumented. If the operation is acting upon an
  233. // anonymous table, or more than one table, this value MUST NOT be set.
  234. DBCassandraTableKey = attribute.Key("db.cassandra.table")
  235. // Whether or not the query is idempotent.
  236. //
  237. // Type: boolean
  238. // Required: No
  239. // Stability: stable
  240. DBCassandraIdempotenceKey = attribute.Key("db.cassandra.idempotence")
  241. // The number of times a query was speculatively executed. Not set or `0` if the
  242. // query was not executed speculatively.
  243. //
  244. // Type: int
  245. // Required: No
  246. // Stability: stable
  247. // Examples: 0, 2
  248. DBCassandraSpeculativeExecutionCountKey = attribute.Key("db.cassandra.speculative_execution_count")
  249. // The ID of the coordinating node for a query.
  250. //
  251. // Type: string
  252. // Required: No
  253. // Stability: stable
  254. // Examples: 'be13faa2-8574-4d71-926d-27f16cf8a7af'
  255. DBCassandraCoordinatorIDKey = attribute.Key("db.cassandra.coordinator.id")
  256. // The data center of the coordinating node for a query.
  257. //
  258. // Type: string
  259. // Required: No
  260. // Stability: stable
  261. // Examples: 'us-west-2'
  262. DBCassandraCoordinatorDCKey = attribute.Key("db.cassandra.coordinator.dc")
  263. )
  264. var (
  265. // all
  266. DBCassandraConsistencyLevelAll = DBCassandraConsistencyLevelKey.String("all")
  267. // each_quorum
  268. DBCassandraConsistencyLevelEachQuorum = DBCassandraConsistencyLevelKey.String("each_quorum")
  269. // quorum
  270. DBCassandraConsistencyLevelQuorum = DBCassandraConsistencyLevelKey.String("quorum")
  271. // local_quorum
  272. DBCassandraConsistencyLevelLocalQuorum = DBCassandraConsistencyLevelKey.String("local_quorum")
  273. // one
  274. DBCassandraConsistencyLevelOne = DBCassandraConsistencyLevelKey.String("one")
  275. // two
  276. DBCassandraConsistencyLevelTwo = DBCassandraConsistencyLevelKey.String("two")
  277. // three
  278. DBCassandraConsistencyLevelThree = DBCassandraConsistencyLevelKey.String("three")
  279. // local_one
  280. DBCassandraConsistencyLevelLocalOne = DBCassandraConsistencyLevelKey.String("local_one")
  281. // any
  282. DBCassandraConsistencyLevelAny = DBCassandraConsistencyLevelKey.String("any")
  283. // serial
  284. DBCassandraConsistencyLevelSerial = DBCassandraConsistencyLevelKey.String("serial")
  285. // local_serial
  286. DBCassandraConsistencyLevelLocalSerial = DBCassandraConsistencyLevelKey.String("local_serial")
  287. )
  288. // Call-level attributes for Apache HBase
  289. const (
  290. // The [HBase namespace](https://hbase.apache.org/book.html#_namespace) being
  291. // accessed. To be used instead of the generic `db.name` attribute.
  292. //
  293. // Type: string
  294. // Required: Always
  295. // Stability: stable
  296. // Examples: 'default'
  297. DBHBaseNamespaceKey = attribute.Key("db.hbase.namespace")
  298. )
  299. // Call-level attributes for Redis
  300. const (
  301. // The index of the database being accessed as used in the [`SELECT`
  302. // command](https://redis.io/commands/select), provided as an integer. To be used
  303. // instead of the generic `db.name` attribute.
  304. //
  305. // Type: int
  306. // Required: Required, if other than the default database (`0`).
  307. // Stability: stable
  308. // Examples: 0, 1, 15
  309. DBRedisDBIndexKey = attribute.Key("db.redis.database_index")
  310. )
  311. // Call-level attributes for MongoDB
  312. const (
  313. // The collection being accessed within the database stated in `db.name`.
  314. //
  315. // Type: string
  316. // Required: Always
  317. // Stability: stable
  318. // Examples: 'customers', 'products'
  319. DBMongoDBCollectionKey = attribute.Key("db.mongodb.collection")
  320. )
  321. // Call-level attrbiutes for SQL databases
  322. const (
  323. // The name of the primary table that the operation is acting upon, including the
  324. // schema name (if applicable).
  325. //
  326. // Type: string
  327. // Required: Recommended if available.
  328. // Stability: stable
  329. // Examples: 'public.users', 'customers'
  330. // Note: It is not recommended to attempt any client-side parsing of
  331. // `db.statement` just to get this property, but it should be set if it is
  332. // provided by the library being instrumented. If the operation is acting upon an
  333. // anonymous table, or more than one table, this value MUST NOT be set.
  334. DBSQLTableKey = attribute.Key("db.sql.table")
  335. )
  336. // This document defines the attributes used to report a single exception associated with a span.
  337. const (
  338. // The type of the exception (its fully-qualified class name, if applicable). The
  339. // dynamic type of the exception should be preferred over the static type in
  340. // languages that support it.
  341. //
  342. // Type: string
  343. // Required: No
  344. // Stability: stable
  345. // Examples: 'java.net.ConnectException', 'OSError'
  346. ExceptionTypeKey = attribute.Key("exception.type")
  347. // The exception message.
  348. //
  349. // Type: string
  350. // Required: No
  351. // Stability: stable
  352. // Examples: 'Division by zero', "Can't convert 'int' object to str implicitly"
  353. ExceptionMessageKey = attribute.Key("exception.message")
  354. // A stacktrace as a string in the natural representation for the language
  355. // runtime. The representation is to be determined and documented by each language
  356. // SIG.
  357. //
  358. // Type: string
  359. // Required: No
  360. // Stability: stable
  361. // Examples: 'Exception in thread "main" java.lang.RuntimeException: Test
  362. // exception\\n at '
  363. // 'com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at '
  364. // 'com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at '
  365. // 'com.example.GenerateTrace.main(GenerateTrace.java:5)'
  366. ExceptionStacktraceKey = attribute.Key("exception.stacktrace")
  367. // SHOULD be set to true if the exception event is recorded at a point where it is
  368. // known that the exception is escaping the scope of the span.
  369. //
  370. // Type: boolean
  371. // Required: No
  372. // Stability: stable
  373. // Note: An exception is considered to have escaped (or left) the scope of a span,
  374. // if that span is ended while the exception is still logically "in flight".
  375. // This may be actually "in flight" in some languages (e.g. if the exception
  376. // is passed to a Context manager's `__exit__` method in Python) but will
  377. // usually be caught at the point of recording the exception in most languages.
  378. // It is usually not possible to determine at the point where an exception is
  379. // thrown
  380. // whether it will escape the scope of a span.
  381. // However, it is trivial to know that an exception
  382. // will escape, if one checks for an active exception just before ending the span,
  383. // as done in the [example above](#exception-end-example).
  384. // It follows that an exception may still escape the scope of the span
  385. // even if the `exception.escaped` attribute was not set or set to false,
  386. // since the event might have been recorded at a time where it was not
  387. // clear whether the exception will escape.
  388. ExceptionEscapedKey = attribute.Key("exception.escaped")
  389. )
  390. // This semantic convention describes an instance of a function that runs without provisioning or managing of servers (also known as serverless functions or Function as a Service (FaaS)) with spans.
  391. const (
  392. // Type of the trigger on which the function is executed.
  393. //
  394. // Type: Enum
  395. // Required: On FaaS instances, faas.trigger MUST be set on incoming invocations.
  396. // Clients invoking FaaS instances MUST set `faas.trigger` on outgoing
  397. // invocations, if it is known to the client. This is, for example, not the case,
  398. // when the transport layer is abstracted in a FaaS client framework without
  399. // access to its configuration.
  400. // Stability: stable
  401. FaaSTriggerKey = attribute.Key("faas.trigger")
  402. // The execution ID of the current function execution.
  403. //
  404. // Type: string
  405. // Required: No
  406. // Stability: stable
  407. // Examples: 'af9d5aa4-a685-4c5f-a22b-444f80b3cc28'
  408. FaaSExecutionKey = attribute.Key("faas.execution")
  409. )
  410. var (
  411. // A response to some data source operation such as a database or filesystem read/write
  412. FaaSTriggerDatasource = FaaSTriggerKey.String("datasource")
  413. // To provide an answer to an inbound HTTP request
  414. FaaSTriggerHTTP = FaaSTriggerKey.String("http")
  415. // A function is set to be executed when messages are sent to a messaging system
  416. FaaSTriggerPubsub = FaaSTriggerKey.String("pubsub")
  417. // A function is scheduled to be executed regularly
  418. FaaSTriggerTimer = FaaSTriggerKey.String("timer")
  419. // If none of the others apply
  420. FaaSTriggerOther = FaaSTriggerKey.String("other")
  421. )
  422. // Semantic Convention for FaaS triggered as a response to some data source operation such as a database or filesystem read/write.
  423. const (
  424. // The name of the source on which the triggering operation was performed. For
  425. // example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos
  426. // DB to the database name.
  427. //
  428. // Type: string
  429. // Required: Always
  430. // Stability: stable
  431. // Examples: 'myBucketName', 'myDBName'
  432. FaaSDocumentCollectionKey = attribute.Key("faas.document.collection")
  433. // Describes the type of the operation that was performed on the data.
  434. //
  435. // Type: Enum
  436. // Required: Always
  437. // Stability: stable
  438. FaaSDocumentOperationKey = attribute.Key("faas.document.operation")
  439. // A string containing the time when the data was accessed in the [ISO
  440. // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed
  441. // in [UTC](https://www.w3.org/TR/NOTE-datetime).
  442. //
  443. // Type: string
  444. // Required: Always
  445. // Stability: stable
  446. // Examples: '2020-01-23T13:47:06Z'
  447. FaaSDocumentTimeKey = attribute.Key("faas.document.time")
  448. // The document name/table subjected to the operation. For example, in Cloud
  449. // Storage or S3 is the name of the file, and in Cosmos DB the table name.
  450. //
  451. // Type: string
  452. // Required: No
  453. // Stability: stable
  454. // Examples: 'myFile.txt', 'myTableName'
  455. FaaSDocumentNameKey = attribute.Key("faas.document.name")
  456. )
  457. var (
  458. // When a new object is created
  459. FaaSDocumentOperationInsert = FaaSDocumentOperationKey.String("insert")
  460. // When an object is modified
  461. FaaSDocumentOperationEdit = FaaSDocumentOperationKey.String("edit")
  462. // When an object is deleted
  463. FaaSDocumentOperationDelete = FaaSDocumentOperationKey.String("delete")
  464. )
  465. // Semantic Convention for FaaS scheduled to be executed regularly.
  466. const (
  467. // A string containing the function invocation time in the [ISO
  468. // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed
  469. // in [UTC](https://www.w3.org/TR/NOTE-datetime).
  470. //
  471. // Type: string
  472. // Required: Always
  473. // Stability: stable
  474. // Examples: '2020-01-23T13:47:06Z'
  475. FaaSTimeKey = attribute.Key("faas.time")
  476. // A string containing the schedule period as [Cron Expression](https://docs.oracl
  477. // e.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm).
  478. //
  479. // Type: string
  480. // Required: No
  481. // Stability: stable
  482. // Examples: '0/5 * * * ? *'
  483. FaaSCronKey = attribute.Key("faas.cron")
  484. )
  485. // Contains additional attributes for incoming FaaS spans.
  486. const (
  487. // A boolean that is true if the serverless function is executed for the first
  488. // time (aka cold-start).
  489. //
  490. // Type: boolean
  491. // Required: No
  492. // Stability: stable
  493. FaaSColdstartKey = attribute.Key("faas.coldstart")
  494. )
  495. // Contains additional attributes for outgoing FaaS spans.
  496. const (
  497. // The name of the invoked function.
  498. //
  499. // Type: string
  500. // Required: Always
  501. // Stability: stable
  502. // Examples: 'my-function'
  503. // Note: SHOULD be equal to the `faas.name` resource attribute of the invoked
  504. // function.
  505. FaaSInvokedNameKey = attribute.Key("faas.invoked_name")
  506. // The cloud provider of the invoked function.
  507. //
  508. // Type: Enum
  509. // Required: Always
  510. // Stability: stable
  511. // Examples: 'aws'
  512. // Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked
  513. // function.
  514. FaaSInvokedProviderKey = attribute.Key("faas.invoked_provider")
  515. // The cloud region of the invoked function.
  516. //
  517. // Type: string
  518. // Required: For some cloud providers, like AWS or GCP, the region in which a
  519. // function is hosted is essential to uniquely identify the function and also part
  520. // of its endpoint. Since it's part of the endpoint being called, the region is
  521. // always known to clients. In these cases, `faas.invoked_region` MUST be set
  522. // accordingly. If the region is unknown to the client or not required for
  523. // identifying the invoked function, setting `faas.invoked_region` is optional.
  524. // Stability: stable
  525. // Examples: 'eu-central-1'
  526. // Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked
  527. // function.
  528. FaaSInvokedRegionKey = attribute.Key("faas.invoked_region")
  529. )
  530. var (
  531. // Amazon Web Services
  532. FaaSInvokedProviderAWS = FaaSInvokedProviderKey.String("aws")
  533. // Microsoft Azure
  534. FaaSInvokedProviderAzure = FaaSInvokedProviderKey.String("azure")
  535. // Google Cloud Platform
  536. FaaSInvokedProviderGCP = FaaSInvokedProviderKey.String("gcp")
  537. )
  538. // These attributes may be used for any network related operation.
  539. const (
  540. // Transport protocol used. See note below.
  541. //
  542. // Type: Enum
  543. // Required: No
  544. // Stability: stable
  545. // Examples: 'ip_tcp'
  546. NetTransportKey = attribute.Key("net.transport")
  547. // Remote address of the peer (dotted decimal for IPv4 or
  548. // [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6)
  549. //
  550. // Type: string
  551. // Required: No
  552. // Stability: stable
  553. // Examples: '127.0.0.1'
  554. NetPeerIPKey = attribute.Key("net.peer.ip")
  555. // Remote port number.
  556. //
  557. // Type: int
  558. // Required: No
  559. // Stability: stable
  560. // Examples: 80, 8080, 443
  561. NetPeerPortKey = attribute.Key("net.peer.port")
  562. // Remote hostname or similar, see note below.
  563. //
  564. // Type: string
  565. // Required: No
  566. // Stability: stable
  567. // Examples: 'example.com'
  568. NetPeerNameKey = attribute.Key("net.peer.name")
  569. // Like `net.peer.ip` but for the host IP. Useful in case of a multi-IP host.
  570. //
  571. // Type: string
  572. // Required: No
  573. // Stability: stable
  574. // Examples: '192.168.0.1'
  575. NetHostIPKey = attribute.Key("net.host.ip")
  576. // Like `net.peer.port` but for the host port.
  577. //
  578. // Type: int
  579. // Required: No
  580. // Stability: stable
  581. // Examples: 35555
  582. NetHostPortKey = attribute.Key("net.host.port")
  583. // Local hostname or similar, see note below.
  584. //
  585. // Type: string
  586. // Required: No
  587. // Stability: stable
  588. // Examples: 'localhost'
  589. NetHostNameKey = attribute.Key("net.host.name")
  590. )
  591. var (
  592. // ip_tcp
  593. NetTransportTCP = NetTransportKey.String("ip_tcp")
  594. // ip_udp
  595. NetTransportUDP = NetTransportKey.String("ip_udp")
  596. // Another IP-based protocol
  597. NetTransportIP = NetTransportKey.String("ip")
  598. // Unix Domain socket. See below
  599. NetTransportUnix = NetTransportKey.String("unix")
  600. // Named or anonymous pipe. See note below
  601. NetTransportPipe = NetTransportKey.String("pipe")
  602. // In-process communication
  603. NetTransportInProc = NetTransportKey.String("inproc")
  604. // Something else (non IP-based)
  605. NetTransportOther = NetTransportKey.String("other")
  606. )
  607. // Operations that access some remote service.
  608. const (
  609. // The [`service.name`](../../resource/semantic_conventions/README.md#service) of
  610. // the remote service. SHOULD be equal to the actual `service.name` resource
  611. // attribute of the remote service if any.
  612. //
  613. // Type: string
  614. // Required: No
  615. // Stability: stable
  616. // Examples: 'AuthTokenCache'
  617. PeerServiceKey = attribute.Key("peer.service")
  618. )
  619. // These attributes may be used for any operation with an authenticated and/or authorized enduser.
  620. const (
  621. // Username or client_id extracted from the access token or
  622. // [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the
  623. // inbound request from outside the system.
  624. //
  625. // Type: string
  626. // Required: No
  627. // Stability: stable
  628. // Examples: 'username'
  629. EnduserIDKey = attribute.Key("enduser.id")
  630. // Actual/assumed role the client is making the request under extracted from token
  631. // or application security context.
  632. //
  633. // Type: string
  634. // Required: No
  635. // Stability: stable
  636. // Examples: 'admin'
  637. EnduserRoleKey = attribute.Key("enduser.role")
  638. // Scopes or granted authorities the client currently possesses extracted from
  639. // token or application security context. The value would come from the scope
  640. // associated with an [OAuth 2.0 Access
  641. // Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value
  642. // in a [SAML 2.0 Assertion](http://docs.oasis-
  643. // open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html).
  644. //
  645. // Type: string
  646. // Required: No
  647. // Stability: stable
  648. // Examples: 'read:message, write:files'
  649. EnduserScopeKey = attribute.Key("enduser.scope")
  650. )
  651. // These attributes may be used for any operation to store information about a thread that started a span.
  652. const (
  653. // Current "managed" thread ID (as opposed to OS thread ID).
  654. //
  655. // Type: int
  656. // Required: No
  657. // Stability: stable
  658. // Examples: 42
  659. ThreadIDKey = attribute.Key("thread.id")
  660. // Current thread name.
  661. //
  662. // Type: string
  663. // Required: No
  664. // Stability: stable
  665. // Examples: 'main'
  666. ThreadNameKey = attribute.Key("thread.name")
  667. )
  668. // These attributes allow to report this unit of code and therefore to provide more context about the span.
  669. const (
  670. // The method or function name, or equivalent (usually rightmost part of the code
  671. // unit's name).
  672. //
  673. // Type: string
  674. // Required: No
  675. // Stability: stable
  676. // Examples: 'serveRequest'
  677. CodeFunctionKey = attribute.Key("code.function")
  678. // The "namespace" within which `code.function` is defined. Usually the qualified
  679. // class or module name, such that `code.namespace` + some separator +
  680. // `code.function` form a unique identifier for the code unit.
  681. //
  682. // Type: string
  683. // Required: No
  684. // Stability: stable
  685. // Examples: 'com.example.MyHTTPService'
  686. CodeNamespaceKey = attribute.Key("code.namespace")
  687. // The source code file name that identifies the code unit as uniquely as possible
  688. // (preferably an absolute file path).
  689. //
  690. // Type: string
  691. // Required: No
  692. // Stability: stable
  693. // Examples: '/usr/local/MyApplication/content_root/app/index.php'
  694. CodeFilepathKey = attribute.Key("code.filepath")
  695. // The line number in `code.filepath` best representing the operation. It SHOULD
  696. // point within the code unit named in `code.function`.
  697. //
  698. // Type: int
  699. // Required: No
  700. // Stability: stable
  701. // Examples: 42
  702. CodeLineNumberKey = attribute.Key("code.lineno")
  703. )
  704. // This document defines semantic conventions for HTTP client and server Spans.
  705. const (
  706. // HTTP request method.
  707. //
  708. // Type: string
  709. // Required: Always
  710. // Stability: stable
  711. // Examples: 'GET', 'POST', 'HEAD'
  712. HTTPMethodKey = attribute.Key("http.method")
  713. // Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`.
  714. // Usually the fragment is not transmitted over HTTP, but if it is known, it
  715. // should be included nevertheless.
  716. //
  717. // Type: string
  718. // Required: No
  719. // Stability: stable
  720. // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv'
  721. // Note: `http.url` MUST NOT contain credentials passed via URL in form of
  722. // `https://username:password@www.example.com/`. In such case the attribute's
  723. // value should be `https://www.example.com/`.
  724. HTTPURLKey = attribute.Key("http.url")
  725. // The full request target as passed in a HTTP request line or equivalent.
  726. //
  727. // Type: string
  728. // Required: No
  729. // Stability: stable
  730. // Examples: '/path/12314/?q=ddds#123'
  731. HTTPTargetKey = attribute.Key("http.target")
  732. // The value of the [HTTP host
  733. // header](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is
  734. // empty or not present, this attribute should be the same.
  735. //
  736. // Type: string
  737. // Required: No
  738. // Stability: stable
  739. // Examples: 'www.example.org'
  740. HTTPHostKey = attribute.Key("http.host")
  741. // The URI scheme identifying the used protocol.
  742. //
  743. // Type: string
  744. // Required: No
  745. // Stability: stable
  746. // Examples: 'http', 'https'
  747. HTTPSchemeKey = attribute.Key("http.scheme")
  748. // [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).
  749. //
  750. // Type: int
  751. // Required: If and only if one was received/sent.
  752. // Stability: stable
  753. // Examples: 200
  754. HTTPStatusCodeKey = attribute.Key("http.status_code")
  755. // Kind of HTTP protocol used.
  756. //
  757. // Type: Enum
  758. // Required: No
  759. // Stability: stable
  760. // Examples: '1.0'
  761. // Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP`
  762. // except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed.
  763. HTTPFlavorKey = attribute.Key("http.flavor")
  764. // Value of the [HTTP User-
  765. // Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the
  766. // client.
  767. //
  768. // Type: string
  769. // Required: No
  770. // Stability: stable
  771. // Examples: 'CERN-LineMode/2.15 libwww/2.17b3'
  772. HTTPUserAgentKey = attribute.Key("http.user_agent")
  773. // The size of the request payload body in bytes. This is the number of bytes
  774. // transferred excluding headers and is often, but not always, present as the
  775. // [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For
  776. // requests using transport encoding, this should be the compressed size.
  777. //
  778. // Type: int
  779. // Required: No
  780. // Stability: stable
  781. // Examples: 3495
  782. HTTPRequestContentLengthKey = attribute.Key("http.request_content_length")
  783. // The size of the uncompressed request payload body after transport decoding. Not
  784. // set if transport encoding not used.
  785. //
  786. // Type: int
  787. // Required: No
  788. // Stability: stable
  789. // Examples: 5493
  790. HTTPRequestContentLengthUncompressedKey = attribute.Key("http.request_content_length_uncompressed")
  791. // The size of the response payload body in bytes. This is the number of bytes
  792. // transferred excluding headers and is often, but not always, present as the
  793. // [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For
  794. // requests using transport encoding, this should be the compressed size.
  795. //
  796. // Type: int
  797. // Required: No
  798. // Stability: stable
  799. // Examples: 3495
  800. HTTPResponseContentLengthKey = attribute.Key("http.response_content_length")
  801. // The size of the uncompressed response payload body after transport decoding.
  802. // Not set if transport encoding not used.
  803. //
  804. // Type: int
  805. // Required: No
  806. // Stability: stable
  807. // Examples: 5493
  808. HTTPResponseContentLengthUncompressedKey = attribute.Key("http.response_content_length_uncompressed")
  809. )
  810. var (
  811. // HTTP 1.0
  812. HTTPFlavorHTTP10 = HTTPFlavorKey.String("1.0")
  813. // HTTP 1.1
  814. HTTPFlavorHTTP11 = HTTPFlavorKey.String("1.1")
  815. // HTTP 2
  816. HTTPFlavorHTTP20 = HTTPFlavorKey.String("2.0")
  817. // SPDY protocol
  818. HTTPFlavorSPDY = HTTPFlavorKey.String("SPDY")
  819. // QUIC protocol
  820. HTTPFlavorQUIC = HTTPFlavorKey.String("QUIC")
  821. )
  822. // Semantic Convention for HTTP Server
  823. const (
  824. // The primary server name of the matched virtual host. This should be obtained
  825. // via configuration. If no such configuration can be obtained, this attribute
  826. // MUST NOT be set ( `net.host.name` should be used instead).
  827. //
  828. // Type: string
  829. // Required: No
  830. // Stability: stable
  831. // Examples: 'example.com'
  832. // Note: `http.url` is usually not readily available on the server side but would
  833. // have to be assembled in a cumbersome and sometimes lossy process from other
  834. // information (see e.g. open-telemetry/opentelemetry-python/pull/148). It is thus
  835. // preferred to supply the raw data that is available.
  836. HTTPServerNameKey = attribute.Key("http.server_name")
  837. // The matched route (path template).
  838. //
  839. // Type: string
  840. // Required: No
  841. // Stability: stable
  842. // Examples: '/users/:userID?'
  843. HTTPRouteKey = attribute.Key("http.route")
  844. // The IP address of the original client behind all proxies, if known (e.g. from
  845. // [X-Forwarded-For](https://developer.mozilla.org/en-
  846. // US/docs/Web/HTTP/Headers/X-Forwarded-For)).
  847. //
  848. // Type: string
  849. // Required: No
  850. // Stability: stable
  851. // Examples: '83.164.160.102'
  852. // Note: This is not necessarily the same as `net.peer.ip`, which would identify
  853. // the network-level peer, which may be a proxy.
  854. HTTPClientIPKey = attribute.Key("http.client_ip")
  855. )
  856. // Attributes that exist for multiple DynamoDB request types.
  857. const (
  858. // The keys in the `RequestItems` object field.
  859. //
  860. // Type: string[]
  861. // Required: No
  862. // Stability: stable
  863. // Examples: 'Users', 'Cats'
  864. AWSDynamoDBTableNamesKey = attribute.Key("aws.dynamodb.table_names")
  865. // The JSON-serialized value of each item in the `ConsumedCapacity` response
  866. // field.
  867. //
  868. // Type: string[]
  869. // Required: No
  870. // Stability: stable
  871. // Examples: '{ "CapacityUnits": number, "GlobalSecondaryIndexes": { "string" : {
  872. // "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits":
  873. // number } }, "LocalSecondaryIndexes": { "string" : { "CapacityUnits": number,
  874. // "ReadCapacityUnits": number, "WriteCapacityUnits": number } },
  875. // "ReadCapacityUnits": number, "Table": { "CapacityUnits": number,
  876. // "ReadCapacityUnits": number, "WriteCapacityUnits": number }, "TableName":
  877. // "string", "WriteCapacityUnits": number }'
  878. AWSDynamoDBConsumedCapacityKey = attribute.Key("aws.dynamodb.consumed_capacity")
  879. // The JSON-serialized value of the `ItemCollectionMetrics` response field.
  880. //
  881. // Type: string
  882. // Required: No
  883. // Stability: stable
  884. // Examples: '{ "string" : [ { "ItemCollectionKey": { "string" : { "B": blob,
  885. // "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": { "string" :
  886. // "AttributeValue" }, "N": "string", "NS": [ "string" ], "NULL": boolean, "S":
  887. // "string", "SS": [ "string" ] } }, "SizeEstimateRangeGB": [ number ] } ] }'
  888. AWSDynamoDBItemCollectionMetricsKey = attribute.Key("aws.dynamodb.item_collection_metrics")
  889. // The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter.
  890. //
  891. // Type: double
  892. // Required: No
  893. // Stability: stable
  894. // Examples: 1.0, 2.0
  895. AWSDynamoDBProvisionedReadCapacityKey = attribute.Key("aws.dynamodb.provisioned_read_capacity")
  896. // The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter.
  897. //
  898. // Type: double
  899. // Required: No
  900. // Stability: stable
  901. // Examples: 1.0, 2.0
  902. AWSDynamoDBProvisionedWriteCapacityKey = attribute.Key("aws.dynamodb.provisioned_write_capacity")
  903. // The value of the `ConsistentRead` request parameter.
  904. //
  905. // Type: boolean
  906. // Required: No
  907. // Stability: stable
  908. AWSDynamoDBConsistentReadKey = attribute.Key("aws.dynamodb.consistent_read")
  909. // The value of the `ProjectionExpression` request parameter.
  910. //
  911. // Type: string
  912. // Required: No
  913. // Stability: stable
  914. // Examples: 'Title', 'Title, Price, Color', 'Title, Description, RelatedItems,
  915. // ProductReviews'
  916. AWSDynamoDBProjectionKey = attribute.Key("aws.dynamodb.projection")
  917. // The value of the `Limit` request parameter.
  918. //
  919. // Type: int
  920. // Required: No
  921. // Stability: stable
  922. // Examples: 10
  923. AWSDynamoDBLimitKey = attribute.Key("aws.dynamodb.limit")
  924. // The value of the `AttributesToGet` request parameter.
  925. //
  926. // Type: string[]
  927. // Required: No
  928. // Stability: stable
  929. // Examples: 'lives', 'id'
  930. AWSDynamoDBAttributesToGetKey = attribute.Key("aws.dynamodb.attributes_to_get")
  931. // The value of the `IndexName` request parameter.
  932. //
  933. // Type: string
  934. // Required: No
  935. // Stability: stable
  936. // Examples: 'name_to_group'
  937. AWSDynamoDBIndexNameKey = attribute.Key("aws.dynamodb.index_name")
  938. // The value of the `Select` request parameter.
  939. //
  940. // Type: string
  941. // Required: No
  942. // Stability: stable
  943. // Examples: 'ALL_ATTRIBUTES', 'COUNT'
  944. AWSDynamoDBSelectKey = attribute.Key("aws.dynamodb.select")
  945. )
  946. // DynamoDB.CreateTable
  947. const (
  948. // The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request
  949. // field
  950. //
  951. // Type: string[]
  952. // Required: No
  953. // Stability: stable
  954. // Examples: '{ "IndexName": "string", "KeySchema": [ { "AttributeName": "string",
  955. // "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ],
  956. // "ProjectionType": "string" }, "ProvisionedThroughput": { "ReadCapacityUnits":
  957. // number, "WriteCapacityUnits": number } }'
  958. AWSDynamoDBGlobalSecondaryIndexesKey = attribute.Key("aws.dynamodb.global_secondary_indexes")
  959. // The JSON-serialized value of each item of the `LocalSecondaryIndexes` request
  960. // field.
  961. //
  962. // Type: string[]
  963. // Required: No
  964. // Stability: stable
  965. // Examples: '{ "IndexARN": "string", "IndexName": "string", "IndexSizeBytes":
  966. // number, "ItemCount": number, "KeySchema": [ { "AttributeName": "string",
  967. // "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ],
  968. // "ProjectionType": "string" } }'
  969. AWSDynamoDBLocalSecondaryIndexesKey = attribute.Key("aws.dynamodb.local_secondary_indexes")
  970. )
  971. // DynamoDB.ListTables
  972. const (
  973. // The value of the `ExclusiveStartTableName` request parameter.
  974. //
  975. // Type: string
  976. // Required: No
  977. // Stability: stable
  978. // Examples: 'Users', 'CatsTable'
  979. AWSDynamoDBExclusiveStartTableKey = attribute.Key("aws.dynamodb.exclusive_start_table")
  980. // The the number of items in the `TableNames` response parameter.
  981. //
  982. // Type: int
  983. // Required: No
  984. // Stability: stable
  985. // Examples: 20
  986. AWSDynamoDBTableCountKey = attribute.Key("aws.dynamodb.table_count")
  987. )
  988. // DynamoDB.Query
  989. const (
  990. // The value of the `ScanIndexForward` request parameter.
  991. //
  992. // Type: boolean
  993. // Required: No
  994. // Stability: stable
  995. AWSDynamoDBScanForwardKey = attribute.Key("aws.dynamodb.scan_forward")
  996. )
  997. // DynamoDB.Scan
  998. const (
  999. // The value of the `Segment` request parameter.
  1000. //
  1001. // Type: int
  1002. // Required: No
  1003. // Stability: stable
  1004. // Examples: 10
  1005. AWSDynamoDBSegmentKey = attribute.Key("aws.dynamodb.segment")
  1006. // The value of the `TotalSegments` request parameter.
  1007. //
  1008. // Type: int
  1009. // Required: No
  1010. // Stability: stable
  1011. // Examples: 100
  1012. AWSDynamoDBTotalSegmentsKey = attribute.Key("aws.dynamodb.total_segments")
  1013. // The value of the `Count` response parameter.
  1014. //
  1015. // Type: int
  1016. // Required: No
  1017. // Stability: stable
  1018. // Examples: 10
  1019. AWSDynamoDBCountKey = attribute.Key("aws.dynamodb.count")
  1020. // The value of the `ScannedCount` response parameter.
  1021. //
  1022. // Type: int
  1023. // Required: No
  1024. // Stability: stable
  1025. // Examples: 50
  1026. AWSDynamoDBScannedCountKey = attribute.Key("aws.dynamodb.scanned_count")
  1027. )
  1028. // DynamoDB.UpdateTable
  1029. const (
  1030. // The JSON-serialized value of each item in the `AttributeDefinitions` request
  1031. // field.
  1032. //
  1033. // Type: string[]
  1034. // Required: No
  1035. // Stability: stable
  1036. // Examples: '{ "AttributeName": "string", "AttributeType": "string" }'
  1037. AWSDynamoDBAttributeDefinitionsKey = attribute.Key("aws.dynamodb.attribute_definitions")
  1038. // The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates`
  1039. // request field.
  1040. //
  1041. // Type: string[]
  1042. // Required: No
  1043. // Stability: stable
  1044. // Examples: '{ "Create": { "IndexName": "string", "KeySchema": [ {
  1045. // "AttributeName": "string", "KeyType": "string" } ], "Projection": {
  1046. // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" },
  1047. // "ProvisionedThroughput": { "ReadCapacityUnits": number, "WriteCapacityUnits":
  1048. // number } }'
  1049. AWSDynamoDBGlobalSecondaryIndexUpdatesKey = attribute.Key("aws.dynamodb.global_secondary_index_updates")
  1050. )
  1051. // This document defines the attributes used in messaging systems.
  1052. const (
  1053. // A string identifying the messaging system.
  1054. //
  1055. // Type: string
  1056. // Required: Always
  1057. // Stability: stable
  1058. // Examples: 'kafka', 'rabbitmq', 'activemq', 'AmazonSQS'
  1059. MessagingSystemKey = attribute.Key("messaging.system")
  1060. // The message destination name. This might be equal to the span name but is
  1061. // required nevertheless.
  1062. //
  1063. // Type: string
  1064. // Required: Always
  1065. // Stability: stable
  1066. // Examples: 'MyQueue', 'MyTopic'
  1067. MessagingDestinationKey = attribute.Key("messaging.destination")
  1068. // The kind of message destination
  1069. //
  1070. // Type: Enum
  1071. // Required: Required only if the message destination is either a `queue` or
  1072. // `topic`.
  1073. // Stability: stable
  1074. MessagingDestinationKindKey = attribute.Key("messaging.destination_kind")
  1075. // A boolean that is true if the message destination is temporary.
  1076. //
  1077. // Type: boolean
  1078. // Required: If missing, it is assumed to be false.
  1079. // Stability: stable
  1080. MessagingTempDestinationKey = attribute.Key("messaging.temp_destination")
  1081. // The name of the transport protocol.
  1082. //
  1083. // Type: string
  1084. // Required: No
  1085. // Stability: stable
  1086. // Examples: 'AMQP', 'MQTT'
  1087. MessagingProtocolKey = attribute.Key("messaging.protocol")
  1088. // The version of the transport protocol.
  1089. //
  1090. // Type: string
  1091. // Required: No
  1092. // Stability: stable
  1093. // Examples: '0.9.1'
  1094. MessagingProtocolVersionKey = attribute.Key("messaging.protocol_version")
  1095. // Connection string.
  1096. //
  1097. // Type: string
  1098. // Required: No
  1099. // Stability: stable
  1100. // Examples: 'tibjmsnaming://localhost:7222',
  1101. // 'https://queue.amazonaws.com/80398EXAMPLE/MyQueue'
  1102. MessagingURLKey = attribute.Key("messaging.url")
  1103. // A value used by the messaging system as an identifier for the message,
  1104. // represented as a string.
  1105. //
  1106. // Type: string
  1107. // Required: No
  1108. // Stability: stable
  1109. // Examples: '452a7c7c7c7048c2f887f61572b18fc2'
  1110. MessagingMessageIDKey = attribute.Key("messaging.message_id")
  1111. // The [conversation ID](#conversations) identifying the conversation to which the
  1112. // message belongs, represented as a string. Sometimes called "Correlation ID".
  1113. //
  1114. // Type: string
  1115. // Required: No
  1116. // Stability: stable
  1117. // Examples: 'MyConversationID'
  1118. MessagingConversationIDKey = attribute.Key("messaging.conversation_id")
  1119. // The (uncompressed) size of the message payload in bytes. Also use this
  1120. // attribute if it is unknown whether the compressed or uncompressed payload size
  1121. // is reported.
  1122. //
  1123. // Type: int
  1124. // Required: No
  1125. // Stability: stable
  1126. // Examples: 2738
  1127. MessagingMessagePayloadSizeBytesKey = attribute.Key("messaging.message_payload_size_bytes")
  1128. // The compressed size of the message payload in bytes.
  1129. //
  1130. // Type: int
  1131. // Required: No
  1132. // Stability: stable
  1133. // Examples: 2048
  1134. MessagingMessagePayloadCompressedSizeBytesKey = attribute.Key("messaging.message_payload_compressed_size_bytes")
  1135. )
  1136. var (
  1137. // A message sent to a queue
  1138. MessagingDestinationKindQueue = MessagingDestinationKindKey.String("queue")
  1139. // A message sent to a topic
  1140. MessagingDestinationKindTopic = MessagingDestinationKindKey.String("topic")
  1141. )
  1142. // Semantic convention for a consumer of messages received from a messaging system
  1143. const (
  1144. // A string identifying the kind of message consumption as defined in the
  1145. // [Operation names](#operation-names) section above. If the operation is "send",
  1146. // this attribute MUST NOT be set, since the operation can be inferred from the
  1147. // span kind in that case.
  1148. //
  1149. // Type: Enum
  1150. // Required: No
  1151. // Stability: stable
  1152. MessagingOperationKey = attribute.Key("messaging.operation")
  1153. )
  1154. var (
  1155. // receive
  1156. MessagingOperationReceive = MessagingOperationKey.String("receive")
  1157. // process
  1158. MessagingOperationProcess = MessagingOperationKey.String("process")
  1159. )
  1160. // Attributes for RabbitMQ
  1161. const (
  1162. // RabbitMQ message routing key.
  1163. //
  1164. // Type: string
  1165. // Required: Unless it is empty.
  1166. // Stability: stable
  1167. // Examples: 'myKey'
  1168. MessagingRabbitmqRoutingKeyKey = attribute.Key("messaging.rabbitmq.routing_key")
  1169. )
  1170. // Attributes for Apache Kafka
  1171. const (
  1172. // Message keys in Kafka are used for grouping alike messages to ensure they're
  1173. // processed on the same partition. They differ from `messaging.message_id` in
  1174. // that they're not unique. If the key is `null`, the attribute MUST NOT be set.
  1175. //
  1176. // Type: string
  1177. // Required: No
  1178. // Stability: stable
  1179. // Examples: 'myKey'
  1180. // Note: If the key type is not string, it's string representation has to be
  1181. // supplied for the attribute. If the key has no unambiguous, canonical string
  1182. // form, don't include its value.
  1183. MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message_key")
  1184. // Name of the Kafka Consumer Group that is handling the message. Only applies to
  1185. // consumers, not producers.
  1186. //
  1187. // Type: string
  1188. // Required: No
  1189. // Stability: stable
  1190. // Examples: 'my-group'
  1191. MessagingKafkaConsumerGroupKey = attribute.Key("messaging.kafka.consumer_group")
  1192. // Client ID for the Consumer or Producer that is handling the message.
  1193. //
  1194. // Type: string
  1195. // Required: No
  1196. // Stability: stable
  1197. // Examples: 'client-5'
  1198. MessagingKafkaClientIDKey = attribute.Key("messaging.kafka.client_id")
  1199. // Partition the message is sent to.
  1200. //
  1201. // Type: int
  1202. // Required: No
  1203. // Stability: stable
  1204. // Examples: 2
  1205. MessagingKafkaPartitionKey = attribute.Key("messaging.kafka.partition")
  1206. // A boolean that is true if the message is a tombstone.
  1207. //
  1208. // Type: boolean
  1209. // Required: If missing, it is assumed to be false.
  1210. // Stability: stable
  1211. MessagingKafkaTombstoneKey = attribute.Key("messaging.kafka.tombstone")
  1212. )
  1213. // This document defines semantic conventions for remote procedure calls.
  1214. const (
  1215. // A string identifying the remoting system.
  1216. //
  1217. // Type: string
  1218. // Required: Always
  1219. // Stability: stable
  1220. // Examples: 'grpc', 'java_rmi', 'wcf'
  1221. RPCSystemKey = attribute.Key("rpc.system")
  1222. // The full name of the service being called, including its package name, if
  1223. // applicable.
  1224. //
  1225. // Type: string
  1226. // Required: No, but recommended
  1227. // Stability: stable
  1228. // Examples: 'myservice.EchoService'
  1229. RPCServiceKey = attribute.Key("rpc.service")
  1230. // The name of the method being called, must be equal to the $method part in the
  1231. // span name.
  1232. //
  1233. // Type: string
  1234. // Required: No, but recommended
  1235. // Stability: stable
  1236. // Examples: 'exampleMethod'
  1237. RPCMethodKey = attribute.Key("rpc.method")
  1238. )
  1239. // Tech-specific attributes for gRPC.
  1240. const (
  1241. // The [numeric status
  1242. // code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC
  1243. // request.
  1244. //
  1245. // Type: Enum
  1246. // Required: Always
  1247. // Stability: stable
  1248. // Examples: 0, 1, 16
  1249. RPCGRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code")
  1250. )
  1251. var (
  1252. // OK
  1253. RPCGRPCStatusCodeOk = RPCGRPCStatusCodeKey.Int(0)
  1254. // CANCELLED
  1255. RPCGRPCStatusCodeCancelled = RPCGRPCStatusCodeKey.Int(1)
  1256. // UNKNOWN
  1257. RPCGRPCStatusCodeUnknown = RPCGRPCStatusCodeKey.Int(2)
  1258. // INVALID_ARGUMENT
  1259. RPCGRPCStatusCodeInvalidArgument = RPCGRPCStatusCodeKey.Int(3)
  1260. // DEADLINE_EXCEEDED
  1261. RPCGRPCStatusCodeDeadlineExceeded = RPCGRPCStatusCodeKey.Int(4)
  1262. // NOT_FOUND
  1263. RPCGRPCStatusCodeNotFound = RPCGRPCStatusCodeKey.Int(5)
  1264. // ALREADY_EXISTS
  1265. RPCGRPCStatusCodeAlreadyExists = RPCGRPCStatusCodeKey.Int(6)
  1266. // PERMISSION_DENIED
  1267. RPCGRPCStatusCodePermissionDenied = RPCGRPCStatusCodeKey.Int(7)
  1268. // RESOURCE_EXHAUSTED
  1269. RPCGRPCStatusCodeResourceExhausted = RPCGRPCStatusCodeKey.Int(8)
  1270. // FAILED_PRECONDITION
  1271. RPCGRPCStatusCodeFailedPrecondition = RPCGRPCStatusCodeKey.Int(9)
  1272. // ABORTED
  1273. RPCGRPCStatusCodeAborted = RPCGRPCStatusCodeKey.Int(10)
  1274. // OUT_OF_RANGE
  1275. RPCGRPCStatusCodeOutOfRange = RPCGRPCStatusCodeKey.Int(11)
  1276. // UNIMPLEMENTED
  1277. RPCGRPCStatusCodeUnimplemented = RPCGRPCStatusCodeKey.Int(12)
  1278. // INTERNAL
  1279. RPCGRPCStatusCodeInternal = RPCGRPCStatusCodeKey.Int(13)
  1280. // UNAVAILABLE
  1281. RPCGRPCStatusCodeUnavailable = RPCGRPCStatusCodeKey.Int(14)
  1282. // DATA_LOSS
  1283. RPCGRPCStatusCodeDataLoss = RPCGRPCStatusCodeKey.Int(15)
  1284. // UNAUTHENTICATED
  1285. RPCGRPCStatusCodeUnauthenticated = RPCGRPCStatusCodeKey.Int(16)
  1286. )
  1287. // Tech-specific attributes for [JSON RPC](https://www.jsonrpc.org/).
  1288. const (
  1289. // Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC
  1290. // 1.0 does not specify this, the value can be omitted.
  1291. //
  1292. // Type: string
  1293. // Required: If missing, it is assumed to be "1.0".
  1294. // Stability: stable
  1295. // Examples: '2.0', '1.0'
  1296. RPCJsonrpcVersionKey = attribute.Key("rpc.jsonrpc.version")
  1297. // `method` property from request. Unlike `rpc.method`, this may not relate to the
  1298. // actual method being called. Useful for client-side traces since client does not
  1299. // know what will be called on the server.
  1300. //
  1301. // Type: string
  1302. // Required: Always
  1303. // Stability: stable
  1304. // Examples: 'users.create', 'get_users'
  1305. RPCJsonrpcMethodKey = attribute.Key("rpc.jsonrpc.method")
  1306. // `id` property of request or response. Since protocol allows id to be int,
  1307. // string, `null` or missing (for notifications), value is expected to be cast to
  1308. // string for simplicity. Use empty string in case of `null` value. Omit entirely
  1309. // if this is a notification.
  1310. //
  1311. // Type: string
  1312. // Required: No
  1313. // Stability: stable
  1314. // Examples: '10', 'request-7', ''
  1315. RPCJsonrpcRequestIDKey = attribute.Key("rpc.jsonrpc.request_id")
  1316. // `error.code` property of response if it is an error response.
  1317. //
  1318. // Type: int
  1319. // Required: If missing, response is assumed to be successful.
  1320. // Stability: stable
  1321. // Examples: -32700, 100
  1322. RPCJsonrpcErrorCodeKey = attribute.Key("rpc.jsonrpc.error_code")
  1323. // `error.message` property of response if it is an error response.
  1324. //
  1325. // Type: string
  1326. // Required: No
  1327. // Stability: stable
  1328. // Examples: 'Parse error', 'User already exists'
  1329. RPCJsonrpcErrorMessageKey = attribute.Key("rpc.jsonrpc.error_message")
  1330. )