trace.go 60 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700
  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.10.0"
  16. import "go.opentelemetry.io/otel/attribute"
  17. // Span attributes used by AWS Lambda (in addition to general `faas` attributes).
  18. const (
  19. // The full invoked ARN as provided on the `Context` passed to the function
  20. // (`Lambda-Runtime-Invoked-Function-ARN` header on the `/runtime/invocation/next`
  21. // applicable).
  22. //
  23. // Type: string
  24. // Required: No
  25. // Stability: stable
  26. // Examples: 'arn:aws:lambda:us-east-1:123456:function:myfunction:myalias'
  27. // Note: This may be different from `faas.id` if an alias is involved.
  28. AWSLambdaInvokedARNKey = attribute.Key("aws.lambda.invoked_arn")
  29. )
  30. // This document defines attributes for CloudEvents. CloudEvents is a specification on how to define event data in a standard way. These attributes can be attached to spans when performing operations with CloudEvents, regardless of the protocol being used.
  31. const (
  32. // The [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec
  33. // .md#id) uniquely identifies the event.
  34. //
  35. // Type: string
  36. // Required: Always
  37. // Stability: stable
  38. // Examples: '123e4567-e89b-12d3-a456-426614174000', '0001'
  39. CloudeventsEventIDKey = attribute.Key("cloudevents.event_id")
  40. // The [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.m
  41. // d#source-1) identifies the context in which an event happened.
  42. //
  43. // Type: string
  44. // Required: Always
  45. // Stability: stable
  46. // Examples: 'https://github.com/cloudevents', '/cloudevents/spec/pull/123', 'my-
  47. // service'
  48. CloudeventsEventSourceKey = attribute.Key("cloudevents.event_source")
  49. // The [version of the CloudEvents specification](https://github.com/cloudevents/s
  50. // pec/blob/v1.0.2/cloudevents/spec.md#specversion) which the event uses.
  51. //
  52. // Type: string
  53. // Required: Always
  54. // Stability: stable
  55. // Examples: '1.0'
  56. CloudeventsEventSpecVersionKey = attribute.Key("cloudevents.event_spec_version")
  57. // The [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/sp
  58. // ec.md#type) contains a value describing the type of event related to the
  59. // originating occurrence.
  60. //
  61. // Type: string
  62. // Required: Always
  63. // Stability: stable
  64. // Examples: 'com.github.pull_request.opened', 'com.example.object.deleted.v2'
  65. CloudeventsEventTypeKey = attribute.Key("cloudevents.event_type")
  66. // The [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.
  67. // md#subject) of the event in the context of the event producer (identified by
  68. // source).
  69. //
  70. // Type: string
  71. // Required: No
  72. // Stability: stable
  73. // Examples: 'mynewfile.jpg'
  74. CloudeventsEventSubjectKey = attribute.Key("cloudevents.event_subject")
  75. )
  76. // This document defines semantic conventions for the OpenTracing Shim
  77. const (
  78. // Parent-child Reference type
  79. //
  80. // Type: Enum
  81. // Required: No
  82. // Stability: stable
  83. // Note: The causal relationship between a child Span and a parent Span.
  84. OpentracingRefTypeKey = attribute.Key("opentracing.ref_type")
  85. )
  86. var (
  87. // The parent Span depends on the child Span in some capacity
  88. OpentracingRefTypeChildOf = OpentracingRefTypeKey.String("child_of")
  89. // The parent Span does not depend in any way on the result of the child Span
  90. OpentracingRefTypeFollowsFrom = OpentracingRefTypeKey.String("follows_from")
  91. )
  92. // This document defines the attributes used to perform database client calls.
  93. const (
  94. // An identifier for the database management system (DBMS) product being used. See
  95. // below for a list of well-known identifiers.
  96. //
  97. // Type: Enum
  98. // Required: Always
  99. // Stability: stable
  100. DBSystemKey = attribute.Key("db.system")
  101. // The connection string used to connect to the database. It is recommended to
  102. // remove embedded credentials.
  103. //
  104. // Type: string
  105. // Required: No
  106. // Stability: stable
  107. // Examples: 'Server=(localdb)\\v11.0;Integrated Security=true;'
  108. DBConnectionStringKey = attribute.Key("db.connection_string")
  109. // Username for accessing the database.
  110. //
  111. // Type: string
  112. // Required: No
  113. // Stability: stable
  114. // Examples: 'readonly_user', 'reporting_user'
  115. DBUserKey = attribute.Key("db.user")
  116. // The fully-qualified class name of the [Java Database Connectivity
  117. // (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver
  118. // used to connect.
  119. //
  120. // Type: string
  121. // Required: No
  122. // Stability: stable
  123. // Examples: 'org.postgresql.Driver',
  124. // 'com.microsoft.sqlserver.jdbc.SQLServerDriver'
  125. DBJDBCDriverClassnameKey = attribute.Key("db.jdbc.driver_classname")
  126. // This attribute is used to report the name of the database being accessed. For
  127. // commands that switch the database, this should be set to the target database
  128. // (even if the command fails).
  129. //
  130. // Type: string
  131. // Required: Required, if applicable.
  132. // Stability: stable
  133. // Examples: 'customers', 'main'
  134. // Note: In some SQL databases, the database name to be used is called "schema
  135. // name". In case there are multiple layers that could be considered for database
  136. // name (e.g. Oracle instance name and schema name), the database name to be used
  137. // is the more specific layer (e.g. Oracle schema name).
  138. DBNameKey = attribute.Key("db.name")
  139. // The database statement being executed.
  140. //
  141. // Type: string
  142. // Required: Required if applicable and not explicitly disabled via
  143. // instrumentation configuration.
  144. // Stability: stable
  145. // Examples: 'SELECT * FROM wuser_table', 'SET mykey "WuValue"'
  146. // Note: The value may be sanitized to exclude sensitive information.
  147. DBStatementKey = attribute.Key("db.statement")
  148. // The name of the operation being executed, e.g. the [MongoDB command
  149. // name](https://docs.mongodb.com/manual/reference/command/#database-operations)
  150. // such as `findAndModify`, or the SQL keyword.
  151. //
  152. // Type: string
  153. // Required: Required, if `db.statement` is not applicable.
  154. // Stability: stable
  155. // Examples: 'findAndModify', 'HMSET', 'SELECT'
  156. // Note: When setting this to an SQL keyword, it is not recommended to attempt any
  157. // client-side parsing of `db.statement` just to get this property, but it should
  158. // be set if the operation name is provided by the library being instrumented. If
  159. // the SQL statement has an ambiguous operation, or performs more than one
  160. // operation, this value may be omitted.
  161. DBOperationKey = attribute.Key("db.operation")
  162. )
  163. var (
  164. // Some other SQL database. Fallback only. See notes
  165. DBSystemOtherSQL = DBSystemKey.String("other_sql")
  166. // Microsoft SQL Server
  167. DBSystemMSSQL = DBSystemKey.String("mssql")
  168. // MySQL
  169. DBSystemMySQL = DBSystemKey.String("mysql")
  170. // Oracle Database
  171. DBSystemOracle = DBSystemKey.String("oracle")
  172. // IBM DB2
  173. DBSystemDB2 = DBSystemKey.String("db2")
  174. // PostgreSQL
  175. DBSystemPostgreSQL = DBSystemKey.String("postgresql")
  176. // Amazon Redshift
  177. DBSystemRedshift = DBSystemKey.String("redshift")
  178. // Apache Hive
  179. DBSystemHive = DBSystemKey.String("hive")
  180. // Cloudscape
  181. DBSystemCloudscape = DBSystemKey.String("cloudscape")
  182. // HyperSQL DataBase
  183. DBSystemHSQLDB = DBSystemKey.String("hsqldb")
  184. // Progress Database
  185. DBSystemProgress = DBSystemKey.String("progress")
  186. // SAP MaxDB
  187. DBSystemMaxDB = DBSystemKey.String("maxdb")
  188. // SAP HANA
  189. DBSystemHanaDB = DBSystemKey.String("hanadb")
  190. // Ingres
  191. DBSystemIngres = DBSystemKey.String("ingres")
  192. // FirstSQL
  193. DBSystemFirstSQL = DBSystemKey.String("firstsql")
  194. // EnterpriseDB
  195. DBSystemEDB = DBSystemKey.String("edb")
  196. // InterSystems Caché
  197. DBSystemCache = DBSystemKey.String("cache")
  198. // Adabas (Adaptable Database System)
  199. DBSystemAdabas = DBSystemKey.String("adabas")
  200. // Firebird
  201. DBSystemFirebird = DBSystemKey.String("firebird")
  202. // Apache Derby
  203. DBSystemDerby = DBSystemKey.String("derby")
  204. // FileMaker
  205. DBSystemFilemaker = DBSystemKey.String("filemaker")
  206. // Informix
  207. DBSystemInformix = DBSystemKey.String("informix")
  208. // InstantDB
  209. DBSystemInstantDB = DBSystemKey.String("instantdb")
  210. // InterBase
  211. DBSystemInterbase = DBSystemKey.String("interbase")
  212. // MariaDB
  213. DBSystemMariaDB = DBSystemKey.String("mariadb")
  214. // Netezza
  215. DBSystemNetezza = DBSystemKey.String("netezza")
  216. // Pervasive PSQL
  217. DBSystemPervasive = DBSystemKey.String("pervasive")
  218. // PointBase
  219. DBSystemPointbase = DBSystemKey.String("pointbase")
  220. // SQLite
  221. DBSystemSqlite = DBSystemKey.String("sqlite")
  222. // Sybase
  223. DBSystemSybase = DBSystemKey.String("sybase")
  224. // Teradata
  225. DBSystemTeradata = DBSystemKey.String("teradata")
  226. // Vertica
  227. DBSystemVertica = DBSystemKey.String("vertica")
  228. // H2
  229. DBSystemH2 = DBSystemKey.String("h2")
  230. // ColdFusion IMQ
  231. DBSystemColdfusion = DBSystemKey.String("coldfusion")
  232. // Apache Cassandra
  233. DBSystemCassandra = DBSystemKey.String("cassandra")
  234. // Apache HBase
  235. DBSystemHBase = DBSystemKey.String("hbase")
  236. // MongoDB
  237. DBSystemMongoDB = DBSystemKey.String("mongodb")
  238. // Redis
  239. DBSystemRedis = DBSystemKey.String("redis")
  240. // Couchbase
  241. DBSystemCouchbase = DBSystemKey.String("couchbase")
  242. // CouchDB
  243. DBSystemCouchDB = DBSystemKey.String("couchdb")
  244. // Microsoft Azure Cosmos DB
  245. DBSystemCosmosDB = DBSystemKey.String("cosmosdb")
  246. // Amazon DynamoDB
  247. DBSystemDynamoDB = DBSystemKey.String("dynamodb")
  248. // Neo4j
  249. DBSystemNeo4j = DBSystemKey.String("neo4j")
  250. // Apache Geode
  251. DBSystemGeode = DBSystemKey.String("geode")
  252. // Elasticsearch
  253. DBSystemElasticsearch = DBSystemKey.String("elasticsearch")
  254. // Memcached
  255. DBSystemMemcached = DBSystemKey.String("memcached")
  256. // CockroachDB
  257. DBSystemCockroachdb = DBSystemKey.String("cockroachdb")
  258. )
  259. // Connection-level attributes for Microsoft SQL Server
  260. const (
  261. // The Microsoft SQL Server [instance name](https://docs.microsoft.com/en-
  262. // us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15)
  263. // connecting to. This name is used to determine the port of a named instance.
  264. //
  265. // Type: string
  266. // Required: No
  267. // Stability: stable
  268. // Examples: 'MSSQLSERVER'
  269. // Note: If setting a `db.mssql.instance_name`, `net.peer.port` is no longer
  270. // required (but still recommended if non-standard).
  271. DBMSSQLInstanceNameKey = attribute.Key("db.mssql.instance_name")
  272. )
  273. // Call-level attributes for Cassandra
  274. const (
  275. // The fetch size used for paging, i.e. how many rows will be returned at once.
  276. //
  277. // Type: int
  278. // Required: No
  279. // Stability: stable
  280. // Examples: 5000
  281. DBCassandraPageSizeKey = attribute.Key("db.cassandra.page_size")
  282. // The consistency level of the query. Based on consistency values from
  283. // [CQL](https://docs.datastax.com/en/cassandra-
  284. // oss/3.0/cassandra/dml/dmlConfigConsistency.html).
  285. //
  286. // Type: Enum
  287. // Required: No
  288. // Stability: stable
  289. DBCassandraConsistencyLevelKey = attribute.Key("db.cassandra.consistency_level")
  290. // The name of the primary table that the operation is acting upon, including the
  291. // keyspace name (if applicable).
  292. //
  293. // Type: string
  294. // Required: Recommended if available.
  295. // Stability: stable
  296. // Examples: 'mytable'
  297. // Note: This mirrors the db.sql.table attribute but references cassandra rather
  298. // than sql. It is not recommended to attempt any client-side parsing of
  299. // `db.statement` just to get this property, but it should be set if it is
  300. // provided by the library being instrumented. If the operation is acting upon an
  301. // anonymous table, or more than one table, this value MUST NOT be set.
  302. DBCassandraTableKey = attribute.Key("db.cassandra.table")
  303. // Whether or not the query is idempotent.
  304. //
  305. // Type: boolean
  306. // Required: No
  307. // Stability: stable
  308. DBCassandraIdempotenceKey = attribute.Key("db.cassandra.idempotence")
  309. // The number of times a query was speculatively executed. Not set or `0` if the
  310. // query was not executed speculatively.
  311. //
  312. // Type: int
  313. // Required: No
  314. // Stability: stable
  315. // Examples: 0, 2
  316. DBCassandraSpeculativeExecutionCountKey = attribute.Key("db.cassandra.speculative_execution_count")
  317. // The ID of the coordinating node for a query.
  318. //
  319. // Type: string
  320. // Required: No
  321. // Stability: stable
  322. // Examples: 'be13faa2-8574-4d71-926d-27f16cf8a7af'
  323. DBCassandraCoordinatorIDKey = attribute.Key("db.cassandra.coordinator.id")
  324. // The data center of the coordinating node for a query.
  325. //
  326. // Type: string
  327. // Required: No
  328. // Stability: stable
  329. // Examples: 'us-west-2'
  330. DBCassandraCoordinatorDCKey = attribute.Key("db.cassandra.coordinator.dc")
  331. )
  332. var (
  333. // all
  334. DBCassandraConsistencyLevelAll = DBCassandraConsistencyLevelKey.String("all")
  335. // each_quorum
  336. DBCassandraConsistencyLevelEachQuorum = DBCassandraConsistencyLevelKey.String("each_quorum")
  337. // quorum
  338. DBCassandraConsistencyLevelQuorum = DBCassandraConsistencyLevelKey.String("quorum")
  339. // local_quorum
  340. DBCassandraConsistencyLevelLocalQuorum = DBCassandraConsistencyLevelKey.String("local_quorum")
  341. // one
  342. DBCassandraConsistencyLevelOne = DBCassandraConsistencyLevelKey.String("one")
  343. // two
  344. DBCassandraConsistencyLevelTwo = DBCassandraConsistencyLevelKey.String("two")
  345. // three
  346. DBCassandraConsistencyLevelThree = DBCassandraConsistencyLevelKey.String("three")
  347. // local_one
  348. DBCassandraConsistencyLevelLocalOne = DBCassandraConsistencyLevelKey.String("local_one")
  349. // any
  350. DBCassandraConsistencyLevelAny = DBCassandraConsistencyLevelKey.String("any")
  351. // serial
  352. DBCassandraConsistencyLevelSerial = DBCassandraConsistencyLevelKey.String("serial")
  353. // local_serial
  354. DBCassandraConsistencyLevelLocalSerial = DBCassandraConsistencyLevelKey.String("local_serial")
  355. )
  356. // Call-level attributes for Redis
  357. const (
  358. // The index of the database being accessed as used in the [`SELECT`
  359. // command](https://redis.io/commands/select), provided as an integer. To be used
  360. // instead of the generic `db.name` attribute.
  361. //
  362. // Type: int
  363. // Required: Required, if other than the default database (`0`).
  364. // Stability: stable
  365. // Examples: 0, 1, 15
  366. DBRedisDBIndexKey = attribute.Key("db.redis.database_index")
  367. )
  368. // Call-level attributes for MongoDB
  369. const (
  370. // The collection being accessed within the database stated in `db.name`.
  371. //
  372. // Type: string
  373. // Required: Always
  374. // Stability: stable
  375. // Examples: 'customers', 'products'
  376. DBMongoDBCollectionKey = attribute.Key("db.mongodb.collection")
  377. )
  378. // Call-level attributes for SQL databases
  379. const (
  380. // The name of the primary table that the operation is acting upon, including the
  381. // database name (if applicable).
  382. //
  383. // Type: string
  384. // Required: Recommended if available.
  385. // Stability: stable
  386. // Examples: 'public.users', 'customers'
  387. // Note: It is not recommended to attempt any client-side parsing of
  388. // `db.statement` just to get this property, but it should be set if it is
  389. // provided by the library being instrumented. If the operation is acting upon an
  390. // anonymous table, or more than one table, this value MUST NOT be set.
  391. DBSQLTableKey = attribute.Key("db.sql.table")
  392. )
  393. // This document defines the attributes used to report a single exception associated with a span.
  394. const (
  395. // The type of the exception (its fully-qualified class name, if applicable). The
  396. // dynamic type of the exception should be preferred over the static type in
  397. // languages that support it.
  398. //
  399. // Type: string
  400. // Required: No
  401. // Stability: stable
  402. // Examples: 'java.net.ConnectException', 'OSError'
  403. ExceptionTypeKey = attribute.Key("exception.type")
  404. // The exception message.
  405. //
  406. // Type: string
  407. // Required: No
  408. // Stability: stable
  409. // Examples: 'Division by zero', "Can't convert 'int' object to str implicitly"
  410. ExceptionMessageKey = attribute.Key("exception.message")
  411. // A stacktrace as a string in the natural representation for the language
  412. // runtime. The representation is to be determined and documented by each language
  413. // SIG.
  414. //
  415. // Type: string
  416. // Required: No
  417. // Stability: stable
  418. // Examples: 'Exception in thread "main" java.lang.RuntimeException: Test
  419. // exception\\n at '
  420. // 'com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at '
  421. // 'com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at '
  422. // 'com.example.GenerateTrace.main(GenerateTrace.java:5)'
  423. ExceptionStacktraceKey = attribute.Key("exception.stacktrace")
  424. // SHOULD be set to true if the exception event is recorded at a point where it is
  425. // known that the exception is escaping the scope of the span.
  426. //
  427. // Type: boolean
  428. // Required: No
  429. // Stability: stable
  430. // Note: An exception is considered to have escaped (or left) the scope of a span,
  431. // if that span is ended while the exception is still logically "in flight".
  432. // This may be actually "in flight" in some languages (e.g. if the exception
  433. // is passed to a Context manager's `__exit__` method in Python) but will
  434. // usually be caught at the point of recording the exception in most languages.
  435. // It is usually not possible to determine at the point where an exception is
  436. // thrown
  437. // whether it will escape the scope of a span.
  438. // However, it is trivial to know that an exception
  439. // will escape, if one checks for an active exception just before ending the span,
  440. // as done in the [example above](#recording-an-exception).
  441. // It follows that an exception may still escape the scope of the span
  442. // even if the `exception.escaped` attribute was not set or set to false,
  443. // since the event might have been recorded at a time where it was not
  444. // clear whether the exception will escape.
  445. ExceptionEscapedKey = attribute.Key("exception.escaped")
  446. )
  447. // 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.
  448. const (
  449. // Type of the trigger which caused this function execution.
  450. //
  451. // Type: Enum
  452. // Required: No
  453. // Stability: stable
  454. // Note: For the server/consumer span on the incoming side,
  455. // `faas.trigger` MUST be set.
  456. // Clients invoking FaaS instances usually cannot set `faas.trigger`,
  457. // since they would typically need to look in the payload to determine
  458. // the event type. If clients set it, it should be the same as the
  459. // trigger that corresponding incoming would have (i.e., this has
  460. // nothing to do with the underlying transport used to make the API
  461. // call to invoke the lambda, which is often HTTP).
  462. FaaSTriggerKey = attribute.Key("faas.trigger")
  463. // The execution ID of the current function execution.
  464. //
  465. // Type: string
  466. // Required: No
  467. // Stability: stable
  468. // Examples: 'af9d5aa4-a685-4c5f-a22b-444f80b3cc28'
  469. FaaSExecutionKey = attribute.Key("faas.execution")
  470. )
  471. var (
  472. // A response to some data source operation such as a database or filesystem read/write
  473. FaaSTriggerDatasource = FaaSTriggerKey.String("datasource")
  474. // To provide an answer to an inbound HTTP request
  475. FaaSTriggerHTTP = FaaSTriggerKey.String("http")
  476. // A function is set to be executed when messages are sent to a messaging system
  477. FaaSTriggerPubsub = FaaSTriggerKey.String("pubsub")
  478. // A function is scheduled to be executed regularly
  479. FaaSTriggerTimer = FaaSTriggerKey.String("timer")
  480. // If none of the others apply
  481. FaaSTriggerOther = FaaSTriggerKey.String("other")
  482. )
  483. // Semantic Convention for FaaS triggered as a response to some data source operation such as a database or filesystem read/write.
  484. const (
  485. // The name of the source on which the triggering operation was performed. For
  486. // example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos
  487. // DB to the database name.
  488. //
  489. // Type: string
  490. // Required: Always
  491. // Stability: stable
  492. // Examples: 'myBucketName', 'myDBName'
  493. FaaSDocumentCollectionKey = attribute.Key("faas.document.collection")
  494. // Describes the type of the operation that was performed on the data.
  495. //
  496. // Type: Enum
  497. // Required: Always
  498. // Stability: stable
  499. FaaSDocumentOperationKey = attribute.Key("faas.document.operation")
  500. // A string containing the time when the data was accessed in the [ISO
  501. // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed
  502. // in [UTC](https://www.w3.org/TR/NOTE-datetime).
  503. //
  504. // Type: string
  505. // Required: Always
  506. // Stability: stable
  507. // Examples: '2020-01-23T13:47:06Z'
  508. FaaSDocumentTimeKey = attribute.Key("faas.document.time")
  509. // The document name/table subjected to the operation. For example, in Cloud
  510. // Storage or S3 is the name of the file, and in Cosmos DB the table name.
  511. //
  512. // Type: string
  513. // Required: No
  514. // Stability: stable
  515. // Examples: 'myFile.txt', 'myTableName'
  516. FaaSDocumentNameKey = attribute.Key("faas.document.name")
  517. )
  518. var (
  519. // When a new object is created
  520. FaaSDocumentOperationInsert = FaaSDocumentOperationKey.String("insert")
  521. // When an object is modified
  522. FaaSDocumentOperationEdit = FaaSDocumentOperationKey.String("edit")
  523. // When an object is deleted
  524. FaaSDocumentOperationDelete = FaaSDocumentOperationKey.String("delete")
  525. )
  526. // Semantic Convention for FaaS scheduled to be executed regularly.
  527. const (
  528. // A string containing the function invocation time in the [ISO
  529. // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed
  530. // in [UTC](https://www.w3.org/TR/NOTE-datetime).
  531. //
  532. // Type: string
  533. // Required: Always
  534. // Stability: stable
  535. // Examples: '2020-01-23T13:47:06Z'
  536. FaaSTimeKey = attribute.Key("faas.time")
  537. // A string containing the schedule period as [Cron Expression](https://docs.oracl
  538. // e.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm).
  539. //
  540. // Type: string
  541. // Required: No
  542. // Stability: stable
  543. // Examples: '0/5 * * * ? *'
  544. FaaSCronKey = attribute.Key("faas.cron")
  545. )
  546. // Contains additional attributes for incoming FaaS spans.
  547. const (
  548. // A boolean that is true if the serverless function is executed for the first
  549. // time (aka cold-start).
  550. //
  551. // Type: boolean
  552. // Required: No
  553. // Stability: stable
  554. FaaSColdstartKey = attribute.Key("faas.coldstart")
  555. )
  556. // Contains additional attributes for outgoing FaaS spans.
  557. const (
  558. // The name of the invoked function.
  559. //
  560. // Type: string
  561. // Required: Always
  562. // Stability: stable
  563. // Examples: 'my-function'
  564. // Note: SHOULD be equal to the `faas.name` resource attribute of the invoked
  565. // function.
  566. FaaSInvokedNameKey = attribute.Key("faas.invoked_name")
  567. // The cloud provider of the invoked function.
  568. //
  569. // Type: Enum
  570. // Required: Always
  571. // Stability: stable
  572. // Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked
  573. // function.
  574. FaaSInvokedProviderKey = attribute.Key("faas.invoked_provider")
  575. // The cloud region of the invoked function.
  576. //
  577. // Type: string
  578. // Required: For some cloud providers, like AWS or GCP, the region in which a
  579. // function is hosted is essential to uniquely identify the function and also part
  580. // of its endpoint. Since it's part of the endpoint being called, the region is
  581. // always known to clients. In these cases, `faas.invoked_region` MUST be set
  582. // accordingly. If the region is unknown to the client or not required for
  583. // identifying the invoked function, setting `faas.invoked_region` is optional.
  584. // Stability: stable
  585. // Examples: 'eu-central-1'
  586. // Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked
  587. // function.
  588. FaaSInvokedRegionKey = attribute.Key("faas.invoked_region")
  589. )
  590. var (
  591. // Alibaba Cloud
  592. FaaSInvokedProviderAlibabaCloud = FaaSInvokedProviderKey.String("alibaba_cloud")
  593. // Amazon Web Services
  594. FaaSInvokedProviderAWS = FaaSInvokedProviderKey.String("aws")
  595. // Microsoft Azure
  596. FaaSInvokedProviderAzure = FaaSInvokedProviderKey.String("azure")
  597. // Google Cloud Platform
  598. FaaSInvokedProviderGCP = FaaSInvokedProviderKey.String("gcp")
  599. // Tencent Cloud
  600. FaaSInvokedProviderTencentCloud = FaaSInvokedProviderKey.String("tencent_cloud")
  601. )
  602. // These attributes may be used for any network related operation.
  603. const (
  604. // Transport protocol used. See note below.
  605. //
  606. // Type: Enum
  607. // Required: No
  608. // Stability: stable
  609. NetTransportKey = attribute.Key("net.transport")
  610. // Remote address of the peer (dotted decimal for IPv4 or
  611. // [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6)
  612. //
  613. // Type: string
  614. // Required: No
  615. // Stability: stable
  616. // Examples: '127.0.0.1'
  617. NetPeerIPKey = attribute.Key("net.peer.ip")
  618. // Remote port number.
  619. //
  620. // Type: int
  621. // Required: No
  622. // Stability: stable
  623. // Examples: 80, 8080, 443
  624. NetPeerPortKey = attribute.Key("net.peer.port")
  625. // Remote hostname or similar, see note below.
  626. //
  627. // Type: string
  628. // Required: No
  629. // Stability: stable
  630. // Examples: 'example.com'
  631. NetPeerNameKey = attribute.Key("net.peer.name")
  632. // Like `net.peer.ip` but for the host IP. Useful in case of a multi-IP host.
  633. //
  634. // Type: string
  635. // Required: No
  636. // Stability: stable
  637. // Examples: '192.168.0.1'
  638. NetHostIPKey = attribute.Key("net.host.ip")
  639. // Like `net.peer.port` but for the host port.
  640. //
  641. // Type: int
  642. // Required: No
  643. // Stability: stable
  644. // Examples: 35555
  645. NetHostPortKey = attribute.Key("net.host.port")
  646. // Local hostname or similar, see note below.
  647. //
  648. // Type: string
  649. // Required: No
  650. // Stability: stable
  651. // Examples: 'localhost'
  652. NetHostNameKey = attribute.Key("net.host.name")
  653. // The internet connection type currently being used by the host.
  654. //
  655. // Type: Enum
  656. // Required: No
  657. // Stability: stable
  658. // Examples: 'wifi'
  659. NetHostConnectionTypeKey = attribute.Key("net.host.connection.type")
  660. // This describes more details regarding the connection.type. It may be the type
  661. // of cell technology connection, but it could be used for describing details
  662. // about a wifi connection.
  663. //
  664. // Type: Enum
  665. // Required: No
  666. // Stability: stable
  667. // Examples: 'LTE'
  668. NetHostConnectionSubtypeKey = attribute.Key("net.host.connection.subtype")
  669. // The name of the mobile carrier.
  670. //
  671. // Type: string
  672. // Required: No
  673. // Stability: stable
  674. // Examples: 'sprint'
  675. NetHostCarrierNameKey = attribute.Key("net.host.carrier.name")
  676. // The mobile carrier country code.
  677. //
  678. // Type: string
  679. // Required: No
  680. // Stability: stable
  681. // Examples: '310'
  682. NetHostCarrierMccKey = attribute.Key("net.host.carrier.mcc")
  683. // The mobile carrier network code.
  684. //
  685. // Type: string
  686. // Required: No
  687. // Stability: stable
  688. // Examples: '001'
  689. NetHostCarrierMncKey = attribute.Key("net.host.carrier.mnc")
  690. // The ISO 3166-1 alpha-2 2-character country code associated with the mobile
  691. // carrier network.
  692. //
  693. // Type: string
  694. // Required: No
  695. // Stability: stable
  696. // Examples: 'DE'
  697. NetHostCarrierIccKey = attribute.Key("net.host.carrier.icc")
  698. )
  699. var (
  700. // ip_tcp
  701. NetTransportTCP = NetTransportKey.String("ip_tcp")
  702. // ip_udp
  703. NetTransportUDP = NetTransportKey.String("ip_udp")
  704. // Another IP-based protocol
  705. NetTransportIP = NetTransportKey.String("ip")
  706. // Unix Domain socket. See below
  707. NetTransportUnix = NetTransportKey.String("unix")
  708. // Named or anonymous pipe. See note below
  709. NetTransportPipe = NetTransportKey.String("pipe")
  710. // In-process communication
  711. NetTransportInProc = NetTransportKey.String("inproc")
  712. // Something else (non IP-based)
  713. NetTransportOther = NetTransportKey.String("other")
  714. )
  715. var (
  716. // wifi
  717. NetHostConnectionTypeWifi = NetHostConnectionTypeKey.String("wifi")
  718. // wired
  719. NetHostConnectionTypeWired = NetHostConnectionTypeKey.String("wired")
  720. // cell
  721. NetHostConnectionTypeCell = NetHostConnectionTypeKey.String("cell")
  722. // unavailable
  723. NetHostConnectionTypeUnavailable = NetHostConnectionTypeKey.String("unavailable")
  724. // unknown
  725. NetHostConnectionTypeUnknown = NetHostConnectionTypeKey.String("unknown")
  726. )
  727. var (
  728. // GPRS
  729. NetHostConnectionSubtypeGprs = NetHostConnectionSubtypeKey.String("gprs")
  730. // EDGE
  731. NetHostConnectionSubtypeEdge = NetHostConnectionSubtypeKey.String("edge")
  732. // UMTS
  733. NetHostConnectionSubtypeUmts = NetHostConnectionSubtypeKey.String("umts")
  734. // CDMA
  735. NetHostConnectionSubtypeCdma = NetHostConnectionSubtypeKey.String("cdma")
  736. // EVDO Rel. 0
  737. NetHostConnectionSubtypeEvdo0 = NetHostConnectionSubtypeKey.String("evdo_0")
  738. // EVDO Rev. A
  739. NetHostConnectionSubtypeEvdoA = NetHostConnectionSubtypeKey.String("evdo_a")
  740. // CDMA2000 1XRTT
  741. NetHostConnectionSubtypeCdma20001xrtt = NetHostConnectionSubtypeKey.String("cdma2000_1xrtt")
  742. // HSDPA
  743. NetHostConnectionSubtypeHsdpa = NetHostConnectionSubtypeKey.String("hsdpa")
  744. // HSUPA
  745. NetHostConnectionSubtypeHsupa = NetHostConnectionSubtypeKey.String("hsupa")
  746. // HSPA
  747. NetHostConnectionSubtypeHspa = NetHostConnectionSubtypeKey.String("hspa")
  748. // IDEN
  749. NetHostConnectionSubtypeIden = NetHostConnectionSubtypeKey.String("iden")
  750. // EVDO Rev. B
  751. NetHostConnectionSubtypeEvdoB = NetHostConnectionSubtypeKey.String("evdo_b")
  752. // LTE
  753. NetHostConnectionSubtypeLte = NetHostConnectionSubtypeKey.String("lte")
  754. // EHRPD
  755. NetHostConnectionSubtypeEhrpd = NetHostConnectionSubtypeKey.String("ehrpd")
  756. // HSPAP
  757. NetHostConnectionSubtypeHspap = NetHostConnectionSubtypeKey.String("hspap")
  758. // GSM
  759. NetHostConnectionSubtypeGsm = NetHostConnectionSubtypeKey.String("gsm")
  760. // TD-SCDMA
  761. NetHostConnectionSubtypeTdScdma = NetHostConnectionSubtypeKey.String("td_scdma")
  762. // IWLAN
  763. NetHostConnectionSubtypeIwlan = NetHostConnectionSubtypeKey.String("iwlan")
  764. // 5G NR (New Radio)
  765. NetHostConnectionSubtypeNr = NetHostConnectionSubtypeKey.String("nr")
  766. // 5G NRNSA (New Radio Non-Standalone)
  767. NetHostConnectionSubtypeNrnsa = NetHostConnectionSubtypeKey.String("nrnsa")
  768. // LTE CA
  769. NetHostConnectionSubtypeLteCa = NetHostConnectionSubtypeKey.String("lte_ca")
  770. )
  771. // Operations that access some remote service.
  772. const (
  773. // The [`service.name`](../../resource/semantic_conventions/README.md#service) of
  774. // the remote service. SHOULD be equal to the actual `service.name` resource
  775. // attribute of the remote service if any.
  776. //
  777. // Type: string
  778. // Required: No
  779. // Stability: stable
  780. // Examples: 'AuthTokenCache'
  781. PeerServiceKey = attribute.Key("peer.service")
  782. )
  783. // These attributes may be used for any operation with an authenticated and/or authorized enduser.
  784. const (
  785. // Username or client_id extracted from the access token or
  786. // [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the
  787. // inbound request from outside the system.
  788. //
  789. // Type: string
  790. // Required: No
  791. // Stability: stable
  792. // Examples: 'username'
  793. EnduserIDKey = attribute.Key("enduser.id")
  794. // Actual/assumed role the client is making the request under extracted from token
  795. // or application security context.
  796. //
  797. // Type: string
  798. // Required: No
  799. // Stability: stable
  800. // Examples: 'admin'
  801. EnduserRoleKey = attribute.Key("enduser.role")
  802. // Scopes or granted authorities the client currently possesses extracted from
  803. // token or application security context. The value would come from the scope
  804. // associated with an [OAuth 2.0 Access
  805. // Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value
  806. // in a [SAML 2.0 Assertion](http://docs.oasis-
  807. // open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html).
  808. //
  809. // Type: string
  810. // Required: No
  811. // Stability: stable
  812. // Examples: 'read:message, write:files'
  813. EnduserScopeKey = attribute.Key("enduser.scope")
  814. )
  815. // These attributes may be used for any operation to store information about a thread that started a span.
  816. const (
  817. // Current "managed" thread ID (as opposed to OS thread ID).
  818. //
  819. // Type: int
  820. // Required: No
  821. // Stability: stable
  822. // Examples: 42
  823. ThreadIDKey = attribute.Key("thread.id")
  824. // Current thread name.
  825. //
  826. // Type: string
  827. // Required: No
  828. // Stability: stable
  829. // Examples: 'main'
  830. ThreadNameKey = attribute.Key("thread.name")
  831. )
  832. // These attributes allow to report this unit of code and therefore to provide more context about the span.
  833. const (
  834. // The method or function name, or equivalent (usually rightmost part of the code
  835. // unit's name).
  836. //
  837. // Type: string
  838. // Required: No
  839. // Stability: stable
  840. // Examples: 'serveRequest'
  841. CodeFunctionKey = attribute.Key("code.function")
  842. // The "namespace" within which `code.function` is defined. Usually the qualified
  843. // class or module name, such that `code.namespace` + some separator +
  844. // `code.function` form a unique identifier for the code unit.
  845. //
  846. // Type: string
  847. // Required: No
  848. // Stability: stable
  849. // Examples: 'com.example.MyHTTPService'
  850. CodeNamespaceKey = attribute.Key("code.namespace")
  851. // The source code file name that identifies the code unit as uniquely as possible
  852. // (preferably an absolute file path).
  853. //
  854. // Type: string
  855. // Required: No
  856. // Stability: stable
  857. // Examples: '/usr/local/MyApplication/content_root/app/index.php'
  858. CodeFilepathKey = attribute.Key("code.filepath")
  859. // The line number in `code.filepath` best representing the operation. It SHOULD
  860. // point within the code unit named in `code.function`.
  861. //
  862. // Type: int
  863. // Required: No
  864. // Stability: stable
  865. // Examples: 42
  866. CodeLineNumberKey = attribute.Key("code.lineno")
  867. )
  868. // This document defines semantic conventions for HTTP client and server Spans.
  869. const (
  870. // HTTP request method.
  871. //
  872. // Type: string
  873. // Required: Always
  874. // Stability: stable
  875. // Examples: 'GET', 'POST', 'HEAD'
  876. HTTPMethodKey = attribute.Key("http.method")
  877. // Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`.
  878. // Usually the fragment is not transmitted over HTTP, but if it is known, it
  879. // should be included nevertheless.
  880. //
  881. // Type: string
  882. // Required: No
  883. // Stability: stable
  884. // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv'
  885. // Note: `http.url` MUST NOT contain credentials passed via URL in form of
  886. // `https://username:password@www.example.com/`. In such case the attribute's
  887. // value should be `https://www.example.com/`.
  888. HTTPURLKey = attribute.Key("http.url")
  889. // The full request target as passed in a HTTP request line or equivalent.
  890. //
  891. // Type: string
  892. // Required: No
  893. // Stability: stable
  894. // Examples: '/path/12314/?q=ddds#123'
  895. HTTPTargetKey = attribute.Key("http.target")
  896. // The value of the [HTTP host
  897. // header](https://tools.ietf.org/html/rfc7230#section-5.4). An empty Host header
  898. // should also be reported, see note.
  899. //
  900. // Type: string
  901. // Required: No
  902. // Stability: stable
  903. // Examples: 'www.example.org'
  904. // Note: When the header is present but empty the attribute SHOULD be set to the
  905. // empty string. Note that this is a valid situation that is expected in certain
  906. // cases, according the aforementioned [section of RFC
  907. // 7230](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is not
  908. // set the attribute MUST NOT be set.
  909. HTTPHostKey = attribute.Key("http.host")
  910. // The URI scheme identifying the used protocol.
  911. //
  912. // Type: string
  913. // Required: No
  914. // Stability: stable
  915. // Examples: 'http', 'https'
  916. HTTPSchemeKey = attribute.Key("http.scheme")
  917. // [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).
  918. //
  919. // Type: int
  920. // Required: If and only if one was received/sent.
  921. // Stability: stable
  922. // Examples: 200
  923. HTTPStatusCodeKey = attribute.Key("http.status_code")
  924. // Kind of HTTP protocol used.
  925. //
  926. // Type: Enum
  927. // Required: No
  928. // Stability: stable
  929. // Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP`
  930. // except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed.
  931. HTTPFlavorKey = attribute.Key("http.flavor")
  932. // Value of the [HTTP User-
  933. // Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the
  934. // client.
  935. //
  936. // Type: string
  937. // Required: No
  938. // Stability: stable
  939. // Examples: 'CERN-LineMode/2.15 libwww/2.17b3'
  940. HTTPUserAgentKey = attribute.Key("http.user_agent")
  941. // The size of the request payload body in bytes. This is the number of bytes
  942. // transferred excluding headers and is often, but not always, present as the
  943. // [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For
  944. // requests using transport encoding, this should be the compressed size.
  945. //
  946. // Type: int
  947. // Required: No
  948. // Stability: stable
  949. // Examples: 3495
  950. HTTPRequestContentLengthKey = attribute.Key("http.request_content_length")
  951. // The size of the uncompressed request payload body after transport decoding. Not
  952. // set if transport encoding not used.
  953. //
  954. // Type: int
  955. // Required: No
  956. // Stability: stable
  957. // Examples: 5493
  958. HTTPRequestContentLengthUncompressedKey = attribute.Key("http.request_content_length_uncompressed")
  959. // The size of the response payload body in bytes. This is the number of bytes
  960. // transferred excluding headers and is often, but not always, present as the
  961. // [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For
  962. // requests using transport encoding, this should be the compressed size.
  963. //
  964. // Type: int
  965. // Required: No
  966. // Stability: stable
  967. // Examples: 3495
  968. HTTPResponseContentLengthKey = attribute.Key("http.response_content_length")
  969. // The size of the uncompressed response payload body after transport decoding.
  970. // Not set if transport encoding not used.
  971. //
  972. // Type: int
  973. // Required: No
  974. // Stability: stable
  975. // Examples: 5493
  976. HTTPResponseContentLengthUncompressedKey = attribute.Key("http.response_content_length_uncompressed")
  977. // The ordinal number of request re-sending attempt.
  978. //
  979. // Type: int
  980. // Required: If and only if a request was retried.
  981. // Stability: stable
  982. // Examples: 3
  983. HTTPRetryCountKey = attribute.Key("http.retry_count")
  984. )
  985. var (
  986. // HTTP 1.0
  987. HTTPFlavorHTTP10 = HTTPFlavorKey.String("1.0")
  988. // HTTP 1.1
  989. HTTPFlavorHTTP11 = HTTPFlavorKey.String("1.1")
  990. // HTTP 2
  991. HTTPFlavorHTTP20 = HTTPFlavorKey.String("2.0")
  992. // SPDY protocol
  993. HTTPFlavorSPDY = HTTPFlavorKey.String("SPDY")
  994. // QUIC protocol
  995. HTTPFlavorQUIC = HTTPFlavorKey.String("QUIC")
  996. )
  997. // Semantic Convention for HTTP Server
  998. const (
  999. // The primary server name of the matched virtual host. This should be obtained
  1000. // via configuration. If no such configuration can be obtained, this attribute
  1001. // MUST NOT be set ( `net.host.name` should be used instead).
  1002. //
  1003. // Type: string
  1004. // Required: No
  1005. // Stability: stable
  1006. // Examples: 'example.com'
  1007. // Note: `http.url` is usually not readily available on the server side but would
  1008. // have to be assembled in a cumbersome and sometimes lossy process from other
  1009. // information (see e.g. open-telemetry/opentelemetry-python/pull/148). It is thus
  1010. // preferred to supply the raw data that is available.
  1011. HTTPServerNameKey = attribute.Key("http.server_name")
  1012. // The matched route (path template).
  1013. //
  1014. // Type: string
  1015. // Required: No
  1016. // Stability: stable
  1017. // Examples: '/users/:userID?'
  1018. HTTPRouteKey = attribute.Key("http.route")
  1019. // The IP address of the original client behind all proxies, if known (e.g. from
  1020. // [X-Forwarded-For](https://developer.mozilla.org/en-
  1021. // US/docs/Web/HTTP/Headers/X-Forwarded-For)).
  1022. //
  1023. // Type: string
  1024. // Required: No
  1025. // Stability: stable
  1026. // Examples: '83.164.160.102'
  1027. // Note: This is not necessarily the same as `net.peer.ip`, which would
  1028. // identify the network-level peer, which may be a proxy.
  1029. // This attribute should be set when a source of information different
  1030. // from the one used for `net.peer.ip`, is available even if that other
  1031. // source just confirms the same value as `net.peer.ip`.
  1032. // Rationale: For `net.peer.ip`, one typically does not know if it
  1033. // comes from a proxy, reverse proxy, or the actual client. Setting
  1034. // `http.client_ip` when it's the same as `net.peer.ip` means that
  1035. // one is at least somewhat confident that the address is not that of
  1036. // the closest proxy.
  1037. HTTPClientIPKey = attribute.Key("http.client_ip")
  1038. )
  1039. // Attributes that exist for multiple DynamoDB request types.
  1040. const (
  1041. // The keys in the `RequestItems` object field.
  1042. //
  1043. // Type: string[]
  1044. // Required: No
  1045. // Stability: stable
  1046. // Examples: 'Users', 'Cats'
  1047. AWSDynamoDBTableNamesKey = attribute.Key("aws.dynamodb.table_names")
  1048. // The JSON-serialized value of each item in the `ConsumedCapacity` response
  1049. // field.
  1050. //
  1051. // Type: string[]
  1052. // Required: No
  1053. // Stability: stable
  1054. // Examples: '{ "CapacityUnits": number, "GlobalSecondaryIndexes": { "string" : {
  1055. // "CapacityUnits": number, "ReadCapacityUnits": number, "WriteCapacityUnits":
  1056. // number } }, "LocalSecondaryIndexes": { "string" : { "CapacityUnits": number,
  1057. // "ReadCapacityUnits": number, "WriteCapacityUnits": number } },
  1058. // "ReadCapacityUnits": number, "Table": { "CapacityUnits": number,
  1059. // "ReadCapacityUnits": number, "WriteCapacityUnits": number }, "TableName":
  1060. // "string", "WriteCapacityUnits": number }'
  1061. AWSDynamoDBConsumedCapacityKey = attribute.Key("aws.dynamodb.consumed_capacity")
  1062. // The JSON-serialized value of the `ItemCollectionMetrics` response field.
  1063. //
  1064. // Type: string
  1065. // Required: No
  1066. // Stability: stable
  1067. // Examples: '{ "string" : [ { "ItemCollectionKey": { "string" : { "B": blob,
  1068. // "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": { "string" :
  1069. // "AttributeValue" }, "N": "string", "NS": [ "string" ], "NULL": boolean, "S":
  1070. // "string", "SS": [ "string" ] } }, "SizeEstimateRangeGB": [ number ] } ] }'
  1071. AWSDynamoDBItemCollectionMetricsKey = attribute.Key("aws.dynamodb.item_collection_metrics")
  1072. // The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter.
  1073. //
  1074. // Type: double
  1075. // Required: No
  1076. // Stability: stable
  1077. // Examples: 1.0, 2.0
  1078. AWSDynamoDBProvisionedReadCapacityKey = attribute.Key("aws.dynamodb.provisioned_read_capacity")
  1079. // The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter.
  1080. //
  1081. // Type: double
  1082. // Required: No
  1083. // Stability: stable
  1084. // Examples: 1.0, 2.0
  1085. AWSDynamoDBProvisionedWriteCapacityKey = attribute.Key("aws.dynamodb.provisioned_write_capacity")
  1086. // The value of the `ConsistentRead` request parameter.
  1087. //
  1088. // Type: boolean
  1089. // Required: No
  1090. // Stability: stable
  1091. AWSDynamoDBConsistentReadKey = attribute.Key("aws.dynamodb.consistent_read")
  1092. // The value of the `ProjectionExpression` request parameter.
  1093. //
  1094. // Type: string
  1095. // Required: No
  1096. // Stability: stable
  1097. // Examples: 'Title', 'Title, Price, Color', 'Title, Description, RelatedItems,
  1098. // ProductReviews'
  1099. AWSDynamoDBProjectionKey = attribute.Key("aws.dynamodb.projection")
  1100. // The value of the `Limit` request parameter.
  1101. //
  1102. // Type: int
  1103. // Required: No
  1104. // Stability: stable
  1105. // Examples: 10
  1106. AWSDynamoDBLimitKey = attribute.Key("aws.dynamodb.limit")
  1107. // The value of the `AttributesToGet` request parameter.
  1108. //
  1109. // Type: string[]
  1110. // Required: No
  1111. // Stability: stable
  1112. // Examples: 'lives', 'id'
  1113. AWSDynamoDBAttributesToGetKey = attribute.Key("aws.dynamodb.attributes_to_get")
  1114. // The value of the `IndexName` request parameter.
  1115. //
  1116. // Type: string
  1117. // Required: No
  1118. // Stability: stable
  1119. // Examples: 'name_to_group'
  1120. AWSDynamoDBIndexNameKey = attribute.Key("aws.dynamodb.index_name")
  1121. // The value of the `Select` request parameter.
  1122. //
  1123. // Type: string
  1124. // Required: No
  1125. // Stability: stable
  1126. // Examples: 'ALL_ATTRIBUTES', 'COUNT'
  1127. AWSDynamoDBSelectKey = attribute.Key("aws.dynamodb.select")
  1128. )
  1129. // DynamoDB.CreateTable
  1130. const (
  1131. // The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request
  1132. // field
  1133. //
  1134. // Type: string[]
  1135. // Required: No
  1136. // Stability: stable
  1137. // Examples: '{ "IndexName": "string", "KeySchema": [ { "AttributeName": "string",
  1138. // "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ],
  1139. // "ProjectionType": "string" }, "ProvisionedThroughput": { "ReadCapacityUnits":
  1140. // number, "WriteCapacityUnits": number } }'
  1141. AWSDynamoDBGlobalSecondaryIndexesKey = attribute.Key("aws.dynamodb.global_secondary_indexes")
  1142. // The JSON-serialized value of each item of the `LocalSecondaryIndexes` request
  1143. // field.
  1144. //
  1145. // Type: string[]
  1146. // Required: No
  1147. // Stability: stable
  1148. // Examples: '{ "IndexARN": "string", "IndexName": "string", "IndexSizeBytes":
  1149. // number, "ItemCount": number, "KeySchema": [ { "AttributeName": "string",
  1150. // "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ "string" ],
  1151. // "ProjectionType": "string" } }'
  1152. AWSDynamoDBLocalSecondaryIndexesKey = attribute.Key("aws.dynamodb.local_secondary_indexes")
  1153. )
  1154. // DynamoDB.ListTables
  1155. const (
  1156. // The value of the `ExclusiveStartTableName` request parameter.
  1157. //
  1158. // Type: string
  1159. // Required: No
  1160. // Stability: stable
  1161. // Examples: 'Users', 'CatsTable'
  1162. AWSDynamoDBExclusiveStartTableKey = attribute.Key("aws.dynamodb.exclusive_start_table")
  1163. // The the number of items in the `TableNames` response parameter.
  1164. //
  1165. // Type: int
  1166. // Required: No
  1167. // Stability: stable
  1168. // Examples: 20
  1169. AWSDynamoDBTableCountKey = attribute.Key("aws.dynamodb.table_count")
  1170. )
  1171. // DynamoDB.Query
  1172. const (
  1173. // The value of the `ScanIndexForward` request parameter.
  1174. //
  1175. // Type: boolean
  1176. // Required: No
  1177. // Stability: stable
  1178. AWSDynamoDBScanForwardKey = attribute.Key("aws.dynamodb.scan_forward")
  1179. )
  1180. // DynamoDB.Scan
  1181. const (
  1182. // The value of the `Segment` request parameter.
  1183. //
  1184. // Type: int
  1185. // Required: No
  1186. // Stability: stable
  1187. // Examples: 10
  1188. AWSDynamoDBSegmentKey = attribute.Key("aws.dynamodb.segment")
  1189. // The value of the `TotalSegments` request parameter.
  1190. //
  1191. // Type: int
  1192. // Required: No
  1193. // Stability: stable
  1194. // Examples: 100
  1195. AWSDynamoDBTotalSegmentsKey = attribute.Key("aws.dynamodb.total_segments")
  1196. // The value of the `Count` response parameter.
  1197. //
  1198. // Type: int
  1199. // Required: No
  1200. // Stability: stable
  1201. // Examples: 10
  1202. AWSDynamoDBCountKey = attribute.Key("aws.dynamodb.count")
  1203. // The value of the `ScannedCount` response parameter.
  1204. //
  1205. // Type: int
  1206. // Required: No
  1207. // Stability: stable
  1208. // Examples: 50
  1209. AWSDynamoDBScannedCountKey = attribute.Key("aws.dynamodb.scanned_count")
  1210. )
  1211. // DynamoDB.UpdateTable
  1212. const (
  1213. // The JSON-serialized value of each item in the `AttributeDefinitions` request
  1214. // field.
  1215. //
  1216. // Type: string[]
  1217. // Required: No
  1218. // Stability: stable
  1219. // Examples: '{ "AttributeName": "string", "AttributeType": "string" }'
  1220. AWSDynamoDBAttributeDefinitionsKey = attribute.Key("aws.dynamodb.attribute_definitions")
  1221. // The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates`
  1222. // request field.
  1223. //
  1224. // Type: string[]
  1225. // Required: No
  1226. // Stability: stable
  1227. // Examples: '{ "Create": { "IndexName": "string", "KeySchema": [ {
  1228. // "AttributeName": "string", "KeyType": "string" } ], "Projection": {
  1229. // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" },
  1230. // "ProvisionedThroughput": { "ReadCapacityUnits": number, "WriteCapacityUnits":
  1231. // number } }'
  1232. AWSDynamoDBGlobalSecondaryIndexUpdatesKey = attribute.Key("aws.dynamodb.global_secondary_index_updates")
  1233. )
  1234. // This document defines the attributes used in messaging systems.
  1235. const (
  1236. // A string identifying the messaging system.
  1237. //
  1238. // Type: string
  1239. // Required: Always
  1240. // Stability: stable
  1241. // Examples: 'kafka', 'rabbitmq', 'rocketmq', 'activemq', 'AmazonSQS'
  1242. MessagingSystemKey = attribute.Key("messaging.system")
  1243. // The message destination name. This might be equal to the span name but is
  1244. // required nevertheless.
  1245. //
  1246. // Type: string
  1247. // Required: Always
  1248. // Stability: stable
  1249. // Examples: 'MyQueue', 'MyTopic'
  1250. MessagingDestinationKey = attribute.Key("messaging.destination")
  1251. // The kind of message destination
  1252. //
  1253. // Type: Enum
  1254. // Required: Required only if the message destination is either a `queue` or
  1255. // `topic`.
  1256. // Stability: stable
  1257. MessagingDestinationKindKey = attribute.Key("messaging.destination_kind")
  1258. // A boolean that is true if the message destination is temporary.
  1259. //
  1260. // Type: boolean
  1261. // Required: If missing, it is assumed to be false.
  1262. // Stability: stable
  1263. MessagingTempDestinationKey = attribute.Key("messaging.temp_destination")
  1264. // The name of the transport protocol.
  1265. //
  1266. // Type: string
  1267. // Required: No
  1268. // Stability: stable
  1269. // Examples: 'AMQP', 'MQTT'
  1270. MessagingProtocolKey = attribute.Key("messaging.protocol")
  1271. // The version of the transport protocol.
  1272. //
  1273. // Type: string
  1274. // Required: No
  1275. // Stability: stable
  1276. // Examples: '0.9.1'
  1277. MessagingProtocolVersionKey = attribute.Key("messaging.protocol_version")
  1278. // Connection string.
  1279. //
  1280. // Type: string
  1281. // Required: No
  1282. // Stability: stable
  1283. // Examples: 'tibjmsnaming://localhost:7222',
  1284. // 'https://queue.amazonaws.com/80398EXAMPLE/MyQueue'
  1285. MessagingURLKey = attribute.Key("messaging.url")
  1286. // A value used by the messaging system as an identifier for the message,
  1287. // represented as a string.
  1288. //
  1289. // Type: string
  1290. // Required: No
  1291. // Stability: stable
  1292. // Examples: '452a7c7c7c7048c2f887f61572b18fc2'
  1293. MessagingMessageIDKey = attribute.Key("messaging.message_id")
  1294. // The [conversation ID](#conversations) identifying the conversation to which the
  1295. // message belongs, represented as a string. Sometimes called "Correlation ID".
  1296. //
  1297. // Type: string
  1298. // Required: No
  1299. // Stability: stable
  1300. // Examples: 'MyConversationID'
  1301. MessagingConversationIDKey = attribute.Key("messaging.conversation_id")
  1302. // The (uncompressed) size of the message payload in bytes. Also use this
  1303. // attribute if it is unknown whether the compressed or uncompressed payload size
  1304. // is reported.
  1305. //
  1306. // Type: int
  1307. // Required: No
  1308. // Stability: stable
  1309. // Examples: 2738
  1310. MessagingMessagePayloadSizeBytesKey = attribute.Key("messaging.message_payload_size_bytes")
  1311. // The compressed size of the message payload in bytes.
  1312. //
  1313. // Type: int
  1314. // Required: No
  1315. // Stability: stable
  1316. // Examples: 2048
  1317. MessagingMessagePayloadCompressedSizeBytesKey = attribute.Key("messaging.message_payload_compressed_size_bytes")
  1318. )
  1319. var (
  1320. // A message sent to a queue
  1321. MessagingDestinationKindQueue = MessagingDestinationKindKey.String("queue")
  1322. // A message sent to a topic
  1323. MessagingDestinationKindTopic = MessagingDestinationKindKey.String("topic")
  1324. )
  1325. // Semantic convention for a consumer of messages received from a messaging system
  1326. const (
  1327. // A string identifying the kind of message consumption as defined in the
  1328. // [Operation names](#operation-names) section above. If the operation is "send",
  1329. // this attribute MUST NOT be set, since the operation can be inferred from the
  1330. // span kind in that case.
  1331. //
  1332. // Type: Enum
  1333. // Required: No
  1334. // Stability: stable
  1335. MessagingOperationKey = attribute.Key("messaging.operation")
  1336. // The identifier for the consumer receiving a message. For Kafka, set it to
  1337. // `{messaging.kafka.consumer_group} - {messaging.kafka.client_id}`, if both are
  1338. // present, or only `messaging.kafka.consumer_group`. For brokers, such as
  1339. // RabbitMQ and Artemis, set it to the `client_id` of the client consuming the
  1340. // message.
  1341. //
  1342. // Type: string
  1343. // Required: No
  1344. // Stability: stable
  1345. // Examples: 'mygroup - client-6'
  1346. MessagingConsumerIDKey = attribute.Key("messaging.consumer_id")
  1347. )
  1348. var (
  1349. // receive
  1350. MessagingOperationReceive = MessagingOperationKey.String("receive")
  1351. // process
  1352. MessagingOperationProcess = MessagingOperationKey.String("process")
  1353. )
  1354. // Attributes for RabbitMQ
  1355. const (
  1356. // RabbitMQ message routing key.
  1357. //
  1358. // Type: string
  1359. // Required: Unless it is empty.
  1360. // Stability: stable
  1361. // Examples: 'myKey'
  1362. MessagingRabbitmqRoutingKeyKey = attribute.Key("messaging.rabbitmq.routing_key")
  1363. )
  1364. // Attributes for Apache Kafka
  1365. const (
  1366. // Message keys in Kafka are used for grouping alike messages to ensure they're
  1367. // processed on the same partition. They differ from `messaging.message_id` in
  1368. // that they're not unique. If the key is `null`, the attribute MUST NOT be set.
  1369. //
  1370. // Type: string
  1371. // Required: No
  1372. // Stability: stable
  1373. // Examples: 'myKey'
  1374. // Note: If the key type is not string, it's string representation has to be
  1375. // supplied for the attribute. If the key has no unambiguous, canonical string
  1376. // form, don't include its value.
  1377. MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message_key")
  1378. // Name of the Kafka Consumer Group that is handling the message. Only applies to
  1379. // consumers, not producers.
  1380. //
  1381. // Type: string
  1382. // Required: No
  1383. // Stability: stable
  1384. // Examples: 'my-group'
  1385. MessagingKafkaConsumerGroupKey = attribute.Key("messaging.kafka.consumer_group")
  1386. // Client ID for the Consumer or Producer that is handling the message.
  1387. //
  1388. // Type: string
  1389. // Required: No
  1390. // Stability: stable
  1391. // Examples: 'client-5'
  1392. MessagingKafkaClientIDKey = attribute.Key("messaging.kafka.client_id")
  1393. // Partition the message is sent to.
  1394. //
  1395. // Type: int
  1396. // Required: No
  1397. // Stability: stable
  1398. // Examples: 2
  1399. MessagingKafkaPartitionKey = attribute.Key("messaging.kafka.partition")
  1400. // A boolean that is true if the message is a tombstone.
  1401. //
  1402. // Type: boolean
  1403. // Required: If missing, it is assumed to be false.
  1404. // Stability: stable
  1405. MessagingKafkaTombstoneKey = attribute.Key("messaging.kafka.tombstone")
  1406. )
  1407. // Attributes for Apache RocketMQ
  1408. const (
  1409. // Namespace of RocketMQ resources, resources in different namespaces are
  1410. // individual.
  1411. //
  1412. // Type: string
  1413. // Required: Always
  1414. // Stability: stable
  1415. // Examples: 'myNamespace'
  1416. MessagingRocketmqNamespaceKey = attribute.Key("messaging.rocketmq.namespace")
  1417. // Name of the RocketMQ producer/consumer group that is handling the message. The
  1418. // client type is identified by the SpanKind.
  1419. //
  1420. // Type: string
  1421. // Required: Always
  1422. // Stability: stable
  1423. // Examples: 'myConsumerGroup'
  1424. MessagingRocketmqClientGroupKey = attribute.Key("messaging.rocketmq.client_group")
  1425. // The unique identifier for each client.
  1426. //
  1427. // Type: string
  1428. // Required: Always
  1429. // Stability: stable
  1430. // Examples: 'myhost@8742@s8083jm'
  1431. MessagingRocketmqClientIDKey = attribute.Key("messaging.rocketmq.client_id")
  1432. // Type of message.
  1433. //
  1434. // Type: Enum
  1435. // Required: No
  1436. // Stability: stable
  1437. MessagingRocketmqMessageTypeKey = attribute.Key("messaging.rocketmq.message_type")
  1438. // The secondary classifier of message besides topic.
  1439. //
  1440. // Type: string
  1441. // Required: No
  1442. // Stability: stable
  1443. // Examples: 'tagA'
  1444. MessagingRocketmqMessageTagKey = attribute.Key("messaging.rocketmq.message_tag")
  1445. // Key(s) of message, another way to mark message besides message id.
  1446. //
  1447. // Type: string[]
  1448. // Required: No
  1449. // Stability: stable
  1450. // Examples: 'keyA', 'keyB'
  1451. MessagingRocketmqMessageKeysKey = attribute.Key("messaging.rocketmq.message_keys")
  1452. // Model of message consumption. This only applies to consumer spans.
  1453. //
  1454. // Type: Enum
  1455. // Required: No
  1456. // Stability: stable
  1457. MessagingRocketmqConsumptionModelKey = attribute.Key("messaging.rocketmq.consumption_model")
  1458. )
  1459. var (
  1460. // Normal message
  1461. MessagingRocketmqMessageTypeNormal = MessagingRocketmqMessageTypeKey.String("normal")
  1462. // FIFO message
  1463. MessagingRocketmqMessageTypeFifo = MessagingRocketmqMessageTypeKey.String("fifo")
  1464. // Delay message
  1465. MessagingRocketmqMessageTypeDelay = MessagingRocketmqMessageTypeKey.String("delay")
  1466. // Transaction message
  1467. MessagingRocketmqMessageTypeTransaction = MessagingRocketmqMessageTypeKey.String("transaction")
  1468. )
  1469. var (
  1470. // Clustering consumption model
  1471. MessagingRocketmqConsumptionModelClustering = MessagingRocketmqConsumptionModelKey.String("clustering")
  1472. // Broadcasting consumption model
  1473. MessagingRocketmqConsumptionModelBroadcasting = MessagingRocketmqConsumptionModelKey.String("broadcasting")
  1474. )
  1475. // This document defines semantic conventions for remote procedure calls.
  1476. const (
  1477. // A string identifying the remoting system. See below for a list of well-known
  1478. // identifiers.
  1479. //
  1480. // Type: Enum
  1481. // Required: Always
  1482. // Stability: stable
  1483. RPCSystemKey = attribute.Key("rpc.system")
  1484. // The full (logical) name of the service being called, including its package
  1485. // name, if applicable.
  1486. //
  1487. // Type: string
  1488. // Required: No, but recommended
  1489. // Stability: stable
  1490. // Examples: 'myservice.EchoService'
  1491. // Note: This is the logical name of the service from the RPC interface
  1492. // perspective, which can be different from the name of any implementing class.
  1493. // The `code.namespace` attribute may be used to store the latter (despite the
  1494. // attribute name, it may include a class name; e.g., class with method actually
  1495. // executing the call on the server side, RPC client stub class on the client
  1496. // side).
  1497. RPCServiceKey = attribute.Key("rpc.service")
  1498. // The name of the (logical) method being called, must be equal to the $method
  1499. // part in the span name.
  1500. //
  1501. // Type: string
  1502. // Required: No, but recommended
  1503. // Stability: stable
  1504. // Examples: 'exampleMethod'
  1505. // Note: This is the logical name of the method from the RPC interface
  1506. // perspective, which can be different from the name of any implementing
  1507. // method/function. The `code.function` attribute may be used to store the latter
  1508. // (e.g., method actually executing the call on the server side, RPC client stub
  1509. // method on the client side).
  1510. RPCMethodKey = attribute.Key("rpc.method")
  1511. )
  1512. var (
  1513. // gRPC
  1514. RPCSystemGRPC = RPCSystemKey.String("grpc")
  1515. // Java RMI
  1516. RPCSystemJavaRmi = RPCSystemKey.String("java_rmi")
  1517. // .NET WCF
  1518. RPCSystemDotnetWcf = RPCSystemKey.String("dotnet_wcf")
  1519. // Apache Dubbo
  1520. RPCSystemApacheDubbo = RPCSystemKey.String("apache_dubbo")
  1521. )
  1522. // Tech-specific attributes for gRPC.
  1523. const (
  1524. // The [numeric status
  1525. // code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC
  1526. // request.
  1527. //
  1528. // Type: Enum
  1529. // Required: Always
  1530. // Stability: stable
  1531. RPCGRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code")
  1532. )
  1533. var (
  1534. // OK
  1535. RPCGRPCStatusCodeOk = RPCGRPCStatusCodeKey.Int(0)
  1536. // CANCELLED
  1537. RPCGRPCStatusCodeCancelled = RPCGRPCStatusCodeKey.Int(1)
  1538. // UNKNOWN
  1539. RPCGRPCStatusCodeUnknown = RPCGRPCStatusCodeKey.Int(2)
  1540. // INVALID_ARGUMENT
  1541. RPCGRPCStatusCodeInvalidArgument = RPCGRPCStatusCodeKey.Int(3)
  1542. // DEADLINE_EXCEEDED
  1543. RPCGRPCStatusCodeDeadlineExceeded = RPCGRPCStatusCodeKey.Int(4)
  1544. // NOT_FOUND
  1545. RPCGRPCStatusCodeNotFound = RPCGRPCStatusCodeKey.Int(5)
  1546. // ALREADY_EXISTS
  1547. RPCGRPCStatusCodeAlreadyExists = RPCGRPCStatusCodeKey.Int(6)
  1548. // PERMISSION_DENIED
  1549. RPCGRPCStatusCodePermissionDenied = RPCGRPCStatusCodeKey.Int(7)
  1550. // RESOURCE_EXHAUSTED
  1551. RPCGRPCStatusCodeResourceExhausted = RPCGRPCStatusCodeKey.Int(8)
  1552. // FAILED_PRECONDITION
  1553. RPCGRPCStatusCodeFailedPrecondition = RPCGRPCStatusCodeKey.Int(9)
  1554. // ABORTED
  1555. RPCGRPCStatusCodeAborted = RPCGRPCStatusCodeKey.Int(10)
  1556. // OUT_OF_RANGE
  1557. RPCGRPCStatusCodeOutOfRange = RPCGRPCStatusCodeKey.Int(11)
  1558. // UNIMPLEMENTED
  1559. RPCGRPCStatusCodeUnimplemented = RPCGRPCStatusCodeKey.Int(12)
  1560. // INTERNAL
  1561. RPCGRPCStatusCodeInternal = RPCGRPCStatusCodeKey.Int(13)
  1562. // UNAVAILABLE
  1563. RPCGRPCStatusCodeUnavailable = RPCGRPCStatusCodeKey.Int(14)
  1564. // DATA_LOSS
  1565. RPCGRPCStatusCodeDataLoss = RPCGRPCStatusCodeKey.Int(15)
  1566. // UNAUTHENTICATED
  1567. RPCGRPCStatusCodeUnauthenticated = RPCGRPCStatusCodeKey.Int(16)
  1568. )
  1569. // Tech-specific attributes for [JSON RPC](https://www.jsonrpc.org/).
  1570. const (
  1571. // Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC
  1572. // 1.0 does not specify this, the value can be omitted.
  1573. //
  1574. // Type: string
  1575. // Required: If missing, it is assumed to be "1.0".
  1576. // Stability: stable
  1577. // Examples: '2.0', '1.0'
  1578. RPCJsonrpcVersionKey = attribute.Key("rpc.jsonrpc.version")
  1579. // `id` property of request or response. Since protocol allows id to be int,
  1580. // string, `null` or missing (for notifications), value is expected to be cast to
  1581. // string for simplicity. Use empty string in case of `null` value. Omit entirely
  1582. // if this is a notification.
  1583. //
  1584. // Type: string
  1585. // Required: No
  1586. // Stability: stable
  1587. // Examples: '10', 'request-7', ''
  1588. RPCJsonrpcRequestIDKey = attribute.Key("rpc.jsonrpc.request_id")
  1589. // `error.code` property of response if it is an error response.
  1590. //
  1591. // Type: int
  1592. // Required: If missing, response is assumed to be successful.
  1593. // Stability: stable
  1594. // Examples: -32700, 100
  1595. RPCJsonrpcErrorCodeKey = attribute.Key("rpc.jsonrpc.error_code")
  1596. // `error.message` property of response if it is an error response.
  1597. //
  1598. // Type: string
  1599. // Required: No
  1600. // Stability: stable
  1601. // Examples: 'Parse error', 'User already exists'
  1602. RPCJsonrpcErrorMessageKey = attribute.Key("rpc.jsonrpc.error_message")
  1603. )
  1604. // RPC received/sent message.
  1605. const (
  1606. // Whether this is a received or sent message.
  1607. //
  1608. // Type: Enum
  1609. // Required: No
  1610. // Stability: stable
  1611. MessageTypeKey = attribute.Key("message.type")
  1612. // MUST be calculated as two different counters starting from `1` one for sent
  1613. // messages and one for received message.
  1614. //
  1615. // Type: int
  1616. // Required: No
  1617. // Stability: stable
  1618. // Note: This way we guarantee that the values will be consistent between
  1619. // different implementations.
  1620. MessageIDKey = attribute.Key("message.id")
  1621. // Compressed size of the message in bytes.
  1622. //
  1623. // Type: int
  1624. // Required: No
  1625. // Stability: stable
  1626. MessageCompressedSizeKey = attribute.Key("message.compressed_size")
  1627. // Uncompressed size of the message in bytes.
  1628. //
  1629. // Type: int
  1630. // Required: No
  1631. // Stability: stable
  1632. MessageUncompressedSizeKey = attribute.Key("message.uncompressed_size")
  1633. )
  1634. var (
  1635. // sent
  1636. MessageTypeSent = MessageTypeKey.String("SENT")
  1637. // received
  1638. MessageTypeReceived = MessageTypeKey.String("RECEIVED")
  1639. )