trace.go 134 KB

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