trace.go 134 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385
  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.18.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. // Attributes for Events represented using Log Records.
  78. const (
  79. // EventNameKey is the attribute Key conforming to the "event.name"
  80. // semantic conventions. It represents the name identifies the event.
  81. //
  82. // Type: string
  83. // RequirementLevel: Required
  84. // Stability: stable
  85. // Examples: 'click', 'exception'
  86. EventNameKey = attribute.Key("event.name")
  87. // EventDomainKey is the attribute Key conforming to the "event.domain"
  88. // semantic conventions. It represents the domain identifies the business
  89. // context for the events.
  90. //
  91. // Type: Enum
  92. // RequirementLevel: Required
  93. // Stability: stable
  94. // Note: Events across different domains may have same `event.name`, yet be
  95. // unrelated events.
  96. EventDomainKey = attribute.Key("event.domain")
  97. )
  98. var (
  99. // Events from browser apps
  100. EventDomainBrowser = EventDomainKey.String("browser")
  101. // Events from mobile apps
  102. EventDomainDevice = EventDomainKey.String("device")
  103. // Events from Kubernetes
  104. EventDomainK8S = EventDomainKey.String("k8s")
  105. )
  106. // EventName returns an attribute KeyValue conforming to the "event.name"
  107. // semantic conventions. It represents the name identifies the event.
  108. func EventName(val string) attribute.KeyValue {
  109. return EventNameKey.String(val)
  110. }
  111. // Span attributes used by AWS Lambda (in addition to general `faas`
  112. // attributes).
  113. const (
  114. // AWSLambdaInvokedARNKey is the attribute Key conforming to the
  115. // "aws.lambda.invoked_arn" semantic conventions. It represents the full
  116. // invoked ARN as provided on the `Context` passed to the function
  117. // (`Lambda-Runtime-Invoked-Function-ARN` header on the
  118. // `/runtime/invocation/next` applicable).
  119. //
  120. // Type: string
  121. // RequirementLevel: Optional
  122. // Stability: stable
  123. // Examples: 'arn:aws:lambda:us-east-1:123456:function:myfunction:myalias'
  124. // Note: This may be different from `faas.id` if an alias is involved.
  125. AWSLambdaInvokedARNKey = attribute.Key("aws.lambda.invoked_arn")
  126. )
  127. // AWSLambdaInvokedARN returns an attribute KeyValue conforming to the
  128. // "aws.lambda.invoked_arn" semantic conventions. It represents the full
  129. // invoked ARN as provided on the `Context` passed to the function
  130. // (`Lambda-Runtime-Invoked-Function-ARN` header on the
  131. // `/runtime/invocation/next` applicable).
  132. func AWSLambdaInvokedARN(val string) attribute.KeyValue {
  133. return AWSLambdaInvokedARNKey.String(val)
  134. }
  135. // Attributes for CloudEvents. CloudEvents is a specification on how to define
  136. // event data in a standard way. These attributes can be attached to spans when
  137. // performing operations with CloudEvents, regardless of the protocol being
  138. // used.
  139. const (
  140. // CloudeventsEventIDKey is the attribute Key conforming to the
  141. // "cloudevents.event_id" semantic conventions. It represents the
  142. // [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id)
  143. // uniquely identifies the event.
  144. //
  145. // Type: string
  146. // RequirementLevel: Required
  147. // Stability: stable
  148. // Examples: '123e4567-e89b-12d3-a456-426614174000', '0001'
  149. CloudeventsEventIDKey = attribute.Key("cloudevents.event_id")
  150. // CloudeventsEventSourceKey is the attribute Key conforming to the
  151. // "cloudevents.event_source" semantic conventions. It represents the
  152. // [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1)
  153. // identifies the context in which an event happened.
  154. //
  155. // Type: string
  156. // RequirementLevel: Required
  157. // Stability: stable
  158. // Examples: 'https://github.com/cloudevents',
  159. // '/cloudevents/spec/pull/123', 'my-service'
  160. CloudeventsEventSourceKey = attribute.Key("cloudevents.event_source")
  161. // CloudeventsEventSpecVersionKey is the attribute Key conforming to the
  162. // "cloudevents.event_spec_version" semantic conventions. It represents the
  163. // [version of the CloudEvents
  164. // specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion)
  165. // which the event uses.
  166. //
  167. // Type: string
  168. // RequirementLevel: Optional
  169. // Stability: stable
  170. // Examples: '1.0'
  171. CloudeventsEventSpecVersionKey = attribute.Key("cloudevents.event_spec_version")
  172. // CloudeventsEventTypeKey is the attribute Key conforming to the
  173. // "cloudevents.event_type" semantic conventions. It represents the
  174. // [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type)
  175. // contains a value describing the type of event related to the originating
  176. // occurrence.
  177. //
  178. // Type: string
  179. // RequirementLevel: Optional
  180. // Stability: stable
  181. // Examples: 'com.github.pull_request.opened',
  182. // 'com.example.object.deleted.v2'
  183. CloudeventsEventTypeKey = attribute.Key("cloudevents.event_type")
  184. // CloudeventsEventSubjectKey is the attribute Key conforming to the
  185. // "cloudevents.event_subject" semantic conventions. It represents the
  186. // [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject)
  187. // of the event in the context of the event producer (identified by
  188. // source).
  189. //
  190. // Type: string
  191. // RequirementLevel: Optional
  192. // Stability: stable
  193. // Examples: 'mynewfile.jpg'
  194. CloudeventsEventSubjectKey = attribute.Key("cloudevents.event_subject")
  195. )
  196. // CloudeventsEventID returns an attribute KeyValue conforming to the
  197. // "cloudevents.event_id" semantic conventions. It represents the
  198. // [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id)
  199. // uniquely identifies the event.
  200. func CloudeventsEventID(val string) attribute.KeyValue {
  201. return CloudeventsEventIDKey.String(val)
  202. }
  203. // CloudeventsEventSource returns an attribute KeyValue conforming to the
  204. // "cloudevents.event_source" semantic conventions. It represents the
  205. // [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1)
  206. // identifies the context in which an event happened.
  207. func CloudeventsEventSource(val string) attribute.KeyValue {
  208. return CloudeventsEventSourceKey.String(val)
  209. }
  210. // CloudeventsEventSpecVersion returns an attribute KeyValue conforming to
  211. // the "cloudevents.event_spec_version" semantic conventions. It represents the
  212. // [version of the CloudEvents
  213. // specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion)
  214. // which the event uses.
  215. func CloudeventsEventSpecVersion(val string) attribute.KeyValue {
  216. return CloudeventsEventSpecVersionKey.String(val)
  217. }
  218. // CloudeventsEventType returns an attribute KeyValue conforming to the
  219. // "cloudevents.event_type" semantic conventions. It represents the
  220. // [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type)
  221. // contains a value describing the type of event related to the originating
  222. // occurrence.
  223. func CloudeventsEventType(val string) attribute.KeyValue {
  224. return CloudeventsEventTypeKey.String(val)
  225. }
  226. // CloudeventsEventSubject returns an attribute KeyValue conforming to the
  227. // "cloudevents.event_subject" semantic conventions. It represents the
  228. // [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject)
  229. // of the event in the context of the event producer (identified by source).
  230. func CloudeventsEventSubject(val string) attribute.KeyValue {
  231. return CloudeventsEventSubjectKey.String(val)
  232. }
  233. // Semantic conventions for the OpenTracing Shim
  234. const (
  235. // OpentracingRefTypeKey is the attribute Key conforming to the
  236. // "opentracing.ref_type" semantic conventions. It represents the
  237. // parent-child Reference type
  238. //
  239. // Type: Enum
  240. // RequirementLevel: Optional
  241. // Stability: stable
  242. // Note: The causal relationship between a child Span and a parent Span.
  243. OpentracingRefTypeKey = attribute.Key("opentracing.ref_type")
  244. )
  245. var (
  246. // The parent Span depends on the child Span in some capacity
  247. OpentracingRefTypeChildOf = OpentracingRefTypeKey.String("child_of")
  248. // The parent Span does not depend in any way on the result of the child Span
  249. OpentracingRefTypeFollowsFrom = OpentracingRefTypeKey.String("follows_from")
  250. )
  251. // The attributes used to perform database client calls.
  252. const (
  253. // DBSystemKey is the attribute Key conforming to the "db.system" semantic
  254. // conventions. It represents an identifier for the database management
  255. // system (DBMS) product being used. See below for a list of well-known
  256. // identifiers.
  257. //
  258. // Type: Enum
  259. // RequirementLevel: Required
  260. // Stability: stable
  261. DBSystemKey = attribute.Key("db.system")
  262. // DBConnectionStringKey is the attribute Key conforming to the
  263. // "db.connection_string" semantic conventions. It represents the
  264. // connection string used to connect to the database. It is recommended to
  265. // remove embedded credentials.
  266. //
  267. // Type: string
  268. // RequirementLevel: Optional
  269. // Stability: stable
  270. // Examples: 'Server=(localdb)\\v11.0;Integrated Security=true;'
  271. DBConnectionStringKey = attribute.Key("db.connection_string")
  272. // DBUserKey is the attribute Key conforming to the "db.user" semantic
  273. // conventions. It represents the username for accessing the database.
  274. //
  275. // Type: string
  276. // RequirementLevel: Optional
  277. // Stability: stable
  278. // Examples: 'readonly_user', 'reporting_user'
  279. DBUserKey = attribute.Key("db.user")
  280. // DBJDBCDriverClassnameKey is the attribute Key conforming to the
  281. // "db.jdbc.driver_classname" semantic conventions. It represents the
  282. // fully-qualified class name of the [Java Database Connectivity
  283. // (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/)
  284. // driver used to connect.
  285. //
  286. // Type: string
  287. // RequirementLevel: Optional
  288. // Stability: stable
  289. // Examples: 'org.postgresql.Driver',
  290. // 'com.microsoft.sqlserver.jdbc.SQLServerDriver'
  291. DBJDBCDriverClassnameKey = attribute.Key("db.jdbc.driver_classname")
  292. // DBNameKey is the attribute Key conforming to the "db.name" semantic
  293. // conventions. It represents the this attribute is used to report the name
  294. // of the database being accessed. For commands that switch the database,
  295. // this should be set to the target database (even if the command fails).
  296. //
  297. // Type: string
  298. // RequirementLevel: ConditionallyRequired (If applicable.)
  299. // Stability: stable
  300. // Examples: 'customers', 'main'
  301. // Note: In some SQL databases, the database name to be used is called
  302. // "schema name". In case there are multiple layers that could be
  303. // considered for database name (e.g. Oracle instance name and schema
  304. // name), the database name to be used is the more specific layer (e.g.
  305. // Oracle schema name).
  306. DBNameKey = attribute.Key("db.name")
  307. // DBStatementKey is the attribute Key conforming to the "db.statement"
  308. // semantic conventions. It represents the database statement being
  309. // executed.
  310. //
  311. // Type: string
  312. // RequirementLevel: ConditionallyRequired (If applicable and not
  313. // explicitly disabled via instrumentation configuration.)
  314. // Stability: stable
  315. // Examples: 'SELECT * FROM wuser_table', 'SET mykey "WuValue"'
  316. // Note: The value may be sanitized to exclude sensitive information.
  317. DBStatementKey = attribute.Key("db.statement")
  318. // DBOperationKey is the attribute Key conforming to the "db.operation"
  319. // semantic conventions. It represents the name of the operation being
  320. // executed, e.g. the [MongoDB command
  321. // name](https://docs.mongodb.com/manual/reference/command/#database-operations)
  322. // such as `findAndModify`, or the SQL keyword.
  323. //
  324. // Type: string
  325. // RequirementLevel: ConditionallyRequired (If `db.statement` is not
  326. // applicable.)
  327. // Stability: stable
  328. // Examples: 'findAndModify', 'HMSET', 'SELECT'
  329. // Note: When setting this to an SQL keyword, it is not recommended to
  330. // attempt any client-side parsing of `db.statement` just to get this
  331. // property, but it should be set if the operation name is provided by the
  332. // library being instrumented. If the SQL statement has an ambiguous
  333. // operation, or performs more than one operation, this value may be
  334. // omitted.
  335. DBOperationKey = attribute.Key("db.operation")
  336. )
  337. var (
  338. // Some other SQL database. Fallback only. See notes
  339. DBSystemOtherSQL = DBSystemKey.String("other_sql")
  340. // Microsoft SQL Server
  341. DBSystemMSSQL = DBSystemKey.String("mssql")
  342. // Microsoft SQL Server Compact
  343. DBSystemMssqlcompact = DBSystemKey.String("mssqlcompact")
  344. // MySQL
  345. DBSystemMySQL = DBSystemKey.String("mysql")
  346. // Oracle Database
  347. DBSystemOracle = DBSystemKey.String("oracle")
  348. // IBM DB2
  349. DBSystemDB2 = DBSystemKey.String("db2")
  350. // PostgreSQL
  351. DBSystemPostgreSQL = DBSystemKey.String("postgresql")
  352. // Amazon Redshift
  353. DBSystemRedshift = DBSystemKey.String("redshift")
  354. // Apache Hive
  355. DBSystemHive = DBSystemKey.String("hive")
  356. // Cloudscape
  357. DBSystemCloudscape = DBSystemKey.String("cloudscape")
  358. // HyperSQL DataBase
  359. DBSystemHSQLDB = DBSystemKey.String("hsqldb")
  360. // Progress Database
  361. DBSystemProgress = DBSystemKey.String("progress")
  362. // SAP MaxDB
  363. DBSystemMaxDB = DBSystemKey.String("maxdb")
  364. // SAP HANA
  365. DBSystemHanaDB = DBSystemKey.String("hanadb")
  366. // Ingres
  367. DBSystemIngres = DBSystemKey.String("ingres")
  368. // FirstSQL
  369. DBSystemFirstSQL = DBSystemKey.String("firstsql")
  370. // EnterpriseDB
  371. DBSystemEDB = DBSystemKey.String("edb")
  372. // InterSystems Caché
  373. DBSystemCache = DBSystemKey.String("cache")
  374. // Adabas (Adaptable Database System)
  375. DBSystemAdabas = DBSystemKey.String("adabas")
  376. // Firebird
  377. DBSystemFirebird = DBSystemKey.String("firebird")
  378. // Apache Derby
  379. DBSystemDerby = DBSystemKey.String("derby")
  380. // FileMaker
  381. DBSystemFilemaker = DBSystemKey.String("filemaker")
  382. // Informix
  383. DBSystemInformix = DBSystemKey.String("informix")
  384. // InstantDB
  385. DBSystemInstantDB = DBSystemKey.String("instantdb")
  386. // InterBase
  387. DBSystemInterbase = DBSystemKey.String("interbase")
  388. // MariaDB
  389. DBSystemMariaDB = DBSystemKey.String("mariadb")
  390. // Netezza
  391. DBSystemNetezza = DBSystemKey.String("netezza")
  392. // Pervasive PSQL
  393. DBSystemPervasive = DBSystemKey.String("pervasive")
  394. // PointBase
  395. DBSystemPointbase = DBSystemKey.String("pointbase")
  396. // SQLite
  397. DBSystemSqlite = DBSystemKey.String("sqlite")
  398. // Sybase
  399. DBSystemSybase = DBSystemKey.String("sybase")
  400. // Teradata
  401. DBSystemTeradata = DBSystemKey.String("teradata")
  402. // Vertica
  403. DBSystemVertica = DBSystemKey.String("vertica")
  404. // H2
  405. DBSystemH2 = DBSystemKey.String("h2")
  406. // ColdFusion IMQ
  407. DBSystemColdfusion = DBSystemKey.String("coldfusion")
  408. // Apache Cassandra
  409. DBSystemCassandra = DBSystemKey.String("cassandra")
  410. // Apache HBase
  411. DBSystemHBase = DBSystemKey.String("hbase")
  412. // MongoDB
  413. DBSystemMongoDB = DBSystemKey.String("mongodb")
  414. // Redis
  415. DBSystemRedis = DBSystemKey.String("redis")
  416. // Couchbase
  417. DBSystemCouchbase = DBSystemKey.String("couchbase")
  418. // CouchDB
  419. DBSystemCouchDB = DBSystemKey.String("couchdb")
  420. // Microsoft Azure Cosmos DB
  421. DBSystemCosmosDB = DBSystemKey.String("cosmosdb")
  422. // Amazon DynamoDB
  423. DBSystemDynamoDB = DBSystemKey.String("dynamodb")
  424. // Neo4j
  425. DBSystemNeo4j = DBSystemKey.String("neo4j")
  426. // Apache Geode
  427. DBSystemGeode = DBSystemKey.String("geode")
  428. // Elasticsearch
  429. DBSystemElasticsearch = DBSystemKey.String("elasticsearch")
  430. // Memcached
  431. DBSystemMemcached = DBSystemKey.String("memcached")
  432. // CockroachDB
  433. DBSystemCockroachdb = DBSystemKey.String("cockroachdb")
  434. // OpenSearch
  435. DBSystemOpensearch = DBSystemKey.String("opensearch")
  436. // ClickHouse
  437. DBSystemClickhouse = DBSystemKey.String("clickhouse")
  438. // Cloud Spanner
  439. DBSystemSpanner = DBSystemKey.String("spanner")
  440. // DaMengDB
  441. DBSystemDaMengDB = DBSystemKey.String("dameng")
  442. // TiDB
  443. DBSystemTiDB = DBSystemKey.String("tidb")
  444. )
  445. // DBConnectionString returns an attribute KeyValue conforming to the
  446. // "db.connection_string" semantic conventions. It represents the connection
  447. // string used to connect to the database. It is recommended to remove embedded
  448. // credentials.
  449. func DBConnectionString(val string) attribute.KeyValue {
  450. return DBConnectionStringKey.String(val)
  451. }
  452. // DBUser returns an attribute KeyValue conforming to the "db.user" semantic
  453. // conventions. It represents the username for accessing the database.
  454. func DBUser(val string) attribute.KeyValue {
  455. return DBUserKey.String(val)
  456. }
  457. // DBJDBCDriverClassname returns an attribute KeyValue conforming to the
  458. // "db.jdbc.driver_classname" semantic conventions. It represents the
  459. // fully-qualified class name of the [Java Database Connectivity
  460. // (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver
  461. // used to connect.
  462. func DBJDBCDriverClassname(val string) attribute.KeyValue {
  463. return DBJDBCDriverClassnameKey.String(val)
  464. }
  465. // DBName returns an attribute KeyValue conforming to the "db.name" semantic
  466. // conventions. It represents the this attribute is used to report the name of
  467. // the database being accessed. For commands that switch the database, this
  468. // should be set to the target database (even if the command fails).
  469. func DBName(val string) attribute.KeyValue {
  470. return DBNameKey.String(val)
  471. }
  472. // DBStatement returns an attribute KeyValue conforming to the
  473. // "db.statement" semantic conventions. It represents the database statement
  474. // being executed.
  475. func DBStatement(val string) attribute.KeyValue {
  476. return DBStatementKey.String(val)
  477. }
  478. // DBOperation returns an attribute KeyValue conforming to the
  479. // "db.operation" semantic conventions. It represents the name of the operation
  480. // being executed, e.g. the [MongoDB command
  481. // name](https://docs.mongodb.com/manual/reference/command/#database-operations)
  482. // such as `findAndModify`, or the SQL keyword.
  483. func DBOperation(val string) attribute.KeyValue {
  484. return DBOperationKey.String(val)
  485. }
  486. // Connection-level attributes for Microsoft SQL Server
  487. const (
  488. // DBMSSQLInstanceNameKey is the attribute Key conforming to the
  489. // "db.mssql.instance_name" semantic conventions. It represents the
  490. // Microsoft SQL Server [instance
  491. // name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15)
  492. // connecting to. This name is used to determine the port of a named
  493. // instance.
  494. //
  495. // Type: string
  496. // RequirementLevel: Optional
  497. // Stability: stable
  498. // Examples: 'MSSQLSERVER'
  499. // Note: If setting a `db.mssql.instance_name`, `net.peer.port` is no
  500. // longer required (but still recommended if non-standard).
  501. DBMSSQLInstanceNameKey = attribute.Key("db.mssql.instance_name")
  502. )
  503. // DBMSSQLInstanceName returns an attribute KeyValue conforming to the
  504. // "db.mssql.instance_name" semantic conventions. It represents the Microsoft
  505. // SQL Server [instance
  506. // name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15)
  507. // connecting to. This name is used to determine the port of a named instance.
  508. func DBMSSQLInstanceName(val string) attribute.KeyValue {
  509. return DBMSSQLInstanceNameKey.String(val)
  510. }
  511. // Call-level attributes for Cassandra
  512. const (
  513. // DBCassandraPageSizeKey is the attribute Key conforming to the
  514. // "db.cassandra.page_size" semantic conventions. It represents the fetch
  515. // size used for paging, i.e. how many rows will be returned at once.
  516. //
  517. // Type: int
  518. // RequirementLevel: Optional
  519. // Stability: stable
  520. // Examples: 5000
  521. DBCassandraPageSizeKey = attribute.Key("db.cassandra.page_size")
  522. // DBCassandraConsistencyLevelKey is the attribute Key conforming to the
  523. // "db.cassandra.consistency_level" semantic conventions. It represents the
  524. // consistency level of the query. Based on consistency values from
  525. // [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html).
  526. //
  527. // Type: Enum
  528. // RequirementLevel: Optional
  529. // Stability: stable
  530. DBCassandraConsistencyLevelKey = attribute.Key("db.cassandra.consistency_level")
  531. // DBCassandraTableKey is the attribute Key conforming to the
  532. // "db.cassandra.table" semantic conventions. It represents the name of the
  533. // primary table that the operation is acting upon, including the keyspace
  534. // name (if applicable).
  535. //
  536. // Type: string
  537. // RequirementLevel: Recommended
  538. // Stability: stable
  539. // Examples: 'mytable'
  540. // Note: This mirrors the db.sql.table attribute but references cassandra
  541. // rather than sql. It is not recommended to attempt any client-side
  542. // parsing of `db.statement` just to get this property, but it should be
  543. // set if it is provided by the library being instrumented. If the
  544. // operation is acting upon an anonymous table, or more than one table,
  545. // this value MUST NOT be set.
  546. DBCassandraTableKey = attribute.Key("db.cassandra.table")
  547. // DBCassandraIdempotenceKey is the attribute Key conforming to the
  548. // "db.cassandra.idempotence" semantic conventions. It represents the
  549. // whether or not the query is idempotent.
  550. //
  551. // Type: boolean
  552. // RequirementLevel: Optional
  553. // Stability: stable
  554. DBCassandraIdempotenceKey = attribute.Key("db.cassandra.idempotence")
  555. // DBCassandraSpeculativeExecutionCountKey is the attribute Key conforming
  556. // to the "db.cassandra.speculative_execution_count" semantic conventions.
  557. // It represents the number of times a query was speculatively executed.
  558. // Not set or `0` if the query was not executed speculatively.
  559. //
  560. // Type: int
  561. // RequirementLevel: Optional
  562. // Stability: stable
  563. // Examples: 0, 2
  564. DBCassandraSpeculativeExecutionCountKey = attribute.Key("db.cassandra.speculative_execution_count")
  565. // DBCassandraCoordinatorIDKey is the attribute Key conforming to the
  566. // "db.cassandra.coordinator.id" semantic conventions. It represents the ID
  567. // of the coordinating node for a query.
  568. //
  569. // Type: string
  570. // RequirementLevel: Optional
  571. // Stability: stable
  572. // Examples: 'be13faa2-8574-4d71-926d-27f16cf8a7af'
  573. DBCassandraCoordinatorIDKey = attribute.Key("db.cassandra.coordinator.id")
  574. // DBCassandraCoordinatorDCKey is the attribute Key conforming to the
  575. // "db.cassandra.coordinator.dc" semantic conventions. It represents the
  576. // data center of the coordinating node for a query.
  577. //
  578. // Type: string
  579. // RequirementLevel: Optional
  580. // Stability: stable
  581. // Examples: 'us-west-2'
  582. DBCassandraCoordinatorDCKey = attribute.Key("db.cassandra.coordinator.dc")
  583. )
  584. var (
  585. // all
  586. DBCassandraConsistencyLevelAll = DBCassandraConsistencyLevelKey.String("all")
  587. // each_quorum
  588. DBCassandraConsistencyLevelEachQuorum = DBCassandraConsistencyLevelKey.String("each_quorum")
  589. // quorum
  590. DBCassandraConsistencyLevelQuorum = DBCassandraConsistencyLevelKey.String("quorum")
  591. // local_quorum
  592. DBCassandraConsistencyLevelLocalQuorum = DBCassandraConsistencyLevelKey.String("local_quorum")
  593. // one
  594. DBCassandraConsistencyLevelOne = DBCassandraConsistencyLevelKey.String("one")
  595. // two
  596. DBCassandraConsistencyLevelTwo = DBCassandraConsistencyLevelKey.String("two")
  597. // three
  598. DBCassandraConsistencyLevelThree = DBCassandraConsistencyLevelKey.String("three")
  599. // local_one
  600. DBCassandraConsistencyLevelLocalOne = DBCassandraConsistencyLevelKey.String("local_one")
  601. // any
  602. DBCassandraConsistencyLevelAny = DBCassandraConsistencyLevelKey.String("any")
  603. // serial
  604. DBCassandraConsistencyLevelSerial = DBCassandraConsistencyLevelKey.String("serial")
  605. // local_serial
  606. DBCassandraConsistencyLevelLocalSerial = DBCassandraConsistencyLevelKey.String("local_serial")
  607. )
  608. // DBCassandraPageSize returns an attribute KeyValue conforming to the
  609. // "db.cassandra.page_size" semantic conventions. It represents the fetch size
  610. // used for paging, i.e. how many rows will be returned at once.
  611. func DBCassandraPageSize(val int) attribute.KeyValue {
  612. return DBCassandraPageSizeKey.Int(val)
  613. }
  614. // DBCassandraTable returns an attribute KeyValue conforming to the
  615. // "db.cassandra.table" semantic conventions. It represents the name of the
  616. // primary table that the operation is acting upon, including the keyspace name
  617. // (if applicable).
  618. func DBCassandraTable(val string) attribute.KeyValue {
  619. return DBCassandraTableKey.String(val)
  620. }
  621. // DBCassandraIdempotence returns an attribute KeyValue conforming to the
  622. // "db.cassandra.idempotence" semantic conventions. It represents the whether
  623. // or not the query is idempotent.
  624. func DBCassandraIdempotence(val bool) attribute.KeyValue {
  625. return DBCassandraIdempotenceKey.Bool(val)
  626. }
  627. // DBCassandraSpeculativeExecutionCount returns an attribute KeyValue
  628. // conforming to the "db.cassandra.speculative_execution_count" semantic
  629. // conventions. It represents the number of times a query was speculatively
  630. // executed. Not set or `0` if the query was not executed speculatively.
  631. func DBCassandraSpeculativeExecutionCount(val int) attribute.KeyValue {
  632. return DBCassandraSpeculativeExecutionCountKey.Int(val)
  633. }
  634. // DBCassandraCoordinatorID returns an attribute KeyValue conforming to the
  635. // "db.cassandra.coordinator.id" semantic conventions. It represents the ID of
  636. // the coordinating node for a query.
  637. func DBCassandraCoordinatorID(val string) attribute.KeyValue {
  638. return DBCassandraCoordinatorIDKey.String(val)
  639. }
  640. // DBCassandraCoordinatorDC returns an attribute KeyValue conforming to the
  641. // "db.cassandra.coordinator.dc" semantic conventions. It represents the data
  642. // center of the coordinating node for a query.
  643. func DBCassandraCoordinatorDC(val string) attribute.KeyValue {
  644. return DBCassandraCoordinatorDCKey.String(val)
  645. }
  646. // Call-level attributes for Redis
  647. const (
  648. // DBRedisDBIndexKey is the attribute Key conforming to the
  649. // "db.redis.database_index" semantic conventions. It represents the index
  650. // of the database being accessed as used in the [`SELECT`
  651. // command](https://redis.io/commands/select), provided as an integer. To
  652. // be used instead of the generic `db.name` attribute.
  653. //
  654. // Type: int
  655. // RequirementLevel: ConditionallyRequired (If other than the default
  656. // database (`0`).)
  657. // Stability: stable
  658. // Examples: 0, 1, 15
  659. DBRedisDBIndexKey = attribute.Key("db.redis.database_index")
  660. )
  661. // DBRedisDBIndex returns an attribute KeyValue conforming to the
  662. // "db.redis.database_index" semantic conventions. It represents the index of
  663. // the database being accessed as used in the [`SELECT`
  664. // command](https://redis.io/commands/select), provided as an integer. To be
  665. // used instead of the generic `db.name` attribute.
  666. func DBRedisDBIndex(val int) attribute.KeyValue {
  667. return DBRedisDBIndexKey.Int(val)
  668. }
  669. // Call-level attributes for MongoDB
  670. const (
  671. // DBMongoDBCollectionKey is the attribute Key conforming to the
  672. // "db.mongodb.collection" semantic conventions. It represents the
  673. // collection being accessed within the database stated in `db.name`.
  674. //
  675. // Type: string
  676. // RequirementLevel: Required
  677. // Stability: stable
  678. // Examples: 'customers', 'products'
  679. DBMongoDBCollectionKey = attribute.Key("db.mongodb.collection")
  680. )
  681. // DBMongoDBCollection returns an attribute KeyValue conforming to the
  682. // "db.mongodb.collection" semantic conventions. It represents the collection
  683. // being accessed within the database stated in `db.name`.
  684. func DBMongoDBCollection(val string) attribute.KeyValue {
  685. return DBMongoDBCollectionKey.String(val)
  686. }
  687. // Call-level attributes for SQL databases
  688. const (
  689. // DBSQLTableKey is the attribute Key conforming to the "db.sql.table"
  690. // semantic conventions. It represents the name of the primary table that
  691. // the operation is acting upon, including the database name (if
  692. // applicable).
  693. //
  694. // Type: string
  695. // RequirementLevel: Recommended
  696. // Stability: stable
  697. // Examples: 'public.users', 'customers'
  698. // Note: It is not recommended to attempt any client-side parsing of
  699. // `db.statement` just to get this property, but it should be set if it is
  700. // provided by the library being instrumented. If the operation is acting
  701. // upon an anonymous table, or more than one table, this value MUST NOT be
  702. // set.
  703. DBSQLTableKey = attribute.Key("db.sql.table")
  704. )
  705. // DBSQLTable returns an attribute KeyValue conforming to the "db.sql.table"
  706. // semantic conventions. It represents the name of the primary table that the
  707. // operation is acting upon, including the database name (if applicable).
  708. func DBSQLTable(val string) attribute.KeyValue {
  709. return DBSQLTableKey.String(val)
  710. }
  711. // Span attributes used by non-OTLP exporters to represent OpenTelemetry Span's
  712. // concepts.
  713. const (
  714. // OTelStatusCodeKey is the attribute Key conforming to the
  715. // "otel.status_code" semantic conventions. It represents the name of the
  716. // code, either "OK" or "ERROR". MUST NOT be set if the status code is
  717. // UNSET.
  718. //
  719. // Type: Enum
  720. // RequirementLevel: Optional
  721. // Stability: stable
  722. OTelStatusCodeKey = attribute.Key("otel.status_code")
  723. // OTelStatusDescriptionKey is the attribute Key conforming to the
  724. // "otel.status_description" semantic conventions. It represents the
  725. // description of the Status if it has a value, otherwise not set.
  726. //
  727. // Type: string
  728. // RequirementLevel: Optional
  729. // Stability: stable
  730. // Examples: 'resource not found'
  731. OTelStatusDescriptionKey = attribute.Key("otel.status_description")
  732. )
  733. var (
  734. // The operation has been validated by an Application developer or Operator to have completed successfully
  735. OTelStatusCodeOk = OTelStatusCodeKey.String("OK")
  736. // The operation contains an error
  737. OTelStatusCodeError = OTelStatusCodeKey.String("ERROR")
  738. )
  739. // OTelStatusDescription returns an attribute KeyValue conforming to the
  740. // "otel.status_description" semantic conventions. It represents the
  741. // description of the Status if it has a value, otherwise not set.
  742. func OTelStatusDescription(val string) attribute.KeyValue {
  743. return OTelStatusDescriptionKey.String(val)
  744. }
  745. // This semantic convention describes an instance of a function that runs
  746. // without provisioning or managing of servers (also known as serverless
  747. // functions or Function as a Service (FaaS)) with spans.
  748. const (
  749. // FaaSTriggerKey is the attribute Key conforming to the "faas.trigger"
  750. // semantic conventions. It represents the type of the trigger which caused
  751. // this function execution.
  752. //
  753. // Type: Enum
  754. // RequirementLevel: Optional
  755. // Stability: stable
  756. // Note: For the server/consumer span on the incoming side,
  757. // `faas.trigger` MUST be set.
  758. //
  759. // Clients invoking FaaS instances usually cannot set `faas.trigger`,
  760. // since they would typically need to look in the payload to determine
  761. // the event type. If clients set it, it should be the same as the
  762. // trigger that corresponding incoming would have (i.e., this has
  763. // nothing to do with the underlying transport used to make the API
  764. // call to invoke the lambda, which is often HTTP).
  765. FaaSTriggerKey = attribute.Key("faas.trigger")
  766. // FaaSExecutionKey is the attribute Key conforming to the "faas.execution"
  767. // semantic conventions. It represents the execution ID of the current
  768. // function execution.
  769. //
  770. // Type: string
  771. // RequirementLevel: Optional
  772. // Stability: stable
  773. // Examples: 'af9d5aa4-a685-4c5f-a22b-444f80b3cc28'
  774. FaaSExecutionKey = attribute.Key("faas.execution")
  775. )
  776. var (
  777. // A response to some data source operation such as a database or filesystem read/write
  778. FaaSTriggerDatasource = FaaSTriggerKey.String("datasource")
  779. // To provide an answer to an inbound HTTP request
  780. FaaSTriggerHTTP = FaaSTriggerKey.String("http")
  781. // A function is set to be executed when messages are sent to a messaging system
  782. FaaSTriggerPubsub = FaaSTriggerKey.String("pubsub")
  783. // A function is scheduled to be executed regularly
  784. FaaSTriggerTimer = FaaSTriggerKey.String("timer")
  785. // If none of the others apply
  786. FaaSTriggerOther = FaaSTriggerKey.String("other")
  787. )
  788. // FaaSExecution returns an attribute KeyValue conforming to the
  789. // "faas.execution" semantic conventions. It represents the execution ID of the
  790. // current function execution.
  791. func FaaSExecution(val string) attribute.KeyValue {
  792. return FaaSExecutionKey.String(val)
  793. }
  794. // Semantic Convention for FaaS triggered as a response to some data source
  795. // operation such as a database or filesystem read/write.
  796. const (
  797. // FaaSDocumentCollectionKey is the attribute Key conforming to the
  798. // "faas.document.collection" semantic conventions. It represents the name
  799. // of the source on which the triggering operation was performed. For
  800. // example, in Cloud Storage or S3 corresponds to the bucket name, and in
  801. // Cosmos DB to the database name.
  802. //
  803. // Type: string
  804. // RequirementLevel: Required
  805. // Stability: stable
  806. // Examples: 'myBucketName', 'myDBName'
  807. FaaSDocumentCollectionKey = attribute.Key("faas.document.collection")
  808. // FaaSDocumentOperationKey is the attribute Key conforming to the
  809. // "faas.document.operation" semantic conventions. It represents the
  810. // describes the type of the operation that was performed on the data.
  811. //
  812. // Type: Enum
  813. // RequirementLevel: Required
  814. // Stability: stable
  815. FaaSDocumentOperationKey = attribute.Key("faas.document.operation")
  816. // FaaSDocumentTimeKey is the attribute Key conforming to the
  817. // "faas.document.time" semantic conventions. It represents a string
  818. // containing the time when the data was accessed in the [ISO
  819. // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
  820. // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
  821. //
  822. // Type: string
  823. // RequirementLevel: Optional
  824. // Stability: stable
  825. // Examples: '2020-01-23T13:47:06Z'
  826. FaaSDocumentTimeKey = attribute.Key("faas.document.time")
  827. // FaaSDocumentNameKey is the attribute Key conforming to the
  828. // "faas.document.name" semantic conventions. It represents the document
  829. // name/table subjected to the operation. For example, in Cloud Storage or
  830. // S3 is the name of the file, and in Cosmos DB the table name.
  831. //
  832. // Type: string
  833. // RequirementLevel: Optional
  834. // Stability: stable
  835. // Examples: 'myFile.txt', 'myTableName'
  836. FaaSDocumentNameKey = attribute.Key("faas.document.name")
  837. )
  838. var (
  839. // When a new object is created
  840. FaaSDocumentOperationInsert = FaaSDocumentOperationKey.String("insert")
  841. // When an object is modified
  842. FaaSDocumentOperationEdit = FaaSDocumentOperationKey.String("edit")
  843. // When an object is deleted
  844. FaaSDocumentOperationDelete = FaaSDocumentOperationKey.String("delete")
  845. )
  846. // FaaSDocumentCollection returns an attribute KeyValue conforming to the
  847. // "faas.document.collection" semantic conventions. It represents the name of
  848. // the source on which the triggering operation was performed. For example, in
  849. // Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the
  850. // database name.
  851. func FaaSDocumentCollection(val string) attribute.KeyValue {
  852. return FaaSDocumentCollectionKey.String(val)
  853. }
  854. // FaaSDocumentTime returns an attribute KeyValue conforming to the
  855. // "faas.document.time" semantic conventions. It represents a string containing
  856. // the time when the data was accessed in the [ISO
  857. // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
  858. // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
  859. func FaaSDocumentTime(val string) attribute.KeyValue {
  860. return FaaSDocumentTimeKey.String(val)
  861. }
  862. // FaaSDocumentName returns an attribute KeyValue conforming to the
  863. // "faas.document.name" semantic conventions. It represents the document
  864. // name/table subjected to the operation. For example, in Cloud Storage or S3
  865. // is the name of the file, and in Cosmos DB the table name.
  866. func FaaSDocumentName(val string) attribute.KeyValue {
  867. return FaaSDocumentNameKey.String(val)
  868. }
  869. // Semantic Convention for FaaS scheduled to be executed regularly.
  870. const (
  871. // FaaSTimeKey is the attribute Key conforming to the "faas.time" semantic
  872. // conventions. It represents a string containing the function invocation
  873. // time in the [ISO
  874. // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
  875. // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
  876. //
  877. // Type: string
  878. // RequirementLevel: Optional
  879. // Stability: stable
  880. // Examples: '2020-01-23T13:47:06Z'
  881. FaaSTimeKey = attribute.Key("faas.time")
  882. // FaaSCronKey is the attribute Key conforming to the "faas.cron" semantic
  883. // conventions. It represents a string containing the schedule period as
  884. // [Cron
  885. // Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm).
  886. //
  887. // Type: string
  888. // RequirementLevel: Optional
  889. // Stability: stable
  890. // Examples: '0/5 * * * ? *'
  891. FaaSCronKey = attribute.Key("faas.cron")
  892. )
  893. // FaaSTime returns an attribute KeyValue conforming to the "faas.time"
  894. // semantic conventions. It represents a string containing the function
  895. // invocation time in the [ISO
  896. // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format
  897. // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).
  898. func FaaSTime(val string) attribute.KeyValue {
  899. return FaaSTimeKey.String(val)
  900. }
  901. // FaaSCron returns an attribute KeyValue conforming to the "faas.cron"
  902. // semantic conventions. It represents a string containing the schedule period
  903. // as [Cron
  904. // Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm).
  905. func FaaSCron(val string) attribute.KeyValue {
  906. return FaaSCronKey.String(val)
  907. }
  908. // Contains additional attributes for incoming FaaS spans.
  909. const (
  910. // FaaSColdstartKey is the attribute Key conforming to the "faas.coldstart"
  911. // semantic conventions. It represents a boolean that is true if the
  912. // serverless function is executed for the first time (aka cold-start).
  913. //
  914. // Type: boolean
  915. // RequirementLevel: Optional
  916. // Stability: stable
  917. FaaSColdstartKey = attribute.Key("faas.coldstart")
  918. )
  919. // FaaSColdstart returns an attribute KeyValue conforming to the
  920. // "faas.coldstart" semantic conventions. It represents a boolean that is true
  921. // if the serverless function is executed for the first time (aka cold-start).
  922. func FaaSColdstart(val bool) attribute.KeyValue {
  923. return FaaSColdstartKey.Bool(val)
  924. }
  925. // Contains additional attributes for outgoing FaaS spans.
  926. const (
  927. // FaaSInvokedNameKey is the attribute Key conforming to the
  928. // "faas.invoked_name" semantic conventions. It represents the name of the
  929. // invoked function.
  930. //
  931. // Type: string
  932. // RequirementLevel: Required
  933. // Stability: stable
  934. // Examples: 'my-function'
  935. // Note: SHOULD be equal to the `faas.name` resource attribute of the
  936. // invoked function.
  937. FaaSInvokedNameKey = attribute.Key("faas.invoked_name")
  938. // FaaSInvokedProviderKey is the attribute Key conforming to the
  939. // "faas.invoked_provider" semantic conventions. It represents the cloud
  940. // provider of the invoked function.
  941. //
  942. // Type: Enum
  943. // RequirementLevel: Required
  944. // Stability: stable
  945. // Note: SHOULD be equal to the `cloud.provider` resource attribute of the
  946. // invoked function.
  947. FaaSInvokedProviderKey = attribute.Key("faas.invoked_provider")
  948. // FaaSInvokedRegionKey is the attribute Key conforming to the
  949. // "faas.invoked_region" semantic conventions. It represents the cloud
  950. // region of the invoked function.
  951. //
  952. // Type: string
  953. // RequirementLevel: ConditionallyRequired (For some cloud providers, like
  954. // AWS or GCP, the region in which a function is hosted is essential to
  955. // uniquely identify the function and also part of its endpoint. Since it's
  956. // part of the endpoint being called, the region is always known to
  957. // clients. In these cases, `faas.invoked_region` MUST be set accordingly.
  958. // If the region is unknown to the client or not required for identifying
  959. // the invoked function, setting `faas.invoked_region` is optional.)
  960. // Stability: stable
  961. // Examples: 'eu-central-1'
  962. // Note: SHOULD be equal to the `cloud.region` resource attribute of the
  963. // invoked function.
  964. FaaSInvokedRegionKey = attribute.Key("faas.invoked_region")
  965. )
  966. var (
  967. // Alibaba Cloud
  968. FaaSInvokedProviderAlibabaCloud = FaaSInvokedProviderKey.String("alibaba_cloud")
  969. // Amazon Web Services
  970. FaaSInvokedProviderAWS = FaaSInvokedProviderKey.String("aws")
  971. // Microsoft Azure
  972. FaaSInvokedProviderAzure = FaaSInvokedProviderKey.String("azure")
  973. // Google Cloud Platform
  974. FaaSInvokedProviderGCP = FaaSInvokedProviderKey.String("gcp")
  975. // Tencent Cloud
  976. FaaSInvokedProviderTencentCloud = FaaSInvokedProviderKey.String("tencent_cloud")
  977. )
  978. // FaaSInvokedName returns an attribute KeyValue conforming to the
  979. // "faas.invoked_name" semantic conventions. It represents the name of the
  980. // invoked function.
  981. func FaaSInvokedName(val string) attribute.KeyValue {
  982. return FaaSInvokedNameKey.String(val)
  983. }
  984. // FaaSInvokedRegion returns an attribute KeyValue conforming to the
  985. // "faas.invoked_region" semantic conventions. It represents the cloud region
  986. // of the invoked function.
  987. func FaaSInvokedRegion(val string) attribute.KeyValue {
  988. return FaaSInvokedRegionKey.String(val)
  989. }
  990. // These attributes may be used for any network related operation.
  991. const (
  992. // NetTransportKey is the attribute Key conforming to the "net.transport"
  993. // semantic conventions. It represents the transport protocol used. See
  994. // note below.
  995. //
  996. // Type: Enum
  997. // RequirementLevel: Optional
  998. // Stability: stable
  999. NetTransportKey = attribute.Key("net.transport")
  1000. // NetAppProtocolNameKey is the attribute Key conforming to the
  1001. // "net.app.protocol.name" semantic conventions. It represents the
  1002. // application layer protocol used. The value SHOULD be normalized to
  1003. // lowercase.
  1004. //
  1005. // Type: string
  1006. // RequirementLevel: Optional
  1007. // Stability: stable
  1008. // Examples: 'amqp', 'http', 'mqtt'
  1009. NetAppProtocolNameKey = attribute.Key("net.app.protocol.name")
  1010. // NetAppProtocolVersionKey is the attribute Key conforming to the
  1011. // "net.app.protocol.version" semantic conventions. It represents the
  1012. // version of the application layer protocol used. See note below.
  1013. //
  1014. // Type: string
  1015. // RequirementLevel: Optional
  1016. // Stability: stable
  1017. // Examples: '3.1.1'
  1018. // Note: `net.app.protocol.version` refers to the version of the protocol
  1019. // used and might be different from the protocol client's version. If the
  1020. // HTTP client used has a version of `0.27.2`, but sends HTTP version
  1021. // `1.1`, this attribute should be set to `1.1`.
  1022. NetAppProtocolVersionKey = attribute.Key("net.app.protocol.version")
  1023. // NetSockPeerNameKey is the attribute Key conforming to the
  1024. // "net.sock.peer.name" semantic conventions. It represents the remote
  1025. // socket peer name.
  1026. //
  1027. // Type: string
  1028. // RequirementLevel: Recommended (If available and different from
  1029. // `net.peer.name` and if `net.sock.peer.addr` is set.)
  1030. // Stability: stable
  1031. // Examples: 'proxy.example.com'
  1032. NetSockPeerNameKey = attribute.Key("net.sock.peer.name")
  1033. // NetSockPeerAddrKey is the attribute Key conforming to the
  1034. // "net.sock.peer.addr" semantic conventions. It represents the remote
  1035. // socket peer address: IPv4 or IPv6 for internet protocols, path for local
  1036. // communication,
  1037. // [etc](https://man7.org/linux/man-pages/man7/address_families.7.html).
  1038. //
  1039. // Type: string
  1040. // RequirementLevel: Optional
  1041. // Stability: stable
  1042. // Examples: '127.0.0.1', '/tmp/mysql.sock'
  1043. NetSockPeerAddrKey = attribute.Key("net.sock.peer.addr")
  1044. // NetSockPeerPortKey is the attribute Key conforming to the
  1045. // "net.sock.peer.port" semantic conventions. It represents the remote
  1046. // socket peer port.
  1047. //
  1048. // Type: int
  1049. // RequirementLevel: Recommended (If defined for the address family and if
  1050. // different than `net.peer.port` and if `net.sock.peer.addr` is set.)
  1051. // Stability: stable
  1052. // Examples: 16456
  1053. NetSockPeerPortKey = attribute.Key("net.sock.peer.port")
  1054. // NetSockFamilyKey is the attribute Key conforming to the
  1055. // "net.sock.family" semantic conventions. It represents the protocol
  1056. // [address
  1057. // family](https://man7.org/linux/man-pages/man7/address_families.7.html)
  1058. // which is used for communication.
  1059. //
  1060. // Type: Enum
  1061. // RequirementLevel: ConditionallyRequired (If different than `inet` and if
  1062. // any of `net.sock.peer.addr` or `net.sock.host.addr` are set. Consumers
  1063. // of telemetry SHOULD accept both IPv4 and IPv6 formats for the address in
  1064. // `net.sock.peer.addr` if `net.sock.family` is not set. This is to support
  1065. // instrumentations that follow previous versions of this document.)
  1066. // Stability: stable
  1067. // Examples: 'inet6', 'bluetooth'
  1068. NetSockFamilyKey = attribute.Key("net.sock.family")
  1069. // NetPeerNameKey is the attribute Key conforming to the "net.peer.name"
  1070. // semantic conventions. It represents the logical remote hostname, see
  1071. // note below.
  1072. //
  1073. // Type: string
  1074. // RequirementLevel: Optional
  1075. // Stability: stable
  1076. // Examples: 'example.com'
  1077. // Note: `net.peer.name` SHOULD NOT be set if capturing it would require an
  1078. // extra DNS lookup.
  1079. NetPeerNameKey = attribute.Key("net.peer.name")
  1080. // NetPeerPortKey is the attribute Key conforming to the "net.peer.port"
  1081. // semantic conventions. It represents the logical remote port number
  1082. //
  1083. // Type: int
  1084. // RequirementLevel: Optional
  1085. // Stability: stable
  1086. // Examples: 80, 8080, 443
  1087. NetPeerPortKey = attribute.Key("net.peer.port")
  1088. // NetHostNameKey is the attribute Key conforming to the "net.host.name"
  1089. // semantic conventions. It represents the logical local hostname or
  1090. // similar, see note below.
  1091. //
  1092. // Type: string
  1093. // RequirementLevel: Optional
  1094. // Stability: stable
  1095. // Examples: 'localhost'
  1096. NetHostNameKey = attribute.Key("net.host.name")
  1097. // NetHostPortKey is the attribute Key conforming to the "net.host.port"
  1098. // semantic conventions. It represents the logical local port number,
  1099. // preferably the one that the peer used to connect
  1100. //
  1101. // Type: int
  1102. // RequirementLevel: Optional
  1103. // Stability: stable
  1104. // Examples: 8080
  1105. NetHostPortKey = attribute.Key("net.host.port")
  1106. // NetSockHostAddrKey is the attribute Key conforming to the
  1107. // "net.sock.host.addr" semantic conventions. It represents the local
  1108. // socket address. Useful in case of a multi-IP host.
  1109. //
  1110. // Type: string
  1111. // RequirementLevel: Optional
  1112. // Stability: stable
  1113. // Examples: '192.168.0.1'
  1114. NetSockHostAddrKey = attribute.Key("net.sock.host.addr")
  1115. // NetSockHostPortKey is the attribute Key conforming to the
  1116. // "net.sock.host.port" semantic conventions. It represents the local
  1117. // socket port number.
  1118. //
  1119. // Type: int
  1120. // RequirementLevel: Recommended (If defined for the address family and if
  1121. // different than `net.host.port` and if `net.sock.host.addr` is set.)
  1122. // Stability: stable
  1123. // Examples: 35555
  1124. NetSockHostPortKey = attribute.Key("net.sock.host.port")
  1125. // NetHostConnectionTypeKey is the attribute Key conforming to the
  1126. // "net.host.connection.type" semantic conventions. It represents the
  1127. // internet connection type currently being used by the host.
  1128. //
  1129. // Type: Enum
  1130. // RequirementLevel: Optional
  1131. // Stability: stable
  1132. // Examples: 'wifi'
  1133. NetHostConnectionTypeKey = attribute.Key("net.host.connection.type")
  1134. // NetHostConnectionSubtypeKey is the attribute Key conforming to the
  1135. // "net.host.connection.subtype" semantic conventions. It represents the
  1136. // this describes more details regarding the connection.type. It may be the
  1137. // type of cell technology connection, but it could be used for describing
  1138. // details about a wifi connection.
  1139. //
  1140. // Type: Enum
  1141. // RequirementLevel: Optional
  1142. // Stability: stable
  1143. // Examples: 'LTE'
  1144. NetHostConnectionSubtypeKey = attribute.Key("net.host.connection.subtype")
  1145. // NetHostCarrierNameKey is the attribute Key conforming to the
  1146. // "net.host.carrier.name" semantic conventions. It represents the name of
  1147. // the mobile carrier.
  1148. //
  1149. // Type: string
  1150. // RequirementLevel: Optional
  1151. // Stability: stable
  1152. // Examples: 'sprint'
  1153. NetHostCarrierNameKey = attribute.Key("net.host.carrier.name")
  1154. // NetHostCarrierMccKey is the attribute Key conforming to the
  1155. // "net.host.carrier.mcc" semantic conventions. It represents the mobile
  1156. // carrier country code.
  1157. //
  1158. // Type: string
  1159. // RequirementLevel: Optional
  1160. // Stability: stable
  1161. // Examples: '310'
  1162. NetHostCarrierMccKey = attribute.Key("net.host.carrier.mcc")
  1163. // NetHostCarrierMncKey is the attribute Key conforming to the
  1164. // "net.host.carrier.mnc" semantic conventions. It represents the mobile
  1165. // carrier network code.
  1166. //
  1167. // Type: string
  1168. // RequirementLevel: Optional
  1169. // Stability: stable
  1170. // Examples: '001'
  1171. NetHostCarrierMncKey = attribute.Key("net.host.carrier.mnc")
  1172. // NetHostCarrierIccKey is the attribute Key conforming to the
  1173. // "net.host.carrier.icc" semantic conventions. It represents the ISO
  1174. // 3166-1 alpha-2 2-character country code associated with the mobile
  1175. // carrier network.
  1176. //
  1177. // Type: string
  1178. // RequirementLevel: Optional
  1179. // Stability: stable
  1180. // Examples: 'DE'
  1181. NetHostCarrierIccKey = attribute.Key("net.host.carrier.icc")
  1182. )
  1183. var (
  1184. // ip_tcp
  1185. NetTransportTCP = NetTransportKey.String("ip_tcp")
  1186. // ip_udp
  1187. NetTransportUDP = NetTransportKey.String("ip_udp")
  1188. // Named or anonymous pipe. See note below
  1189. NetTransportPipe = NetTransportKey.String("pipe")
  1190. // In-process communication
  1191. NetTransportInProc = NetTransportKey.String("inproc")
  1192. // Something else (non IP-based)
  1193. NetTransportOther = NetTransportKey.String("other")
  1194. )
  1195. var (
  1196. // IPv4 address
  1197. NetSockFamilyInet = NetSockFamilyKey.String("inet")
  1198. // IPv6 address
  1199. NetSockFamilyInet6 = NetSockFamilyKey.String("inet6")
  1200. // Unix domain socket path
  1201. NetSockFamilyUnix = NetSockFamilyKey.String("unix")
  1202. )
  1203. var (
  1204. // wifi
  1205. NetHostConnectionTypeWifi = NetHostConnectionTypeKey.String("wifi")
  1206. // wired
  1207. NetHostConnectionTypeWired = NetHostConnectionTypeKey.String("wired")
  1208. // cell
  1209. NetHostConnectionTypeCell = NetHostConnectionTypeKey.String("cell")
  1210. // unavailable
  1211. NetHostConnectionTypeUnavailable = NetHostConnectionTypeKey.String("unavailable")
  1212. // unknown
  1213. NetHostConnectionTypeUnknown = NetHostConnectionTypeKey.String("unknown")
  1214. )
  1215. var (
  1216. // GPRS
  1217. NetHostConnectionSubtypeGprs = NetHostConnectionSubtypeKey.String("gprs")
  1218. // EDGE
  1219. NetHostConnectionSubtypeEdge = NetHostConnectionSubtypeKey.String("edge")
  1220. // UMTS
  1221. NetHostConnectionSubtypeUmts = NetHostConnectionSubtypeKey.String("umts")
  1222. // CDMA
  1223. NetHostConnectionSubtypeCdma = NetHostConnectionSubtypeKey.String("cdma")
  1224. // EVDO Rel. 0
  1225. NetHostConnectionSubtypeEvdo0 = NetHostConnectionSubtypeKey.String("evdo_0")
  1226. // EVDO Rev. A
  1227. NetHostConnectionSubtypeEvdoA = NetHostConnectionSubtypeKey.String("evdo_a")
  1228. // CDMA2000 1XRTT
  1229. NetHostConnectionSubtypeCdma20001xrtt = NetHostConnectionSubtypeKey.String("cdma2000_1xrtt")
  1230. // HSDPA
  1231. NetHostConnectionSubtypeHsdpa = NetHostConnectionSubtypeKey.String("hsdpa")
  1232. // HSUPA
  1233. NetHostConnectionSubtypeHsupa = NetHostConnectionSubtypeKey.String("hsupa")
  1234. // HSPA
  1235. NetHostConnectionSubtypeHspa = NetHostConnectionSubtypeKey.String("hspa")
  1236. // IDEN
  1237. NetHostConnectionSubtypeIden = NetHostConnectionSubtypeKey.String("iden")
  1238. // EVDO Rev. B
  1239. NetHostConnectionSubtypeEvdoB = NetHostConnectionSubtypeKey.String("evdo_b")
  1240. // LTE
  1241. NetHostConnectionSubtypeLte = NetHostConnectionSubtypeKey.String("lte")
  1242. // EHRPD
  1243. NetHostConnectionSubtypeEhrpd = NetHostConnectionSubtypeKey.String("ehrpd")
  1244. // HSPAP
  1245. NetHostConnectionSubtypeHspap = NetHostConnectionSubtypeKey.String("hspap")
  1246. // GSM
  1247. NetHostConnectionSubtypeGsm = NetHostConnectionSubtypeKey.String("gsm")
  1248. // TD-SCDMA
  1249. NetHostConnectionSubtypeTdScdma = NetHostConnectionSubtypeKey.String("td_scdma")
  1250. // IWLAN
  1251. NetHostConnectionSubtypeIwlan = NetHostConnectionSubtypeKey.String("iwlan")
  1252. // 5G NR (New Radio)
  1253. NetHostConnectionSubtypeNr = NetHostConnectionSubtypeKey.String("nr")
  1254. // 5G NRNSA (New Radio Non-Standalone)
  1255. NetHostConnectionSubtypeNrnsa = NetHostConnectionSubtypeKey.String("nrnsa")
  1256. // LTE CA
  1257. NetHostConnectionSubtypeLteCa = NetHostConnectionSubtypeKey.String("lte_ca")
  1258. )
  1259. // NetAppProtocolName returns an attribute KeyValue conforming to the
  1260. // "net.app.protocol.name" semantic conventions. It represents the application
  1261. // layer protocol used. The value SHOULD be normalized to lowercase.
  1262. func NetAppProtocolName(val string) attribute.KeyValue {
  1263. return NetAppProtocolNameKey.String(val)
  1264. }
  1265. // NetAppProtocolVersion returns an attribute KeyValue conforming to the
  1266. // "net.app.protocol.version" semantic conventions. It represents the version
  1267. // of the application layer protocol used. See note below.
  1268. func NetAppProtocolVersion(val string) attribute.KeyValue {
  1269. return NetAppProtocolVersionKey.String(val)
  1270. }
  1271. // NetSockPeerName returns an attribute KeyValue conforming to the
  1272. // "net.sock.peer.name" semantic conventions. It represents the remote socket
  1273. // peer name.
  1274. func NetSockPeerName(val string) attribute.KeyValue {
  1275. return NetSockPeerNameKey.String(val)
  1276. }
  1277. // NetSockPeerAddr returns an attribute KeyValue conforming to the
  1278. // "net.sock.peer.addr" semantic conventions. It represents the remote socket
  1279. // peer address: IPv4 or IPv6 for internet protocols, path for local
  1280. // communication,
  1281. // [etc](https://man7.org/linux/man-pages/man7/address_families.7.html).
  1282. func NetSockPeerAddr(val string) attribute.KeyValue {
  1283. return NetSockPeerAddrKey.String(val)
  1284. }
  1285. // NetSockPeerPort returns an attribute KeyValue conforming to the
  1286. // "net.sock.peer.port" semantic conventions. It represents the remote socket
  1287. // peer port.
  1288. func NetSockPeerPort(val int) attribute.KeyValue {
  1289. return NetSockPeerPortKey.Int(val)
  1290. }
  1291. // NetPeerName returns an attribute KeyValue conforming to the
  1292. // "net.peer.name" semantic conventions. It represents the logical remote
  1293. // hostname, see note below.
  1294. func NetPeerName(val string) attribute.KeyValue {
  1295. return NetPeerNameKey.String(val)
  1296. }
  1297. // NetPeerPort returns an attribute KeyValue conforming to the
  1298. // "net.peer.port" semantic conventions. It represents the logical remote port
  1299. // number
  1300. func NetPeerPort(val int) attribute.KeyValue {
  1301. return NetPeerPortKey.Int(val)
  1302. }
  1303. // NetHostName returns an attribute KeyValue conforming to the
  1304. // "net.host.name" semantic conventions. It represents the logical local
  1305. // hostname or similar, see note below.
  1306. func NetHostName(val string) attribute.KeyValue {
  1307. return NetHostNameKey.String(val)
  1308. }
  1309. // NetHostPort returns an attribute KeyValue conforming to the
  1310. // "net.host.port" semantic conventions. It represents the logical local port
  1311. // number, preferably the one that the peer used to connect
  1312. func NetHostPort(val int) attribute.KeyValue {
  1313. return NetHostPortKey.Int(val)
  1314. }
  1315. // NetSockHostAddr returns an attribute KeyValue conforming to the
  1316. // "net.sock.host.addr" semantic conventions. It represents the local socket
  1317. // address. Useful in case of a multi-IP host.
  1318. func NetSockHostAddr(val string) attribute.KeyValue {
  1319. return NetSockHostAddrKey.String(val)
  1320. }
  1321. // NetSockHostPort returns an attribute KeyValue conforming to the
  1322. // "net.sock.host.port" semantic conventions. It represents the local socket
  1323. // port number.
  1324. func NetSockHostPort(val int) attribute.KeyValue {
  1325. return NetSockHostPortKey.Int(val)
  1326. }
  1327. // NetHostCarrierName returns an attribute KeyValue conforming to the
  1328. // "net.host.carrier.name" semantic conventions. It represents the name of the
  1329. // mobile carrier.
  1330. func NetHostCarrierName(val string) attribute.KeyValue {
  1331. return NetHostCarrierNameKey.String(val)
  1332. }
  1333. // NetHostCarrierMcc returns an attribute KeyValue conforming to the
  1334. // "net.host.carrier.mcc" semantic conventions. It represents the mobile
  1335. // carrier country code.
  1336. func NetHostCarrierMcc(val string) attribute.KeyValue {
  1337. return NetHostCarrierMccKey.String(val)
  1338. }
  1339. // NetHostCarrierMnc returns an attribute KeyValue conforming to the
  1340. // "net.host.carrier.mnc" semantic conventions. It represents the mobile
  1341. // carrier network code.
  1342. func NetHostCarrierMnc(val string) attribute.KeyValue {
  1343. return NetHostCarrierMncKey.String(val)
  1344. }
  1345. // NetHostCarrierIcc returns an attribute KeyValue conforming to the
  1346. // "net.host.carrier.icc" semantic conventions. It represents the ISO 3166-1
  1347. // alpha-2 2-character country code associated with the mobile carrier network.
  1348. func NetHostCarrierIcc(val string) attribute.KeyValue {
  1349. return NetHostCarrierIccKey.String(val)
  1350. }
  1351. // Operations that access some remote service.
  1352. const (
  1353. // PeerServiceKey is the attribute Key conforming to the "peer.service"
  1354. // semantic conventions. It represents the
  1355. // [`service.name`](../../resource/semantic_conventions/README.md#service)
  1356. // of the remote service. SHOULD be equal to the actual `service.name`
  1357. // resource attribute of the remote service if any.
  1358. //
  1359. // Type: string
  1360. // RequirementLevel: Optional
  1361. // Stability: stable
  1362. // Examples: 'AuthTokenCache'
  1363. PeerServiceKey = attribute.Key("peer.service")
  1364. )
  1365. // PeerService returns an attribute KeyValue conforming to the
  1366. // "peer.service" semantic conventions. It represents the
  1367. // [`service.name`](../../resource/semantic_conventions/README.md#service) of
  1368. // the remote service. SHOULD be equal to the actual `service.name` resource
  1369. // attribute of the remote service if any.
  1370. func PeerService(val string) attribute.KeyValue {
  1371. return PeerServiceKey.String(val)
  1372. }
  1373. // These attributes may be used for any operation with an authenticated and/or
  1374. // authorized enduser.
  1375. const (
  1376. // EnduserIDKey is the attribute Key conforming to the "enduser.id"
  1377. // semantic conventions. It represents the username or client_id extracted
  1378. // from the access token or
  1379. // [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header
  1380. // in the inbound request from outside the system.
  1381. //
  1382. // Type: string
  1383. // RequirementLevel: Optional
  1384. // Stability: stable
  1385. // Examples: 'username'
  1386. EnduserIDKey = attribute.Key("enduser.id")
  1387. // EnduserRoleKey is the attribute Key conforming to the "enduser.role"
  1388. // semantic conventions. It represents the actual/assumed role the client
  1389. // is making the request under extracted from token or application security
  1390. // context.
  1391. //
  1392. // Type: string
  1393. // RequirementLevel: Optional
  1394. // Stability: stable
  1395. // Examples: 'admin'
  1396. EnduserRoleKey = attribute.Key("enduser.role")
  1397. // EnduserScopeKey is the attribute Key conforming to the "enduser.scope"
  1398. // semantic conventions. It represents the scopes or granted authorities
  1399. // the client currently possesses extracted from token or application
  1400. // security context. The value would come from the scope associated with an
  1401. // [OAuth 2.0 Access
  1402. // Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute
  1403. // value in a [SAML 2.0
  1404. // Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html).
  1405. //
  1406. // Type: string
  1407. // RequirementLevel: Optional
  1408. // Stability: stable
  1409. // Examples: 'read:message, write:files'
  1410. EnduserScopeKey = attribute.Key("enduser.scope")
  1411. )
  1412. // EnduserID returns an attribute KeyValue conforming to the "enduser.id"
  1413. // semantic conventions. It represents the username or client_id extracted from
  1414. // the access token or
  1415. // [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in
  1416. // the inbound request from outside the system.
  1417. func EnduserID(val string) attribute.KeyValue {
  1418. return EnduserIDKey.String(val)
  1419. }
  1420. // EnduserRole returns an attribute KeyValue conforming to the
  1421. // "enduser.role" semantic conventions. It represents the actual/assumed role
  1422. // the client is making the request under extracted from token or application
  1423. // security context.
  1424. func EnduserRole(val string) attribute.KeyValue {
  1425. return EnduserRoleKey.String(val)
  1426. }
  1427. // EnduserScope returns an attribute KeyValue conforming to the
  1428. // "enduser.scope" semantic conventions. It represents the scopes or granted
  1429. // authorities the client currently possesses extracted from token or
  1430. // application security context. The value would come from the scope associated
  1431. // with an [OAuth 2.0 Access
  1432. // Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute
  1433. // value in a [SAML 2.0
  1434. // Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html).
  1435. func EnduserScope(val string) attribute.KeyValue {
  1436. return EnduserScopeKey.String(val)
  1437. }
  1438. // These attributes may be used for any operation to store information about a
  1439. // thread that started a span.
  1440. const (
  1441. // ThreadIDKey is the attribute Key conforming to the "thread.id" semantic
  1442. // conventions. It represents the current "managed" thread ID (as opposed
  1443. // to OS thread ID).
  1444. //
  1445. // Type: int
  1446. // RequirementLevel: Optional
  1447. // Stability: stable
  1448. // Examples: 42
  1449. ThreadIDKey = attribute.Key("thread.id")
  1450. // ThreadNameKey is the attribute Key conforming to the "thread.name"
  1451. // semantic conventions. It represents the current thread name.
  1452. //
  1453. // Type: string
  1454. // RequirementLevel: Optional
  1455. // Stability: stable
  1456. // Examples: 'main'
  1457. ThreadNameKey = attribute.Key("thread.name")
  1458. )
  1459. // ThreadID returns an attribute KeyValue conforming to the "thread.id"
  1460. // semantic conventions. It represents the current "managed" thread ID (as
  1461. // opposed to OS thread ID).
  1462. func ThreadID(val int) attribute.KeyValue {
  1463. return ThreadIDKey.Int(val)
  1464. }
  1465. // ThreadName returns an attribute KeyValue conforming to the "thread.name"
  1466. // semantic conventions. It represents the current thread name.
  1467. func ThreadName(val string) attribute.KeyValue {
  1468. return ThreadNameKey.String(val)
  1469. }
  1470. // These attributes allow to report this unit of code and therefore to provide
  1471. // more context about the span.
  1472. const (
  1473. // CodeFunctionKey is the attribute Key conforming to the "code.function"
  1474. // semantic conventions. It represents the method or function name, or
  1475. // equivalent (usually rightmost part of the code unit's name).
  1476. //
  1477. // Type: string
  1478. // RequirementLevel: Optional
  1479. // Stability: stable
  1480. // Examples: 'serveRequest'
  1481. CodeFunctionKey = attribute.Key("code.function")
  1482. // CodeNamespaceKey is the attribute Key conforming to the "code.namespace"
  1483. // semantic conventions. It represents the "namespace" within which
  1484. // `code.function` is defined. Usually the qualified class or module name,
  1485. // such that `code.namespace` + some separator + `code.function` form a
  1486. // unique identifier for the code unit.
  1487. //
  1488. // Type: string
  1489. // RequirementLevel: Optional
  1490. // Stability: stable
  1491. // Examples: 'com.example.MyHTTPService'
  1492. CodeNamespaceKey = attribute.Key("code.namespace")
  1493. // CodeFilepathKey is the attribute Key conforming to the "code.filepath"
  1494. // semantic conventions. It represents the source code file name that
  1495. // identifies the code unit as uniquely as possible (preferably an absolute
  1496. // file path).
  1497. //
  1498. // Type: string
  1499. // RequirementLevel: Optional
  1500. // Stability: stable
  1501. // Examples: '/usr/local/MyApplication/content_root/app/index.php'
  1502. CodeFilepathKey = attribute.Key("code.filepath")
  1503. // CodeLineNumberKey is the attribute Key conforming to the "code.lineno"
  1504. // semantic conventions. It represents the line number in `code.filepath`
  1505. // best representing the operation. It SHOULD point within the code unit
  1506. // named in `code.function`.
  1507. //
  1508. // Type: int
  1509. // RequirementLevel: Optional
  1510. // Stability: stable
  1511. // Examples: 42
  1512. CodeLineNumberKey = attribute.Key("code.lineno")
  1513. // CodeColumnKey is the attribute Key conforming to the "code.column"
  1514. // semantic conventions. It represents the column number in `code.filepath`
  1515. // best representing the operation. It SHOULD point within the code unit
  1516. // named in `code.function`.
  1517. //
  1518. // Type: int
  1519. // RequirementLevel: Optional
  1520. // Stability: stable
  1521. // Examples: 16
  1522. CodeColumnKey = attribute.Key("code.column")
  1523. )
  1524. // CodeFunction returns an attribute KeyValue conforming to the
  1525. // "code.function" semantic conventions. It represents the method or function
  1526. // name, or equivalent (usually rightmost part of the code unit's name).
  1527. func CodeFunction(val string) attribute.KeyValue {
  1528. return CodeFunctionKey.String(val)
  1529. }
  1530. // CodeNamespace returns an attribute KeyValue conforming to the
  1531. // "code.namespace" semantic conventions. It represents the "namespace" within
  1532. // which `code.function` is defined. Usually the qualified class or module
  1533. // name, such that `code.namespace` + some separator + `code.function` form a
  1534. // unique identifier for the code unit.
  1535. func CodeNamespace(val string) attribute.KeyValue {
  1536. return CodeNamespaceKey.String(val)
  1537. }
  1538. // CodeFilepath returns an attribute KeyValue conforming to the
  1539. // "code.filepath" semantic conventions. It represents the source code file
  1540. // name that identifies the code unit as uniquely as possible (preferably an
  1541. // absolute file path).
  1542. func CodeFilepath(val string) attribute.KeyValue {
  1543. return CodeFilepathKey.String(val)
  1544. }
  1545. // CodeLineNumber returns an attribute KeyValue conforming to the "code.lineno"
  1546. // semantic conventions. It represents the line number in `code.filepath` best
  1547. // representing the operation. It SHOULD point within the code unit named in
  1548. // `code.function`.
  1549. func CodeLineNumber(val int) attribute.KeyValue {
  1550. return CodeLineNumberKey.Int(val)
  1551. }
  1552. // CodeColumn returns an attribute KeyValue conforming to the "code.column"
  1553. // semantic conventions. It represents the column number in `code.filepath`
  1554. // best representing the operation. It SHOULD point within the code unit named
  1555. // in `code.function`.
  1556. func CodeColumn(val int) attribute.KeyValue {
  1557. return CodeColumnKey.Int(val)
  1558. }
  1559. // Semantic conventions for HTTP client and server Spans.
  1560. const (
  1561. // HTTPMethodKey is the attribute Key conforming to the "http.method"
  1562. // semantic conventions. It represents the hTTP request method.
  1563. //
  1564. // Type: string
  1565. // RequirementLevel: Required
  1566. // Stability: stable
  1567. // Examples: 'GET', 'POST', 'HEAD'
  1568. HTTPMethodKey = attribute.Key("http.method")
  1569. // HTTPStatusCodeKey is the attribute Key conforming to the
  1570. // "http.status_code" semantic conventions. It represents the [HTTP
  1571. // response status code](https://tools.ietf.org/html/rfc7231#section-6).
  1572. //
  1573. // Type: int
  1574. // RequirementLevel: ConditionallyRequired (If and only if one was
  1575. // received/sent.)
  1576. // Stability: stable
  1577. // Examples: 200
  1578. HTTPStatusCodeKey = attribute.Key("http.status_code")
  1579. // HTTPFlavorKey is the attribute Key conforming to the "http.flavor"
  1580. // semantic conventions. It represents the kind of HTTP protocol used.
  1581. //
  1582. // Type: Enum
  1583. // RequirementLevel: Optional
  1584. // Stability: stable
  1585. // Note: If `net.transport` is not specified, it can be assumed to be
  1586. // `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is
  1587. // assumed.
  1588. HTTPFlavorKey = attribute.Key("http.flavor")
  1589. // HTTPUserAgentKey is the attribute Key conforming to the
  1590. // "http.user_agent" semantic conventions. It represents the value of the
  1591. // [HTTP
  1592. // User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent)
  1593. // header sent by the client.
  1594. //
  1595. // Type: string
  1596. // RequirementLevel: Optional
  1597. // Stability: stable
  1598. // Examples: 'CERN-LineMode/2.15 libwww/2.17b3'
  1599. HTTPUserAgentKey = attribute.Key("http.user_agent")
  1600. // HTTPRequestContentLengthKey is the attribute Key conforming to the
  1601. // "http.request_content_length" semantic conventions. It represents the
  1602. // size of the request payload body in bytes. This is the number of bytes
  1603. // transferred excluding headers and is often, but not always, present as
  1604. // the
  1605. // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
  1606. // header. For requests using transport encoding, this should be the
  1607. // compressed size.
  1608. //
  1609. // Type: int
  1610. // RequirementLevel: Optional
  1611. // Stability: stable
  1612. // Examples: 3495
  1613. HTTPRequestContentLengthKey = attribute.Key("http.request_content_length")
  1614. // HTTPResponseContentLengthKey is the attribute Key conforming to the
  1615. // "http.response_content_length" semantic conventions. It represents the
  1616. // size of the response payload body in bytes. This is the number of bytes
  1617. // transferred excluding headers and is often, but not always, present as
  1618. // the
  1619. // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
  1620. // header. For requests using transport encoding, this should be the
  1621. // compressed size.
  1622. //
  1623. // Type: int
  1624. // RequirementLevel: Optional
  1625. // Stability: stable
  1626. // Examples: 3495
  1627. HTTPResponseContentLengthKey = attribute.Key("http.response_content_length")
  1628. )
  1629. var (
  1630. // HTTP/1.0
  1631. HTTPFlavorHTTP10 = HTTPFlavorKey.String("1.0")
  1632. // HTTP/1.1
  1633. HTTPFlavorHTTP11 = HTTPFlavorKey.String("1.1")
  1634. // HTTP/2
  1635. HTTPFlavorHTTP20 = HTTPFlavorKey.String("2.0")
  1636. // HTTP/3
  1637. HTTPFlavorHTTP30 = HTTPFlavorKey.String("3.0")
  1638. // SPDY protocol
  1639. HTTPFlavorSPDY = HTTPFlavorKey.String("SPDY")
  1640. // QUIC protocol
  1641. HTTPFlavorQUIC = HTTPFlavorKey.String("QUIC")
  1642. )
  1643. // HTTPMethod returns an attribute KeyValue conforming to the "http.method"
  1644. // semantic conventions. It represents the hTTP request method.
  1645. func HTTPMethod(val string) attribute.KeyValue {
  1646. return HTTPMethodKey.String(val)
  1647. }
  1648. // HTTPStatusCode returns an attribute KeyValue conforming to the
  1649. // "http.status_code" semantic conventions. It represents the [HTTP response
  1650. // status code](https://tools.ietf.org/html/rfc7231#section-6).
  1651. func HTTPStatusCode(val int) attribute.KeyValue {
  1652. return HTTPStatusCodeKey.Int(val)
  1653. }
  1654. // HTTPUserAgent returns an attribute KeyValue conforming to the
  1655. // "http.user_agent" semantic conventions. It represents the value of the [HTTP
  1656. // User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent)
  1657. // header sent by the client.
  1658. func HTTPUserAgent(val string) attribute.KeyValue {
  1659. return HTTPUserAgentKey.String(val)
  1660. }
  1661. // HTTPRequestContentLength returns an attribute KeyValue conforming to the
  1662. // "http.request_content_length" semantic conventions. It represents the size
  1663. // of the request payload body in bytes. This is the number of bytes
  1664. // transferred excluding headers and is often, but not always, present as the
  1665. // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
  1666. // header. For requests using transport encoding, this should be the compressed
  1667. // size.
  1668. func HTTPRequestContentLength(val int) attribute.KeyValue {
  1669. return HTTPRequestContentLengthKey.Int(val)
  1670. }
  1671. // HTTPResponseContentLength returns an attribute KeyValue conforming to the
  1672. // "http.response_content_length" semantic conventions. It represents the size
  1673. // of the response payload body in bytes. This is the number of bytes
  1674. // transferred excluding headers and is often, but not always, present as the
  1675. // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
  1676. // header. For requests using transport encoding, this should be the compressed
  1677. // size.
  1678. func HTTPResponseContentLength(val int) attribute.KeyValue {
  1679. return HTTPResponseContentLengthKey.Int(val)
  1680. }
  1681. // Semantic Convention for HTTP Client
  1682. const (
  1683. // HTTPURLKey is the attribute Key conforming to the "http.url" semantic
  1684. // conventions. It represents the full HTTP request URL in the form
  1685. // `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is
  1686. // not transmitted over HTTP, but if it is known, it should be included
  1687. // nevertheless.
  1688. //
  1689. // Type: string
  1690. // RequirementLevel: Required
  1691. // Stability: stable
  1692. // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv'
  1693. // Note: `http.url` MUST NOT contain credentials passed via URL in form of
  1694. // `https://username:[email protected]/`. In such case the
  1695. // attribute's value should be `https://www.example.com/`.
  1696. HTTPURLKey = attribute.Key("http.url")
  1697. // HTTPResendCountKey is the attribute Key conforming to the
  1698. // "http.resend_count" semantic conventions. It represents the ordinal
  1699. // number of request resending attempt (for any reason, including
  1700. // redirects).
  1701. //
  1702. // Type: int
  1703. // RequirementLevel: Recommended (if and only if request was retried.)
  1704. // Stability: stable
  1705. // Examples: 3
  1706. // Note: The resend count SHOULD be updated each time an HTTP request gets
  1707. // resent by the client, regardless of what was the cause of the resending
  1708. // (e.g. redirection, authorization failure, 503 Server Unavailable,
  1709. // network issues, or any other).
  1710. HTTPResendCountKey = attribute.Key("http.resend_count")
  1711. )
  1712. // HTTPURL returns an attribute KeyValue conforming to the "http.url"
  1713. // semantic conventions. It represents the full HTTP request URL in the form
  1714. // `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not
  1715. // transmitted over HTTP, but if it is known, it should be included
  1716. // nevertheless.
  1717. func HTTPURL(val string) attribute.KeyValue {
  1718. return HTTPURLKey.String(val)
  1719. }
  1720. // HTTPResendCount returns an attribute KeyValue conforming to the
  1721. // "http.resend_count" semantic conventions. It represents the ordinal number
  1722. // of request resending attempt (for any reason, including redirects).
  1723. func HTTPResendCount(val int) attribute.KeyValue {
  1724. return HTTPResendCountKey.Int(val)
  1725. }
  1726. // Semantic Convention for HTTP Server
  1727. const (
  1728. // HTTPSchemeKey is the attribute Key conforming to the "http.scheme"
  1729. // semantic conventions. It represents the URI scheme identifying the used
  1730. // protocol.
  1731. //
  1732. // Type: string
  1733. // RequirementLevel: Required
  1734. // Stability: stable
  1735. // Examples: 'http', 'https'
  1736. HTTPSchemeKey = attribute.Key("http.scheme")
  1737. // HTTPTargetKey is the attribute Key conforming to the "http.target"
  1738. // semantic conventions. It represents the full request target as passed in
  1739. // a HTTP request line or equivalent.
  1740. //
  1741. // Type: string
  1742. // RequirementLevel: Required
  1743. // Stability: stable
  1744. // Examples: '/path/12314/?q=ddds'
  1745. HTTPTargetKey = attribute.Key("http.target")
  1746. // HTTPRouteKey is the attribute Key conforming to the "http.route"
  1747. // semantic conventions. It represents the matched route (path template in
  1748. // the format used by the respective server framework). See note below
  1749. //
  1750. // Type: string
  1751. // RequirementLevel: ConditionallyRequired (If and only if it's available)
  1752. // Stability: stable
  1753. // Examples: '/users/:userID?', '{controller}/{action}/{id?}'
  1754. // Note: MUST NOT be populated when this is not supported by the HTTP
  1755. // server framework as the route attribute should have low-cardinality and
  1756. // the URI path can NOT substitute it.
  1757. // SHOULD include the [application root](#http-server-definitions) if there
  1758. // is one.
  1759. HTTPRouteKey = attribute.Key("http.route")
  1760. // HTTPClientIPKey is the attribute Key conforming to the "http.client_ip"
  1761. // semantic conventions. It represents the IP address of the original
  1762. // client behind all proxies, if known (e.g. from
  1763. // [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)).
  1764. //
  1765. // Type: string
  1766. // RequirementLevel: Optional
  1767. // Stability: stable
  1768. // Examples: '83.164.160.102'
  1769. // Note: This is not necessarily the same as `net.sock.peer.addr`, which
  1770. // would
  1771. // identify the network-level peer, which may be a proxy.
  1772. //
  1773. // This attribute should be set when a source of information different
  1774. // from the one used for `net.sock.peer.addr`, is available even if that
  1775. // other
  1776. // source just confirms the same value as `net.sock.peer.addr`.
  1777. // Rationale: For `net.sock.peer.addr`, one typically does not know if it
  1778. // comes from a proxy, reverse proxy, or the actual client. Setting
  1779. // `http.client_ip` when it's the same as `net.sock.peer.addr` means that
  1780. // one is at least somewhat confident that the address is not that of
  1781. // the closest proxy.
  1782. HTTPClientIPKey = attribute.Key("http.client_ip")
  1783. )
  1784. // HTTPScheme returns an attribute KeyValue conforming to the "http.scheme"
  1785. // semantic conventions. It represents the URI scheme identifying the used
  1786. // protocol.
  1787. func HTTPScheme(val string) attribute.KeyValue {
  1788. return HTTPSchemeKey.String(val)
  1789. }
  1790. // HTTPTarget returns an attribute KeyValue conforming to the "http.target"
  1791. // semantic conventions. It represents the full request target as passed in a
  1792. // HTTP request line or equivalent.
  1793. func HTTPTarget(val string) attribute.KeyValue {
  1794. return HTTPTargetKey.String(val)
  1795. }
  1796. // HTTPRoute returns an attribute KeyValue conforming to the "http.route"
  1797. // semantic conventions. It represents the matched route (path template in the
  1798. // format used by the respective server framework). See note below
  1799. func HTTPRoute(val string) attribute.KeyValue {
  1800. return HTTPRouteKey.String(val)
  1801. }
  1802. // HTTPClientIP returns an attribute KeyValue conforming to the
  1803. // "http.client_ip" semantic conventions. It represents the IP address of the
  1804. // original client behind all proxies, if known (e.g. from
  1805. // [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)).
  1806. func HTTPClientIP(val string) attribute.KeyValue {
  1807. return HTTPClientIPKey.String(val)
  1808. }
  1809. // Attributes that exist for multiple DynamoDB request types.
  1810. const (
  1811. // AWSDynamoDBTableNamesKey is the attribute Key conforming to the
  1812. // "aws.dynamodb.table_names" semantic conventions. It represents the keys
  1813. // in the `RequestItems` object field.
  1814. //
  1815. // Type: string[]
  1816. // RequirementLevel: Optional
  1817. // Stability: stable
  1818. // Examples: 'Users', 'Cats'
  1819. AWSDynamoDBTableNamesKey = attribute.Key("aws.dynamodb.table_names")
  1820. // AWSDynamoDBConsumedCapacityKey is the attribute Key conforming to the
  1821. // "aws.dynamodb.consumed_capacity" semantic conventions. It represents the
  1822. // JSON-serialized value of each item in the `ConsumedCapacity` response
  1823. // field.
  1824. //
  1825. // Type: string[]
  1826. // RequirementLevel: Optional
  1827. // Stability: stable
  1828. // Examples: '{ "CapacityUnits": number, "GlobalSecondaryIndexes": {
  1829. // "string" : { "CapacityUnits": number, "ReadCapacityUnits": number,
  1830. // "WriteCapacityUnits": number } }, "LocalSecondaryIndexes": { "string" :
  1831. // { "CapacityUnits": number, "ReadCapacityUnits": number,
  1832. // "WriteCapacityUnits": number } }, "ReadCapacityUnits": number, "Table":
  1833. // { "CapacityUnits": number, "ReadCapacityUnits": number,
  1834. // "WriteCapacityUnits": number }, "TableName": "string",
  1835. // "WriteCapacityUnits": number }'
  1836. AWSDynamoDBConsumedCapacityKey = attribute.Key("aws.dynamodb.consumed_capacity")
  1837. // AWSDynamoDBItemCollectionMetricsKey is the attribute Key conforming to
  1838. // the "aws.dynamodb.item_collection_metrics" semantic conventions. It
  1839. // represents the JSON-serialized value of the `ItemCollectionMetrics`
  1840. // response field.
  1841. //
  1842. // Type: string
  1843. // RequirementLevel: Optional
  1844. // Stability: stable
  1845. // Examples: '{ "string" : [ { "ItemCollectionKey": { "string" : { "B":
  1846. // blob, "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": {
  1847. // "string" : "AttributeValue" }, "N": "string", "NS": [ "string" ],
  1848. // "NULL": boolean, "S": "string", "SS": [ "string" ] } },
  1849. // "SizeEstimateRangeGB": [ number ] } ] }'
  1850. AWSDynamoDBItemCollectionMetricsKey = attribute.Key("aws.dynamodb.item_collection_metrics")
  1851. // AWSDynamoDBProvisionedReadCapacityKey is the attribute Key conforming to
  1852. // the "aws.dynamodb.provisioned_read_capacity" semantic conventions. It
  1853. // represents the value of the `ProvisionedThroughput.ReadCapacityUnits`
  1854. // request parameter.
  1855. //
  1856. // Type: double
  1857. // RequirementLevel: Optional
  1858. // Stability: stable
  1859. // Examples: 1.0, 2.0
  1860. AWSDynamoDBProvisionedReadCapacityKey = attribute.Key("aws.dynamodb.provisioned_read_capacity")
  1861. // AWSDynamoDBProvisionedWriteCapacityKey is the attribute Key conforming
  1862. // to the "aws.dynamodb.provisioned_write_capacity" semantic conventions.
  1863. // It represents the value of the
  1864. // `ProvisionedThroughput.WriteCapacityUnits` request parameter.
  1865. //
  1866. // Type: double
  1867. // RequirementLevel: Optional
  1868. // Stability: stable
  1869. // Examples: 1.0, 2.0
  1870. AWSDynamoDBProvisionedWriteCapacityKey = attribute.Key("aws.dynamodb.provisioned_write_capacity")
  1871. // AWSDynamoDBConsistentReadKey is the attribute Key conforming to the
  1872. // "aws.dynamodb.consistent_read" semantic conventions. It represents the
  1873. // value of the `ConsistentRead` request parameter.
  1874. //
  1875. // Type: boolean
  1876. // RequirementLevel: Optional
  1877. // Stability: stable
  1878. AWSDynamoDBConsistentReadKey = attribute.Key("aws.dynamodb.consistent_read")
  1879. // AWSDynamoDBProjectionKey is the attribute Key conforming to the
  1880. // "aws.dynamodb.projection" semantic conventions. It represents the value
  1881. // of the `ProjectionExpression` request parameter.
  1882. //
  1883. // Type: string
  1884. // RequirementLevel: Optional
  1885. // Stability: stable
  1886. // Examples: 'Title', 'Title, Price, Color', 'Title, Description,
  1887. // RelatedItems, ProductReviews'
  1888. AWSDynamoDBProjectionKey = attribute.Key("aws.dynamodb.projection")
  1889. // AWSDynamoDBLimitKey is the attribute Key conforming to the
  1890. // "aws.dynamodb.limit" semantic conventions. It represents the value of
  1891. // the `Limit` request parameter.
  1892. //
  1893. // Type: int
  1894. // RequirementLevel: Optional
  1895. // Stability: stable
  1896. // Examples: 10
  1897. AWSDynamoDBLimitKey = attribute.Key("aws.dynamodb.limit")
  1898. // AWSDynamoDBAttributesToGetKey is the attribute Key conforming to the
  1899. // "aws.dynamodb.attributes_to_get" semantic conventions. It represents the
  1900. // value of the `AttributesToGet` request parameter.
  1901. //
  1902. // Type: string[]
  1903. // RequirementLevel: Optional
  1904. // Stability: stable
  1905. // Examples: 'lives', 'id'
  1906. AWSDynamoDBAttributesToGetKey = attribute.Key("aws.dynamodb.attributes_to_get")
  1907. // AWSDynamoDBIndexNameKey is the attribute Key conforming to the
  1908. // "aws.dynamodb.index_name" semantic conventions. It represents the value
  1909. // of the `IndexName` request parameter.
  1910. //
  1911. // Type: string
  1912. // RequirementLevel: Optional
  1913. // Stability: stable
  1914. // Examples: 'name_to_group'
  1915. AWSDynamoDBIndexNameKey = attribute.Key("aws.dynamodb.index_name")
  1916. // AWSDynamoDBSelectKey is the attribute Key conforming to the
  1917. // "aws.dynamodb.select" semantic conventions. It represents the value of
  1918. // the `Select` request parameter.
  1919. //
  1920. // Type: string
  1921. // RequirementLevel: Optional
  1922. // Stability: stable
  1923. // Examples: 'ALL_ATTRIBUTES', 'COUNT'
  1924. AWSDynamoDBSelectKey = attribute.Key("aws.dynamodb.select")
  1925. )
  1926. // AWSDynamoDBTableNames returns an attribute KeyValue conforming to the
  1927. // "aws.dynamodb.table_names" semantic conventions. It represents the keys in
  1928. // the `RequestItems` object field.
  1929. func AWSDynamoDBTableNames(val ...string) attribute.KeyValue {
  1930. return AWSDynamoDBTableNamesKey.StringSlice(val)
  1931. }
  1932. // AWSDynamoDBConsumedCapacity returns an attribute KeyValue conforming to
  1933. // the "aws.dynamodb.consumed_capacity" semantic conventions. It represents the
  1934. // JSON-serialized value of each item in the `ConsumedCapacity` response field.
  1935. func AWSDynamoDBConsumedCapacity(val ...string) attribute.KeyValue {
  1936. return AWSDynamoDBConsumedCapacityKey.StringSlice(val)
  1937. }
  1938. // AWSDynamoDBItemCollectionMetrics returns an attribute KeyValue conforming
  1939. // to the "aws.dynamodb.item_collection_metrics" semantic conventions. It
  1940. // represents the JSON-serialized value of the `ItemCollectionMetrics` response
  1941. // field.
  1942. func AWSDynamoDBItemCollectionMetrics(val string) attribute.KeyValue {
  1943. return AWSDynamoDBItemCollectionMetricsKey.String(val)
  1944. }
  1945. // AWSDynamoDBProvisionedReadCapacity returns an attribute KeyValue
  1946. // conforming to the "aws.dynamodb.provisioned_read_capacity" semantic
  1947. // conventions. It represents the value of the
  1948. // `ProvisionedThroughput.ReadCapacityUnits` request parameter.
  1949. func AWSDynamoDBProvisionedReadCapacity(val float64) attribute.KeyValue {
  1950. return AWSDynamoDBProvisionedReadCapacityKey.Float64(val)
  1951. }
  1952. // AWSDynamoDBProvisionedWriteCapacity returns an attribute KeyValue
  1953. // conforming to the "aws.dynamodb.provisioned_write_capacity" semantic
  1954. // conventions. It represents the value of the
  1955. // `ProvisionedThroughput.WriteCapacityUnits` request parameter.
  1956. func AWSDynamoDBProvisionedWriteCapacity(val float64) attribute.KeyValue {
  1957. return AWSDynamoDBProvisionedWriteCapacityKey.Float64(val)
  1958. }
  1959. // AWSDynamoDBConsistentRead returns an attribute KeyValue conforming to the
  1960. // "aws.dynamodb.consistent_read" semantic conventions. It represents the value
  1961. // of the `ConsistentRead` request parameter.
  1962. func AWSDynamoDBConsistentRead(val bool) attribute.KeyValue {
  1963. return AWSDynamoDBConsistentReadKey.Bool(val)
  1964. }
  1965. // AWSDynamoDBProjection returns an attribute KeyValue conforming to the
  1966. // "aws.dynamodb.projection" semantic conventions. It represents the value of
  1967. // the `ProjectionExpression` request parameter.
  1968. func AWSDynamoDBProjection(val string) attribute.KeyValue {
  1969. return AWSDynamoDBProjectionKey.String(val)
  1970. }
  1971. // AWSDynamoDBLimit returns an attribute KeyValue conforming to the
  1972. // "aws.dynamodb.limit" semantic conventions. It represents the value of the
  1973. // `Limit` request parameter.
  1974. func AWSDynamoDBLimit(val int) attribute.KeyValue {
  1975. return AWSDynamoDBLimitKey.Int(val)
  1976. }
  1977. // AWSDynamoDBAttributesToGet returns an attribute KeyValue conforming to
  1978. // the "aws.dynamodb.attributes_to_get" semantic conventions. It represents the
  1979. // value of the `AttributesToGet` request parameter.
  1980. func AWSDynamoDBAttributesToGet(val ...string) attribute.KeyValue {
  1981. return AWSDynamoDBAttributesToGetKey.StringSlice(val)
  1982. }
  1983. // AWSDynamoDBIndexName returns an attribute KeyValue conforming to the
  1984. // "aws.dynamodb.index_name" semantic conventions. It represents the value of
  1985. // the `IndexName` request parameter.
  1986. func AWSDynamoDBIndexName(val string) attribute.KeyValue {
  1987. return AWSDynamoDBIndexNameKey.String(val)
  1988. }
  1989. // AWSDynamoDBSelect returns an attribute KeyValue conforming to the
  1990. // "aws.dynamodb.select" semantic conventions. It represents the value of the
  1991. // `Select` request parameter.
  1992. func AWSDynamoDBSelect(val string) attribute.KeyValue {
  1993. return AWSDynamoDBSelectKey.String(val)
  1994. }
  1995. // DynamoDB.CreateTable
  1996. const (
  1997. // AWSDynamoDBGlobalSecondaryIndexesKey is the attribute Key conforming to
  1998. // the "aws.dynamodb.global_secondary_indexes" semantic conventions. It
  1999. // represents the JSON-serialized value of each item of the
  2000. // `GlobalSecondaryIndexes` request field
  2001. //
  2002. // Type: string[]
  2003. // RequirementLevel: Optional
  2004. // Stability: stable
  2005. // Examples: '{ "IndexName": "string", "KeySchema": [ { "AttributeName":
  2006. // "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [
  2007. // "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": {
  2008. // "ReadCapacityUnits": number, "WriteCapacityUnits": number } }'
  2009. AWSDynamoDBGlobalSecondaryIndexesKey = attribute.Key("aws.dynamodb.global_secondary_indexes")
  2010. // AWSDynamoDBLocalSecondaryIndexesKey is the attribute Key conforming to
  2011. // the "aws.dynamodb.local_secondary_indexes" semantic conventions. It
  2012. // represents the JSON-serialized value of each item of the
  2013. // `LocalSecondaryIndexes` request field.
  2014. //
  2015. // Type: string[]
  2016. // RequirementLevel: Optional
  2017. // Stability: stable
  2018. // Examples: '{ "IndexARN": "string", "IndexName": "string",
  2019. // "IndexSizeBytes": number, "ItemCount": number, "KeySchema": [ {
  2020. // "AttributeName": "string", "KeyType": "string" } ], "Projection": {
  2021. // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" } }'
  2022. AWSDynamoDBLocalSecondaryIndexesKey = attribute.Key("aws.dynamodb.local_secondary_indexes")
  2023. )
  2024. // AWSDynamoDBGlobalSecondaryIndexes returns an attribute KeyValue
  2025. // conforming to the "aws.dynamodb.global_secondary_indexes" semantic
  2026. // conventions. It represents the JSON-serialized value of each item of the
  2027. // `GlobalSecondaryIndexes` request field
  2028. func AWSDynamoDBGlobalSecondaryIndexes(val ...string) attribute.KeyValue {
  2029. return AWSDynamoDBGlobalSecondaryIndexesKey.StringSlice(val)
  2030. }
  2031. // AWSDynamoDBLocalSecondaryIndexes returns an attribute KeyValue conforming
  2032. // to the "aws.dynamodb.local_secondary_indexes" semantic conventions. It
  2033. // represents the JSON-serialized value of each item of the
  2034. // `LocalSecondaryIndexes` request field.
  2035. func AWSDynamoDBLocalSecondaryIndexes(val ...string) attribute.KeyValue {
  2036. return AWSDynamoDBLocalSecondaryIndexesKey.StringSlice(val)
  2037. }
  2038. // DynamoDB.ListTables
  2039. const (
  2040. // AWSDynamoDBExclusiveStartTableKey is the attribute Key conforming to the
  2041. // "aws.dynamodb.exclusive_start_table" semantic conventions. It represents
  2042. // the value of the `ExclusiveStartTableName` request parameter.
  2043. //
  2044. // Type: string
  2045. // RequirementLevel: Optional
  2046. // Stability: stable
  2047. // Examples: 'Users', 'CatsTable'
  2048. AWSDynamoDBExclusiveStartTableKey = attribute.Key("aws.dynamodb.exclusive_start_table")
  2049. // AWSDynamoDBTableCountKey is the attribute Key conforming to the
  2050. // "aws.dynamodb.table_count" semantic conventions. It represents the the
  2051. // number of items in the `TableNames` response parameter.
  2052. //
  2053. // Type: int
  2054. // RequirementLevel: Optional
  2055. // Stability: stable
  2056. // Examples: 20
  2057. AWSDynamoDBTableCountKey = attribute.Key("aws.dynamodb.table_count")
  2058. )
  2059. // AWSDynamoDBExclusiveStartTable returns an attribute KeyValue conforming
  2060. // to the "aws.dynamodb.exclusive_start_table" semantic conventions. It
  2061. // represents the value of the `ExclusiveStartTableName` request parameter.
  2062. func AWSDynamoDBExclusiveStartTable(val string) attribute.KeyValue {
  2063. return AWSDynamoDBExclusiveStartTableKey.String(val)
  2064. }
  2065. // AWSDynamoDBTableCount returns an attribute KeyValue conforming to the
  2066. // "aws.dynamodb.table_count" semantic conventions. It represents the the
  2067. // number of items in the `TableNames` response parameter.
  2068. func AWSDynamoDBTableCount(val int) attribute.KeyValue {
  2069. return AWSDynamoDBTableCountKey.Int(val)
  2070. }
  2071. // DynamoDB.Query
  2072. const (
  2073. // AWSDynamoDBScanForwardKey is the attribute Key conforming to the
  2074. // "aws.dynamodb.scan_forward" semantic conventions. It represents the
  2075. // value of the `ScanIndexForward` request parameter.
  2076. //
  2077. // Type: boolean
  2078. // RequirementLevel: Optional
  2079. // Stability: stable
  2080. AWSDynamoDBScanForwardKey = attribute.Key("aws.dynamodb.scan_forward")
  2081. )
  2082. // AWSDynamoDBScanForward returns an attribute KeyValue conforming to the
  2083. // "aws.dynamodb.scan_forward" semantic conventions. It represents the value of
  2084. // the `ScanIndexForward` request parameter.
  2085. func AWSDynamoDBScanForward(val bool) attribute.KeyValue {
  2086. return AWSDynamoDBScanForwardKey.Bool(val)
  2087. }
  2088. // DynamoDB.Scan
  2089. const (
  2090. // AWSDynamoDBSegmentKey is the attribute Key conforming to the
  2091. // "aws.dynamodb.segment" semantic conventions. It represents the value of
  2092. // the `Segment` request parameter.
  2093. //
  2094. // Type: int
  2095. // RequirementLevel: Optional
  2096. // Stability: stable
  2097. // Examples: 10
  2098. AWSDynamoDBSegmentKey = attribute.Key("aws.dynamodb.segment")
  2099. // AWSDynamoDBTotalSegmentsKey is the attribute Key conforming to the
  2100. // "aws.dynamodb.total_segments" semantic conventions. It represents the
  2101. // value of the `TotalSegments` request parameter.
  2102. //
  2103. // Type: int
  2104. // RequirementLevel: Optional
  2105. // Stability: stable
  2106. // Examples: 100
  2107. AWSDynamoDBTotalSegmentsKey = attribute.Key("aws.dynamodb.total_segments")
  2108. // AWSDynamoDBCountKey is the attribute Key conforming to the
  2109. // "aws.dynamodb.count" semantic conventions. It represents the value of
  2110. // the `Count` response parameter.
  2111. //
  2112. // Type: int
  2113. // RequirementLevel: Optional
  2114. // Stability: stable
  2115. // Examples: 10
  2116. AWSDynamoDBCountKey = attribute.Key("aws.dynamodb.count")
  2117. // AWSDynamoDBScannedCountKey is the attribute Key conforming to the
  2118. // "aws.dynamodb.scanned_count" semantic conventions. It represents the
  2119. // value of the `ScannedCount` response parameter.
  2120. //
  2121. // Type: int
  2122. // RequirementLevel: Optional
  2123. // Stability: stable
  2124. // Examples: 50
  2125. AWSDynamoDBScannedCountKey = attribute.Key("aws.dynamodb.scanned_count")
  2126. )
  2127. // AWSDynamoDBSegment returns an attribute KeyValue conforming to the
  2128. // "aws.dynamodb.segment" semantic conventions. It represents the value of the
  2129. // `Segment` request parameter.
  2130. func AWSDynamoDBSegment(val int) attribute.KeyValue {
  2131. return AWSDynamoDBSegmentKey.Int(val)
  2132. }
  2133. // AWSDynamoDBTotalSegments returns an attribute KeyValue conforming to the
  2134. // "aws.dynamodb.total_segments" semantic conventions. It represents the value
  2135. // of the `TotalSegments` request parameter.
  2136. func AWSDynamoDBTotalSegments(val int) attribute.KeyValue {
  2137. return AWSDynamoDBTotalSegmentsKey.Int(val)
  2138. }
  2139. // AWSDynamoDBCount returns an attribute KeyValue conforming to the
  2140. // "aws.dynamodb.count" semantic conventions. It represents the value of the
  2141. // `Count` response parameter.
  2142. func AWSDynamoDBCount(val int) attribute.KeyValue {
  2143. return AWSDynamoDBCountKey.Int(val)
  2144. }
  2145. // AWSDynamoDBScannedCount returns an attribute KeyValue conforming to the
  2146. // "aws.dynamodb.scanned_count" semantic conventions. It represents the value
  2147. // of the `ScannedCount` response parameter.
  2148. func AWSDynamoDBScannedCount(val int) attribute.KeyValue {
  2149. return AWSDynamoDBScannedCountKey.Int(val)
  2150. }
  2151. // DynamoDB.UpdateTable
  2152. const (
  2153. // AWSDynamoDBAttributeDefinitionsKey is the attribute Key conforming to
  2154. // the "aws.dynamodb.attribute_definitions" semantic conventions. It
  2155. // represents the JSON-serialized value of each item in the
  2156. // `AttributeDefinitions` request field.
  2157. //
  2158. // Type: string[]
  2159. // RequirementLevel: Optional
  2160. // Stability: stable
  2161. // Examples: '{ "AttributeName": "string", "AttributeType": "string" }'
  2162. AWSDynamoDBAttributeDefinitionsKey = attribute.Key("aws.dynamodb.attribute_definitions")
  2163. // AWSDynamoDBGlobalSecondaryIndexUpdatesKey is the attribute Key
  2164. // conforming to the "aws.dynamodb.global_secondary_index_updates" semantic
  2165. // conventions. It represents the JSON-serialized value of each item in the
  2166. // the `GlobalSecondaryIndexUpdates` request field.
  2167. //
  2168. // Type: string[]
  2169. // RequirementLevel: Optional
  2170. // Stability: stable
  2171. // Examples: '{ "Create": { "IndexName": "string", "KeySchema": [ {
  2172. // "AttributeName": "string", "KeyType": "string" } ], "Projection": {
  2173. // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" },
  2174. // "ProvisionedThroughput": { "ReadCapacityUnits": number,
  2175. // "WriteCapacityUnits": number } }'
  2176. AWSDynamoDBGlobalSecondaryIndexUpdatesKey = attribute.Key("aws.dynamodb.global_secondary_index_updates")
  2177. )
  2178. // AWSDynamoDBAttributeDefinitions returns an attribute KeyValue conforming
  2179. // to the "aws.dynamodb.attribute_definitions" semantic conventions. It
  2180. // represents the JSON-serialized value of each item in the
  2181. // `AttributeDefinitions` request field.
  2182. func AWSDynamoDBAttributeDefinitions(val ...string) attribute.KeyValue {
  2183. return AWSDynamoDBAttributeDefinitionsKey.StringSlice(val)
  2184. }
  2185. // AWSDynamoDBGlobalSecondaryIndexUpdates returns an attribute KeyValue
  2186. // conforming to the "aws.dynamodb.global_secondary_index_updates" semantic
  2187. // conventions. It represents the JSON-serialized value of each item in the the
  2188. // `GlobalSecondaryIndexUpdates` request field.
  2189. func AWSDynamoDBGlobalSecondaryIndexUpdates(val ...string) attribute.KeyValue {
  2190. return AWSDynamoDBGlobalSecondaryIndexUpdatesKey.StringSlice(val)
  2191. }
  2192. // Semantic conventions to apply when instrumenting the GraphQL implementation.
  2193. // They map GraphQL operations to attributes on a Span.
  2194. const (
  2195. // GraphqlOperationNameKey is the attribute Key conforming to the
  2196. // "graphql.operation.name" semantic conventions. It represents the name of
  2197. // the operation being executed.
  2198. //
  2199. // Type: string
  2200. // RequirementLevel: Optional
  2201. // Stability: stable
  2202. // Examples: 'findBookByID'
  2203. GraphqlOperationNameKey = attribute.Key("graphql.operation.name")
  2204. // GraphqlOperationTypeKey is the attribute Key conforming to the
  2205. // "graphql.operation.type" semantic conventions. It represents the type of
  2206. // the operation being executed.
  2207. //
  2208. // Type: Enum
  2209. // RequirementLevel: Optional
  2210. // Stability: stable
  2211. // Examples: 'query', 'mutation', 'subscription'
  2212. GraphqlOperationTypeKey = attribute.Key("graphql.operation.type")
  2213. // GraphqlDocumentKey is the attribute Key conforming to the
  2214. // "graphql.document" semantic conventions. It represents the GraphQL
  2215. // document being executed.
  2216. //
  2217. // Type: string
  2218. // RequirementLevel: Optional
  2219. // Stability: stable
  2220. // Examples: 'query findBookByID { bookByID(id: ?) { name } }'
  2221. // Note: The value may be sanitized to exclude sensitive information.
  2222. GraphqlDocumentKey = attribute.Key("graphql.document")
  2223. )
  2224. var (
  2225. // GraphQL query
  2226. GraphqlOperationTypeQuery = GraphqlOperationTypeKey.String("query")
  2227. // GraphQL mutation
  2228. GraphqlOperationTypeMutation = GraphqlOperationTypeKey.String("mutation")
  2229. // GraphQL subscription
  2230. GraphqlOperationTypeSubscription = GraphqlOperationTypeKey.String("subscription")
  2231. )
  2232. // GraphqlOperationName returns an attribute KeyValue conforming to the
  2233. // "graphql.operation.name" semantic conventions. It represents the name of the
  2234. // operation being executed.
  2235. func GraphqlOperationName(val string) attribute.KeyValue {
  2236. return GraphqlOperationNameKey.String(val)
  2237. }
  2238. // GraphqlDocument returns an attribute KeyValue conforming to the
  2239. // "graphql.document" semantic conventions. It represents the GraphQL document
  2240. // being executed.
  2241. func GraphqlDocument(val string) attribute.KeyValue {
  2242. return GraphqlDocumentKey.String(val)
  2243. }
  2244. // Semantic convention describing per-message attributes populated on messaging
  2245. // spans or links.
  2246. const (
  2247. // MessagingMessageIDKey is the attribute Key conforming to the
  2248. // "messaging.message.id" semantic conventions. It represents a value used
  2249. // by the messaging system as an identifier for the message, represented as
  2250. // a string.
  2251. //
  2252. // Type: string
  2253. // RequirementLevel: Optional
  2254. // Stability: stable
  2255. // Examples: '452a7c7c7c7048c2f887f61572b18fc2'
  2256. MessagingMessageIDKey = attribute.Key("messaging.message.id")
  2257. // MessagingMessageConversationIDKey is the attribute Key conforming to the
  2258. // "messaging.message.conversation_id" semantic conventions. It represents
  2259. // the [conversation ID](#conversations) identifying the conversation to
  2260. // which the message belongs, represented as a string. Sometimes called
  2261. // "Correlation ID".
  2262. //
  2263. // Type: string
  2264. // RequirementLevel: Optional
  2265. // Stability: stable
  2266. // Examples: 'MyConversationID'
  2267. MessagingMessageConversationIDKey = attribute.Key("messaging.message.conversation_id")
  2268. // MessagingMessagePayloadSizeBytesKey is the attribute Key conforming to
  2269. // the "messaging.message.payload_size_bytes" semantic conventions. It
  2270. // represents the (uncompressed) size of the message payload in bytes. Also
  2271. // use this attribute if it is unknown whether the compressed or
  2272. // uncompressed payload size is reported.
  2273. //
  2274. // Type: int
  2275. // RequirementLevel: Optional
  2276. // Stability: stable
  2277. // Examples: 2738
  2278. MessagingMessagePayloadSizeBytesKey = attribute.Key("messaging.message.payload_size_bytes")
  2279. // MessagingMessagePayloadCompressedSizeBytesKey is the attribute Key
  2280. // conforming to the "messaging.message.payload_compressed_size_bytes"
  2281. // semantic conventions. It represents the compressed size of the message
  2282. // payload in bytes.
  2283. //
  2284. // Type: int
  2285. // RequirementLevel: Optional
  2286. // Stability: stable
  2287. // Examples: 2048
  2288. MessagingMessagePayloadCompressedSizeBytesKey = attribute.Key("messaging.message.payload_compressed_size_bytes")
  2289. )
  2290. // MessagingMessageID returns an attribute KeyValue conforming to the
  2291. // "messaging.message.id" semantic conventions. It represents a value used by
  2292. // the messaging system as an identifier for the message, represented as a
  2293. // string.
  2294. func MessagingMessageID(val string) attribute.KeyValue {
  2295. return MessagingMessageIDKey.String(val)
  2296. }
  2297. // MessagingMessageConversationID returns an attribute KeyValue conforming
  2298. // to the "messaging.message.conversation_id" semantic conventions. It
  2299. // represents the [conversation ID](#conversations) identifying the
  2300. // conversation to which the message belongs, represented as a string.
  2301. // Sometimes called "Correlation ID".
  2302. func MessagingMessageConversationID(val string) attribute.KeyValue {
  2303. return MessagingMessageConversationIDKey.String(val)
  2304. }
  2305. // MessagingMessagePayloadSizeBytes returns an attribute KeyValue conforming
  2306. // to the "messaging.message.payload_size_bytes" semantic conventions. It
  2307. // represents the (uncompressed) size of the message payload in bytes. Also use
  2308. // this attribute if it is unknown whether the compressed or uncompressed
  2309. // payload size is reported.
  2310. func MessagingMessagePayloadSizeBytes(val int) attribute.KeyValue {
  2311. return MessagingMessagePayloadSizeBytesKey.Int(val)
  2312. }
  2313. // MessagingMessagePayloadCompressedSizeBytes returns an attribute KeyValue
  2314. // conforming to the "messaging.message.payload_compressed_size_bytes" semantic
  2315. // conventions. It represents the compressed size of the message payload in
  2316. // bytes.
  2317. func MessagingMessagePayloadCompressedSizeBytes(val int) attribute.KeyValue {
  2318. return MessagingMessagePayloadCompressedSizeBytesKey.Int(val)
  2319. }
  2320. // Semantic convention for attributes that describe messaging destination on
  2321. // broker
  2322. const (
  2323. // MessagingDestinationNameKey is the attribute Key conforming to the
  2324. // "messaging.destination.name" semantic conventions. It represents the
  2325. // message destination name
  2326. //
  2327. // Type: string
  2328. // RequirementLevel: Optional
  2329. // Stability: stable
  2330. // Examples: 'MyQueue', 'MyTopic'
  2331. // Note: Destination name SHOULD uniquely identify a specific queue, topic
  2332. // or other entity within the broker. If
  2333. // the broker does not have such notion, the destination name SHOULD
  2334. // uniquely identify the broker.
  2335. MessagingDestinationNameKey = attribute.Key("messaging.destination.name")
  2336. // MessagingDestinationKindKey is the attribute Key conforming to the
  2337. // "messaging.destination.kind" semantic conventions. It represents the
  2338. // kind of message destination
  2339. //
  2340. // Type: Enum
  2341. // RequirementLevel: Optional
  2342. // Stability: stable
  2343. MessagingDestinationKindKey = attribute.Key("messaging.destination.kind")
  2344. // MessagingDestinationTemplateKey is the attribute Key conforming to the
  2345. // "messaging.destination.template" semantic conventions. It represents the
  2346. // low cardinality representation of the messaging destination name
  2347. //
  2348. // Type: string
  2349. // RequirementLevel: Optional
  2350. // Stability: stable
  2351. // Examples: '/customers/{customerID}'
  2352. // Note: Destination names could be constructed from templates. An example
  2353. // would be a destination name involving a user name or product id.
  2354. // Although the destination name in this case is of high cardinality, the
  2355. // underlying template is of low cardinality and can be effectively used
  2356. // for grouping and aggregation.
  2357. MessagingDestinationTemplateKey = attribute.Key("messaging.destination.template")
  2358. // MessagingDestinationTemporaryKey is the attribute Key conforming to the
  2359. // "messaging.destination.temporary" semantic conventions. It represents a
  2360. // boolean that is true if the message destination is temporary and might
  2361. // not exist anymore after messages are processed.
  2362. //
  2363. // Type: boolean
  2364. // RequirementLevel: Optional
  2365. // Stability: stable
  2366. MessagingDestinationTemporaryKey = attribute.Key("messaging.destination.temporary")
  2367. // MessagingDestinationAnonymousKey is the attribute Key conforming to the
  2368. // "messaging.destination.anonymous" semantic conventions. It represents a
  2369. // boolean that is true if the message destination is anonymous (could be
  2370. // unnamed or have auto-generated name).
  2371. //
  2372. // Type: boolean
  2373. // RequirementLevel: Optional
  2374. // Stability: stable
  2375. MessagingDestinationAnonymousKey = attribute.Key("messaging.destination.anonymous")
  2376. )
  2377. var (
  2378. // A message sent to a queue
  2379. MessagingDestinationKindQueue = MessagingDestinationKindKey.String("queue")
  2380. // A message sent to a topic
  2381. MessagingDestinationKindTopic = MessagingDestinationKindKey.String("topic")
  2382. )
  2383. // MessagingDestinationName returns an attribute KeyValue conforming to the
  2384. // "messaging.destination.name" semantic conventions. It represents the message
  2385. // destination name
  2386. func MessagingDestinationName(val string) attribute.KeyValue {
  2387. return MessagingDestinationNameKey.String(val)
  2388. }
  2389. // MessagingDestinationTemplate returns an attribute KeyValue conforming to
  2390. // the "messaging.destination.template" semantic conventions. It represents the
  2391. // low cardinality representation of the messaging destination name
  2392. func MessagingDestinationTemplate(val string) attribute.KeyValue {
  2393. return MessagingDestinationTemplateKey.String(val)
  2394. }
  2395. // MessagingDestinationTemporary returns an attribute KeyValue conforming to
  2396. // the "messaging.destination.temporary" semantic conventions. It represents a
  2397. // boolean that is true if the message destination is temporary and might not
  2398. // exist anymore after messages are processed.
  2399. func MessagingDestinationTemporary(val bool) attribute.KeyValue {
  2400. return MessagingDestinationTemporaryKey.Bool(val)
  2401. }
  2402. // MessagingDestinationAnonymous returns an attribute KeyValue conforming to
  2403. // the "messaging.destination.anonymous" semantic conventions. It represents a
  2404. // boolean that is true if the message destination is anonymous (could be
  2405. // unnamed or have auto-generated name).
  2406. func MessagingDestinationAnonymous(val bool) attribute.KeyValue {
  2407. return MessagingDestinationAnonymousKey.Bool(val)
  2408. }
  2409. // Semantic convention for attributes that describe messaging source on broker
  2410. const (
  2411. // MessagingSourceNameKey is the attribute Key conforming to the
  2412. // "messaging.source.name" semantic conventions. It represents the message
  2413. // source name
  2414. //
  2415. // Type: string
  2416. // RequirementLevel: Optional
  2417. // Stability: stable
  2418. // Examples: 'MyQueue', 'MyTopic'
  2419. // Note: Source name SHOULD uniquely identify a specific queue, topic, or
  2420. // other entity within the broker. If
  2421. // the broker does not have such notion, the source name SHOULD uniquely
  2422. // identify the broker.
  2423. MessagingSourceNameKey = attribute.Key("messaging.source.name")
  2424. // MessagingSourceKindKey is the attribute Key conforming to the
  2425. // "messaging.source.kind" semantic conventions. It represents the kind of
  2426. // message source
  2427. //
  2428. // Type: Enum
  2429. // RequirementLevel: Optional
  2430. // Stability: stable
  2431. MessagingSourceKindKey = attribute.Key("messaging.source.kind")
  2432. // MessagingSourceTemplateKey is the attribute Key conforming to the
  2433. // "messaging.source.template" semantic conventions. It represents the low
  2434. // cardinality representation of the messaging source name
  2435. //
  2436. // Type: string
  2437. // RequirementLevel: Optional
  2438. // Stability: stable
  2439. // Examples: '/customers/{customerID}'
  2440. // Note: Source names could be constructed from templates. An example would
  2441. // be a source name involving a user name or product id. Although the
  2442. // source name in this case is of high cardinality, the underlying template
  2443. // is of low cardinality and can be effectively used for grouping and
  2444. // aggregation.
  2445. MessagingSourceTemplateKey = attribute.Key("messaging.source.template")
  2446. // MessagingSourceTemporaryKey is the attribute Key conforming to the
  2447. // "messaging.source.temporary" semantic conventions. It represents a
  2448. // boolean that is true if the message source is temporary and might not
  2449. // exist anymore after messages are processed.
  2450. //
  2451. // Type: boolean
  2452. // RequirementLevel: Optional
  2453. // Stability: stable
  2454. MessagingSourceTemporaryKey = attribute.Key("messaging.source.temporary")
  2455. // MessagingSourceAnonymousKey is the attribute Key conforming to the
  2456. // "messaging.source.anonymous" semantic conventions. It represents a
  2457. // boolean that is true if the message source is anonymous (could be
  2458. // unnamed or have auto-generated name).
  2459. //
  2460. // Type: boolean
  2461. // RequirementLevel: Optional
  2462. // Stability: stable
  2463. MessagingSourceAnonymousKey = attribute.Key("messaging.source.anonymous")
  2464. )
  2465. var (
  2466. // A message received from a queue
  2467. MessagingSourceKindQueue = MessagingSourceKindKey.String("queue")
  2468. // A message received from a topic
  2469. MessagingSourceKindTopic = MessagingSourceKindKey.String("topic")
  2470. )
  2471. // MessagingSourceName returns an attribute KeyValue conforming to the
  2472. // "messaging.source.name" semantic conventions. It represents the message
  2473. // source name
  2474. func MessagingSourceName(val string) attribute.KeyValue {
  2475. return MessagingSourceNameKey.String(val)
  2476. }
  2477. // MessagingSourceTemplate returns an attribute KeyValue conforming to the
  2478. // "messaging.source.template" semantic conventions. It represents the low
  2479. // cardinality representation of the messaging source name
  2480. func MessagingSourceTemplate(val string) attribute.KeyValue {
  2481. return MessagingSourceTemplateKey.String(val)
  2482. }
  2483. // MessagingSourceTemporary returns an attribute KeyValue conforming to the
  2484. // "messaging.source.temporary" semantic conventions. It represents a boolean
  2485. // that is true if the message source is temporary and might not exist anymore
  2486. // after messages are processed.
  2487. func MessagingSourceTemporary(val bool) attribute.KeyValue {
  2488. return MessagingSourceTemporaryKey.Bool(val)
  2489. }
  2490. // MessagingSourceAnonymous returns an attribute KeyValue conforming to the
  2491. // "messaging.source.anonymous" semantic conventions. It represents a boolean
  2492. // that is true if the message source is anonymous (could be unnamed or have
  2493. // auto-generated name).
  2494. func MessagingSourceAnonymous(val bool) attribute.KeyValue {
  2495. return MessagingSourceAnonymousKey.Bool(val)
  2496. }
  2497. // General attributes used in messaging systems.
  2498. const (
  2499. // MessagingSystemKey is the attribute Key conforming to the
  2500. // "messaging.system" semantic conventions. It represents a string
  2501. // identifying the messaging system.
  2502. //
  2503. // Type: string
  2504. // RequirementLevel: Required
  2505. // Stability: stable
  2506. // Examples: 'kafka', 'rabbitmq', 'rocketmq', 'activemq', 'AmazonSQS'
  2507. MessagingSystemKey = attribute.Key("messaging.system")
  2508. // MessagingOperationKey is the attribute Key conforming to the
  2509. // "messaging.operation" semantic conventions. It represents a string
  2510. // identifying the kind of messaging operation as defined in the [Operation
  2511. // names](#operation-names) section above.
  2512. //
  2513. // Type: Enum
  2514. // RequirementLevel: Required
  2515. // Stability: stable
  2516. // Note: If a custom value is used, it MUST be of low cardinality.
  2517. MessagingOperationKey = attribute.Key("messaging.operation")
  2518. // MessagingBatchMessageCountKey is the attribute Key conforming to the
  2519. // "messaging.batch.message_count" semantic conventions. It represents the
  2520. // number of messages sent, received, or processed in the scope of the
  2521. // batching operation.
  2522. //
  2523. // Type: int
  2524. // RequirementLevel: ConditionallyRequired (If the span describes an
  2525. // operation on a batch of messages.)
  2526. // Stability: stable
  2527. // Examples: 0, 1, 2
  2528. // Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on
  2529. // spans that operate with a single message. When a messaging client
  2530. // library supports both batch and single-message API for the same
  2531. // operation, instrumentations SHOULD use `messaging.batch.message_count`
  2532. // for batching APIs and SHOULD NOT use it for single-message APIs.
  2533. MessagingBatchMessageCountKey = attribute.Key("messaging.batch.message_count")
  2534. )
  2535. var (
  2536. // publish
  2537. MessagingOperationPublish = MessagingOperationKey.String("publish")
  2538. // receive
  2539. MessagingOperationReceive = MessagingOperationKey.String("receive")
  2540. // process
  2541. MessagingOperationProcess = MessagingOperationKey.String("process")
  2542. )
  2543. // MessagingSystem returns an attribute KeyValue conforming to the
  2544. // "messaging.system" semantic conventions. It represents a string identifying
  2545. // the messaging system.
  2546. func MessagingSystem(val string) attribute.KeyValue {
  2547. return MessagingSystemKey.String(val)
  2548. }
  2549. // MessagingBatchMessageCount returns an attribute KeyValue conforming to
  2550. // the "messaging.batch.message_count" semantic conventions. It represents the
  2551. // number of messages sent, received, or processed in the scope of the batching
  2552. // operation.
  2553. func MessagingBatchMessageCount(val int) attribute.KeyValue {
  2554. return MessagingBatchMessageCountKey.Int(val)
  2555. }
  2556. // Semantic convention for a consumer of messages received from a messaging
  2557. // system
  2558. const (
  2559. // MessagingConsumerIDKey is the attribute Key conforming to the
  2560. // "messaging.consumer.id" semantic conventions. It represents the
  2561. // identifier for the consumer receiving a message. For Kafka, set it to
  2562. // `{messaging.kafka.consumer.group} - {messaging.kafka.client_id}`, if
  2563. // both are present, or only `messaging.kafka.consumer.group`. For brokers,
  2564. // such as RabbitMQ and Artemis, set it to the `client_id` of the client
  2565. // consuming the message.
  2566. //
  2567. // Type: string
  2568. // RequirementLevel: Optional
  2569. // Stability: stable
  2570. // Examples: 'mygroup - client-6'
  2571. MessagingConsumerIDKey = attribute.Key("messaging.consumer.id")
  2572. )
  2573. // MessagingConsumerID returns an attribute KeyValue conforming to the
  2574. // "messaging.consumer.id" semantic conventions. It represents the identifier
  2575. // for the consumer receiving a message. For Kafka, set it to
  2576. // `{messaging.kafka.consumer.group} - {messaging.kafka.client_id}`, if both
  2577. // are present, or only `messaging.kafka.consumer.group`. For brokers, such as
  2578. // RabbitMQ and Artemis, set it to the `client_id` of the client consuming the
  2579. // message.
  2580. func MessagingConsumerID(val string) attribute.KeyValue {
  2581. return MessagingConsumerIDKey.String(val)
  2582. }
  2583. // Attributes for RabbitMQ
  2584. const (
  2585. // MessagingRabbitmqDestinationRoutingKeyKey is the attribute Key
  2586. // conforming to the "messaging.rabbitmq.destination.routing_key" semantic
  2587. // conventions. It represents the rabbitMQ message routing key.
  2588. //
  2589. // Type: string
  2590. // RequirementLevel: ConditionallyRequired (If not empty.)
  2591. // Stability: stable
  2592. // Examples: 'myKey'
  2593. MessagingRabbitmqDestinationRoutingKeyKey = attribute.Key("messaging.rabbitmq.destination.routing_key")
  2594. )
  2595. // MessagingRabbitmqDestinationRoutingKey returns an attribute KeyValue
  2596. // conforming to the "messaging.rabbitmq.destination.routing_key" semantic
  2597. // conventions. It represents the rabbitMQ message routing key.
  2598. func MessagingRabbitmqDestinationRoutingKey(val string) attribute.KeyValue {
  2599. return MessagingRabbitmqDestinationRoutingKeyKey.String(val)
  2600. }
  2601. // Attributes for Apache Kafka
  2602. const (
  2603. // MessagingKafkaMessageKeyKey is the attribute Key conforming to the
  2604. // "messaging.kafka.message.key" semantic conventions. It represents the
  2605. // message keys in Kafka are used for grouping alike messages to ensure
  2606. // they're processed on the same partition. They differ from
  2607. // `messaging.message.id` in that they're not unique. If the key is `null`,
  2608. // the attribute MUST NOT be set.
  2609. //
  2610. // Type: string
  2611. // RequirementLevel: Optional
  2612. // Stability: stable
  2613. // Examples: 'myKey'
  2614. // Note: If the key type is not string, it's string representation has to
  2615. // be supplied for the attribute. If the key has no unambiguous, canonical
  2616. // string form, don't include its value.
  2617. MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message.key")
  2618. // MessagingKafkaConsumerGroupKey is the attribute Key conforming to the
  2619. // "messaging.kafka.consumer.group" semantic conventions. It represents the
  2620. // name of the Kafka Consumer Group that is handling the message. Only
  2621. // applies to consumers, not producers.
  2622. //
  2623. // Type: string
  2624. // RequirementLevel: Optional
  2625. // Stability: stable
  2626. // Examples: 'my-group'
  2627. MessagingKafkaConsumerGroupKey = attribute.Key("messaging.kafka.consumer.group")
  2628. // MessagingKafkaClientIDKey is the attribute Key conforming to the
  2629. // "messaging.kafka.client_id" semantic conventions. It represents the
  2630. // client ID for the Consumer or Producer that is handling the message.
  2631. //
  2632. // Type: string
  2633. // RequirementLevel: Optional
  2634. // Stability: stable
  2635. // Examples: 'client-5'
  2636. MessagingKafkaClientIDKey = attribute.Key("messaging.kafka.client_id")
  2637. // MessagingKafkaDestinationPartitionKey is the attribute Key conforming to
  2638. // the "messaging.kafka.destination.partition" semantic conventions. It
  2639. // represents the partition the message is sent to.
  2640. //
  2641. // Type: int
  2642. // RequirementLevel: Optional
  2643. // Stability: stable
  2644. // Examples: 2
  2645. MessagingKafkaDestinationPartitionKey = attribute.Key("messaging.kafka.destination.partition")
  2646. // MessagingKafkaSourcePartitionKey is the attribute Key conforming to the
  2647. // "messaging.kafka.source.partition" semantic conventions. It represents
  2648. // the partition the message is received from.
  2649. //
  2650. // Type: int
  2651. // RequirementLevel: Optional
  2652. // Stability: stable
  2653. // Examples: 2
  2654. MessagingKafkaSourcePartitionKey = attribute.Key("messaging.kafka.source.partition")
  2655. // MessagingKafkaMessageOffsetKey is the attribute Key conforming to the
  2656. // "messaging.kafka.message.offset" semantic conventions. It represents the
  2657. // offset of a record in the corresponding Kafka partition.
  2658. //
  2659. // Type: int
  2660. // RequirementLevel: Optional
  2661. // Stability: stable
  2662. // Examples: 42
  2663. MessagingKafkaMessageOffsetKey = attribute.Key("messaging.kafka.message.offset")
  2664. // MessagingKafkaMessageTombstoneKey is the attribute Key conforming to the
  2665. // "messaging.kafka.message.tombstone" semantic conventions. It represents
  2666. // a boolean that is true if the message is a tombstone.
  2667. //
  2668. // Type: boolean
  2669. // RequirementLevel: ConditionallyRequired (If value is `true`. When
  2670. // missing, the value is assumed to be `false`.)
  2671. // Stability: stable
  2672. MessagingKafkaMessageTombstoneKey = attribute.Key("messaging.kafka.message.tombstone")
  2673. )
  2674. // MessagingKafkaMessageKey returns an attribute KeyValue conforming to the
  2675. // "messaging.kafka.message.key" semantic conventions. It represents the
  2676. // message keys in Kafka are used for grouping alike messages to ensure they're
  2677. // processed on the same partition. They differ from `messaging.message.id` in
  2678. // that they're not unique. If the key is `null`, the attribute MUST NOT be
  2679. // set.
  2680. func MessagingKafkaMessageKey(val string) attribute.KeyValue {
  2681. return MessagingKafkaMessageKeyKey.String(val)
  2682. }
  2683. // MessagingKafkaConsumerGroup returns an attribute KeyValue conforming to
  2684. // the "messaging.kafka.consumer.group" semantic conventions. It represents the
  2685. // name of the Kafka Consumer Group that is handling the message. Only applies
  2686. // to consumers, not producers.
  2687. func MessagingKafkaConsumerGroup(val string) attribute.KeyValue {
  2688. return MessagingKafkaConsumerGroupKey.String(val)
  2689. }
  2690. // MessagingKafkaClientID returns an attribute KeyValue conforming to the
  2691. // "messaging.kafka.client_id" semantic conventions. It represents the client
  2692. // ID for the Consumer or Producer that is handling the message.
  2693. func MessagingKafkaClientID(val string) attribute.KeyValue {
  2694. return MessagingKafkaClientIDKey.String(val)
  2695. }
  2696. // MessagingKafkaDestinationPartition returns an attribute KeyValue
  2697. // conforming to the "messaging.kafka.destination.partition" semantic
  2698. // conventions. It represents the partition the message is sent to.
  2699. func MessagingKafkaDestinationPartition(val int) attribute.KeyValue {
  2700. return MessagingKafkaDestinationPartitionKey.Int(val)
  2701. }
  2702. // MessagingKafkaSourcePartition returns an attribute KeyValue conforming to
  2703. // the "messaging.kafka.source.partition" semantic conventions. It represents
  2704. // the partition the message is received from.
  2705. func MessagingKafkaSourcePartition(val int) attribute.KeyValue {
  2706. return MessagingKafkaSourcePartitionKey.Int(val)
  2707. }
  2708. // MessagingKafkaMessageOffset returns an attribute KeyValue conforming to
  2709. // the "messaging.kafka.message.offset" semantic conventions. It represents the
  2710. // offset of a record in the corresponding Kafka partition.
  2711. func MessagingKafkaMessageOffset(val int) attribute.KeyValue {
  2712. return MessagingKafkaMessageOffsetKey.Int(val)
  2713. }
  2714. // MessagingKafkaMessageTombstone returns an attribute KeyValue conforming
  2715. // to the "messaging.kafka.message.tombstone" semantic conventions. It
  2716. // represents a boolean that is true if the message is a tombstone.
  2717. func MessagingKafkaMessageTombstone(val bool) attribute.KeyValue {
  2718. return MessagingKafkaMessageTombstoneKey.Bool(val)
  2719. }
  2720. // Attributes for Apache RocketMQ
  2721. const (
  2722. // MessagingRocketmqNamespaceKey is the attribute Key conforming to the
  2723. // "messaging.rocketmq.namespace" semantic conventions. It represents the
  2724. // namespace of RocketMQ resources, resources in different namespaces are
  2725. // individual.
  2726. //
  2727. // Type: string
  2728. // RequirementLevel: Required
  2729. // Stability: stable
  2730. // Examples: 'myNamespace'
  2731. MessagingRocketmqNamespaceKey = attribute.Key("messaging.rocketmq.namespace")
  2732. // MessagingRocketmqClientGroupKey is the attribute Key conforming to the
  2733. // "messaging.rocketmq.client_group" semantic conventions. It represents
  2734. // the name of the RocketMQ producer/consumer group that is handling the
  2735. // message. The client type is identified by the SpanKind.
  2736. //
  2737. // Type: string
  2738. // RequirementLevel: Required
  2739. // Stability: stable
  2740. // Examples: 'myConsumerGroup'
  2741. MessagingRocketmqClientGroupKey = attribute.Key("messaging.rocketmq.client_group")
  2742. // MessagingRocketmqClientIDKey is the attribute Key conforming to the
  2743. // "messaging.rocketmq.client_id" semantic conventions. It represents the
  2744. // unique identifier for each client.
  2745. //
  2746. // Type: string
  2747. // RequirementLevel: Required
  2748. // Stability: stable
  2749. // Examples: 'myhost@8742@s8083jm'
  2750. MessagingRocketmqClientIDKey = attribute.Key("messaging.rocketmq.client_id")
  2751. // MessagingRocketmqMessageDeliveryTimestampKey is the attribute Key
  2752. // conforming to the "messaging.rocketmq.message.delivery_timestamp"
  2753. // semantic conventions. It represents the timestamp in milliseconds that
  2754. // the delay message is expected to be delivered to consumer.
  2755. //
  2756. // Type: int
  2757. // RequirementLevel: ConditionallyRequired (If the message type is delay
  2758. // and delay time level is not specified.)
  2759. // Stability: stable
  2760. // Examples: 1665987217045
  2761. MessagingRocketmqMessageDeliveryTimestampKey = attribute.Key("messaging.rocketmq.message.delivery_timestamp")
  2762. // MessagingRocketmqMessageDelayTimeLevelKey is the attribute Key
  2763. // conforming to the "messaging.rocketmq.message.delay_time_level" semantic
  2764. // conventions. It represents the delay time level for delay message, which
  2765. // determines the message delay time.
  2766. //
  2767. // Type: int
  2768. // RequirementLevel: ConditionallyRequired (If the message type is delay
  2769. // and delivery timestamp is not specified.)
  2770. // Stability: stable
  2771. // Examples: 3
  2772. MessagingRocketmqMessageDelayTimeLevelKey = attribute.Key("messaging.rocketmq.message.delay_time_level")
  2773. // MessagingRocketmqMessageGroupKey is the attribute Key conforming to the
  2774. // "messaging.rocketmq.message.group" semantic conventions. It represents
  2775. // the it is essential for FIFO message. Messages that belong to the same
  2776. // message group are always processed one by one within the same consumer
  2777. // group.
  2778. //
  2779. // Type: string
  2780. // RequirementLevel: ConditionallyRequired (If the message type is FIFO.)
  2781. // Stability: stable
  2782. // Examples: 'myMessageGroup'
  2783. MessagingRocketmqMessageGroupKey = attribute.Key("messaging.rocketmq.message.group")
  2784. // MessagingRocketmqMessageTypeKey is the attribute Key conforming to the
  2785. // "messaging.rocketmq.message.type" semantic conventions. It represents
  2786. // the type of message.
  2787. //
  2788. // Type: Enum
  2789. // RequirementLevel: Optional
  2790. // Stability: stable
  2791. MessagingRocketmqMessageTypeKey = attribute.Key("messaging.rocketmq.message.type")
  2792. // MessagingRocketmqMessageTagKey is the attribute Key conforming to the
  2793. // "messaging.rocketmq.message.tag" semantic conventions. It represents the
  2794. // secondary classifier of message besides topic.
  2795. //
  2796. // Type: string
  2797. // RequirementLevel: Optional
  2798. // Stability: stable
  2799. // Examples: 'tagA'
  2800. MessagingRocketmqMessageTagKey = attribute.Key("messaging.rocketmq.message.tag")
  2801. // MessagingRocketmqMessageKeysKey is the attribute Key conforming to the
  2802. // "messaging.rocketmq.message.keys" semantic conventions. It represents
  2803. // the key(s) of message, another way to mark message besides message id.
  2804. //
  2805. // Type: string[]
  2806. // RequirementLevel: Optional
  2807. // Stability: stable
  2808. // Examples: 'keyA', 'keyB'
  2809. MessagingRocketmqMessageKeysKey = attribute.Key("messaging.rocketmq.message.keys")
  2810. // MessagingRocketmqConsumptionModelKey is the attribute Key conforming to
  2811. // the "messaging.rocketmq.consumption_model" semantic conventions. It
  2812. // represents the model of message consumption. This only applies to
  2813. // consumer spans.
  2814. //
  2815. // Type: Enum
  2816. // RequirementLevel: Optional
  2817. // Stability: stable
  2818. MessagingRocketmqConsumptionModelKey = attribute.Key("messaging.rocketmq.consumption_model")
  2819. )
  2820. var (
  2821. // Normal message
  2822. MessagingRocketmqMessageTypeNormal = MessagingRocketmqMessageTypeKey.String("normal")
  2823. // FIFO message
  2824. MessagingRocketmqMessageTypeFifo = MessagingRocketmqMessageTypeKey.String("fifo")
  2825. // Delay message
  2826. MessagingRocketmqMessageTypeDelay = MessagingRocketmqMessageTypeKey.String("delay")
  2827. // Transaction message
  2828. MessagingRocketmqMessageTypeTransaction = MessagingRocketmqMessageTypeKey.String("transaction")
  2829. )
  2830. var (
  2831. // Clustering consumption model
  2832. MessagingRocketmqConsumptionModelClustering = MessagingRocketmqConsumptionModelKey.String("clustering")
  2833. // Broadcasting consumption model
  2834. MessagingRocketmqConsumptionModelBroadcasting = MessagingRocketmqConsumptionModelKey.String("broadcasting")
  2835. )
  2836. // MessagingRocketmqNamespace returns an attribute KeyValue conforming to
  2837. // the "messaging.rocketmq.namespace" semantic conventions. It represents the
  2838. // namespace of RocketMQ resources, resources in different namespaces are
  2839. // individual.
  2840. func MessagingRocketmqNamespace(val string) attribute.KeyValue {
  2841. return MessagingRocketmqNamespaceKey.String(val)
  2842. }
  2843. // MessagingRocketmqClientGroup returns an attribute KeyValue conforming to
  2844. // the "messaging.rocketmq.client_group" semantic conventions. It represents
  2845. // the name of the RocketMQ producer/consumer group that is handling the
  2846. // message. The client type is identified by the SpanKind.
  2847. func MessagingRocketmqClientGroup(val string) attribute.KeyValue {
  2848. return MessagingRocketmqClientGroupKey.String(val)
  2849. }
  2850. // MessagingRocketmqClientID returns an attribute KeyValue conforming to the
  2851. // "messaging.rocketmq.client_id" semantic conventions. It represents the
  2852. // unique identifier for each client.
  2853. func MessagingRocketmqClientID(val string) attribute.KeyValue {
  2854. return MessagingRocketmqClientIDKey.String(val)
  2855. }
  2856. // MessagingRocketmqMessageDeliveryTimestamp returns an attribute KeyValue
  2857. // conforming to the "messaging.rocketmq.message.delivery_timestamp" semantic
  2858. // conventions. It represents the timestamp in milliseconds that the delay
  2859. // message is expected to be delivered to consumer.
  2860. func MessagingRocketmqMessageDeliveryTimestamp(val int) attribute.KeyValue {
  2861. return MessagingRocketmqMessageDeliveryTimestampKey.Int(val)
  2862. }
  2863. // MessagingRocketmqMessageDelayTimeLevel returns an attribute KeyValue
  2864. // conforming to the "messaging.rocketmq.message.delay_time_level" semantic
  2865. // conventions. It represents the delay time level for delay message, which
  2866. // determines the message delay time.
  2867. func MessagingRocketmqMessageDelayTimeLevel(val int) attribute.KeyValue {
  2868. return MessagingRocketmqMessageDelayTimeLevelKey.Int(val)
  2869. }
  2870. // MessagingRocketmqMessageGroup returns an attribute KeyValue conforming to
  2871. // the "messaging.rocketmq.message.group" semantic conventions. It represents
  2872. // the it is essential for FIFO message. Messages that belong to the same
  2873. // message group are always processed one by one within the same consumer
  2874. // group.
  2875. func MessagingRocketmqMessageGroup(val string) attribute.KeyValue {
  2876. return MessagingRocketmqMessageGroupKey.String(val)
  2877. }
  2878. // MessagingRocketmqMessageTag returns an attribute KeyValue conforming to
  2879. // the "messaging.rocketmq.message.tag" semantic conventions. It represents the
  2880. // secondary classifier of message besides topic.
  2881. func MessagingRocketmqMessageTag(val string) attribute.KeyValue {
  2882. return MessagingRocketmqMessageTagKey.String(val)
  2883. }
  2884. // MessagingRocketmqMessageKeys returns an attribute KeyValue conforming to
  2885. // the "messaging.rocketmq.message.keys" semantic conventions. It represents
  2886. // the key(s) of message, another way to mark message besides message id.
  2887. func MessagingRocketmqMessageKeys(val ...string) attribute.KeyValue {
  2888. return MessagingRocketmqMessageKeysKey.StringSlice(val)
  2889. }
  2890. // Semantic conventions for remote procedure calls.
  2891. const (
  2892. // RPCSystemKey is the attribute Key conforming to the "rpc.system"
  2893. // semantic conventions. It represents a string identifying the remoting
  2894. // system. See below for a list of well-known identifiers.
  2895. //
  2896. // Type: Enum
  2897. // RequirementLevel: Required
  2898. // Stability: stable
  2899. RPCSystemKey = attribute.Key("rpc.system")
  2900. // RPCServiceKey is the attribute Key conforming to the "rpc.service"
  2901. // semantic conventions. It represents the full (logical) name of the
  2902. // service being called, including its package name, if applicable.
  2903. //
  2904. // Type: string
  2905. // RequirementLevel: Recommended
  2906. // Stability: stable
  2907. // Examples: 'myservice.EchoService'
  2908. // Note: This is the logical name of the service from the RPC interface
  2909. // perspective, which can be different from the name of any implementing
  2910. // class. The `code.namespace` attribute may be used to store the latter
  2911. // (despite the attribute name, it may include a class name; e.g., class
  2912. // with method actually executing the call on the server side, RPC client
  2913. // stub class on the client side).
  2914. RPCServiceKey = attribute.Key("rpc.service")
  2915. // RPCMethodKey is the attribute Key conforming to the "rpc.method"
  2916. // semantic conventions. It represents the name of the (logical) method
  2917. // being called, must be equal to the $method part in the span name.
  2918. //
  2919. // Type: string
  2920. // RequirementLevel: Recommended
  2921. // Stability: stable
  2922. // Examples: 'exampleMethod'
  2923. // Note: This is the logical name of the method from the RPC interface
  2924. // perspective, which can be different from the name of any implementing
  2925. // method/function. The `code.function` attribute may be used to store the
  2926. // latter (e.g., method actually executing the call on the server side, RPC
  2927. // client stub method on the client side).
  2928. RPCMethodKey = attribute.Key("rpc.method")
  2929. )
  2930. var (
  2931. // gRPC
  2932. RPCSystemGRPC = RPCSystemKey.String("grpc")
  2933. // Java RMI
  2934. RPCSystemJavaRmi = RPCSystemKey.String("java_rmi")
  2935. // .NET WCF
  2936. RPCSystemDotnetWcf = RPCSystemKey.String("dotnet_wcf")
  2937. // Apache Dubbo
  2938. RPCSystemApacheDubbo = RPCSystemKey.String("apache_dubbo")
  2939. )
  2940. // RPCService returns an attribute KeyValue conforming to the "rpc.service"
  2941. // semantic conventions. It represents the full (logical) name of the service
  2942. // being called, including its package name, if applicable.
  2943. func RPCService(val string) attribute.KeyValue {
  2944. return RPCServiceKey.String(val)
  2945. }
  2946. // RPCMethod returns an attribute KeyValue conforming to the "rpc.method"
  2947. // semantic conventions. It represents the name of the (logical) method being
  2948. // called, must be equal to the $method part in the span name.
  2949. func RPCMethod(val string) attribute.KeyValue {
  2950. return RPCMethodKey.String(val)
  2951. }
  2952. // Tech-specific attributes for gRPC.
  2953. const (
  2954. // RPCGRPCStatusCodeKey is the attribute Key conforming to the
  2955. // "rpc.grpc.status_code" semantic conventions. It represents the [numeric
  2956. // status
  2957. // code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of
  2958. // the gRPC request.
  2959. //
  2960. // Type: Enum
  2961. // RequirementLevel: Required
  2962. // Stability: stable
  2963. RPCGRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code")
  2964. )
  2965. var (
  2966. // OK
  2967. RPCGRPCStatusCodeOk = RPCGRPCStatusCodeKey.Int(0)
  2968. // CANCELLED
  2969. RPCGRPCStatusCodeCancelled = RPCGRPCStatusCodeKey.Int(1)
  2970. // UNKNOWN
  2971. RPCGRPCStatusCodeUnknown = RPCGRPCStatusCodeKey.Int(2)
  2972. // INVALID_ARGUMENT
  2973. RPCGRPCStatusCodeInvalidArgument = RPCGRPCStatusCodeKey.Int(3)
  2974. // DEADLINE_EXCEEDED
  2975. RPCGRPCStatusCodeDeadlineExceeded = RPCGRPCStatusCodeKey.Int(4)
  2976. // NOT_FOUND
  2977. RPCGRPCStatusCodeNotFound = RPCGRPCStatusCodeKey.Int(5)
  2978. // ALREADY_EXISTS
  2979. RPCGRPCStatusCodeAlreadyExists = RPCGRPCStatusCodeKey.Int(6)
  2980. // PERMISSION_DENIED
  2981. RPCGRPCStatusCodePermissionDenied = RPCGRPCStatusCodeKey.Int(7)
  2982. // RESOURCE_EXHAUSTED
  2983. RPCGRPCStatusCodeResourceExhausted = RPCGRPCStatusCodeKey.Int(8)
  2984. // FAILED_PRECONDITION
  2985. RPCGRPCStatusCodeFailedPrecondition = RPCGRPCStatusCodeKey.Int(9)
  2986. // ABORTED
  2987. RPCGRPCStatusCodeAborted = RPCGRPCStatusCodeKey.Int(10)
  2988. // OUT_OF_RANGE
  2989. RPCGRPCStatusCodeOutOfRange = RPCGRPCStatusCodeKey.Int(11)
  2990. // UNIMPLEMENTED
  2991. RPCGRPCStatusCodeUnimplemented = RPCGRPCStatusCodeKey.Int(12)
  2992. // INTERNAL
  2993. RPCGRPCStatusCodeInternal = RPCGRPCStatusCodeKey.Int(13)
  2994. // UNAVAILABLE
  2995. RPCGRPCStatusCodeUnavailable = RPCGRPCStatusCodeKey.Int(14)
  2996. // DATA_LOSS
  2997. RPCGRPCStatusCodeDataLoss = RPCGRPCStatusCodeKey.Int(15)
  2998. // UNAUTHENTICATED
  2999. RPCGRPCStatusCodeUnauthenticated = RPCGRPCStatusCodeKey.Int(16)
  3000. )
  3001. // Tech-specific attributes for [JSON RPC](https://www.jsonrpc.org/).
  3002. const (
  3003. // RPCJsonrpcVersionKey is the attribute Key conforming to the
  3004. // "rpc.jsonrpc.version" semantic conventions. It represents the protocol
  3005. // version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0
  3006. // does not specify this, the value can be omitted.
  3007. //
  3008. // Type: string
  3009. // RequirementLevel: ConditionallyRequired (If other than the default
  3010. // version (`1.0`))
  3011. // Stability: stable
  3012. // Examples: '2.0', '1.0'
  3013. RPCJsonrpcVersionKey = attribute.Key("rpc.jsonrpc.version")
  3014. // RPCJsonrpcRequestIDKey is the attribute Key conforming to the
  3015. // "rpc.jsonrpc.request_id" semantic conventions. It represents the `id`
  3016. // property of request or response. Since protocol allows id to be int,
  3017. // string, `null` or missing (for notifications), value is expected to be
  3018. // cast to string for simplicity. Use empty string in case of `null` value.
  3019. // Omit entirely if this is a notification.
  3020. //
  3021. // Type: string
  3022. // RequirementLevel: Optional
  3023. // Stability: stable
  3024. // Examples: '10', 'request-7', ''
  3025. RPCJsonrpcRequestIDKey = attribute.Key("rpc.jsonrpc.request_id")
  3026. // RPCJsonrpcErrorCodeKey is the attribute Key conforming to the
  3027. // "rpc.jsonrpc.error_code" semantic conventions. It represents the
  3028. // `error.code` property of response if it is an error response.
  3029. //
  3030. // Type: int
  3031. // RequirementLevel: ConditionallyRequired (If response is not successful.)
  3032. // Stability: stable
  3033. // Examples: -32700, 100
  3034. RPCJsonrpcErrorCodeKey = attribute.Key("rpc.jsonrpc.error_code")
  3035. // RPCJsonrpcErrorMessageKey is the attribute Key conforming to the
  3036. // "rpc.jsonrpc.error_message" semantic conventions. It represents the
  3037. // `error.message` property of response if it is an error response.
  3038. //
  3039. // Type: string
  3040. // RequirementLevel: Optional
  3041. // Stability: stable
  3042. // Examples: 'Parse error', 'User already exists'
  3043. RPCJsonrpcErrorMessageKey = attribute.Key("rpc.jsonrpc.error_message")
  3044. )
  3045. // RPCJsonrpcVersion returns an attribute KeyValue conforming to the
  3046. // "rpc.jsonrpc.version" semantic conventions. It represents the protocol
  3047. // version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0
  3048. // does not specify this, the value can be omitted.
  3049. func RPCJsonrpcVersion(val string) attribute.KeyValue {
  3050. return RPCJsonrpcVersionKey.String(val)
  3051. }
  3052. // RPCJsonrpcRequestID returns an attribute KeyValue conforming to the
  3053. // "rpc.jsonrpc.request_id" semantic conventions. It represents the `id`
  3054. // property of request or response. Since protocol allows id to be int, string,
  3055. // `null` or missing (for notifications), value is expected to be cast to
  3056. // string for simplicity. Use empty string in case of `null` value. Omit
  3057. // entirely if this is a notification.
  3058. func RPCJsonrpcRequestID(val string) attribute.KeyValue {
  3059. return RPCJsonrpcRequestIDKey.String(val)
  3060. }
  3061. // RPCJsonrpcErrorCode returns an attribute KeyValue conforming to the
  3062. // "rpc.jsonrpc.error_code" semantic conventions. It represents the
  3063. // `error.code` property of response if it is an error response.
  3064. func RPCJsonrpcErrorCode(val int) attribute.KeyValue {
  3065. return RPCJsonrpcErrorCodeKey.Int(val)
  3066. }
  3067. // RPCJsonrpcErrorMessage returns an attribute KeyValue conforming to the
  3068. // "rpc.jsonrpc.error_message" semantic conventions. It represents the
  3069. // `error.message` property of response if it is an error response.
  3070. func RPCJsonrpcErrorMessage(val string) attribute.KeyValue {
  3071. return RPCJsonrpcErrorMessageKey.String(val)
  3072. }