trace.go 100 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495
  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.21.0"
  16. import "go.opentelemetry.io/otel/attribute"
  17. // The shared attributes used to report a single exception associated with a
  18. // span or log.
  19. const (
  20. // ExceptionTypeKey is the attribute Key conforming to the "exception.type"
  21. // semantic conventions. It represents the type of the exception (its
  22. // fully-qualified class name, if applicable). The dynamic type of the
  23. // exception should be preferred over the static type in languages that
  24. // support it.
  25. //
  26. // Type: string
  27. // RequirementLevel: Optional
  28. // Stability: stable
  29. // Examples: 'java.net.ConnectException', 'OSError'
  30. ExceptionTypeKey = attribute.Key("exception.type")
  31. // ExceptionMessageKey is the attribute Key conforming to the
  32. // "exception.message" semantic conventions. It represents the exception
  33. // message.
  34. //
  35. // Type: string
  36. // RequirementLevel: Optional
  37. // Stability: stable
  38. // Examples: 'Division by zero', "Can't convert 'int' object to str
  39. // implicitly"
  40. ExceptionMessageKey = attribute.Key("exception.message")
  41. // ExceptionStacktraceKey is the attribute Key conforming to the
  42. // "exception.stacktrace" semantic conventions. It represents a stacktrace
  43. // as a string in the natural representation for the language runtime. The
  44. // representation is to be determined and documented by each language SIG.
  45. //
  46. // Type: string
  47. // RequirementLevel: Optional
  48. // Stability: stable
  49. // Examples: 'Exception in thread "main" java.lang.RuntimeException: Test
  50. // exception\\n at '
  51. // 'com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at '
  52. // 'com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at '
  53. // 'com.example.GenerateTrace.main(GenerateTrace.java:5)'
  54. ExceptionStacktraceKey = attribute.Key("exception.stacktrace")
  55. )
  56. // ExceptionType returns an attribute KeyValue conforming to the
  57. // "exception.type" semantic conventions. It represents the type of the
  58. // exception (its fully-qualified class name, if applicable). The dynamic type
  59. // of the exception should be preferred over the static type in languages that
  60. // support it.
  61. func ExceptionType(val string) attribute.KeyValue {
  62. return ExceptionTypeKey.String(val)
  63. }
  64. // ExceptionMessage returns an attribute KeyValue conforming to the
  65. // "exception.message" semantic conventions. It represents the exception
  66. // message.
  67. func ExceptionMessage(val string) attribute.KeyValue {
  68. return ExceptionMessageKey.String(val)
  69. }
  70. // ExceptionStacktrace returns an attribute KeyValue conforming to the
  71. // "exception.stacktrace" semantic conventions. It represents a stacktrace as a
  72. // string in the natural representation for the language runtime. The
  73. // representation is to be determined and documented by each language SIG.
  74. func ExceptionStacktrace(val string) attribute.KeyValue {
  75. return ExceptionStacktraceKey.String(val)
  76. }
  77. // Span attributes used by AWS Lambda (in addition to general `faas`
  78. // attributes).
  79. const (
  80. // AWSLambdaInvokedARNKey is the attribute Key conforming to the
  81. // "aws.lambda.invoked_arn" semantic conventions. It represents the full
  82. // invoked ARN as provided on the `Context` passed to the function
  83. // (`Lambda-Runtime-Invoked-Function-ARN` header on the
  84. // `/runtime/invocation/next` applicable).
  85. //
  86. // Type: string
  87. // RequirementLevel: Optional
  88. // Stability: stable
  89. // Examples: 'arn:aws:lambda:us-east-1:123456:function:myfunction:myalias'
  90. // Note: This may be different from `cloud.resource_id` if an alias is
  91. // involved.
  92. AWSLambdaInvokedARNKey = attribute.Key("aws.lambda.invoked_arn")
  93. )
  94. // AWSLambdaInvokedARN returns an attribute KeyValue conforming to the
  95. // "aws.lambda.invoked_arn" semantic conventions. It represents the full
  96. // invoked ARN as provided on the `Context` passed to the function
  97. // (`Lambda-Runtime-Invoked-Function-ARN` header on the
  98. // `/runtime/invocation/next` applicable).
  99. func AWSLambdaInvokedARN(val string) attribute.KeyValue {
  100. return AWSLambdaInvokedARNKey.String(val)
  101. }
  102. // Attributes for CloudEvents. CloudEvents is a specification on how to define
  103. // event data in a standard way. These attributes can be attached to spans when
  104. // performing operations with CloudEvents, regardless of the protocol being
  105. // used.
  106. const (
  107. // CloudeventsEventIDKey is the attribute Key conforming to the
  108. // "cloudevents.event_id" semantic conventions. It represents the
  109. // [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id)
  110. // uniquely identifies the event.
  111. //
  112. // Type: string
  113. // RequirementLevel: Required
  114. // Stability: stable
  115. // Examples: '123e4567-e89b-12d3-a456-426614174000', '0001'
  116. CloudeventsEventIDKey = attribute.Key("cloudevents.event_id")
  117. // CloudeventsEventSourceKey is the attribute Key conforming to the
  118. // "cloudevents.event_source" semantic conventions. It represents the
  119. // [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1)
  120. // identifies the context in which an event happened.
  121. //
  122. // Type: string
  123. // RequirementLevel: Required
  124. // Stability: stable
  125. // Examples: 'https://github.com/cloudevents',
  126. // '/cloudevents/spec/pull/123', 'my-service'
  127. CloudeventsEventSourceKey = attribute.Key("cloudevents.event_source")
  128. // CloudeventsEventSpecVersionKey is the attribute Key conforming to the
  129. // "cloudevents.event_spec_version" semantic conventions. It represents the
  130. // [version of the CloudEvents
  131. // specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion)
  132. // which the event uses.
  133. //
  134. // Type: string
  135. // RequirementLevel: Optional
  136. // Stability: stable
  137. // Examples: '1.0'
  138. CloudeventsEventSpecVersionKey = attribute.Key("cloudevents.event_spec_version")
  139. // CloudeventsEventTypeKey is the attribute Key conforming to the
  140. // "cloudevents.event_type" semantic conventions. It represents the
  141. // [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type)
  142. // contains a value describing the type of event related to the originating
  143. // occurrence.
  144. //
  145. // Type: string
  146. // RequirementLevel: Optional
  147. // Stability: stable
  148. // Examples: 'com.github.pull_request.opened',
  149. // 'com.example.object.deleted.v2'
  150. CloudeventsEventTypeKey = attribute.Key("cloudevents.event_type")
  151. // CloudeventsEventSubjectKey is the attribute Key conforming to the
  152. // "cloudevents.event_subject" semantic conventions. It represents the
  153. // [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject)
  154. // of the event in the context of the event producer (identified by
  155. // source).
  156. //
  157. // Type: string
  158. // RequirementLevel: Optional
  159. // Stability: stable
  160. // Examples: 'mynewfile.jpg'
  161. CloudeventsEventSubjectKey = attribute.Key("cloudevents.event_subject")
  162. )
  163. // CloudeventsEventID returns an attribute KeyValue conforming to the
  164. // "cloudevents.event_id" semantic conventions. It represents the
  165. // [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id)
  166. // uniquely identifies the event.
  167. func CloudeventsEventID(val string) attribute.KeyValue {
  168. return CloudeventsEventIDKey.String(val)
  169. }
  170. // CloudeventsEventSource returns an attribute KeyValue conforming to the
  171. // "cloudevents.event_source" semantic conventions. It represents the
  172. // [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1)
  173. // identifies the context in which an event happened.
  174. func CloudeventsEventSource(val string) attribute.KeyValue {
  175. return CloudeventsEventSourceKey.String(val)
  176. }
  177. // CloudeventsEventSpecVersion returns an attribute KeyValue conforming to
  178. // the "cloudevents.event_spec_version" semantic conventions. It represents the
  179. // [version of the CloudEvents
  180. // specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion)
  181. // which the event uses.
  182. func CloudeventsEventSpecVersion(val string) attribute.KeyValue {
  183. return CloudeventsEventSpecVersionKey.String(val)
  184. }
  185. // CloudeventsEventType returns an attribute KeyValue conforming to the
  186. // "cloudevents.event_type" semantic conventions. It represents the
  187. // [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type)
  188. // contains a value describing the type of event related to the originating
  189. // occurrence.
  190. func CloudeventsEventType(val string) attribute.KeyValue {
  191. return CloudeventsEventTypeKey.String(val)
  192. }
  193. // CloudeventsEventSubject returns an attribute KeyValue conforming to the
  194. // "cloudevents.event_subject" semantic conventions. It represents the
  195. // [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject)
  196. // of the event in the context of the event producer (identified by source).
  197. func CloudeventsEventSubject(val string) attribute.KeyValue {
  198. return CloudeventsEventSubjectKey.String(val)
  199. }
  200. // Semantic conventions for the OpenTracing Shim
  201. const (
  202. // OpentracingRefTypeKey is the attribute Key conforming to the
  203. // "opentracing.ref_type" semantic conventions. It represents the
  204. // parent-child Reference type
  205. //
  206. // Type: Enum
  207. // RequirementLevel: Optional
  208. // Stability: stable
  209. // Note: The causal relationship between a child Span and a parent Span.
  210. OpentracingRefTypeKey = attribute.Key("opentracing.ref_type")
  211. )
  212. var (
  213. // The parent Span depends on the child Span in some capacity
  214. OpentracingRefTypeChildOf = OpentracingRefTypeKey.String("child_of")
  215. // The parent Span does not depend in any way on the result of the child Span
  216. OpentracingRefTypeFollowsFrom = OpentracingRefTypeKey.String("follows_from")
  217. )
  218. // The attributes used to perform database client calls.
  219. const (
  220. // DBSystemKey is the attribute Key conforming to the "db.system" semantic
  221. // conventions. It represents an identifier for the database management
  222. // system (DBMS) product being used. See below for a list of well-known
  223. // identifiers.
  224. //
  225. // Type: Enum
  226. // RequirementLevel: Required
  227. // Stability: stable
  228. DBSystemKey = attribute.Key("db.system")
  229. // DBConnectionStringKey is the attribute Key conforming to the
  230. // "db.connection_string" semantic conventions. It represents the
  231. // connection string used to connect to the database. It is recommended to
  232. // remove embedded credentials.
  233. //
  234. // Type: string
  235. // RequirementLevel: Optional
  236. // Stability: stable
  237. // Examples: 'Server=(localdb)\\v11.0;Integrated Security=true;'
  238. DBConnectionStringKey = attribute.Key("db.connection_string")
  239. // DBUserKey is the attribute Key conforming to the "db.user" semantic
  240. // conventions. It represents the username for accessing the database.
  241. //
  242. // Type: string
  243. // RequirementLevel: Optional
  244. // Stability: stable
  245. // Examples: 'readonly_user', 'reporting_user'
  246. DBUserKey = attribute.Key("db.user")
  247. // DBJDBCDriverClassnameKey is the attribute Key conforming to the
  248. // "db.jdbc.driver_classname" semantic conventions. It represents the
  249. // fully-qualified class name of the [Java Database Connectivity
  250. // (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/)
  251. // driver used to connect.
  252. //
  253. // Type: string
  254. // RequirementLevel: Optional
  255. // Stability: stable
  256. // Examples: 'org.postgresql.Driver',
  257. // 'com.microsoft.sqlserver.jdbc.SQLServerDriver'
  258. DBJDBCDriverClassnameKey = attribute.Key("db.jdbc.driver_classname")
  259. // DBNameKey is the attribute Key conforming to the "db.name" semantic
  260. // conventions. It represents the this attribute is used to report the name
  261. // of the database being accessed. For commands that switch the database,
  262. // this should be set to the target database (even if the command fails).
  263. //
  264. // Type: string
  265. // RequirementLevel: ConditionallyRequired (If applicable.)
  266. // Stability: stable
  267. // Examples: 'customers', 'main'
  268. // Note: In some SQL databases, the database name to be used is called
  269. // "schema name". In case there are multiple layers that could be
  270. // considered for database name (e.g. Oracle instance name and schema
  271. // name), the database name to be used is the more specific layer (e.g.
  272. // Oracle schema name).
  273. DBNameKey = attribute.Key("db.name")
  274. // DBStatementKey is the attribute Key conforming to the "db.statement"
  275. // semantic conventions. It represents the database statement being
  276. // executed.
  277. //
  278. // Type: string
  279. // RequirementLevel: Recommended (Should be collected by default only if
  280. // there is sanitization that excludes sensitive information.)
  281. // Stability: stable
  282. // Examples: 'SELECT * FROM wuser_table', 'SET mykey "WuValue"'
  283. DBStatementKey = attribute.Key("db.statement")
  284. // DBOperationKey is the attribute Key conforming to the "db.operation"
  285. // semantic conventions. It represents the name of the operation being
  286. // executed, e.g. the [MongoDB command
  287. // name](https://docs.mongodb.com/manual/reference/command/#database-operations)
  288. // such as `findAndModify`, or the SQL keyword.
  289. //
  290. // Type: string
  291. // RequirementLevel: ConditionallyRequired (If `db.statement` is not
  292. // applicable.)
  293. // Stability: stable
  294. // Examples: 'findAndModify', 'HMSET', 'SELECT'
  295. // Note: When setting this to an SQL keyword, it is not recommended to
  296. // attempt any client-side parsing of `db.statement` just to get this
  297. // property, but it should be set if the operation name is provided by the
  298. // library being instrumented. If the SQL statement has an ambiguous
  299. // operation, or performs more than one operation, this value may be
  300. // omitted.
  301. DBOperationKey = attribute.Key("db.operation")
  302. )
  303. var (
  304. // Some other SQL database. Fallback only. See notes
  305. DBSystemOtherSQL = DBSystemKey.String("other_sql")
  306. // Microsoft SQL Server
  307. DBSystemMSSQL = DBSystemKey.String("mssql")
  308. // Microsoft SQL Server Compact
  309. DBSystemMssqlcompact = DBSystemKey.String("mssqlcompact")
  310. // MySQL
  311. DBSystemMySQL = DBSystemKey.String("mysql")
  312. // Oracle Database
  313. DBSystemOracle = DBSystemKey.String("oracle")
  314. // IBM DB2
  315. DBSystemDB2 = DBSystemKey.String("db2")
  316. // PostgreSQL
  317. DBSystemPostgreSQL = DBSystemKey.String("postgresql")
  318. // Amazon Redshift
  319. DBSystemRedshift = DBSystemKey.String("redshift")
  320. // Apache Hive
  321. DBSystemHive = DBSystemKey.String("hive")
  322. // Cloudscape
  323. DBSystemCloudscape = DBSystemKey.String("cloudscape")
  324. // HyperSQL DataBase
  325. DBSystemHSQLDB = DBSystemKey.String("hsqldb")
  326. // Progress Database
  327. DBSystemProgress = DBSystemKey.String("progress")
  328. // SAP MaxDB
  329. DBSystemMaxDB = DBSystemKey.String("maxdb")
  330. // SAP HANA
  331. DBSystemHanaDB = DBSystemKey.String("hanadb")
  332. // Ingres
  333. DBSystemIngres = DBSystemKey.String("ingres")
  334. // FirstSQL
  335. DBSystemFirstSQL = DBSystemKey.String("firstsql")
  336. // EnterpriseDB
  337. DBSystemEDB = DBSystemKey.String("edb")
  338. // InterSystems Caché
  339. DBSystemCache = DBSystemKey.String("cache")
  340. // Adabas (Adaptable Database System)
  341. DBSystemAdabas = DBSystemKey.String("adabas")
  342. // Firebird
  343. DBSystemFirebird = DBSystemKey.String("firebird")
  344. // Apache Derby
  345. DBSystemDerby = DBSystemKey.String("derby")
  346. // FileMaker
  347. DBSystemFilemaker = DBSystemKey.String("filemaker")
  348. // Informix
  349. DBSystemInformix = DBSystemKey.String("informix")
  350. // InstantDB
  351. DBSystemInstantDB = DBSystemKey.String("instantdb")
  352. // InterBase
  353. DBSystemInterbase = DBSystemKey.String("interbase")
  354. // MariaDB
  355. DBSystemMariaDB = DBSystemKey.String("mariadb")
  356. // Netezza
  357. DBSystemNetezza = DBSystemKey.String("netezza")
  358. // Pervasive PSQL
  359. DBSystemPervasive = DBSystemKey.String("pervasive")
  360. // PointBase
  361. DBSystemPointbase = DBSystemKey.String("pointbase")
  362. // SQLite
  363. DBSystemSqlite = DBSystemKey.String("sqlite")
  364. // Sybase
  365. DBSystemSybase = DBSystemKey.String("sybase")
  366. // Teradata
  367. DBSystemTeradata = DBSystemKey.String("teradata")
  368. // Vertica
  369. DBSystemVertica = DBSystemKey.String("vertica")
  370. // H2
  371. DBSystemH2 = DBSystemKey.String("h2")
  372. // ColdFusion IMQ
  373. DBSystemColdfusion = DBSystemKey.String("coldfusion")
  374. // Apache Cassandra
  375. DBSystemCassandra = DBSystemKey.String("cassandra")
  376. // Apache HBase
  377. DBSystemHBase = DBSystemKey.String("hbase")
  378. // MongoDB
  379. DBSystemMongoDB = DBSystemKey.String("mongodb")
  380. // Redis
  381. DBSystemRedis = DBSystemKey.String("redis")
  382. // Couchbase
  383. DBSystemCouchbase = DBSystemKey.String("couchbase")
  384. // CouchDB
  385. DBSystemCouchDB = DBSystemKey.String("couchdb")
  386. // Microsoft Azure Cosmos DB
  387. DBSystemCosmosDB = DBSystemKey.String("cosmosdb")
  388. // Amazon DynamoDB
  389. DBSystemDynamoDB = DBSystemKey.String("dynamodb")
  390. // Neo4j
  391. DBSystemNeo4j = DBSystemKey.String("neo4j")
  392. // Apache Geode
  393. DBSystemGeode = DBSystemKey.String("geode")
  394. // Elasticsearch
  395. DBSystemElasticsearch = DBSystemKey.String("elasticsearch")
  396. // Memcached
  397. DBSystemMemcached = DBSystemKey.String("memcached")
  398. // CockroachDB
  399. DBSystemCockroachdb = DBSystemKey.String("cockroachdb")
  400. // OpenSearch
  401. DBSystemOpensearch = DBSystemKey.String("opensearch")
  402. // ClickHouse
  403. DBSystemClickhouse = DBSystemKey.String("clickhouse")
  404. // Cloud Spanner
  405. DBSystemSpanner = DBSystemKey.String("spanner")
  406. // Trino
  407. DBSystemTrino = DBSystemKey.String("trino")
  408. )
  409. // DBConnectionString returns an attribute KeyValue conforming to the
  410. // "db.connection_string" semantic conventions. It represents the connection
  411. // string used to connect to the database. It is recommended to remove embedded
  412. // credentials.
  413. func DBConnectionString(val string) attribute.KeyValue {
  414. return DBConnectionStringKey.String(val)
  415. }
  416. // DBUser returns an attribute KeyValue conforming to the "db.user" semantic
  417. // conventions. It represents the username for accessing the database.
  418. func DBUser(val string) attribute.KeyValue {
  419. return DBUserKey.String(val)
  420. }
  421. // DBJDBCDriverClassname returns an attribute KeyValue conforming to the
  422. // "db.jdbc.driver_classname" semantic conventions. It represents the
  423. // fully-qualified class name of the [Java Database Connectivity
  424. // (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver
  425. // used to connect.
  426. func DBJDBCDriverClassname(val string) attribute.KeyValue {
  427. return DBJDBCDriverClassnameKey.String(val)
  428. }
  429. // DBName returns an attribute KeyValue conforming to the "db.name" semantic
  430. // conventions. It represents the this attribute is used to report the name of
  431. // the database being accessed. For commands that switch the database, this
  432. // should be set to the target database (even if the command fails).
  433. func DBName(val string) attribute.KeyValue {
  434. return DBNameKey.String(val)
  435. }
  436. // DBStatement returns an attribute KeyValue conforming to the
  437. // "db.statement" semantic conventions. It represents the database statement
  438. // being executed.
  439. func DBStatement(val string) attribute.KeyValue {
  440. return DBStatementKey.String(val)
  441. }
  442. // DBOperation returns an attribute KeyValue conforming to the
  443. // "db.operation" semantic conventions. It represents the name of the operation
  444. // being executed, e.g. the [MongoDB command
  445. // name](https://docs.mongodb.com/manual/reference/command/#database-operations)
  446. // such as `findAndModify`, or the SQL keyword.
  447. func DBOperation(val string) attribute.KeyValue {
  448. return DBOperationKey.String(val)
  449. }
  450. // Connection-level attributes for Microsoft SQL Server
  451. const (
  452. // DBMSSQLInstanceNameKey is the attribute Key conforming to the
  453. // "db.mssql.instance_name" semantic conventions. It represents the
  454. // Microsoft SQL Server [instance
  455. // name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15)
  456. // connecting to. This name is used to determine the port of a named
  457. // instance.
  458. //
  459. // Type: string
  460. // RequirementLevel: Optional
  461. // Stability: stable
  462. // Examples: 'MSSQLSERVER'
  463. // Note: If setting a `db.mssql.instance_name`, `server.port` is no longer
  464. // required (but still recommended if non-standard).
  465. DBMSSQLInstanceNameKey = attribute.Key("db.mssql.instance_name")
  466. )
  467. // DBMSSQLInstanceName returns an attribute KeyValue conforming to the
  468. // "db.mssql.instance_name" semantic conventions. It represents the Microsoft
  469. // SQL Server [instance
  470. // name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15)
  471. // connecting to. This name is used to determine the port of a named instance.
  472. func DBMSSQLInstanceName(val string) attribute.KeyValue {
  473. return DBMSSQLInstanceNameKey.String(val)
  474. }
  475. // Call-level attributes for Cassandra
  476. const (
  477. // DBCassandraPageSizeKey is the attribute Key conforming to the
  478. // "db.cassandra.page_size" semantic conventions. It represents the fetch
  479. // size used for paging, i.e. how many rows will be returned at once.
  480. //
  481. // Type: int
  482. // RequirementLevel: Optional
  483. // Stability: stable
  484. // Examples: 5000
  485. DBCassandraPageSizeKey = attribute.Key("db.cassandra.page_size")
  486. // DBCassandraConsistencyLevelKey is the attribute Key conforming to the
  487. // "db.cassandra.consistency_level" semantic conventions. It represents the
  488. // consistency level of the query. Based on consistency values from
  489. // [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html).
  490. //
  491. // Type: Enum
  492. // RequirementLevel: Optional
  493. // Stability: stable
  494. DBCassandraConsistencyLevelKey = attribute.Key("db.cassandra.consistency_level")
  495. // DBCassandraTableKey is the attribute Key conforming to the
  496. // "db.cassandra.table" semantic conventions. It represents the name of the
  497. // primary table that the operation is acting upon, including the keyspace
  498. // name (if applicable).
  499. //
  500. // Type: string
  501. // RequirementLevel: Recommended
  502. // Stability: stable
  503. // Examples: 'mytable'
  504. // Note: This mirrors the db.sql.table attribute but references cassandra
  505. // rather than sql. It is not recommended to attempt any client-side
  506. // parsing of `db.statement` just to get this property, but it should be
  507. // set if it is provided by the library being instrumented. If the
  508. // operation is acting upon an anonymous table, or more than one table,
  509. // this value MUST NOT be set.
  510. DBCassandraTableKey = attribute.Key("db.cassandra.table")
  511. // DBCassandraIdempotenceKey is the attribute Key conforming to the
  512. // "db.cassandra.idempotence" semantic conventions. It represents the
  513. // whether or not the query is idempotent.
  514. //
  515. // Type: boolean
  516. // RequirementLevel: Optional
  517. // Stability: stable
  518. DBCassandraIdempotenceKey = attribute.Key("db.cassandra.idempotence")
  519. // DBCassandraSpeculativeExecutionCountKey is the attribute Key conforming
  520. // to the "db.cassandra.speculative_execution_count" semantic conventions.
  521. // It represents the number of times a query was speculatively executed.
  522. // Not set or `0` if the query was not executed speculatively.
  523. //
  524. // Type: int
  525. // RequirementLevel: Optional
  526. // Stability: stable
  527. // Examples: 0, 2
  528. DBCassandraSpeculativeExecutionCountKey = attribute.Key("db.cassandra.speculative_execution_count")
  529. // DBCassandraCoordinatorIDKey is the attribute Key conforming to the
  530. // "db.cassandra.coordinator.id" semantic conventions. It represents the ID
  531. // of the coordinating node for a query.
  532. //
  533. // Type: string
  534. // RequirementLevel: Optional
  535. // Stability: stable
  536. // Examples: 'be13faa2-8574-4d71-926d-27f16cf8a7af'
  537. DBCassandraCoordinatorIDKey = attribute.Key("db.cassandra.coordinator.id")
  538. // DBCassandraCoordinatorDCKey is the attribute Key conforming to the
  539. // "db.cassandra.coordinator.dc" semantic conventions. It represents the
  540. // data center of the coordinating node for a query.
  541. //
  542. // Type: string
  543. // RequirementLevel: Optional
  544. // Stability: stable
  545. // Examples: 'us-west-2'
  546. DBCassandraCoordinatorDCKey = attribute.Key("db.cassandra.coordinator.dc")
  547. )
  548. var (
  549. // all
  550. DBCassandraConsistencyLevelAll = DBCassandraConsistencyLevelKey.String("all")
  551. // each_quorum
  552. DBCassandraConsistencyLevelEachQuorum = DBCassandraConsistencyLevelKey.String("each_quorum")
  553. // quorum
  554. DBCassandraConsistencyLevelQuorum = DBCassandraConsistencyLevelKey.String("quorum")
  555. // local_quorum
  556. DBCassandraConsistencyLevelLocalQuorum = DBCassandraConsistencyLevelKey.String("local_quorum")
  557. // one
  558. DBCassandraConsistencyLevelOne = DBCassandraConsistencyLevelKey.String("one")
  559. // two
  560. DBCassandraConsistencyLevelTwo = DBCassandraConsistencyLevelKey.String("two")
  561. // three
  562. DBCassandraConsistencyLevelThree = DBCassandraConsistencyLevelKey.String("three")
  563. // local_one
  564. DBCassandraConsistencyLevelLocalOne = DBCassandraConsistencyLevelKey.String("local_one")
  565. // any
  566. DBCassandraConsistencyLevelAny = DBCassandraConsistencyLevelKey.String("any")
  567. // serial
  568. DBCassandraConsistencyLevelSerial = DBCassandraConsistencyLevelKey.String("serial")
  569. // local_serial
  570. DBCassandraConsistencyLevelLocalSerial = DBCassandraConsistencyLevelKey.String("local_serial")
  571. )
  572. // DBCassandraPageSize returns an attribute KeyValue conforming to the
  573. // "db.cassandra.page_size" semantic conventions. It represents the fetch size
  574. // used for paging, i.e. how many rows will be returned at once.
  575. func DBCassandraPageSize(val int) attribute.KeyValue {
  576. return DBCassandraPageSizeKey.Int(val)
  577. }
  578. // DBCassandraTable returns an attribute KeyValue conforming to the
  579. // "db.cassandra.table" semantic conventions. It represents the name of the
  580. // primary table that the operation is acting upon, including the keyspace name
  581. // (if applicable).
  582. func DBCassandraTable(val string) attribute.KeyValue {
  583. return DBCassandraTableKey.String(val)
  584. }
  585. // DBCassandraIdempotence returns an attribute KeyValue conforming to the
  586. // "db.cassandra.idempotence" semantic conventions. It represents the whether
  587. // or not the query is idempotent.
  588. func DBCassandraIdempotence(val bool) attribute.KeyValue {
  589. return DBCassandraIdempotenceKey.Bool(val)
  590. }
  591. // DBCassandraSpeculativeExecutionCount returns an attribute KeyValue
  592. // conforming to the "db.cassandra.speculative_execution_count" semantic
  593. // conventions. It represents the number of times a query was speculatively
  594. // executed. Not set or `0` if the query was not executed speculatively.
  595. func DBCassandraSpeculativeExecutionCount(val int) attribute.KeyValue {
  596. return DBCassandraSpeculativeExecutionCountKey.Int(val)
  597. }
  598. // DBCassandraCoordinatorID returns an attribute KeyValue conforming to the
  599. // "db.cassandra.coordinator.id" semantic conventions. It represents the ID of
  600. // the coordinating node for a query.
  601. func DBCassandraCoordinatorID(val string) attribute.KeyValue {
  602. return DBCassandraCoordinatorIDKey.String(val)
  603. }
  604. // DBCassandraCoordinatorDC returns an attribute KeyValue conforming to the
  605. // "db.cassandra.coordinator.dc" semantic conventions. It represents the data
  606. // center of the coordinating node for a query.
  607. func DBCassandraCoordinatorDC(val string) attribute.KeyValue {
  608. return DBCassandraCoordinatorDCKey.String(val)
  609. }
  610. // Call-level attributes for Redis
  611. const (
  612. // DBRedisDBIndexKey is the attribute Key conforming to the
  613. // "db.redis.database_index" semantic conventions. It represents the index
  614. // of the database being accessed as used in the [`SELECT`
  615. // command](https://redis.io/commands/select), provided as an integer. To
  616. // be used instead of the generic `db.name` attribute.
  617. //
  618. // Type: int
  619. // RequirementLevel: ConditionallyRequired (If other than the default
  620. // database (`0`).)
  621. // Stability: stable
  622. // Examples: 0, 1, 15
  623. DBRedisDBIndexKey = attribute.Key("db.redis.database_index")
  624. )
  625. // DBRedisDBIndex returns an attribute KeyValue conforming to the
  626. // "db.redis.database_index" semantic conventions. It represents the index of
  627. // the database being accessed as used in the [`SELECT`
  628. // command](https://redis.io/commands/select), provided as an integer. To be
  629. // used instead of the generic `db.name` attribute.
  630. func DBRedisDBIndex(val int) attribute.KeyValue {
  631. return DBRedisDBIndexKey.Int(val)
  632. }
  633. // Call-level attributes for MongoDB
  634. const (
  635. // DBMongoDBCollectionKey is the attribute Key conforming to the
  636. // "db.mongodb.collection" semantic conventions. It represents the
  637. // collection being accessed within the database stated in `db.name`.
  638. //
  639. // Type: string
  640. // RequirementLevel: Required
  641. // Stability: stable
  642. // Examples: 'customers', 'products'
  643. DBMongoDBCollectionKey = attribute.Key("db.mongodb.collection")
  644. )
  645. // DBMongoDBCollection returns an attribute KeyValue conforming to the
  646. // "db.mongodb.collection" semantic conventions. It represents the collection
  647. // being accessed within the database stated in `db.name`.
  648. func DBMongoDBCollection(val string) attribute.KeyValue {
  649. return DBMongoDBCollectionKey.String(val)
  650. }
  651. // Call-level attributes for SQL databases
  652. const (
  653. // DBSQLTableKey is the attribute Key conforming to the "db.sql.table"
  654. // semantic conventions. It represents the name of the primary table that
  655. // the operation is acting upon, including the database name (if
  656. // applicable).
  657. //
  658. // Type: string
  659. // RequirementLevel: Recommended
  660. // Stability: stable
  661. // Examples: 'public.users', 'customers'
  662. // Note: It is not recommended to attempt any client-side parsing of
  663. // `db.statement` just to get this property, but it should be set if it is
  664. // provided by the library being instrumented. If the operation is acting
  665. // upon an anonymous table, or more than one table, this value MUST NOT be
  666. // set.
  667. DBSQLTableKey = attribute.Key("db.sql.table")
  668. )
  669. // DBSQLTable returns an attribute KeyValue conforming to the "db.sql.table"
  670. // semantic conventions. It represents the name of the primary table that the
  671. // operation is acting upon, including the database name (if applicable).
  672. func DBSQLTable(val string) attribute.KeyValue {
  673. return DBSQLTableKey.String(val)
  674. }
  675. // Call-level attributes for Cosmos DB.
  676. const (
  677. // DBCosmosDBClientIDKey is the attribute Key conforming to the
  678. // "db.cosmosdb.client_id" semantic conventions. It represents the unique
  679. // Cosmos client instance id.
  680. //
  681. // Type: string
  682. // RequirementLevel: Optional
  683. // Stability: stable
  684. // Examples: '3ba4827d-4422-483f-b59f-85b74211c11d'
  685. DBCosmosDBClientIDKey = attribute.Key("db.cosmosdb.client_id")
  686. // DBCosmosDBOperationTypeKey is the attribute Key conforming to the
  687. // "db.cosmosdb.operation_type" semantic conventions. It represents the
  688. // cosmosDB Operation Type.
  689. //
  690. // Type: Enum
  691. // RequirementLevel: ConditionallyRequired (when performing one of the
  692. // operations in this list)
  693. // Stability: stable
  694. DBCosmosDBOperationTypeKey = attribute.Key("db.cosmosdb.operation_type")
  695. // DBCosmosDBConnectionModeKey is the attribute Key conforming to the
  696. // "db.cosmosdb.connection_mode" semantic conventions. It represents the
  697. // cosmos client connection mode.
  698. //
  699. // Type: Enum
  700. // RequirementLevel: ConditionallyRequired (if not `direct` (or pick gw as
  701. // default))
  702. // Stability: stable
  703. DBCosmosDBConnectionModeKey = attribute.Key("db.cosmosdb.connection_mode")
  704. // DBCosmosDBContainerKey is the attribute Key conforming to the
  705. // "db.cosmosdb.container" semantic conventions. It represents the cosmos
  706. // DB container name.
  707. //
  708. // Type: string
  709. // RequirementLevel: ConditionallyRequired (if available)
  710. // Stability: stable
  711. // Examples: 'anystring'
  712. DBCosmosDBContainerKey = attribute.Key("db.cosmosdb.container")
  713. // DBCosmosDBRequestContentLengthKey is the attribute Key conforming to the
  714. // "db.cosmosdb.request_content_length" semantic conventions. It represents
  715. // the request payload size in bytes
  716. //
  717. // Type: int
  718. // RequirementLevel: Optional
  719. // Stability: stable
  720. DBCosmosDBRequestContentLengthKey = attribute.Key("db.cosmosdb.request_content_length")
  721. // DBCosmosDBStatusCodeKey is the attribute Key conforming to the
  722. // "db.cosmosdb.status_code" semantic conventions. It represents the cosmos
  723. // DB status code.
  724. //
  725. // Type: int
  726. // RequirementLevel: ConditionallyRequired (if response was received)
  727. // Stability: stable
  728. // Examples: 200, 201
  729. DBCosmosDBStatusCodeKey = attribute.Key("db.cosmosdb.status_code")
  730. // DBCosmosDBSubStatusCodeKey is the attribute Key conforming to the
  731. // "db.cosmosdb.sub_status_code" semantic conventions. It represents the
  732. // cosmos DB sub status code.
  733. //
  734. // Type: int
  735. // RequirementLevel: ConditionallyRequired (when response was received and
  736. // contained sub-code.)
  737. // Stability: stable
  738. // Examples: 1000, 1002
  739. DBCosmosDBSubStatusCodeKey = attribute.Key("db.cosmosdb.sub_status_code")
  740. // DBCosmosDBRequestChargeKey is the attribute Key conforming to the
  741. // "db.cosmosdb.request_charge" semantic conventions. It represents the rU
  742. // consumed for that operation
  743. //
  744. // Type: double
  745. // RequirementLevel: ConditionallyRequired (when available)
  746. // Stability: stable
  747. // Examples: 46.18, 1.0
  748. DBCosmosDBRequestChargeKey = attribute.Key("db.cosmosdb.request_charge")
  749. )
  750. var (
  751. // invalid
  752. DBCosmosDBOperationTypeInvalid = DBCosmosDBOperationTypeKey.String("Invalid")
  753. // create
  754. DBCosmosDBOperationTypeCreate = DBCosmosDBOperationTypeKey.String("Create")
  755. // patch
  756. DBCosmosDBOperationTypePatch = DBCosmosDBOperationTypeKey.String("Patch")
  757. // read
  758. DBCosmosDBOperationTypeRead = DBCosmosDBOperationTypeKey.String("Read")
  759. // read_feed
  760. DBCosmosDBOperationTypeReadFeed = DBCosmosDBOperationTypeKey.String("ReadFeed")
  761. // delete
  762. DBCosmosDBOperationTypeDelete = DBCosmosDBOperationTypeKey.String("Delete")
  763. // replace
  764. DBCosmosDBOperationTypeReplace = DBCosmosDBOperationTypeKey.String("Replace")
  765. // execute
  766. DBCosmosDBOperationTypeExecute = DBCosmosDBOperationTypeKey.String("Execute")
  767. // query
  768. DBCosmosDBOperationTypeQuery = DBCosmosDBOperationTypeKey.String("Query")
  769. // head
  770. DBCosmosDBOperationTypeHead = DBCosmosDBOperationTypeKey.String("Head")
  771. // head_feed
  772. DBCosmosDBOperationTypeHeadFeed = DBCosmosDBOperationTypeKey.String("HeadFeed")
  773. // upsert
  774. DBCosmosDBOperationTypeUpsert = DBCosmosDBOperationTypeKey.String("Upsert")
  775. // batch
  776. DBCosmosDBOperationTypeBatch = DBCosmosDBOperationTypeKey.String("Batch")
  777. // query_plan
  778. DBCosmosDBOperationTypeQueryPlan = DBCosmosDBOperationTypeKey.String("QueryPlan")
  779. // execute_javascript
  780. DBCosmosDBOperationTypeExecuteJavascript = DBCosmosDBOperationTypeKey.String("ExecuteJavaScript")
  781. )
  782. var (
  783. // Gateway (HTTP) connections mode
  784. DBCosmosDBConnectionModeGateway = DBCosmosDBConnectionModeKey.String("gateway")
  785. // Direct connection
  786. DBCosmosDBConnectionModeDirect = DBCosmosDBConnectionModeKey.String("direct")
  787. )
  788. // DBCosmosDBClientID returns an attribute KeyValue conforming to the
  789. // "db.cosmosdb.client_id" semantic conventions. It represents the unique
  790. // Cosmos client instance id.
  791. func DBCosmosDBClientID(val string) attribute.KeyValue {
  792. return DBCosmosDBClientIDKey.String(val)
  793. }
  794. // DBCosmosDBContainer returns an attribute KeyValue conforming to the
  795. // "db.cosmosdb.container" semantic conventions. It represents the cosmos DB
  796. // container name.
  797. func DBCosmosDBContainer(val string) attribute.KeyValue {
  798. return DBCosmosDBContainerKey.String(val)
  799. }
  800. // DBCosmosDBRequestContentLength returns an attribute KeyValue conforming
  801. // to the "db.cosmosdb.request_content_length" semantic conventions. It
  802. // represents the request payload size in bytes
  803. func DBCosmosDBRequestContentLength(val int) attribute.KeyValue {
  804. return DBCosmosDBRequestContentLengthKey.Int(val)
  805. }
  806. // DBCosmosDBStatusCode returns an attribute KeyValue conforming to the
  807. // "db.cosmosdb.status_code" semantic conventions. It represents the cosmos DB
  808. // status code.
  809. func DBCosmosDBStatusCode(val int) attribute.KeyValue {
  810. return DBCosmosDBStatusCodeKey.Int(val)
  811. }
  812. // DBCosmosDBSubStatusCode returns an attribute KeyValue conforming to the
  813. // "db.cosmosdb.sub_status_code" semantic conventions. It represents the cosmos
  814. // DB sub status code.
  815. func DBCosmosDBSubStatusCode(val int) attribute.KeyValue {
  816. return DBCosmosDBSubStatusCodeKey.Int(val)
  817. }
  818. // DBCosmosDBRequestCharge returns an attribute KeyValue conforming to the
  819. // "db.cosmosdb.request_charge" semantic conventions. It represents the rU
  820. // consumed for that operation
  821. func DBCosmosDBRequestCharge(val float64) attribute.KeyValue {
  822. return DBCosmosDBRequestChargeKey.Float64(val)
  823. }
  824. // Span attributes used by non-OTLP exporters to represent OpenTelemetry Span's
  825. // concepts.
  826. const (
  827. // OTelStatusCodeKey is the attribute Key conforming to the
  828. // "otel.status_code" semantic conventions. It represents the name of the
  829. // code, either "OK" or "ERROR". MUST NOT be set if the status code is
  830. // UNSET.
  831. //
  832. // Type: Enum
  833. // RequirementLevel: Optional
  834. // Stability: stable
  835. OTelStatusCodeKey = attribute.Key("otel.status_code")
  836. // OTelStatusDescriptionKey is the attribute Key conforming to the
  837. // "otel.status_description" semantic conventions. It represents the
  838. // description of the Status if it has a value, otherwise not set.
  839. //
  840. // Type: string
  841. // RequirementLevel: Optional
  842. // Stability: stable
  843. // Examples: 'resource not found'
  844. OTelStatusDescriptionKey = attribute.Key("otel.status_description")
  845. )
  846. var (
  847. // The operation has been validated by an Application developer or Operator to have completed successfully
  848. OTelStatusCodeOk = OTelStatusCodeKey.String("OK")
  849. // The operation contains an error
  850. OTelStatusCodeError = OTelStatusCodeKey.String("ERROR")
  851. )
  852. // OTelStatusDescription returns an attribute KeyValue conforming to the
  853. // "otel.status_description" semantic conventions. It represents the
  854. // description of the Status if it has a value, otherwise not set.
  855. func OTelStatusDescription(val string) attribute.KeyValue {
  856. return OTelStatusDescriptionKey.String(val)
  857. }
  858. // This semantic convention describes an instance of a function that runs
  859. // without provisioning or managing of servers (also known as serverless
  860. // functions or Function as a Service (FaaS)) with spans.
  861. const (
  862. // FaaSTriggerKey is the attribute Key conforming to the "faas.trigger"
  863. // semantic conventions. It represents the type of the trigger which caused
  864. // this function invocation.
  865. //
  866. // Type: Enum
  867. // RequirementLevel: Optional
  868. // Stability: stable
  869. // Note: For the server/consumer span on the incoming side,
  870. // `faas.trigger` MUST be set.
  871. //
  872. // Clients invoking FaaS instances usually cannot set `faas.trigger`,
  873. // since they would typically need to look in the payload to determine
  874. // the event type. If clients set it, it should be the same as the
  875. // trigger that corresponding incoming would have (i.e., this has
  876. // nothing to do with the underlying transport used to make the API
  877. // call to invoke the lambda, which is often HTTP).
  878. FaaSTriggerKey = attribute.Key("faas.trigger")
  879. // FaaSInvocationIDKey is the attribute Key conforming to the
  880. // "faas.invocation_id" semantic conventions. It represents the invocation
  881. // ID of the current function invocation.
  882. //
  883. // Type: string
  884. // RequirementLevel: Optional
  885. // Stability: stable
  886. // Examples: 'af9d5aa4-a685-4c5f-a22b-444f80b3cc28'
  887. FaaSInvocationIDKey = attribute.Key("faas.invocation_id")
  888. )
  889. var (
  890. // A response to some data source operation such as a database or filesystem read/write
  891. FaaSTriggerDatasource = FaaSTriggerKey.String("datasource")
  892. // To provide an answer to an inbound HTTP request
  893. FaaSTriggerHTTP = FaaSTriggerKey.String("http")
  894. // A function is set to be executed when messages are sent to a messaging system
  895. FaaSTriggerPubsub = FaaSTriggerKey.String("pubsub")
  896. // A function is scheduled to be executed regularly
  897. FaaSTriggerTimer = FaaSTriggerKey.String("timer")
  898. // If none of the others apply
  899. FaaSTriggerOther = FaaSTriggerKey.String("other")
  900. )
  901. // FaaSInvocationID returns an attribute KeyValue conforming to the
  902. // "faas.invocation_id" semantic conventions. It represents the invocation ID
  903. // of the current function invocation.
  904. func FaaSInvocationID(val string) attribute.KeyValue {
  905. return FaaSInvocationIDKey.String(val)
  906. }
  907. // Semantic Convention for FaaS triggered as a response to some data source
  908. // operation such as a database or filesystem read/write.
  909. const (
  910. // FaaSDocumentCollectionKey is the attribute Key conforming to the
  911. // "faas.document.collection" semantic conventions. It represents the name
  912. // of the source on which the triggering operation was performed. For
  913. // example, in Cloud Storage or S3 corresponds to the bucket name, and in
  914. // Cosmos DB to the database name.
  915. //
  916. // Type: string
  917. // RequirementLevel: Required
  918. // Stability: stable
  919. // Examples: 'myBucketName', 'myDBName'
  920. FaaSDocumentCollectionKey = attribute.Key("faas.document.collection")
  921. // FaaSDocumentOperationKey is the attribute Key conforming to the
  922. // "faas.document.operation" semantic conventions. It represents the
  923. // describes the type of the operation that was performed on the data.
  924. //
  925. // Type: Enum
  926. // RequirementLevel: Required
  927. // Stability: stable
  928. FaaSDocumentOperationKey = attribute.Key("faas.document.operation")
  929. // FaaSDocumentTimeKey is the attribute Key conforming to the
  930. // "faas.document.time" semantic conventions. It represents a string
  931. // containing the time when the data was accessed in the [ISO
  932. // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
  933. // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
  934. //
  935. // Type: string
  936. // RequirementLevel: Optional
  937. // Stability: stable
  938. // Examples: '2020-01-23T13:47:06Z'
  939. FaaSDocumentTimeKey = attribute.Key("faas.document.time")
  940. // FaaSDocumentNameKey is the attribute Key conforming to the
  941. // "faas.document.name" semantic conventions. It represents the document
  942. // name/table subjected to the operation. For example, in Cloud Storage or
  943. // S3 is the name of the file, and in Cosmos DB the table name.
  944. //
  945. // Type: string
  946. // RequirementLevel: Optional
  947. // Stability: stable
  948. // Examples: 'myFile.txt', 'myTableName'
  949. FaaSDocumentNameKey = attribute.Key("faas.document.name")
  950. )
  951. var (
  952. // When a new object is created
  953. FaaSDocumentOperationInsert = FaaSDocumentOperationKey.String("insert")
  954. // When an object is modified
  955. FaaSDocumentOperationEdit = FaaSDocumentOperationKey.String("edit")
  956. // When an object is deleted
  957. FaaSDocumentOperationDelete = FaaSDocumentOperationKey.String("delete")
  958. )
  959. // FaaSDocumentCollection returns an attribute KeyValue conforming to the
  960. // "faas.document.collection" semantic conventions. It represents the name of
  961. // the source on which the triggering operation was performed. For example, in
  962. // Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the
  963. // database name.
  964. func FaaSDocumentCollection(val string) attribute.KeyValue {
  965. return FaaSDocumentCollectionKey.String(val)
  966. }
  967. // FaaSDocumentTime returns an attribute KeyValue conforming to the
  968. // "faas.document.time" semantic conventions. It represents a string containing
  969. // the time when the data was accessed in the [ISO
  970. // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
  971. // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
  972. func FaaSDocumentTime(val string) attribute.KeyValue {
  973. return FaaSDocumentTimeKey.String(val)
  974. }
  975. // FaaSDocumentName returns an attribute KeyValue conforming to the
  976. // "faas.document.name" semantic conventions. It represents the document
  977. // name/table subjected to the operation. For example, in Cloud Storage or S3
  978. // is the name of the file, and in Cosmos DB the table name.
  979. func FaaSDocumentName(val string) attribute.KeyValue {
  980. return FaaSDocumentNameKey.String(val)
  981. }
  982. // Semantic Convention for FaaS scheduled to be executed regularly.
  983. const (
  984. // FaaSTimeKey is the attribute Key conforming to the "faas.time" semantic
  985. // conventions. It represents a string containing the function invocation
  986. // time in the [ISO
  987. // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
  988. // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
  989. //
  990. // Type: string
  991. // RequirementLevel: Optional
  992. // Stability: stable
  993. // Examples: '2020-01-23T13:47:06Z'
  994. FaaSTimeKey = attribute.Key("faas.time")
  995. // FaaSCronKey is the attribute Key conforming to the "faas.cron" semantic
  996. // conventions. It represents a string containing the schedule period as
  997. // [Cron
  998. // Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm).
  999. //
  1000. // Type: string
  1001. // RequirementLevel: Optional
  1002. // Stability: stable
  1003. // Examples: '0/5 * * * ? *'
  1004. FaaSCronKey = attribute.Key("faas.cron")
  1005. )
  1006. // FaaSTime returns an attribute KeyValue conforming to the "faas.time"
  1007. // semantic conventions. It represents a string containing the function
  1008. // invocation time in the [ISO
  1009. // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
  1010. // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
  1011. func FaaSTime(val string) attribute.KeyValue {
  1012. return FaaSTimeKey.String(val)
  1013. }
  1014. // FaaSCron returns an attribute KeyValue conforming to the "faas.cron"
  1015. // semantic conventions. It represents a string containing the schedule period
  1016. // as [Cron
  1017. // Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm).
  1018. func FaaSCron(val string) attribute.KeyValue {
  1019. return FaaSCronKey.String(val)
  1020. }
  1021. // Contains additional attributes for incoming FaaS spans.
  1022. const (
  1023. // FaaSColdstartKey is the attribute Key conforming to the "faas.coldstart"
  1024. // semantic conventions. It represents a boolean that is true if the
  1025. // serverless function is executed for the first time (aka cold-start).
  1026. //
  1027. // Type: boolean
  1028. // RequirementLevel: Optional
  1029. // Stability: stable
  1030. FaaSColdstartKey = attribute.Key("faas.coldstart")
  1031. )
  1032. // FaaSColdstart returns an attribute KeyValue conforming to the
  1033. // "faas.coldstart" semantic conventions. It represents a boolean that is true
  1034. // if the serverless function is executed for the first time (aka cold-start).
  1035. func FaaSColdstart(val bool) attribute.KeyValue {
  1036. return FaaSColdstartKey.Bool(val)
  1037. }
  1038. // Contains additional attributes for outgoing FaaS spans.
  1039. const (
  1040. // FaaSInvokedNameKey is the attribute Key conforming to the
  1041. // "faas.invoked_name" semantic conventions. It represents the name of the
  1042. // invoked function.
  1043. //
  1044. // Type: string
  1045. // RequirementLevel: Required
  1046. // Stability: stable
  1047. // Examples: 'my-function'
  1048. // Note: SHOULD be equal to the `faas.name` resource attribute of the
  1049. // invoked function.
  1050. FaaSInvokedNameKey = attribute.Key("faas.invoked_name")
  1051. // FaaSInvokedProviderKey is the attribute Key conforming to the
  1052. // "faas.invoked_provider" semantic conventions. It represents the cloud
  1053. // provider of the invoked function.
  1054. //
  1055. // Type: Enum
  1056. // RequirementLevel: Required
  1057. // Stability: stable
  1058. // Note: SHOULD be equal to the `cloud.provider` resource attribute of the
  1059. // invoked function.
  1060. FaaSInvokedProviderKey = attribute.Key("faas.invoked_provider")
  1061. // FaaSInvokedRegionKey is the attribute Key conforming to the
  1062. // "faas.invoked_region" semantic conventions. It represents the cloud
  1063. // region of the invoked function.
  1064. //
  1065. // Type: string
  1066. // RequirementLevel: ConditionallyRequired (For some cloud providers, like
  1067. // AWS or GCP, the region in which a function is hosted is essential to
  1068. // uniquely identify the function and also part of its endpoint. Since it's
  1069. // part of the endpoint being called, the region is always known to
  1070. // clients. In these cases, `faas.invoked_region` MUST be set accordingly.
  1071. // If the region is unknown to the client or not required for identifying
  1072. // the invoked function, setting `faas.invoked_region` is optional.)
  1073. // Stability: stable
  1074. // Examples: 'eu-central-1'
  1075. // Note: SHOULD be equal to the `cloud.region` resource attribute of the
  1076. // invoked function.
  1077. FaaSInvokedRegionKey = attribute.Key("faas.invoked_region")
  1078. )
  1079. var (
  1080. // Alibaba Cloud
  1081. FaaSInvokedProviderAlibabaCloud = FaaSInvokedProviderKey.String("alibaba_cloud")
  1082. // Amazon Web Services
  1083. FaaSInvokedProviderAWS = FaaSInvokedProviderKey.String("aws")
  1084. // Microsoft Azure
  1085. FaaSInvokedProviderAzure = FaaSInvokedProviderKey.String("azure")
  1086. // Google Cloud Platform
  1087. FaaSInvokedProviderGCP = FaaSInvokedProviderKey.String("gcp")
  1088. // Tencent Cloud
  1089. FaaSInvokedProviderTencentCloud = FaaSInvokedProviderKey.String("tencent_cloud")
  1090. )
  1091. // FaaSInvokedName returns an attribute KeyValue conforming to the
  1092. // "faas.invoked_name" semantic conventions. It represents the name of the
  1093. // invoked function.
  1094. func FaaSInvokedName(val string) attribute.KeyValue {
  1095. return FaaSInvokedNameKey.String(val)
  1096. }
  1097. // FaaSInvokedRegion returns an attribute KeyValue conforming to the
  1098. // "faas.invoked_region" semantic conventions. It represents the cloud region
  1099. // of the invoked function.
  1100. func FaaSInvokedRegion(val string) attribute.KeyValue {
  1101. return FaaSInvokedRegionKey.String(val)
  1102. }
  1103. // Operations that access some remote service.
  1104. const (
  1105. // PeerServiceKey is the attribute Key conforming to the "peer.service"
  1106. // semantic conventions. It represents the
  1107. // [`service.name`](/docs/resource/README.md#service) of the remote
  1108. // service. SHOULD be equal to the actual `service.name` resource attribute
  1109. // of the remote service if any.
  1110. //
  1111. // Type: string
  1112. // RequirementLevel: Optional
  1113. // Stability: stable
  1114. // Examples: 'AuthTokenCache'
  1115. PeerServiceKey = attribute.Key("peer.service")
  1116. )
  1117. // PeerService returns an attribute KeyValue conforming to the
  1118. // "peer.service" semantic conventions. It represents the
  1119. // [`service.name`](/docs/resource/README.md#service) of the remote service.
  1120. // SHOULD be equal to the actual `service.name` resource attribute of the
  1121. // remote service if any.
  1122. func PeerService(val string) attribute.KeyValue {
  1123. return PeerServiceKey.String(val)
  1124. }
  1125. // These attributes may be used for any operation with an authenticated and/or
  1126. // authorized enduser.
  1127. const (
  1128. // EnduserIDKey is the attribute Key conforming to the "enduser.id"
  1129. // semantic conventions. It represents the username or client_id extracted
  1130. // from the access token or
  1131. // [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header
  1132. // in the inbound request from outside the system.
  1133. //
  1134. // Type: string
  1135. // RequirementLevel: Optional
  1136. // Stability: stable
  1137. // Examples: 'username'
  1138. EnduserIDKey = attribute.Key("enduser.id")
  1139. // EnduserRoleKey is the attribute Key conforming to the "enduser.role"
  1140. // semantic conventions. It represents the actual/assumed role the client
  1141. // is making the request under extracted from token or application security
  1142. // context.
  1143. //
  1144. // Type: string
  1145. // RequirementLevel: Optional
  1146. // Stability: stable
  1147. // Examples: 'admin'
  1148. EnduserRoleKey = attribute.Key("enduser.role")
  1149. // EnduserScopeKey is the attribute Key conforming to the "enduser.scope"
  1150. // semantic conventions. It represents the scopes or granted authorities
  1151. // the client currently possesses extracted from token or application
  1152. // security context. The value would come from the scope associated with an
  1153. // [OAuth 2.0 Access
  1154. // Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute
  1155. // value in a [SAML 2.0
  1156. // Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html).
  1157. //
  1158. // Type: string
  1159. // RequirementLevel: Optional
  1160. // Stability: stable
  1161. // Examples: 'read:message, write:files'
  1162. EnduserScopeKey = attribute.Key("enduser.scope")
  1163. )
  1164. // EnduserID returns an attribute KeyValue conforming to the "enduser.id"
  1165. // semantic conventions. It represents the username or client_id extracted from
  1166. // the access token or
  1167. // [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in
  1168. // the inbound request from outside the system.
  1169. func EnduserID(val string) attribute.KeyValue {
  1170. return EnduserIDKey.String(val)
  1171. }
  1172. // EnduserRole returns an attribute KeyValue conforming to the
  1173. // "enduser.role" semantic conventions. It represents the actual/assumed role
  1174. // the client is making the request under extracted from token or application
  1175. // security context.
  1176. func EnduserRole(val string) attribute.KeyValue {
  1177. return EnduserRoleKey.String(val)
  1178. }
  1179. // EnduserScope returns an attribute KeyValue conforming to the
  1180. // "enduser.scope" semantic conventions. It represents the scopes or granted
  1181. // authorities the client currently possesses extracted from token or
  1182. // application security context. The value would come from the scope associated
  1183. // with an [OAuth 2.0 Access
  1184. // Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute
  1185. // value in a [SAML 2.0
  1186. // Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html).
  1187. func EnduserScope(val string) attribute.KeyValue {
  1188. return EnduserScopeKey.String(val)
  1189. }
  1190. // These attributes may be used for any operation to store information about a
  1191. // thread that started a span.
  1192. const (
  1193. // ThreadIDKey is the attribute Key conforming to the "thread.id" semantic
  1194. // conventions. It represents the current "managed" thread ID (as opposed
  1195. // to OS thread ID).
  1196. //
  1197. // Type: int
  1198. // RequirementLevel: Optional
  1199. // Stability: stable
  1200. // Examples: 42
  1201. ThreadIDKey = attribute.Key("thread.id")
  1202. // ThreadNameKey is the attribute Key conforming to the "thread.name"
  1203. // semantic conventions. It represents the current thread name.
  1204. //
  1205. // Type: string
  1206. // RequirementLevel: Optional
  1207. // Stability: stable
  1208. // Examples: 'main'
  1209. ThreadNameKey = attribute.Key("thread.name")
  1210. )
  1211. // ThreadID returns an attribute KeyValue conforming to the "thread.id"
  1212. // semantic conventions. It represents the current "managed" thread ID (as
  1213. // opposed to OS thread ID).
  1214. func ThreadID(val int) attribute.KeyValue {
  1215. return ThreadIDKey.Int(val)
  1216. }
  1217. // ThreadName returns an attribute KeyValue conforming to the "thread.name"
  1218. // semantic conventions. It represents the current thread name.
  1219. func ThreadName(val string) attribute.KeyValue {
  1220. return ThreadNameKey.String(val)
  1221. }
  1222. // These attributes allow to report this unit of code and therefore to provide
  1223. // more context about the span.
  1224. const (
  1225. // CodeFunctionKey is the attribute Key conforming to the "code.function"
  1226. // semantic conventions. It represents the method or function name, or
  1227. // equivalent (usually rightmost part of the code unit's name).
  1228. //
  1229. // Type: string
  1230. // RequirementLevel: Optional
  1231. // Stability: stable
  1232. // Examples: 'serveRequest'
  1233. CodeFunctionKey = attribute.Key("code.function")
  1234. // CodeNamespaceKey is the attribute Key conforming to the "code.namespace"
  1235. // semantic conventions. It represents the "namespace" within which
  1236. // `code.function` is defined. Usually the qualified class or module name,
  1237. // such that `code.namespace` + some separator + `code.function` form a
  1238. // unique identifier for the code unit.
  1239. //
  1240. // Type: string
  1241. // RequirementLevel: Optional
  1242. // Stability: stable
  1243. // Examples: 'com.example.MyHTTPService'
  1244. CodeNamespaceKey = attribute.Key("code.namespace")
  1245. // CodeFilepathKey is the attribute Key conforming to the "code.filepath"
  1246. // semantic conventions. It represents the source code file name that
  1247. // identifies the code unit as uniquely as possible (preferably an absolute
  1248. // file path).
  1249. //
  1250. // Type: string
  1251. // RequirementLevel: Optional
  1252. // Stability: stable
  1253. // Examples: '/usr/local/MyApplication/content_root/app/index.php'
  1254. CodeFilepathKey = attribute.Key("code.filepath")
  1255. // CodeLineNumberKey is the attribute Key conforming to the "code.lineno"
  1256. // semantic conventions. It represents the line number in `code.filepath`
  1257. // best representing the operation. It SHOULD point within the code unit
  1258. // named in `code.function`.
  1259. //
  1260. // Type: int
  1261. // RequirementLevel: Optional
  1262. // Stability: stable
  1263. // Examples: 42
  1264. CodeLineNumberKey = attribute.Key("code.lineno")
  1265. // CodeColumnKey is the attribute Key conforming to the "code.column"
  1266. // semantic conventions. It represents the column number in `code.filepath`
  1267. // best representing the operation. It SHOULD point within the code unit
  1268. // named in `code.function`.
  1269. //
  1270. // Type: int
  1271. // RequirementLevel: Optional
  1272. // Stability: stable
  1273. // Examples: 16
  1274. CodeColumnKey = attribute.Key("code.column")
  1275. )
  1276. // CodeFunction returns an attribute KeyValue conforming to the
  1277. // "code.function" semantic conventions. It represents the method or function
  1278. // name, or equivalent (usually rightmost part of the code unit's name).
  1279. func CodeFunction(val string) attribute.KeyValue {
  1280. return CodeFunctionKey.String(val)
  1281. }
  1282. // CodeNamespace returns an attribute KeyValue conforming to the
  1283. // "code.namespace" semantic conventions. It represents the "namespace" within
  1284. // which `code.function` is defined. Usually the qualified class or module
  1285. // name, such that `code.namespace` + some separator + `code.function` form a
  1286. // unique identifier for the code unit.
  1287. func CodeNamespace(val string) attribute.KeyValue {
  1288. return CodeNamespaceKey.String(val)
  1289. }
  1290. // CodeFilepath returns an attribute KeyValue conforming to the
  1291. // "code.filepath" semantic conventions. It represents the source code file
  1292. // name that identifies the code unit as uniquely as possible (preferably an
  1293. // absolute file path).
  1294. func CodeFilepath(val string) attribute.KeyValue {
  1295. return CodeFilepathKey.String(val)
  1296. }
  1297. // CodeLineNumber returns an attribute KeyValue conforming to the "code.lineno"
  1298. // semantic conventions. It represents the line number in `code.filepath` best
  1299. // representing the operation. It SHOULD point within the code unit named in
  1300. // `code.function`.
  1301. func CodeLineNumber(val int) attribute.KeyValue {
  1302. return CodeLineNumberKey.Int(val)
  1303. }
  1304. // CodeColumn returns an attribute KeyValue conforming to the "code.column"
  1305. // semantic conventions. It represents the column number in `code.filepath`
  1306. // best representing the operation. It SHOULD point within the code unit named
  1307. // in `code.function`.
  1308. func CodeColumn(val int) attribute.KeyValue {
  1309. return CodeColumnKey.Int(val)
  1310. }
  1311. // Semantic Convention for HTTP Client
  1312. const (
  1313. // HTTPResendCountKey is the attribute Key conforming to the
  1314. // "http.resend_count" semantic conventions. It represents the ordinal
  1315. // number of request resending attempt (for any reason, including
  1316. // redirects).
  1317. //
  1318. // Type: int
  1319. // RequirementLevel: Recommended (if and only if request was retried.)
  1320. // Stability: stable
  1321. // Examples: 3
  1322. // Note: The resend count SHOULD be updated each time an HTTP request gets
  1323. // resent by the client, regardless of what was the cause of the resending
  1324. // (e.g. redirection, authorization failure, 503 Server Unavailable,
  1325. // network issues, or any other).
  1326. HTTPResendCountKey = attribute.Key("http.resend_count")
  1327. )
  1328. // HTTPResendCount returns an attribute KeyValue conforming to the
  1329. // "http.resend_count" semantic conventions. It represents the ordinal number
  1330. // of request resending attempt (for any reason, including redirects).
  1331. func HTTPResendCount(val int) attribute.KeyValue {
  1332. return HTTPResendCountKey.Int(val)
  1333. }
  1334. // The `aws` conventions apply to operations using the AWS SDK. They map
  1335. // request or response parameters in AWS SDK API calls to attributes on a Span.
  1336. // The conventions have been collected over time based on feedback from AWS
  1337. // users of tracing and will continue to evolve as new interesting conventions
  1338. // are found.
  1339. // Some descriptions are also provided for populating general OpenTelemetry
  1340. // semantic conventions based on these APIs.
  1341. const (
  1342. // AWSRequestIDKey is the attribute Key conforming to the "aws.request_id"
  1343. // semantic conventions. It represents the AWS request ID as returned in
  1344. // the response headers `x-amz-request-id` or `x-amz-requestid`.
  1345. //
  1346. // Type: string
  1347. // RequirementLevel: Optional
  1348. // Stability: stable
  1349. // Examples: '79b9da39-b7ae-508a-a6bc-864b2829c622', 'C9ER4AJX75574TDJ'
  1350. AWSRequestIDKey = attribute.Key("aws.request_id")
  1351. )
  1352. // AWSRequestID returns an attribute KeyValue conforming to the
  1353. // "aws.request_id" semantic conventions. It represents the AWS request ID as
  1354. // returned in the response headers `x-amz-request-id` or `x-amz-requestid`.
  1355. func AWSRequestID(val string) attribute.KeyValue {
  1356. return AWSRequestIDKey.String(val)
  1357. }
  1358. // Attributes that exist for multiple DynamoDB request types.
  1359. const (
  1360. // AWSDynamoDBTableNamesKey is the attribute Key conforming to the
  1361. // "aws.dynamodb.table_names" semantic conventions. It represents the keys
  1362. // in the `RequestItems` object field.
  1363. //
  1364. // Type: string[]
  1365. // RequirementLevel: Optional
  1366. // Stability: stable
  1367. // Examples: 'Users', 'Cats'
  1368. AWSDynamoDBTableNamesKey = attribute.Key("aws.dynamodb.table_names")
  1369. // AWSDynamoDBConsumedCapacityKey is the attribute Key conforming to the
  1370. // "aws.dynamodb.consumed_capacity" semantic conventions. It represents the
  1371. // JSON-serialized value of each item in the `ConsumedCapacity` response
  1372. // field.
  1373. //
  1374. // Type: string[]
  1375. // RequirementLevel: Optional
  1376. // Stability: stable
  1377. // Examples: '{ "CapacityUnits": number, "GlobalSecondaryIndexes": {
  1378. // "string" : { "CapacityUnits": number, "ReadCapacityUnits": number,
  1379. // "WriteCapacityUnits": number } }, "LocalSecondaryIndexes": { "string" :
  1380. // { "CapacityUnits": number, "ReadCapacityUnits": number,
  1381. // "WriteCapacityUnits": number } }, "ReadCapacityUnits": number, "Table":
  1382. // { "CapacityUnits": number, "ReadCapacityUnits": number,
  1383. // "WriteCapacityUnits": number }, "TableName": "string",
  1384. // "WriteCapacityUnits": number }'
  1385. AWSDynamoDBConsumedCapacityKey = attribute.Key("aws.dynamodb.consumed_capacity")
  1386. // AWSDynamoDBItemCollectionMetricsKey is the attribute Key conforming to
  1387. // the "aws.dynamodb.item_collection_metrics" semantic conventions. It
  1388. // represents the JSON-serialized value of the `ItemCollectionMetrics`
  1389. // response field.
  1390. //
  1391. // Type: string
  1392. // RequirementLevel: Optional
  1393. // Stability: stable
  1394. // Examples: '{ "string" : [ { "ItemCollectionKey": { "string" : { "B":
  1395. // blob, "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": {
  1396. // "string" : "AttributeValue" }, "N": "string", "NS": [ "string" ],
  1397. // "NULL": boolean, "S": "string", "SS": [ "string" ] } },
  1398. // "SizeEstimateRangeGB": [ number ] } ] }'
  1399. AWSDynamoDBItemCollectionMetricsKey = attribute.Key("aws.dynamodb.item_collection_metrics")
  1400. // AWSDynamoDBProvisionedReadCapacityKey is the attribute Key conforming to
  1401. // the "aws.dynamodb.provisioned_read_capacity" semantic conventions. It
  1402. // represents the value of the `ProvisionedThroughput.ReadCapacityUnits`
  1403. // request parameter.
  1404. //
  1405. // Type: double
  1406. // RequirementLevel: Optional
  1407. // Stability: stable
  1408. // Examples: 1.0, 2.0
  1409. AWSDynamoDBProvisionedReadCapacityKey = attribute.Key("aws.dynamodb.provisioned_read_capacity")
  1410. // AWSDynamoDBProvisionedWriteCapacityKey is the attribute Key conforming
  1411. // to the "aws.dynamodb.provisioned_write_capacity" semantic conventions.
  1412. // It represents the value of the
  1413. // `ProvisionedThroughput.WriteCapacityUnits` request parameter.
  1414. //
  1415. // Type: double
  1416. // RequirementLevel: Optional
  1417. // Stability: stable
  1418. // Examples: 1.0, 2.0
  1419. AWSDynamoDBProvisionedWriteCapacityKey = attribute.Key("aws.dynamodb.provisioned_write_capacity")
  1420. // AWSDynamoDBConsistentReadKey is the attribute Key conforming to the
  1421. // "aws.dynamodb.consistent_read" semantic conventions. It represents the
  1422. // value of the `ConsistentRead` request parameter.
  1423. //
  1424. // Type: boolean
  1425. // RequirementLevel: Optional
  1426. // Stability: stable
  1427. AWSDynamoDBConsistentReadKey = attribute.Key("aws.dynamodb.consistent_read")
  1428. // AWSDynamoDBProjectionKey is the attribute Key conforming to the
  1429. // "aws.dynamodb.projection" semantic conventions. It represents the value
  1430. // of the `ProjectionExpression` request parameter.
  1431. //
  1432. // Type: string
  1433. // RequirementLevel: Optional
  1434. // Stability: stable
  1435. // Examples: 'Title', 'Title, Price, Color', 'Title, Description,
  1436. // RelatedItems, ProductReviews'
  1437. AWSDynamoDBProjectionKey = attribute.Key("aws.dynamodb.projection")
  1438. // AWSDynamoDBLimitKey is the attribute Key conforming to the
  1439. // "aws.dynamodb.limit" semantic conventions. It represents the value of
  1440. // the `Limit` request parameter.
  1441. //
  1442. // Type: int
  1443. // RequirementLevel: Optional
  1444. // Stability: stable
  1445. // Examples: 10
  1446. AWSDynamoDBLimitKey = attribute.Key("aws.dynamodb.limit")
  1447. // AWSDynamoDBAttributesToGetKey is the attribute Key conforming to the
  1448. // "aws.dynamodb.attributes_to_get" semantic conventions. It represents the
  1449. // value of the `AttributesToGet` request parameter.
  1450. //
  1451. // Type: string[]
  1452. // RequirementLevel: Optional
  1453. // Stability: stable
  1454. // Examples: 'lives', 'id'
  1455. AWSDynamoDBAttributesToGetKey = attribute.Key("aws.dynamodb.attributes_to_get")
  1456. // AWSDynamoDBIndexNameKey is the attribute Key conforming to the
  1457. // "aws.dynamodb.index_name" semantic conventions. It represents the value
  1458. // of the `IndexName` request parameter.
  1459. //
  1460. // Type: string
  1461. // RequirementLevel: Optional
  1462. // Stability: stable
  1463. // Examples: 'name_to_group'
  1464. AWSDynamoDBIndexNameKey = attribute.Key("aws.dynamodb.index_name")
  1465. // AWSDynamoDBSelectKey is the attribute Key conforming to the
  1466. // "aws.dynamodb.select" semantic conventions. It represents the value of
  1467. // the `Select` request parameter.
  1468. //
  1469. // Type: string
  1470. // RequirementLevel: Optional
  1471. // Stability: stable
  1472. // Examples: 'ALL_ATTRIBUTES', 'COUNT'
  1473. AWSDynamoDBSelectKey = attribute.Key("aws.dynamodb.select")
  1474. )
  1475. // AWSDynamoDBTableNames returns an attribute KeyValue conforming to the
  1476. // "aws.dynamodb.table_names" semantic conventions. It represents the keys in
  1477. // the `RequestItems` object field.
  1478. func AWSDynamoDBTableNames(val ...string) attribute.KeyValue {
  1479. return AWSDynamoDBTableNamesKey.StringSlice(val)
  1480. }
  1481. // AWSDynamoDBConsumedCapacity returns an attribute KeyValue conforming to
  1482. // the "aws.dynamodb.consumed_capacity" semantic conventions. It represents the
  1483. // JSON-serialized value of each item in the `ConsumedCapacity` response field.
  1484. func AWSDynamoDBConsumedCapacity(val ...string) attribute.KeyValue {
  1485. return AWSDynamoDBConsumedCapacityKey.StringSlice(val)
  1486. }
  1487. // AWSDynamoDBItemCollectionMetrics returns an attribute KeyValue conforming
  1488. // to the "aws.dynamodb.item_collection_metrics" semantic conventions. It
  1489. // represents the JSON-serialized value of the `ItemCollectionMetrics` response
  1490. // field.
  1491. func AWSDynamoDBItemCollectionMetrics(val string) attribute.KeyValue {
  1492. return AWSDynamoDBItemCollectionMetricsKey.String(val)
  1493. }
  1494. // AWSDynamoDBProvisionedReadCapacity returns an attribute KeyValue
  1495. // conforming to the "aws.dynamodb.provisioned_read_capacity" semantic
  1496. // conventions. It represents the value of the
  1497. // `ProvisionedThroughput.ReadCapacityUnits` request parameter.
  1498. func AWSDynamoDBProvisionedReadCapacity(val float64) attribute.KeyValue {
  1499. return AWSDynamoDBProvisionedReadCapacityKey.Float64(val)
  1500. }
  1501. // AWSDynamoDBProvisionedWriteCapacity returns an attribute KeyValue
  1502. // conforming to the "aws.dynamodb.provisioned_write_capacity" semantic
  1503. // conventions. It represents the value of the
  1504. // `ProvisionedThroughput.WriteCapacityUnits` request parameter.
  1505. func AWSDynamoDBProvisionedWriteCapacity(val float64) attribute.KeyValue {
  1506. return AWSDynamoDBProvisionedWriteCapacityKey.Float64(val)
  1507. }
  1508. // AWSDynamoDBConsistentRead returns an attribute KeyValue conforming to the
  1509. // "aws.dynamodb.consistent_read" semantic conventions. It represents the value
  1510. // of the `ConsistentRead` request parameter.
  1511. func AWSDynamoDBConsistentRead(val bool) attribute.KeyValue {
  1512. return AWSDynamoDBConsistentReadKey.Bool(val)
  1513. }
  1514. // AWSDynamoDBProjection returns an attribute KeyValue conforming to the
  1515. // "aws.dynamodb.projection" semantic conventions. It represents the value of
  1516. // the `ProjectionExpression` request parameter.
  1517. func AWSDynamoDBProjection(val string) attribute.KeyValue {
  1518. return AWSDynamoDBProjectionKey.String(val)
  1519. }
  1520. // AWSDynamoDBLimit returns an attribute KeyValue conforming to the
  1521. // "aws.dynamodb.limit" semantic conventions. It represents the value of the
  1522. // `Limit` request parameter.
  1523. func AWSDynamoDBLimit(val int) attribute.KeyValue {
  1524. return AWSDynamoDBLimitKey.Int(val)
  1525. }
  1526. // AWSDynamoDBAttributesToGet returns an attribute KeyValue conforming to
  1527. // the "aws.dynamodb.attributes_to_get" semantic conventions. It represents the
  1528. // value of the `AttributesToGet` request parameter.
  1529. func AWSDynamoDBAttributesToGet(val ...string) attribute.KeyValue {
  1530. return AWSDynamoDBAttributesToGetKey.StringSlice(val)
  1531. }
  1532. // AWSDynamoDBIndexName returns an attribute KeyValue conforming to the
  1533. // "aws.dynamodb.index_name" semantic conventions. It represents the value of
  1534. // the `IndexName` request parameter.
  1535. func AWSDynamoDBIndexName(val string) attribute.KeyValue {
  1536. return AWSDynamoDBIndexNameKey.String(val)
  1537. }
  1538. // AWSDynamoDBSelect returns an attribute KeyValue conforming to the
  1539. // "aws.dynamodb.select" semantic conventions. It represents the value of the
  1540. // `Select` request parameter.
  1541. func AWSDynamoDBSelect(val string) attribute.KeyValue {
  1542. return AWSDynamoDBSelectKey.String(val)
  1543. }
  1544. // DynamoDB.CreateTable
  1545. const (
  1546. // AWSDynamoDBGlobalSecondaryIndexesKey is the attribute Key conforming to
  1547. // the "aws.dynamodb.global_secondary_indexes" semantic conventions. It
  1548. // represents the JSON-serialized value of each item of the
  1549. // `GlobalSecondaryIndexes` request field
  1550. //
  1551. // Type: string[]
  1552. // RequirementLevel: Optional
  1553. // Stability: stable
  1554. // Examples: '{ "IndexName": "string", "KeySchema": [ { "AttributeName":
  1555. // "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [
  1556. // "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": {
  1557. // "ReadCapacityUnits": number, "WriteCapacityUnits": number } }'
  1558. AWSDynamoDBGlobalSecondaryIndexesKey = attribute.Key("aws.dynamodb.global_secondary_indexes")
  1559. // AWSDynamoDBLocalSecondaryIndexesKey is the attribute Key conforming to
  1560. // the "aws.dynamodb.local_secondary_indexes" semantic conventions. It
  1561. // represents the JSON-serialized value of each item of the
  1562. // `LocalSecondaryIndexes` request field.
  1563. //
  1564. // Type: string[]
  1565. // RequirementLevel: Optional
  1566. // Stability: stable
  1567. // Examples: '{ "IndexARN": "string", "IndexName": "string",
  1568. // "IndexSizeBytes": number, "ItemCount": number, "KeySchema": [ {
  1569. // "AttributeName": "string", "KeyType": "string" } ], "Projection": {
  1570. // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" } }'
  1571. AWSDynamoDBLocalSecondaryIndexesKey = attribute.Key("aws.dynamodb.local_secondary_indexes")
  1572. )
  1573. // AWSDynamoDBGlobalSecondaryIndexes returns an attribute KeyValue
  1574. // conforming to the "aws.dynamodb.global_secondary_indexes" semantic
  1575. // conventions. It represents the JSON-serialized value of each item of the
  1576. // `GlobalSecondaryIndexes` request field
  1577. func AWSDynamoDBGlobalSecondaryIndexes(val ...string) attribute.KeyValue {
  1578. return AWSDynamoDBGlobalSecondaryIndexesKey.StringSlice(val)
  1579. }
  1580. // AWSDynamoDBLocalSecondaryIndexes returns an attribute KeyValue conforming
  1581. // to the "aws.dynamodb.local_secondary_indexes" semantic conventions. It
  1582. // represents the JSON-serialized value of each item of the
  1583. // `LocalSecondaryIndexes` request field.
  1584. func AWSDynamoDBLocalSecondaryIndexes(val ...string) attribute.KeyValue {
  1585. return AWSDynamoDBLocalSecondaryIndexesKey.StringSlice(val)
  1586. }
  1587. // DynamoDB.ListTables
  1588. const (
  1589. // AWSDynamoDBExclusiveStartTableKey is the attribute Key conforming to the
  1590. // "aws.dynamodb.exclusive_start_table" semantic conventions. It represents
  1591. // the value of the `ExclusiveStartTableName` request parameter.
  1592. //
  1593. // Type: string
  1594. // RequirementLevel: Optional
  1595. // Stability: stable
  1596. // Examples: 'Users', 'CatsTable'
  1597. AWSDynamoDBExclusiveStartTableKey = attribute.Key("aws.dynamodb.exclusive_start_table")
  1598. // AWSDynamoDBTableCountKey is the attribute Key conforming to the
  1599. // "aws.dynamodb.table_count" semantic conventions. It represents the the
  1600. // number of items in the `TableNames` response parameter.
  1601. //
  1602. // Type: int
  1603. // RequirementLevel: Optional
  1604. // Stability: stable
  1605. // Examples: 20
  1606. AWSDynamoDBTableCountKey = attribute.Key("aws.dynamodb.table_count")
  1607. )
  1608. // AWSDynamoDBExclusiveStartTable returns an attribute KeyValue conforming
  1609. // to the "aws.dynamodb.exclusive_start_table" semantic conventions. It
  1610. // represents the value of the `ExclusiveStartTableName` request parameter.
  1611. func AWSDynamoDBExclusiveStartTable(val string) attribute.KeyValue {
  1612. return AWSDynamoDBExclusiveStartTableKey.String(val)
  1613. }
  1614. // AWSDynamoDBTableCount returns an attribute KeyValue conforming to the
  1615. // "aws.dynamodb.table_count" semantic conventions. It represents the the
  1616. // number of items in the `TableNames` response parameter.
  1617. func AWSDynamoDBTableCount(val int) attribute.KeyValue {
  1618. return AWSDynamoDBTableCountKey.Int(val)
  1619. }
  1620. // DynamoDB.Query
  1621. const (
  1622. // AWSDynamoDBScanForwardKey is the attribute Key conforming to the
  1623. // "aws.dynamodb.scan_forward" semantic conventions. It represents the
  1624. // value of the `ScanIndexForward` request parameter.
  1625. //
  1626. // Type: boolean
  1627. // RequirementLevel: Optional
  1628. // Stability: stable
  1629. AWSDynamoDBScanForwardKey = attribute.Key("aws.dynamodb.scan_forward")
  1630. )
  1631. // AWSDynamoDBScanForward returns an attribute KeyValue conforming to the
  1632. // "aws.dynamodb.scan_forward" semantic conventions. It represents the value of
  1633. // the `ScanIndexForward` request parameter.
  1634. func AWSDynamoDBScanForward(val bool) attribute.KeyValue {
  1635. return AWSDynamoDBScanForwardKey.Bool(val)
  1636. }
  1637. // DynamoDB.Scan
  1638. const (
  1639. // AWSDynamoDBSegmentKey is the attribute Key conforming to the
  1640. // "aws.dynamodb.segment" semantic conventions. It represents the value of
  1641. // the `Segment` request parameter.
  1642. //
  1643. // Type: int
  1644. // RequirementLevel: Optional
  1645. // Stability: stable
  1646. // Examples: 10
  1647. AWSDynamoDBSegmentKey = attribute.Key("aws.dynamodb.segment")
  1648. // AWSDynamoDBTotalSegmentsKey is the attribute Key conforming to the
  1649. // "aws.dynamodb.total_segments" semantic conventions. It represents the
  1650. // value of the `TotalSegments` request parameter.
  1651. //
  1652. // Type: int
  1653. // RequirementLevel: Optional
  1654. // Stability: stable
  1655. // Examples: 100
  1656. AWSDynamoDBTotalSegmentsKey = attribute.Key("aws.dynamodb.total_segments")
  1657. // AWSDynamoDBCountKey is the attribute Key conforming to the
  1658. // "aws.dynamodb.count" semantic conventions. It represents the value of
  1659. // the `Count` response parameter.
  1660. //
  1661. // Type: int
  1662. // RequirementLevel: Optional
  1663. // Stability: stable
  1664. // Examples: 10
  1665. AWSDynamoDBCountKey = attribute.Key("aws.dynamodb.count")
  1666. // AWSDynamoDBScannedCountKey is the attribute Key conforming to the
  1667. // "aws.dynamodb.scanned_count" semantic conventions. It represents the
  1668. // value of the `ScannedCount` response parameter.
  1669. //
  1670. // Type: int
  1671. // RequirementLevel: Optional
  1672. // Stability: stable
  1673. // Examples: 50
  1674. AWSDynamoDBScannedCountKey = attribute.Key("aws.dynamodb.scanned_count")
  1675. )
  1676. // AWSDynamoDBSegment returns an attribute KeyValue conforming to the
  1677. // "aws.dynamodb.segment" semantic conventions. It represents the value of the
  1678. // `Segment` request parameter.
  1679. func AWSDynamoDBSegment(val int) attribute.KeyValue {
  1680. return AWSDynamoDBSegmentKey.Int(val)
  1681. }
  1682. // AWSDynamoDBTotalSegments returns an attribute KeyValue conforming to the
  1683. // "aws.dynamodb.total_segments" semantic conventions. It represents the value
  1684. // of the `TotalSegments` request parameter.
  1685. func AWSDynamoDBTotalSegments(val int) attribute.KeyValue {
  1686. return AWSDynamoDBTotalSegmentsKey.Int(val)
  1687. }
  1688. // AWSDynamoDBCount returns an attribute KeyValue conforming to the
  1689. // "aws.dynamodb.count" semantic conventions. It represents the value of the
  1690. // `Count` response parameter.
  1691. func AWSDynamoDBCount(val int) attribute.KeyValue {
  1692. return AWSDynamoDBCountKey.Int(val)
  1693. }
  1694. // AWSDynamoDBScannedCount returns an attribute KeyValue conforming to the
  1695. // "aws.dynamodb.scanned_count" semantic conventions. It represents the value
  1696. // of the `ScannedCount` response parameter.
  1697. func AWSDynamoDBScannedCount(val int) attribute.KeyValue {
  1698. return AWSDynamoDBScannedCountKey.Int(val)
  1699. }
  1700. // DynamoDB.UpdateTable
  1701. const (
  1702. // AWSDynamoDBAttributeDefinitionsKey is the attribute Key conforming to
  1703. // the "aws.dynamodb.attribute_definitions" semantic conventions. It
  1704. // represents the JSON-serialized value of each item in the
  1705. // `AttributeDefinitions` request field.
  1706. //
  1707. // Type: string[]
  1708. // RequirementLevel: Optional
  1709. // Stability: stable
  1710. // Examples: '{ "AttributeName": "string", "AttributeType": "string" }'
  1711. AWSDynamoDBAttributeDefinitionsKey = attribute.Key("aws.dynamodb.attribute_definitions")
  1712. // AWSDynamoDBGlobalSecondaryIndexUpdatesKey is the attribute Key
  1713. // conforming to the "aws.dynamodb.global_secondary_index_updates" semantic
  1714. // conventions. It represents the JSON-serialized value of each item in the
  1715. // the `GlobalSecondaryIndexUpdates` request field.
  1716. //
  1717. // Type: string[]
  1718. // RequirementLevel: Optional
  1719. // Stability: stable
  1720. // Examples: '{ "Create": { "IndexName": "string", "KeySchema": [ {
  1721. // "AttributeName": "string", "KeyType": "string" } ], "Projection": {
  1722. // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" },
  1723. // "ProvisionedThroughput": { "ReadCapacityUnits": number,
  1724. // "WriteCapacityUnits": number } }'
  1725. AWSDynamoDBGlobalSecondaryIndexUpdatesKey = attribute.Key("aws.dynamodb.global_secondary_index_updates")
  1726. )
  1727. // AWSDynamoDBAttributeDefinitions returns an attribute KeyValue conforming
  1728. // to the "aws.dynamodb.attribute_definitions" semantic conventions. It
  1729. // represents the JSON-serialized value of each item in the
  1730. // `AttributeDefinitions` request field.
  1731. func AWSDynamoDBAttributeDefinitions(val ...string) attribute.KeyValue {
  1732. return AWSDynamoDBAttributeDefinitionsKey.StringSlice(val)
  1733. }
  1734. // AWSDynamoDBGlobalSecondaryIndexUpdates returns an attribute KeyValue
  1735. // conforming to the "aws.dynamodb.global_secondary_index_updates" semantic
  1736. // conventions. It represents the JSON-serialized value of each item in the the
  1737. // `GlobalSecondaryIndexUpdates` request field.
  1738. func AWSDynamoDBGlobalSecondaryIndexUpdates(val ...string) attribute.KeyValue {
  1739. return AWSDynamoDBGlobalSecondaryIndexUpdatesKey.StringSlice(val)
  1740. }
  1741. // Attributes that exist for S3 request types.
  1742. const (
  1743. // AWSS3BucketKey is the attribute Key conforming to the "aws.s3.bucket"
  1744. // semantic conventions. It represents the S3 bucket name the request
  1745. // refers to. Corresponds to the `--bucket` parameter of the [S3
  1746. // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
  1747. // operations.
  1748. //
  1749. // Type: string
  1750. // RequirementLevel: Optional
  1751. // Stability: stable
  1752. // Examples: 'some-bucket-name'
  1753. // Note: The `bucket` attribute is applicable to all S3 operations that
  1754. // reference a bucket, i.e. that require the bucket name as a mandatory
  1755. // parameter.
  1756. // This applies to almost all S3 operations except `list-buckets`.
  1757. AWSS3BucketKey = attribute.Key("aws.s3.bucket")
  1758. // AWSS3KeyKey is the attribute Key conforming to the "aws.s3.key" semantic
  1759. // conventions. It represents the S3 object key the request refers to.
  1760. // Corresponds to the `--key` parameter of the [S3
  1761. // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
  1762. // operations.
  1763. //
  1764. // Type: string
  1765. // RequirementLevel: Optional
  1766. // Stability: stable
  1767. // Examples: 'someFile.yml'
  1768. // Note: The `key` attribute is applicable to all object-related S3
  1769. // operations, i.e. that require the object key as a mandatory parameter.
  1770. // This applies in particular to the following operations:
  1771. //
  1772. // -
  1773. // [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html)
  1774. // -
  1775. // [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html)
  1776. // -
  1777. // [get-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html)
  1778. // -
  1779. // [head-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html)
  1780. // -
  1781. // [put-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html)
  1782. // -
  1783. // [restore-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html)
  1784. // -
  1785. // [select-object-content](https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html)
  1786. // -
  1787. // [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html)
  1788. // -
  1789. // [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html)
  1790. // -
  1791. // [create-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html)
  1792. // -
  1793. // [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html)
  1794. // -
  1795. // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html)
  1796. // -
  1797. // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
  1798. AWSS3KeyKey = attribute.Key("aws.s3.key")
  1799. // AWSS3CopySourceKey is the attribute Key conforming to the
  1800. // "aws.s3.copy_source" semantic conventions. It represents the source
  1801. // object (in the form `bucket`/`key`) for the copy operation.
  1802. //
  1803. // Type: string
  1804. // RequirementLevel: Optional
  1805. // Stability: stable
  1806. // Examples: 'someFile.yml'
  1807. // Note: The `copy_source` attribute applies to S3 copy operations and
  1808. // corresponds to the `--copy-source` parameter
  1809. // of the [copy-object operation within the S3
  1810. // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html).
  1811. // This applies in particular to the following operations:
  1812. //
  1813. // -
  1814. // [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html)
  1815. // -
  1816. // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
  1817. AWSS3CopySourceKey = attribute.Key("aws.s3.copy_source")
  1818. // AWSS3UploadIDKey is the attribute Key conforming to the
  1819. // "aws.s3.upload_id" semantic conventions. It represents the upload ID
  1820. // that identifies the multipart upload.
  1821. //
  1822. // Type: string
  1823. // RequirementLevel: Optional
  1824. // Stability: stable
  1825. // Examples: 'dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ'
  1826. // Note: The `upload_id` attribute applies to S3 multipart-upload
  1827. // operations and corresponds to the `--upload-id` parameter
  1828. // of the [S3
  1829. // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
  1830. // multipart operations.
  1831. // This applies in particular to the following operations:
  1832. //
  1833. // -
  1834. // [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html)
  1835. // -
  1836. // [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html)
  1837. // -
  1838. // [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html)
  1839. // -
  1840. // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html)
  1841. // -
  1842. // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
  1843. AWSS3UploadIDKey = attribute.Key("aws.s3.upload_id")
  1844. // AWSS3DeleteKey is the attribute Key conforming to the "aws.s3.delete"
  1845. // semantic conventions. It represents the delete request container that
  1846. // specifies the objects to be deleted.
  1847. //
  1848. // Type: string
  1849. // RequirementLevel: Optional
  1850. // Stability: stable
  1851. // Examples:
  1852. // 'Objects=[{Key=string,VersionID=string},{Key=string,VersionID=string}],Quiet=boolean'
  1853. // Note: The `delete` attribute is only applicable to the
  1854. // [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html)
  1855. // operation.
  1856. // The `delete` attribute corresponds to the `--delete` parameter of the
  1857. // [delete-objects operation within the S3
  1858. // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html).
  1859. AWSS3DeleteKey = attribute.Key("aws.s3.delete")
  1860. // AWSS3PartNumberKey is the attribute Key conforming to the
  1861. // "aws.s3.part_number" semantic conventions. It represents the part number
  1862. // of the part being uploaded in a multipart-upload operation. This is a
  1863. // positive integer between 1 and 10,000.
  1864. //
  1865. // Type: int
  1866. // RequirementLevel: Optional
  1867. // Stability: stable
  1868. // Examples: 3456
  1869. // Note: The `part_number` attribute is only applicable to the
  1870. // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html)
  1871. // and
  1872. // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html)
  1873. // operations.
  1874. // The `part_number` attribute corresponds to the `--part-number` parameter
  1875. // of the
  1876. // [upload-part operation within the S3
  1877. // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html).
  1878. AWSS3PartNumberKey = attribute.Key("aws.s3.part_number")
  1879. )
  1880. // AWSS3Bucket returns an attribute KeyValue conforming to the
  1881. // "aws.s3.bucket" semantic conventions. It represents the S3 bucket name the
  1882. // request refers to. Corresponds to the `--bucket` parameter of the [S3
  1883. // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
  1884. // operations.
  1885. func AWSS3Bucket(val string) attribute.KeyValue {
  1886. return AWSS3BucketKey.String(val)
  1887. }
  1888. // AWSS3Key returns an attribute KeyValue conforming to the "aws.s3.key"
  1889. // semantic conventions. It represents the S3 object key the request refers to.
  1890. // Corresponds to the `--key` parameter of the [S3
  1891. // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html)
  1892. // operations.
  1893. func AWSS3Key(val string) attribute.KeyValue {
  1894. return AWSS3KeyKey.String(val)
  1895. }
  1896. // AWSS3CopySource returns an attribute KeyValue conforming to the
  1897. // "aws.s3.copy_source" semantic conventions. It represents the source object
  1898. // (in the form `bucket`/`key`) for the copy operation.
  1899. func AWSS3CopySource(val string) attribute.KeyValue {
  1900. return AWSS3CopySourceKey.String(val)
  1901. }
  1902. // AWSS3UploadID returns an attribute KeyValue conforming to the
  1903. // "aws.s3.upload_id" semantic conventions. It represents the upload ID that
  1904. // identifies the multipart upload.
  1905. func AWSS3UploadID(val string) attribute.KeyValue {
  1906. return AWSS3UploadIDKey.String(val)
  1907. }
  1908. // AWSS3Delete returns an attribute KeyValue conforming to the
  1909. // "aws.s3.delete" semantic conventions. It represents the delete request
  1910. // container that specifies the objects to be deleted.
  1911. func AWSS3Delete(val string) attribute.KeyValue {
  1912. return AWSS3DeleteKey.String(val)
  1913. }
  1914. // AWSS3PartNumber returns an attribute KeyValue conforming to the
  1915. // "aws.s3.part_number" semantic conventions. It represents the part number of
  1916. // the part being uploaded in a multipart-upload operation. This is a positive
  1917. // integer between 1 and 10,000.
  1918. func AWSS3PartNumber(val int) attribute.KeyValue {
  1919. return AWSS3PartNumberKey.Int(val)
  1920. }
  1921. // Semantic conventions to apply when instrumenting the GraphQL implementation.
  1922. // They map GraphQL operations to attributes on a Span.
  1923. const (
  1924. // GraphqlOperationNameKey is the attribute Key conforming to the
  1925. // "graphql.operation.name" semantic conventions. It represents the name of
  1926. // the operation being executed.
  1927. //
  1928. // Type: string
  1929. // RequirementLevel: Optional
  1930. // Stability: stable
  1931. // Examples: 'findBookByID'
  1932. GraphqlOperationNameKey = attribute.Key("graphql.operation.name")
  1933. // GraphqlOperationTypeKey is the attribute Key conforming to the
  1934. // "graphql.operation.type" semantic conventions. It represents the type of
  1935. // the operation being executed.
  1936. //
  1937. // Type: Enum
  1938. // RequirementLevel: Optional
  1939. // Stability: stable
  1940. // Examples: 'query', 'mutation', 'subscription'
  1941. GraphqlOperationTypeKey = attribute.Key("graphql.operation.type")
  1942. // GraphqlDocumentKey is the attribute Key conforming to the
  1943. // "graphql.document" semantic conventions. It represents the GraphQL
  1944. // document being executed.
  1945. //
  1946. // Type: string
  1947. // RequirementLevel: Optional
  1948. // Stability: stable
  1949. // Examples: 'query findBookByID { bookByID(id: ?) { name } }'
  1950. // Note: The value may be sanitized to exclude sensitive information.
  1951. GraphqlDocumentKey = attribute.Key("graphql.document")
  1952. )
  1953. var (
  1954. // GraphQL query
  1955. GraphqlOperationTypeQuery = GraphqlOperationTypeKey.String("query")
  1956. // GraphQL mutation
  1957. GraphqlOperationTypeMutation = GraphqlOperationTypeKey.String("mutation")
  1958. // GraphQL subscription
  1959. GraphqlOperationTypeSubscription = GraphqlOperationTypeKey.String("subscription")
  1960. )
  1961. // GraphqlOperationName returns an attribute KeyValue conforming to the
  1962. // "graphql.operation.name" semantic conventions. It represents the name of the
  1963. // operation being executed.
  1964. func GraphqlOperationName(val string) attribute.KeyValue {
  1965. return GraphqlOperationNameKey.String(val)
  1966. }
  1967. // GraphqlDocument returns an attribute KeyValue conforming to the
  1968. // "graphql.document" semantic conventions. It represents the GraphQL document
  1969. // being executed.
  1970. func GraphqlDocument(val string) attribute.KeyValue {
  1971. return GraphqlDocumentKey.String(val)
  1972. }
  1973. // General attributes used in messaging systems.
  1974. const (
  1975. // MessagingSystemKey is the attribute Key conforming to the
  1976. // "messaging.system" semantic conventions. It represents a string
  1977. // identifying the messaging system.
  1978. //
  1979. // Type: string
  1980. // RequirementLevel: Required
  1981. // Stability: stable
  1982. // Examples: 'kafka', 'rabbitmq', 'rocketmq', 'activemq', 'AmazonSQS'
  1983. MessagingSystemKey = attribute.Key("messaging.system")
  1984. // MessagingOperationKey is the attribute Key conforming to the
  1985. // "messaging.operation" semantic conventions. It represents a string
  1986. // identifying the kind of messaging operation as defined in the [Operation
  1987. // names](#operation-names) section above.
  1988. //
  1989. // Type: Enum
  1990. // RequirementLevel: Required
  1991. // Stability: stable
  1992. // Note: If a custom value is used, it MUST be of low cardinality.
  1993. MessagingOperationKey = attribute.Key("messaging.operation")
  1994. // MessagingBatchMessageCountKey is the attribute Key conforming to the
  1995. // "messaging.batch.message_count" semantic conventions. It represents the
  1996. // number of messages sent, received, or processed in the scope of the
  1997. // batching operation.
  1998. //
  1999. // Type: int
  2000. // RequirementLevel: ConditionallyRequired (If the span describes an
  2001. // operation on a batch of messages.)
  2002. // Stability: stable
  2003. // Examples: 0, 1, 2
  2004. // Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on
  2005. // spans that operate with a single message. When a messaging client
  2006. // library supports both batch and single-message API for the same
  2007. // operation, instrumentations SHOULD use `messaging.batch.message_count`
  2008. // for batching APIs and SHOULD NOT use it for single-message APIs.
  2009. MessagingBatchMessageCountKey = attribute.Key("messaging.batch.message_count")
  2010. // MessagingClientIDKey is the attribute Key conforming to the
  2011. // "messaging.client_id" semantic conventions. It represents a unique
  2012. // identifier for the client that consumes or produces a message.
  2013. //
  2014. // Type: string
  2015. // RequirementLevel: Recommended (If a client id is available)
  2016. // Stability: stable
  2017. // Examples: 'client-5', 'myhost@8742@s8083jm'
  2018. MessagingClientIDKey = attribute.Key("messaging.client_id")
  2019. )
  2020. var (
  2021. // publish
  2022. MessagingOperationPublish = MessagingOperationKey.String("publish")
  2023. // receive
  2024. MessagingOperationReceive = MessagingOperationKey.String("receive")
  2025. // process
  2026. MessagingOperationProcess = MessagingOperationKey.String("process")
  2027. )
  2028. // MessagingSystem returns an attribute KeyValue conforming to the
  2029. // "messaging.system" semantic conventions. It represents a string identifying
  2030. // the messaging system.
  2031. func MessagingSystem(val string) attribute.KeyValue {
  2032. return MessagingSystemKey.String(val)
  2033. }
  2034. // MessagingBatchMessageCount returns an attribute KeyValue conforming to
  2035. // the "messaging.batch.message_count" semantic conventions. It represents the
  2036. // number of messages sent, received, or processed in the scope of the batching
  2037. // operation.
  2038. func MessagingBatchMessageCount(val int) attribute.KeyValue {
  2039. return MessagingBatchMessageCountKey.Int(val)
  2040. }
  2041. // MessagingClientID returns an attribute KeyValue conforming to the
  2042. // "messaging.client_id" semantic conventions. It represents a unique
  2043. // identifier for the client that consumes or produces a message.
  2044. func MessagingClientID(val string) attribute.KeyValue {
  2045. return MessagingClientIDKey.String(val)
  2046. }
  2047. // Semantic conventions for remote procedure calls.
  2048. const (
  2049. // RPCSystemKey is the attribute Key conforming to the "rpc.system"
  2050. // semantic conventions. It represents a string identifying the remoting
  2051. // system. See below for a list of well-known identifiers.
  2052. //
  2053. // Type: Enum
  2054. // RequirementLevel: Required
  2055. // Stability: stable
  2056. RPCSystemKey = attribute.Key("rpc.system")
  2057. // RPCServiceKey is the attribute Key conforming to the "rpc.service"
  2058. // semantic conventions. It represents the full (logical) name of the
  2059. // service being called, including its package name, if applicable.
  2060. //
  2061. // Type: string
  2062. // RequirementLevel: Recommended
  2063. // Stability: stable
  2064. // Examples: 'myservice.EchoService'
  2065. // Note: This is the logical name of the service from the RPC interface
  2066. // perspective, which can be different from the name of any implementing
  2067. // class. The `code.namespace` attribute may be used to store the latter
  2068. // (despite the attribute name, it may include a class name; e.g., class
  2069. // with method actually executing the call on the server side, RPC client
  2070. // stub class on the client side).
  2071. RPCServiceKey = attribute.Key("rpc.service")
  2072. // RPCMethodKey is the attribute Key conforming to the "rpc.method"
  2073. // semantic conventions. It represents the name of the (logical) method
  2074. // being called, must be equal to the $method part in the span name.
  2075. //
  2076. // Type: string
  2077. // RequirementLevel: Recommended
  2078. // Stability: stable
  2079. // Examples: 'exampleMethod'
  2080. // Note: This is the logical name of the method from the RPC interface
  2081. // perspective, which can be different from the name of any implementing
  2082. // method/function. The `code.function` attribute may be used to store the
  2083. // latter (e.g., method actually executing the call on the server side, RPC
  2084. // client stub method on the client side).
  2085. RPCMethodKey = attribute.Key("rpc.method")
  2086. )
  2087. var (
  2088. // gRPC
  2089. RPCSystemGRPC = RPCSystemKey.String("grpc")
  2090. // Java RMI
  2091. RPCSystemJavaRmi = RPCSystemKey.String("java_rmi")
  2092. // .NET WCF
  2093. RPCSystemDotnetWcf = RPCSystemKey.String("dotnet_wcf")
  2094. // Apache Dubbo
  2095. RPCSystemApacheDubbo = RPCSystemKey.String("apache_dubbo")
  2096. // Connect RPC
  2097. RPCSystemConnectRPC = RPCSystemKey.String("connect_rpc")
  2098. )
  2099. // RPCService returns an attribute KeyValue conforming to the "rpc.service"
  2100. // semantic conventions. It represents the full (logical) name of the service
  2101. // being called, including its package name, if applicable.
  2102. func RPCService(val string) attribute.KeyValue {
  2103. return RPCServiceKey.String(val)
  2104. }
  2105. // RPCMethod returns an attribute KeyValue conforming to the "rpc.method"
  2106. // semantic conventions. It represents the name of the (logical) method being
  2107. // called, must be equal to the $method part in the span name.
  2108. func RPCMethod(val string) attribute.KeyValue {
  2109. return RPCMethodKey.String(val)
  2110. }
  2111. // Tech-specific attributes for gRPC.
  2112. const (
  2113. // RPCGRPCStatusCodeKey is the attribute Key conforming to the
  2114. // "rpc.grpc.status_code" semantic conventions. It represents the [numeric
  2115. // status
  2116. // code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of
  2117. // the gRPC request.
  2118. //
  2119. // Type: Enum
  2120. // RequirementLevel: Required
  2121. // Stability: stable
  2122. RPCGRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code")
  2123. )
  2124. var (
  2125. // OK
  2126. RPCGRPCStatusCodeOk = RPCGRPCStatusCodeKey.Int(0)
  2127. // CANCELLED
  2128. RPCGRPCStatusCodeCancelled = RPCGRPCStatusCodeKey.Int(1)
  2129. // UNKNOWN
  2130. RPCGRPCStatusCodeUnknown = RPCGRPCStatusCodeKey.Int(2)
  2131. // INVALID_ARGUMENT
  2132. RPCGRPCStatusCodeInvalidArgument = RPCGRPCStatusCodeKey.Int(3)
  2133. // DEADLINE_EXCEEDED
  2134. RPCGRPCStatusCodeDeadlineExceeded = RPCGRPCStatusCodeKey.Int(4)
  2135. // NOT_FOUND
  2136. RPCGRPCStatusCodeNotFound = RPCGRPCStatusCodeKey.Int(5)
  2137. // ALREADY_EXISTS
  2138. RPCGRPCStatusCodeAlreadyExists = RPCGRPCStatusCodeKey.Int(6)
  2139. // PERMISSION_DENIED
  2140. RPCGRPCStatusCodePermissionDenied = RPCGRPCStatusCodeKey.Int(7)
  2141. // RESOURCE_EXHAUSTED
  2142. RPCGRPCStatusCodeResourceExhausted = RPCGRPCStatusCodeKey.Int(8)
  2143. // FAILED_PRECONDITION
  2144. RPCGRPCStatusCodeFailedPrecondition = RPCGRPCStatusCodeKey.Int(9)
  2145. // ABORTED
  2146. RPCGRPCStatusCodeAborted = RPCGRPCStatusCodeKey.Int(10)
  2147. // OUT_OF_RANGE
  2148. RPCGRPCStatusCodeOutOfRange = RPCGRPCStatusCodeKey.Int(11)
  2149. // UNIMPLEMENTED
  2150. RPCGRPCStatusCodeUnimplemented = RPCGRPCStatusCodeKey.Int(12)
  2151. // INTERNAL
  2152. RPCGRPCStatusCodeInternal = RPCGRPCStatusCodeKey.Int(13)
  2153. // UNAVAILABLE
  2154. RPCGRPCStatusCodeUnavailable = RPCGRPCStatusCodeKey.Int(14)
  2155. // DATA_LOSS
  2156. RPCGRPCStatusCodeDataLoss = RPCGRPCStatusCodeKey.Int(15)
  2157. // UNAUTHENTICATED
  2158. RPCGRPCStatusCodeUnauthenticated = RPCGRPCStatusCodeKey.Int(16)
  2159. )
  2160. // Tech-specific attributes for [JSON RPC](https://www.jsonrpc.org/).
  2161. const (
  2162. // RPCJsonrpcVersionKey is the attribute Key conforming to the
  2163. // "rpc.jsonrpc.version" semantic conventions. It represents the protocol
  2164. // version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0
  2165. // does not specify this, the value can be omitted.
  2166. //
  2167. // Type: string
  2168. // RequirementLevel: ConditionallyRequired (If other than the default
  2169. // version (`1.0`))
  2170. // Stability: stable
  2171. // Examples: '2.0', '1.0'
  2172. RPCJsonrpcVersionKey = attribute.Key("rpc.jsonrpc.version")
  2173. // RPCJsonrpcRequestIDKey is the attribute Key conforming to the
  2174. // "rpc.jsonrpc.request_id" semantic conventions. It represents the `id`
  2175. // property of request or response. Since protocol allows id to be int,
  2176. // string, `null` or missing (for notifications), value is expected to be
  2177. // cast to string for simplicity. Use empty string in case of `null` value.
  2178. // Omit entirely if this is a notification.
  2179. //
  2180. // Type: string
  2181. // RequirementLevel: Optional
  2182. // Stability: stable
  2183. // Examples: '10', 'request-7', ''
  2184. RPCJsonrpcRequestIDKey = attribute.Key("rpc.jsonrpc.request_id")
  2185. // RPCJsonrpcErrorCodeKey is the attribute Key conforming to the
  2186. // "rpc.jsonrpc.error_code" semantic conventions. It represents the
  2187. // `error.code` property of response if it is an error response.
  2188. //
  2189. // Type: int
  2190. // RequirementLevel: ConditionallyRequired (If response is not successful.)
  2191. // Stability: stable
  2192. // Examples: -32700, 100
  2193. RPCJsonrpcErrorCodeKey = attribute.Key("rpc.jsonrpc.error_code")
  2194. // RPCJsonrpcErrorMessageKey is the attribute Key conforming to the
  2195. // "rpc.jsonrpc.error_message" semantic conventions. It represents the
  2196. // `error.message` property of response if it is an error response.
  2197. //
  2198. // Type: string
  2199. // RequirementLevel: Optional
  2200. // Stability: stable
  2201. // Examples: 'Parse error', 'User already exists'
  2202. RPCJsonrpcErrorMessageKey = attribute.Key("rpc.jsonrpc.error_message")
  2203. )
  2204. // RPCJsonrpcVersion returns an attribute KeyValue conforming to the
  2205. // "rpc.jsonrpc.version" semantic conventions. It represents the protocol
  2206. // version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0
  2207. // does not specify this, the value can be omitted.
  2208. func RPCJsonrpcVersion(val string) attribute.KeyValue {
  2209. return RPCJsonrpcVersionKey.String(val)
  2210. }
  2211. // RPCJsonrpcRequestID returns an attribute KeyValue conforming to the
  2212. // "rpc.jsonrpc.request_id" semantic conventions. It represents the `id`
  2213. // property of request or response. Since protocol allows id to be int, string,
  2214. // `null` or missing (for notifications), value is expected to be cast to
  2215. // string for simplicity. Use empty string in case of `null` value. Omit
  2216. // entirely if this is a notification.
  2217. func RPCJsonrpcRequestID(val string) attribute.KeyValue {
  2218. return RPCJsonrpcRequestIDKey.String(val)
  2219. }
  2220. // RPCJsonrpcErrorCode returns an attribute KeyValue conforming to the
  2221. // "rpc.jsonrpc.error_code" semantic conventions. It represents the
  2222. // `error.code` property of response if it is an error response.
  2223. func RPCJsonrpcErrorCode(val int) attribute.KeyValue {
  2224. return RPCJsonrpcErrorCodeKey.Int(val)
  2225. }
  2226. // RPCJsonrpcErrorMessage returns an attribute KeyValue conforming to the
  2227. // "rpc.jsonrpc.error_message" semantic conventions. It represents the
  2228. // `error.message` property of response if it is an error response.
  2229. func RPCJsonrpcErrorMessage(val string) attribute.KeyValue {
  2230. return RPCJsonrpcErrorMessageKey.String(val)
  2231. }
  2232. // Tech-specific attributes for Connect RPC.
  2233. const (
  2234. // RPCConnectRPCErrorCodeKey is the attribute Key conforming to the
  2235. // "rpc.connect_rpc.error_code" semantic conventions. It represents the
  2236. // [error codes](https://connect.build/docs/protocol/#error-codes) of the
  2237. // Connect request. Error codes are always string values.
  2238. //
  2239. // Type: Enum
  2240. // RequirementLevel: ConditionallyRequired (If response is not successful
  2241. // and if error code available.)
  2242. // Stability: stable
  2243. RPCConnectRPCErrorCodeKey = attribute.Key("rpc.connect_rpc.error_code")
  2244. )
  2245. var (
  2246. // cancelled
  2247. RPCConnectRPCErrorCodeCancelled = RPCConnectRPCErrorCodeKey.String("cancelled")
  2248. // unknown
  2249. RPCConnectRPCErrorCodeUnknown = RPCConnectRPCErrorCodeKey.String("unknown")
  2250. // invalid_argument
  2251. RPCConnectRPCErrorCodeInvalidArgument = RPCConnectRPCErrorCodeKey.String("invalid_argument")
  2252. // deadline_exceeded
  2253. RPCConnectRPCErrorCodeDeadlineExceeded = RPCConnectRPCErrorCodeKey.String("deadline_exceeded")
  2254. // not_found
  2255. RPCConnectRPCErrorCodeNotFound = RPCConnectRPCErrorCodeKey.String("not_found")
  2256. // already_exists
  2257. RPCConnectRPCErrorCodeAlreadyExists = RPCConnectRPCErrorCodeKey.String("already_exists")
  2258. // permission_denied
  2259. RPCConnectRPCErrorCodePermissionDenied = RPCConnectRPCErrorCodeKey.String("permission_denied")
  2260. // resource_exhausted
  2261. RPCConnectRPCErrorCodeResourceExhausted = RPCConnectRPCErrorCodeKey.String("resource_exhausted")
  2262. // failed_precondition
  2263. RPCConnectRPCErrorCodeFailedPrecondition = RPCConnectRPCErrorCodeKey.String("failed_precondition")
  2264. // aborted
  2265. RPCConnectRPCErrorCodeAborted = RPCConnectRPCErrorCodeKey.String("aborted")
  2266. // out_of_range
  2267. RPCConnectRPCErrorCodeOutOfRange = RPCConnectRPCErrorCodeKey.String("out_of_range")
  2268. // unimplemented
  2269. RPCConnectRPCErrorCodeUnimplemented = RPCConnectRPCErrorCodeKey.String("unimplemented")
  2270. // internal
  2271. RPCConnectRPCErrorCodeInternal = RPCConnectRPCErrorCodeKey.String("internal")
  2272. // unavailable
  2273. RPCConnectRPCErrorCodeUnavailable = RPCConnectRPCErrorCodeKey.String("unavailable")
  2274. // data_loss
  2275. RPCConnectRPCErrorCodeDataLoss = RPCConnectRPCErrorCodeKey.String("data_loss")
  2276. // unauthenticated
  2277. RPCConnectRPCErrorCodeUnauthenticated = RPCConnectRPCErrorCodeKey.String("unauthenticated")
  2278. )