trace.go 104 KB

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