attribute_group.go 73 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877
  1. // Copyright The OpenTelemetry Authors
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. // Code generated from semantic convention specification. DO NOT EDIT.
  15. package semconv // import "go.opentelemetry.io/otel/semconv/v1.21.0"
  16. import "go.opentelemetry.io/otel/attribute"
  17. // These attributes may be used to describe the client in a connection-based
  18. // network interaction where there is one side that initiates the connection
  19. // (the client is the side that initiates the connection). This covers all TCP
  20. // network interactions since TCP is connection-based and one side initiates
  21. // the connection (an exception is made for peer-to-peer communication over TCP
  22. // where the "user-facing" surface of the protocol / API does not expose a
  23. // clear notion of client and server). This also covers UDP network
  24. // interactions where one side initiates the interaction, e.g. QUIC (HTTP/3)
  25. // and DNS.
  26. const (
  27. // ClientAddressKey is the attribute Key conforming to the "client.address"
  28. // semantic conventions. It represents the client address - unix domain
  29. // socket name, IPv4 or IPv6 address.
  30. //
  31. // Type: string
  32. // RequirementLevel: Optional
  33. // Stability: stable
  34. // Examples: '/tmp/my.sock', '10.1.2.80'
  35. // Note: When observed from the server side, and when communicating through
  36. // an intermediary, `client.address` SHOULD represent client address behind
  37. // any intermediaries (e.g. proxies) if it's available.
  38. ClientAddressKey = attribute.Key("client.address")
  39. // ClientPortKey is the attribute Key conforming to the "client.port"
  40. // semantic conventions. It represents the client port number
  41. //
  42. // Type: int
  43. // RequirementLevel: Optional
  44. // Stability: stable
  45. // Examples: 65123
  46. // Note: When observed from the server side, and when communicating through
  47. // an intermediary, `client.port` SHOULD represent client port behind any
  48. // intermediaries (e.g. proxies) if it's available.
  49. ClientPortKey = attribute.Key("client.port")
  50. // ClientSocketAddressKey is the attribute Key conforming to the
  51. // "client.socket.address" semantic conventions. It represents the
  52. // immediate client peer address - unix domain socket name, IPv4 or IPv6
  53. // address.
  54. //
  55. // Type: string
  56. // RequirementLevel: Recommended (If different than `client.address`.)
  57. // Stability: stable
  58. // Examples: '/tmp/my.sock', '127.0.0.1'
  59. ClientSocketAddressKey = attribute.Key("client.socket.address")
  60. // ClientSocketPortKey is the attribute Key conforming to the
  61. // "client.socket.port" semantic conventions. It represents the immediate
  62. // client peer port number
  63. //
  64. // Type: int
  65. // RequirementLevel: Recommended (If different than `client.port`.)
  66. // Stability: stable
  67. // Examples: 35555
  68. ClientSocketPortKey = attribute.Key("client.socket.port")
  69. )
  70. // ClientAddress returns an attribute KeyValue conforming to the
  71. // "client.address" semantic conventions. It represents the client address -
  72. // unix domain socket name, IPv4 or IPv6 address.
  73. func ClientAddress(val string) attribute.KeyValue {
  74. return ClientAddressKey.String(val)
  75. }
  76. // ClientPort returns an attribute KeyValue conforming to the "client.port"
  77. // semantic conventions. It represents the client port number
  78. func ClientPort(val int) attribute.KeyValue {
  79. return ClientPortKey.Int(val)
  80. }
  81. // ClientSocketAddress returns an attribute KeyValue conforming to the
  82. // "client.socket.address" semantic conventions. It represents the immediate
  83. // client peer address - unix domain socket name, IPv4 or IPv6 address.
  84. func ClientSocketAddress(val string) attribute.KeyValue {
  85. return ClientSocketAddressKey.String(val)
  86. }
  87. // ClientSocketPort returns an attribute KeyValue conforming to the
  88. // "client.socket.port" semantic conventions. It represents the immediate
  89. // client peer port number
  90. func ClientSocketPort(val int) attribute.KeyValue {
  91. return ClientSocketPortKey.Int(val)
  92. }
  93. // Describes deprecated HTTP attributes.
  94. const (
  95. // HTTPMethodKey is the attribute Key conforming to the "http.method"
  96. // semantic conventions. It represents the deprecated, use
  97. // `http.request.method` instead.
  98. //
  99. // Type: string
  100. // RequirementLevel: Optional
  101. // Stability: deprecated
  102. // Examples: 'GET', 'POST', 'HEAD'
  103. HTTPMethodKey = attribute.Key("http.method")
  104. // HTTPStatusCodeKey is the attribute Key conforming to the
  105. // "http.status_code" semantic conventions. It represents the deprecated,
  106. // use `http.response.status_code` instead.
  107. //
  108. // Type: int
  109. // RequirementLevel: Optional
  110. // Stability: deprecated
  111. // Examples: 200
  112. HTTPStatusCodeKey = attribute.Key("http.status_code")
  113. // HTTPSchemeKey is the attribute Key conforming to the "http.scheme"
  114. // semantic conventions. It represents the deprecated, use `url.scheme`
  115. // instead.
  116. //
  117. // Type: string
  118. // RequirementLevel: Optional
  119. // Stability: deprecated
  120. // Examples: 'http', 'https'
  121. HTTPSchemeKey = attribute.Key("http.scheme")
  122. // HTTPURLKey is the attribute Key conforming to the "http.url" semantic
  123. // conventions. It represents the deprecated, use `url.full` instead.
  124. //
  125. // Type: string
  126. // RequirementLevel: Optional
  127. // Stability: deprecated
  128. // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv'
  129. HTTPURLKey = attribute.Key("http.url")
  130. // HTTPTargetKey is the attribute Key conforming to the "http.target"
  131. // semantic conventions. It represents the deprecated, use `url.path` and
  132. // `url.query` instead.
  133. //
  134. // Type: string
  135. // RequirementLevel: Optional
  136. // Stability: deprecated
  137. // Examples: '/search?q=OpenTelemetry#SemConv'
  138. HTTPTargetKey = attribute.Key("http.target")
  139. // HTTPRequestContentLengthKey is the attribute Key conforming to the
  140. // "http.request_content_length" semantic conventions. It represents the
  141. // deprecated, use `http.request.body.size` instead.
  142. //
  143. // Type: int
  144. // RequirementLevel: Optional
  145. // Stability: deprecated
  146. // Examples: 3495
  147. HTTPRequestContentLengthKey = attribute.Key("http.request_content_length")
  148. // HTTPResponseContentLengthKey is the attribute Key conforming to the
  149. // "http.response_content_length" semantic conventions. It represents the
  150. // deprecated, use `http.response.body.size` instead.
  151. //
  152. // Type: int
  153. // RequirementLevel: Optional
  154. // Stability: deprecated
  155. // Examples: 3495
  156. HTTPResponseContentLengthKey = attribute.Key("http.response_content_length")
  157. )
  158. // HTTPMethod returns an attribute KeyValue conforming to the "http.method"
  159. // semantic conventions. It represents the deprecated, use
  160. // `http.request.method` instead.
  161. func HTTPMethod(val string) attribute.KeyValue {
  162. return HTTPMethodKey.String(val)
  163. }
  164. // HTTPStatusCode returns an attribute KeyValue conforming to the
  165. // "http.status_code" semantic conventions. It represents the deprecated, use
  166. // `http.response.status_code` instead.
  167. func HTTPStatusCode(val int) attribute.KeyValue {
  168. return HTTPStatusCodeKey.Int(val)
  169. }
  170. // HTTPScheme returns an attribute KeyValue conforming to the "http.scheme"
  171. // semantic conventions. It represents the deprecated, use `url.scheme`
  172. // instead.
  173. func HTTPScheme(val string) attribute.KeyValue {
  174. return HTTPSchemeKey.String(val)
  175. }
  176. // HTTPURL returns an attribute KeyValue conforming to the "http.url"
  177. // semantic conventions. It represents the deprecated, use `url.full` instead.
  178. func HTTPURL(val string) attribute.KeyValue {
  179. return HTTPURLKey.String(val)
  180. }
  181. // HTTPTarget returns an attribute KeyValue conforming to the "http.target"
  182. // semantic conventions. It represents the deprecated, use `url.path` and
  183. // `url.query` instead.
  184. func HTTPTarget(val string) attribute.KeyValue {
  185. return HTTPTargetKey.String(val)
  186. }
  187. // HTTPRequestContentLength returns an attribute KeyValue conforming to the
  188. // "http.request_content_length" semantic conventions. It represents the
  189. // deprecated, use `http.request.body.size` instead.
  190. func HTTPRequestContentLength(val int) attribute.KeyValue {
  191. return HTTPRequestContentLengthKey.Int(val)
  192. }
  193. // HTTPResponseContentLength returns an attribute KeyValue conforming to the
  194. // "http.response_content_length" semantic conventions. It represents the
  195. // deprecated, use `http.response.body.size` instead.
  196. func HTTPResponseContentLength(val int) attribute.KeyValue {
  197. return HTTPResponseContentLengthKey.Int(val)
  198. }
  199. // These attributes may be used for any network related operation.
  200. const (
  201. // NetSockPeerNameKey is the attribute Key conforming to the
  202. // "net.sock.peer.name" semantic conventions. It represents the deprecated,
  203. // use `server.socket.domain` on client spans.
  204. //
  205. // Type: string
  206. // RequirementLevel: Optional
  207. // Stability: deprecated
  208. // Examples: '/var/my.sock'
  209. NetSockPeerNameKey = attribute.Key("net.sock.peer.name")
  210. // NetSockPeerAddrKey is the attribute Key conforming to the
  211. // "net.sock.peer.addr" semantic conventions. It represents the deprecated,
  212. // use `server.socket.address` on client spans and `client.socket.address`
  213. // on server spans.
  214. //
  215. // Type: string
  216. // RequirementLevel: Optional
  217. // Stability: deprecated
  218. // Examples: '192.168.0.1'
  219. NetSockPeerAddrKey = attribute.Key("net.sock.peer.addr")
  220. // NetSockPeerPortKey is the attribute Key conforming to the
  221. // "net.sock.peer.port" semantic conventions. It represents the deprecated,
  222. // use `server.socket.port` on client spans and `client.socket.port` on
  223. // server spans.
  224. //
  225. // Type: int
  226. // RequirementLevel: Optional
  227. // Stability: deprecated
  228. // Examples: 65531
  229. NetSockPeerPortKey = attribute.Key("net.sock.peer.port")
  230. // NetPeerNameKey is the attribute Key conforming to the "net.peer.name"
  231. // semantic conventions. It represents the deprecated, use `server.address`
  232. // on client spans and `client.address` on server spans.
  233. //
  234. // Type: string
  235. // RequirementLevel: Optional
  236. // Stability: deprecated
  237. // Examples: 'example.com'
  238. NetPeerNameKey = attribute.Key("net.peer.name")
  239. // NetPeerPortKey is the attribute Key conforming to the "net.peer.port"
  240. // semantic conventions. It represents the deprecated, use `server.port` on
  241. // client spans and `client.port` on server spans.
  242. //
  243. // Type: int
  244. // RequirementLevel: Optional
  245. // Stability: deprecated
  246. // Examples: 8080
  247. NetPeerPortKey = attribute.Key("net.peer.port")
  248. // NetHostNameKey is the attribute Key conforming to the "net.host.name"
  249. // semantic conventions. It represents the deprecated, use
  250. // `server.address`.
  251. //
  252. // Type: string
  253. // RequirementLevel: Optional
  254. // Stability: deprecated
  255. // Examples: 'example.com'
  256. NetHostNameKey = attribute.Key("net.host.name")
  257. // NetHostPortKey is the attribute Key conforming to the "net.host.port"
  258. // semantic conventions. It represents the deprecated, use `server.port`.
  259. //
  260. // Type: int
  261. // RequirementLevel: Optional
  262. // Stability: deprecated
  263. // Examples: 8080
  264. NetHostPortKey = attribute.Key("net.host.port")
  265. // NetSockHostAddrKey is the attribute Key conforming to the
  266. // "net.sock.host.addr" semantic conventions. It represents the deprecated,
  267. // use `server.socket.address`.
  268. //
  269. // Type: string
  270. // RequirementLevel: Optional
  271. // Stability: deprecated
  272. // Examples: '/var/my.sock'
  273. NetSockHostAddrKey = attribute.Key("net.sock.host.addr")
  274. // NetSockHostPortKey is the attribute Key conforming to the
  275. // "net.sock.host.port" semantic conventions. It represents the deprecated,
  276. // use `server.socket.port`.
  277. //
  278. // Type: int
  279. // RequirementLevel: Optional
  280. // Stability: deprecated
  281. // Examples: 8080
  282. NetSockHostPortKey = attribute.Key("net.sock.host.port")
  283. // NetTransportKey is the attribute Key conforming to the "net.transport"
  284. // semantic conventions. It represents the deprecated, use
  285. // `network.transport`.
  286. //
  287. // Type: Enum
  288. // RequirementLevel: Optional
  289. // Stability: deprecated
  290. NetTransportKey = attribute.Key("net.transport")
  291. // NetProtocolNameKey is the attribute Key conforming to the
  292. // "net.protocol.name" semantic conventions. It represents the deprecated,
  293. // use `network.protocol.name`.
  294. //
  295. // Type: string
  296. // RequirementLevel: Optional
  297. // Stability: deprecated
  298. // Examples: 'amqp', 'http', 'mqtt'
  299. NetProtocolNameKey = attribute.Key("net.protocol.name")
  300. // NetProtocolVersionKey is the attribute Key conforming to the
  301. // "net.protocol.version" semantic conventions. It represents the
  302. // deprecated, use `network.protocol.version`.
  303. //
  304. // Type: string
  305. // RequirementLevel: Optional
  306. // Stability: deprecated
  307. // Examples: '3.1.1'
  308. NetProtocolVersionKey = attribute.Key("net.protocol.version")
  309. // NetSockFamilyKey is the attribute Key conforming to the
  310. // "net.sock.family" semantic conventions. It represents the deprecated,
  311. // use `network.transport` and `network.type`.
  312. //
  313. // Type: Enum
  314. // RequirementLevel: Optional
  315. // Stability: deprecated
  316. NetSockFamilyKey = attribute.Key("net.sock.family")
  317. )
  318. var (
  319. // ip_tcp
  320. NetTransportTCP = NetTransportKey.String("ip_tcp")
  321. // ip_udp
  322. NetTransportUDP = NetTransportKey.String("ip_udp")
  323. // Named or anonymous pipe
  324. NetTransportPipe = NetTransportKey.String("pipe")
  325. // In-process communication
  326. NetTransportInProc = NetTransportKey.String("inproc")
  327. // Something else (non IP-based)
  328. NetTransportOther = NetTransportKey.String("other")
  329. )
  330. var (
  331. // IPv4 address
  332. NetSockFamilyInet = NetSockFamilyKey.String("inet")
  333. // IPv6 address
  334. NetSockFamilyInet6 = NetSockFamilyKey.String("inet6")
  335. // Unix domain socket path
  336. NetSockFamilyUnix = NetSockFamilyKey.String("unix")
  337. )
  338. // NetSockPeerName returns an attribute KeyValue conforming to the
  339. // "net.sock.peer.name" semantic conventions. It represents the deprecated, use
  340. // `server.socket.domain` on client spans.
  341. func NetSockPeerName(val string) attribute.KeyValue {
  342. return NetSockPeerNameKey.String(val)
  343. }
  344. // NetSockPeerAddr returns an attribute KeyValue conforming to the
  345. // "net.sock.peer.addr" semantic conventions. It represents the deprecated, use
  346. // `server.socket.address` on client spans and `client.socket.address` on
  347. // server spans.
  348. func NetSockPeerAddr(val string) attribute.KeyValue {
  349. return NetSockPeerAddrKey.String(val)
  350. }
  351. // NetSockPeerPort returns an attribute KeyValue conforming to the
  352. // "net.sock.peer.port" semantic conventions. It represents the deprecated, use
  353. // `server.socket.port` on client spans and `client.socket.port` on server
  354. // spans.
  355. func NetSockPeerPort(val int) attribute.KeyValue {
  356. return NetSockPeerPortKey.Int(val)
  357. }
  358. // NetPeerName returns an attribute KeyValue conforming to the
  359. // "net.peer.name" semantic conventions. It represents the deprecated, use
  360. // `server.address` on client spans and `client.address` on server spans.
  361. func NetPeerName(val string) attribute.KeyValue {
  362. return NetPeerNameKey.String(val)
  363. }
  364. // NetPeerPort returns an attribute KeyValue conforming to the
  365. // "net.peer.port" semantic conventions. It represents the deprecated, use
  366. // `server.port` on client spans and `client.port` on server spans.
  367. func NetPeerPort(val int) attribute.KeyValue {
  368. return NetPeerPortKey.Int(val)
  369. }
  370. // NetHostName returns an attribute KeyValue conforming to the
  371. // "net.host.name" semantic conventions. It represents the deprecated, use
  372. // `server.address`.
  373. func NetHostName(val string) attribute.KeyValue {
  374. return NetHostNameKey.String(val)
  375. }
  376. // NetHostPort returns an attribute KeyValue conforming to the
  377. // "net.host.port" semantic conventions. It represents the deprecated, use
  378. // `server.port`.
  379. func NetHostPort(val int) attribute.KeyValue {
  380. return NetHostPortKey.Int(val)
  381. }
  382. // NetSockHostAddr returns an attribute KeyValue conforming to the
  383. // "net.sock.host.addr" semantic conventions. It represents the deprecated, use
  384. // `server.socket.address`.
  385. func NetSockHostAddr(val string) attribute.KeyValue {
  386. return NetSockHostAddrKey.String(val)
  387. }
  388. // NetSockHostPort returns an attribute KeyValue conforming to the
  389. // "net.sock.host.port" semantic conventions. It represents the deprecated, use
  390. // `server.socket.port`.
  391. func NetSockHostPort(val int) attribute.KeyValue {
  392. return NetSockHostPortKey.Int(val)
  393. }
  394. // NetProtocolName returns an attribute KeyValue conforming to the
  395. // "net.protocol.name" semantic conventions. It represents the deprecated, use
  396. // `network.protocol.name`.
  397. func NetProtocolName(val string) attribute.KeyValue {
  398. return NetProtocolNameKey.String(val)
  399. }
  400. // NetProtocolVersion returns an attribute KeyValue conforming to the
  401. // "net.protocol.version" semantic conventions. It represents the deprecated,
  402. // use `network.protocol.version`.
  403. func NetProtocolVersion(val string) attribute.KeyValue {
  404. return NetProtocolVersionKey.String(val)
  405. }
  406. // These attributes may be used to describe the receiver of a network
  407. // exchange/packet. These should be used when there is no client/server
  408. // relationship between the two sides, or when that relationship is unknown.
  409. // This covers low-level network interactions (e.g. packet tracing) where you
  410. // don't know if there was a connection or which side initiated it. This also
  411. // covers unidirectional UDP flows and peer-to-peer communication where the
  412. // "user-facing" surface of the protocol / API does not expose a clear notion
  413. // of client and server.
  414. const (
  415. // DestinationDomainKey is the attribute Key conforming to the
  416. // "destination.domain" semantic conventions. It represents the domain name
  417. // of the destination system.
  418. //
  419. // Type: string
  420. // RequirementLevel: Optional
  421. // Stability: stable
  422. // Examples: 'foo.example.com'
  423. // Note: This value may be a host name, a fully qualified domain name, or
  424. // another host naming format.
  425. DestinationDomainKey = attribute.Key("destination.domain")
  426. // DestinationAddressKey is the attribute Key conforming to the
  427. // "destination.address" semantic conventions. It represents the peer
  428. // address, for example IP address or UNIX socket name.
  429. //
  430. // Type: string
  431. // RequirementLevel: Optional
  432. // Stability: stable
  433. // Examples: '10.5.3.2'
  434. DestinationAddressKey = attribute.Key("destination.address")
  435. // DestinationPortKey is the attribute Key conforming to the
  436. // "destination.port" semantic conventions. It represents the peer port
  437. // number
  438. //
  439. // Type: int
  440. // RequirementLevel: Optional
  441. // Stability: stable
  442. // Examples: 3389, 2888
  443. DestinationPortKey = attribute.Key("destination.port")
  444. )
  445. // DestinationDomain returns an attribute KeyValue conforming to the
  446. // "destination.domain" semantic conventions. It represents the domain name of
  447. // the destination system.
  448. func DestinationDomain(val string) attribute.KeyValue {
  449. return DestinationDomainKey.String(val)
  450. }
  451. // DestinationAddress returns an attribute KeyValue conforming to the
  452. // "destination.address" semantic conventions. It represents the peer address,
  453. // for example IP address or UNIX socket name.
  454. func DestinationAddress(val string) attribute.KeyValue {
  455. return DestinationAddressKey.String(val)
  456. }
  457. // DestinationPort returns an attribute KeyValue conforming to the
  458. // "destination.port" semantic conventions. It represents the peer port number
  459. func DestinationPort(val int) attribute.KeyValue {
  460. return DestinationPortKey.Int(val)
  461. }
  462. // Describes HTTP attributes.
  463. const (
  464. // HTTPRequestMethodKey is the attribute Key conforming to the
  465. // "http.request.method" semantic conventions. It represents the hTTP
  466. // request method.
  467. //
  468. // Type: Enum
  469. // RequirementLevel: Required
  470. // Stability: stable
  471. // Examples: 'GET', 'POST', 'HEAD'
  472. // Note: HTTP request method value SHOULD be "known" to the
  473. // instrumentation.
  474. // By default, this convention defines "known" methods as the ones listed
  475. // in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods)
  476. // and the PATCH method defined in
  477. // [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html).
  478. //
  479. // If the HTTP request method is not known to instrumentation, it MUST set
  480. // the `http.request.method` attribute to `_OTHER` and, except if reporting
  481. // a metric, MUST
  482. // set the exact method received in the request line as value of the
  483. // `http.request.method_original` attribute.
  484. //
  485. // If the HTTP instrumentation could end up converting valid HTTP request
  486. // methods to `_OTHER`, then it MUST provide a way to override
  487. // the list of known HTTP methods. If this override is done via environment
  488. // variable, then the environment variable MUST be named
  489. // OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated
  490. // list of case-sensitive known HTTP methods
  491. // (this list MUST be a full override of the default known method, it is
  492. // not a list of known methods in addition to the defaults).
  493. //
  494. // HTTP method names are case-sensitive and `http.request.method` attribute
  495. // value MUST match a known HTTP method name exactly.
  496. // Instrumentations for specific web frameworks that consider HTTP methods
  497. // to be case insensitive, SHOULD populate a canonical equivalent.
  498. // Tracing instrumentations that do so, MUST also set
  499. // `http.request.method_original` to the original value.
  500. HTTPRequestMethodKey = attribute.Key("http.request.method")
  501. // HTTPResponseStatusCodeKey is the attribute Key conforming to the
  502. // "http.response.status_code" semantic conventions. It represents the
  503. // [HTTP response status
  504. // code](https://tools.ietf.org/html/rfc7231#section-6).
  505. //
  506. // Type: int
  507. // RequirementLevel: ConditionallyRequired (If and only if one was
  508. // received/sent.)
  509. // Stability: stable
  510. // Examples: 200
  511. HTTPResponseStatusCodeKey = attribute.Key("http.response.status_code")
  512. )
  513. var (
  514. // CONNECT method
  515. HTTPRequestMethodConnect = HTTPRequestMethodKey.String("CONNECT")
  516. // DELETE method
  517. HTTPRequestMethodDelete = HTTPRequestMethodKey.String("DELETE")
  518. // GET method
  519. HTTPRequestMethodGet = HTTPRequestMethodKey.String("GET")
  520. // HEAD method
  521. HTTPRequestMethodHead = HTTPRequestMethodKey.String("HEAD")
  522. // OPTIONS method
  523. HTTPRequestMethodOptions = HTTPRequestMethodKey.String("OPTIONS")
  524. // PATCH method
  525. HTTPRequestMethodPatch = HTTPRequestMethodKey.String("PATCH")
  526. // POST method
  527. HTTPRequestMethodPost = HTTPRequestMethodKey.String("POST")
  528. // PUT method
  529. HTTPRequestMethodPut = HTTPRequestMethodKey.String("PUT")
  530. // TRACE method
  531. HTTPRequestMethodTrace = HTTPRequestMethodKey.String("TRACE")
  532. // Any HTTP method that the instrumentation has no prior knowledge of
  533. HTTPRequestMethodOther = HTTPRequestMethodKey.String("_OTHER")
  534. )
  535. // HTTPResponseStatusCode returns an attribute KeyValue conforming to the
  536. // "http.response.status_code" semantic conventions. It represents the [HTTP
  537. // response status code](https://tools.ietf.org/html/rfc7231#section-6).
  538. func HTTPResponseStatusCode(val int) attribute.KeyValue {
  539. return HTTPResponseStatusCodeKey.Int(val)
  540. }
  541. // HTTP Server attributes
  542. const (
  543. // HTTPRouteKey is the attribute Key conforming to the "http.route"
  544. // semantic conventions. It represents the matched route (path template in
  545. // the format used by the respective server framework). See note below
  546. //
  547. // Type: string
  548. // RequirementLevel: ConditionallyRequired (If and only if it's available)
  549. // Stability: stable
  550. // Examples: '/users/:userID?', '{controller}/{action}/{id?}'
  551. // Note: MUST NOT be populated when this is not supported by the HTTP
  552. // server framework as the route attribute should have low-cardinality and
  553. // the URI path can NOT substitute it.
  554. // SHOULD include the [application
  555. // root](/docs/http/http-spans.md#http-server-definitions) if there is one.
  556. HTTPRouteKey = attribute.Key("http.route")
  557. )
  558. // HTTPRoute returns an attribute KeyValue conforming to the "http.route"
  559. // semantic conventions. It represents the matched route (path template in the
  560. // format used by the respective server framework). See note below
  561. func HTTPRoute(val string) attribute.KeyValue {
  562. return HTTPRouteKey.String(val)
  563. }
  564. // Attributes for Events represented using Log Records.
  565. const (
  566. // EventNameKey is the attribute Key conforming to the "event.name"
  567. // semantic conventions. It represents the name identifies the event.
  568. //
  569. // Type: string
  570. // RequirementLevel: Required
  571. // Stability: stable
  572. // Examples: 'click', 'exception'
  573. EventNameKey = attribute.Key("event.name")
  574. // EventDomainKey is the attribute Key conforming to the "event.domain"
  575. // semantic conventions. It represents the domain identifies the business
  576. // context for the events.
  577. //
  578. // Type: Enum
  579. // RequirementLevel: Required
  580. // Stability: stable
  581. // Note: Events across different domains may have same `event.name`, yet be
  582. // unrelated events.
  583. EventDomainKey = attribute.Key("event.domain")
  584. )
  585. var (
  586. // Events from browser apps
  587. EventDomainBrowser = EventDomainKey.String("browser")
  588. // Events from mobile apps
  589. EventDomainDevice = EventDomainKey.String("device")
  590. // Events from Kubernetes
  591. EventDomainK8S = EventDomainKey.String("k8s")
  592. )
  593. // EventName returns an attribute KeyValue conforming to the "event.name"
  594. // semantic conventions. It represents the name identifies the event.
  595. func EventName(val string) attribute.KeyValue {
  596. return EventNameKey.String(val)
  597. }
  598. // The attributes described in this section are rather generic. They may be
  599. // used in any Log Record they apply to.
  600. const (
  601. // LogRecordUIDKey is the attribute Key conforming to the "log.record.uid"
  602. // semantic conventions. It represents a unique identifier for the Log
  603. // Record.
  604. //
  605. // Type: string
  606. // RequirementLevel: Optional
  607. // Stability: stable
  608. // Examples: '01ARZ3NDEKTSV4RRFFQ69G5FAV'
  609. // Note: If an id is provided, other log records with the same id will be
  610. // considered duplicates and can be removed safely. This means, that two
  611. // distinguishable log records MUST have different values.
  612. // The id MAY be an [Universally Unique Lexicographically Sortable
  613. // Identifier (ULID)](https://github.com/ulid/spec), but other identifiers
  614. // (e.g. UUID) may be used as needed.
  615. LogRecordUIDKey = attribute.Key("log.record.uid")
  616. )
  617. // LogRecordUID returns an attribute KeyValue conforming to the
  618. // "log.record.uid" semantic conventions. It represents a unique identifier for
  619. // the Log Record.
  620. func LogRecordUID(val string) attribute.KeyValue {
  621. return LogRecordUIDKey.String(val)
  622. }
  623. // Describes Log attributes
  624. const (
  625. // LogIostreamKey is the attribute Key conforming to the "log.iostream"
  626. // semantic conventions. It represents the stream associated with the log.
  627. // See below for a list of well-known values.
  628. //
  629. // Type: Enum
  630. // RequirementLevel: Optional
  631. // Stability: stable
  632. LogIostreamKey = attribute.Key("log.iostream")
  633. )
  634. var (
  635. // Logs from stdout stream
  636. LogIostreamStdout = LogIostreamKey.String("stdout")
  637. // Events from stderr stream
  638. LogIostreamStderr = LogIostreamKey.String("stderr")
  639. )
  640. // A file to which log was emitted.
  641. const (
  642. // LogFileNameKey is the attribute Key conforming to the "log.file.name"
  643. // semantic conventions. It represents the basename of the file.
  644. //
  645. // Type: string
  646. // RequirementLevel: Recommended
  647. // Stability: stable
  648. // Examples: 'audit.log'
  649. LogFileNameKey = attribute.Key("log.file.name")
  650. // LogFilePathKey is the attribute Key conforming to the "log.file.path"
  651. // semantic conventions. It represents the full path to the file.
  652. //
  653. // Type: string
  654. // RequirementLevel: Optional
  655. // Stability: stable
  656. // Examples: '/var/log/mysql/audit.log'
  657. LogFilePathKey = attribute.Key("log.file.path")
  658. // LogFileNameResolvedKey is the attribute Key conforming to the
  659. // "log.file.name_resolved" semantic conventions. It represents the
  660. // basename of the file, with symlinks resolved.
  661. //
  662. // Type: string
  663. // RequirementLevel: Optional
  664. // Stability: stable
  665. // Examples: 'uuid.log'
  666. LogFileNameResolvedKey = attribute.Key("log.file.name_resolved")
  667. // LogFilePathResolvedKey is the attribute Key conforming to the
  668. // "log.file.path_resolved" semantic conventions. It represents the full
  669. // path to the file, with symlinks resolved.
  670. //
  671. // Type: string
  672. // RequirementLevel: Optional
  673. // Stability: stable
  674. // Examples: '/var/lib/docker/uuid.log'
  675. LogFilePathResolvedKey = attribute.Key("log.file.path_resolved")
  676. )
  677. // LogFileName returns an attribute KeyValue conforming to the
  678. // "log.file.name" semantic conventions. It represents the basename of the
  679. // file.
  680. func LogFileName(val string) attribute.KeyValue {
  681. return LogFileNameKey.String(val)
  682. }
  683. // LogFilePath returns an attribute KeyValue conforming to the
  684. // "log.file.path" semantic conventions. It represents the full path to the
  685. // file.
  686. func LogFilePath(val string) attribute.KeyValue {
  687. return LogFilePathKey.String(val)
  688. }
  689. // LogFileNameResolved returns an attribute KeyValue conforming to the
  690. // "log.file.name_resolved" semantic conventions. It represents the basename of
  691. // the file, with symlinks resolved.
  692. func LogFileNameResolved(val string) attribute.KeyValue {
  693. return LogFileNameResolvedKey.String(val)
  694. }
  695. // LogFilePathResolved returns an attribute KeyValue conforming to the
  696. // "log.file.path_resolved" semantic conventions. It represents the full path
  697. // to the file, with symlinks resolved.
  698. func LogFilePathResolved(val string) attribute.KeyValue {
  699. return LogFilePathResolvedKey.String(val)
  700. }
  701. // Describes JVM memory metric attributes.
  702. const (
  703. // TypeKey is the attribute Key conforming to the "type" semantic
  704. // conventions. It represents the type of memory.
  705. //
  706. // Type: Enum
  707. // RequirementLevel: Recommended
  708. // Stability: stable
  709. // Examples: 'heap', 'non_heap'
  710. TypeKey = attribute.Key("type")
  711. // PoolKey is the attribute Key conforming to the "pool" semantic
  712. // conventions. It represents the name of the memory pool.
  713. //
  714. // Type: string
  715. // RequirementLevel: Recommended
  716. // Stability: stable
  717. // Examples: 'G1 Old Gen', 'G1 Eden space', 'G1 Survivor Space'
  718. // Note: Pool names are generally obtained via
  719. // [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()).
  720. PoolKey = attribute.Key("pool")
  721. )
  722. var (
  723. // Heap memory
  724. TypeHeap = TypeKey.String("heap")
  725. // Non-heap memory
  726. TypeNonHeap = TypeKey.String("non_heap")
  727. )
  728. // Pool returns an attribute KeyValue conforming to the "pool" semantic
  729. // conventions. It represents the name of the memory pool.
  730. func Pool(val string) attribute.KeyValue {
  731. return PoolKey.String(val)
  732. }
  733. // These attributes may be used to describe the server in a connection-based
  734. // network interaction where there is one side that initiates the connection
  735. // (the client is the side that initiates the connection). This covers all TCP
  736. // network interactions since TCP is connection-based and one side initiates
  737. // the connection (an exception is made for peer-to-peer communication over TCP
  738. // where the "user-facing" surface of the protocol / API does not expose a
  739. // clear notion of client and server). This also covers UDP network
  740. // interactions where one side initiates the interaction, e.g. QUIC (HTTP/3)
  741. // and DNS.
  742. const (
  743. // ServerAddressKey is the attribute Key conforming to the "server.address"
  744. // semantic conventions. It represents the logical server hostname, matches
  745. // server FQDN if available, and IP or socket address if FQDN is not known.
  746. //
  747. // Type: string
  748. // RequirementLevel: Optional
  749. // Stability: stable
  750. // Examples: 'example.com'
  751. ServerAddressKey = attribute.Key("server.address")
  752. // ServerPortKey is the attribute Key conforming to the "server.port"
  753. // semantic conventions. It represents the logical server port number
  754. //
  755. // Type: int
  756. // RequirementLevel: Optional
  757. // Stability: stable
  758. // Examples: 80, 8080, 443
  759. ServerPortKey = attribute.Key("server.port")
  760. // ServerSocketDomainKey is the attribute Key conforming to the
  761. // "server.socket.domain" semantic conventions. It represents the domain
  762. // name of an immediate peer.
  763. //
  764. // Type: string
  765. // RequirementLevel: Recommended (If different than `server.address`.)
  766. // Stability: stable
  767. // Examples: 'proxy.example.com'
  768. // Note: Typically observed from the client side, and represents a proxy or
  769. // other intermediary domain name.
  770. ServerSocketDomainKey = attribute.Key("server.socket.domain")
  771. // ServerSocketAddressKey is the attribute Key conforming to the
  772. // "server.socket.address" semantic conventions. It represents the physical
  773. // server IP address or Unix socket address. If set from the client, should
  774. // simply use the socket's peer address, and not attempt to find any actual
  775. // server IP (i.e., if set from client, this may represent some proxy
  776. // server instead of the logical server).
  777. //
  778. // Type: string
  779. // RequirementLevel: Recommended (If different than `server.address`.)
  780. // Stability: stable
  781. // Examples: '10.5.3.2'
  782. ServerSocketAddressKey = attribute.Key("server.socket.address")
  783. // ServerSocketPortKey is the attribute Key conforming to the
  784. // "server.socket.port" semantic conventions. It represents the physical
  785. // server port.
  786. //
  787. // Type: int
  788. // RequirementLevel: Recommended (If different than `server.port`.)
  789. // Stability: stable
  790. // Examples: 16456
  791. ServerSocketPortKey = attribute.Key("server.socket.port")
  792. )
  793. // ServerAddress returns an attribute KeyValue conforming to the
  794. // "server.address" semantic conventions. It represents the logical server
  795. // hostname, matches server FQDN if available, and IP or socket address if FQDN
  796. // is not known.
  797. func ServerAddress(val string) attribute.KeyValue {
  798. return ServerAddressKey.String(val)
  799. }
  800. // ServerPort returns an attribute KeyValue conforming to the "server.port"
  801. // semantic conventions. It represents the logical server port number
  802. func ServerPort(val int) attribute.KeyValue {
  803. return ServerPortKey.Int(val)
  804. }
  805. // ServerSocketDomain returns an attribute KeyValue conforming to the
  806. // "server.socket.domain" semantic conventions. It represents the domain name
  807. // of an immediate peer.
  808. func ServerSocketDomain(val string) attribute.KeyValue {
  809. return ServerSocketDomainKey.String(val)
  810. }
  811. // ServerSocketAddress returns an attribute KeyValue conforming to the
  812. // "server.socket.address" semantic conventions. It represents the physical
  813. // server IP address or Unix socket address. If set from the client, should
  814. // simply use the socket's peer address, and not attempt to find any actual
  815. // server IP (i.e., if set from client, this may represent some proxy server
  816. // instead of the logical server).
  817. func ServerSocketAddress(val string) attribute.KeyValue {
  818. return ServerSocketAddressKey.String(val)
  819. }
  820. // ServerSocketPort returns an attribute KeyValue conforming to the
  821. // "server.socket.port" semantic conventions. It represents the physical server
  822. // port.
  823. func ServerSocketPort(val int) attribute.KeyValue {
  824. return ServerSocketPortKey.Int(val)
  825. }
  826. // These attributes may be used to describe the sender of a network
  827. // exchange/packet. These should be used when there is no client/server
  828. // relationship between the two sides, or when that relationship is unknown.
  829. // This covers low-level network interactions (e.g. packet tracing) where you
  830. // don't know if there was a connection or which side initiated it. This also
  831. // covers unidirectional UDP flows and peer-to-peer communication where the
  832. // "user-facing" surface of the protocol / API does not expose a clear notion
  833. // of client and server.
  834. const (
  835. // SourceDomainKey is the attribute Key conforming to the "source.domain"
  836. // semantic conventions. It represents the domain name of the source
  837. // system.
  838. //
  839. // Type: string
  840. // RequirementLevel: Optional
  841. // Stability: stable
  842. // Examples: 'foo.example.com'
  843. // Note: This value may be a host name, a fully qualified domain name, or
  844. // another host naming format.
  845. SourceDomainKey = attribute.Key("source.domain")
  846. // SourceAddressKey is the attribute Key conforming to the "source.address"
  847. // semantic conventions. It represents the source address, for example IP
  848. // address or Unix socket name.
  849. //
  850. // Type: string
  851. // RequirementLevel: Optional
  852. // Stability: stable
  853. // Examples: '10.5.3.2'
  854. SourceAddressKey = attribute.Key("source.address")
  855. // SourcePortKey is the attribute Key conforming to the "source.port"
  856. // semantic conventions. It represents the source port number
  857. //
  858. // Type: int
  859. // RequirementLevel: Optional
  860. // Stability: stable
  861. // Examples: 3389, 2888
  862. SourcePortKey = attribute.Key("source.port")
  863. )
  864. // SourceDomain returns an attribute KeyValue conforming to the
  865. // "source.domain" semantic conventions. It represents the domain name of the
  866. // source system.
  867. func SourceDomain(val string) attribute.KeyValue {
  868. return SourceDomainKey.String(val)
  869. }
  870. // SourceAddress returns an attribute KeyValue conforming to the
  871. // "source.address" semantic conventions. It represents the source address, for
  872. // example IP address or Unix socket name.
  873. func SourceAddress(val string) attribute.KeyValue {
  874. return SourceAddressKey.String(val)
  875. }
  876. // SourcePort returns an attribute KeyValue conforming to the "source.port"
  877. // semantic conventions. It represents the source port number
  878. func SourcePort(val int) attribute.KeyValue {
  879. return SourcePortKey.Int(val)
  880. }
  881. // These attributes may be used for any network related operation.
  882. const (
  883. // NetworkTransportKey is the attribute Key conforming to the
  884. // "network.transport" semantic conventions. It represents the [OSI
  885. // Transport Layer](https://osi-model.com/transport-layer/) or
  886. // [Inter-process Communication
  887. // method](https://en.wikipedia.org/wiki/Inter-process_communication). The
  888. // value SHOULD be normalized to lowercase.
  889. //
  890. // Type: Enum
  891. // RequirementLevel: Optional
  892. // Stability: stable
  893. // Examples: 'tcp', 'udp'
  894. NetworkTransportKey = attribute.Key("network.transport")
  895. // NetworkTypeKey is the attribute Key conforming to the "network.type"
  896. // semantic conventions. It represents the [OSI Network
  897. // Layer](https://osi-model.com/network-layer/) or non-OSI equivalent. The
  898. // value SHOULD be normalized to lowercase.
  899. //
  900. // Type: Enum
  901. // RequirementLevel: Optional
  902. // Stability: stable
  903. // Examples: 'ipv4', 'ipv6'
  904. NetworkTypeKey = attribute.Key("network.type")
  905. // NetworkProtocolNameKey is the attribute Key conforming to the
  906. // "network.protocol.name" semantic conventions. It represents the [OSI
  907. // Application Layer](https://osi-model.com/application-layer/) or non-OSI
  908. // equivalent. The value SHOULD be normalized to lowercase.
  909. //
  910. // Type: string
  911. // RequirementLevel: Optional
  912. // Stability: stable
  913. // Examples: 'amqp', 'http', 'mqtt'
  914. NetworkProtocolNameKey = attribute.Key("network.protocol.name")
  915. // NetworkProtocolVersionKey is the attribute Key conforming to the
  916. // "network.protocol.version" semantic conventions. It represents the
  917. // version of the application layer protocol used. See note below.
  918. //
  919. // Type: string
  920. // RequirementLevel: Optional
  921. // Stability: stable
  922. // Examples: '3.1.1'
  923. // Note: `network.protocol.version` refers to the version of the protocol
  924. // used and might be different from the protocol client's version. If the
  925. // HTTP client used has a version of `0.27.2`, but sends HTTP version
  926. // `1.1`, this attribute should be set to `1.1`.
  927. NetworkProtocolVersionKey = attribute.Key("network.protocol.version")
  928. )
  929. var (
  930. // TCP
  931. NetworkTransportTCP = NetworkTransportKey.String("tcp")
  932. // UDP
  933. NetworkTransportUDP = NetworkTransportKey.String("udp")
  934. // Named or anonymous pipe. See note below
  935. NetworkTransportPipe = NetworkTransportKey.String("pipe")
  936. // Unix domain socket
  937. NetworkTransportUnix = NetworkTransportKey.String("unix")
  938. )
  939. var (
  940. // IPv4
  941. NetworkTypeIpv4 = NetworkTypeKey.String("ipv4")
  942. // IPv6
  943. NetworkTypeIpv6 = NetworkTypeKey.String("ipv6")
  944. )
  945. // NetworkProtocolName returns an attribute KeyValue conforming to the
  946. // "network.protocol.name" semantic conventions. It represents the [OSI
  947. // Application Layer](https://osi-model.com/application-layer/) or non-OSI
  948. // equivalent. The value SHOULD be normalized to lowercase.
  949. func NetworkProtocolName(val string) attribute.KeyValue {
  950. return NetworkProtocolNameKey.String(val)
  951. }
  952. // NetworkProtocolVersion returns an attribute KeyValue conforming to the
  953. // "network.protocol.version" semantic conventions. It represents the version
  954. // of the application layer protocol used. See note below.
  955. func NetworkProtocolVersion(val string) attribute.KeyValue {
  956. return NetworkProtocolVersionKey.String(val)
  957. }
  958. // These attributes may be used for any network related operation.
  959. const (
  960. // NetworkConnectionTypeKey is the attribute Key conforming to the
  961. // "network.connection.type" semantic conventions. It represents the
  962. // internet connection type.
  963. //
  964. // Type: Enum
  965. // RequirementLevel: Optional
  966. // Stability: stable
  967. // Examples: 'wifi'
  968. NetworkConnectionTypeKey = attribute.Key("network.connection.type")
  969. // NetworkConnectionSubtypeKey is the attribute Key conforming to the
  970. // "network.connection.subtype" semantic conventions. It represents the
  971. // this describes more details regarding the connection.type. It may be the
  972. // type of cell technology connection, but it could be used for describing
  973. // details about a wifi connection.
  974. //
  975. // Type: Enum
  976. // RequirementLevel: Optional
  977. // Stability: stable
  978. // Examples: 'LTE'
  979. NetworkConnectionSubtypeKey = attribute.Key("network.connection.subtype")
  980. // NetworkCarrierNameKey is the attribute Key conforming to the
  981. // "network.carrier.name" semantic conventions. It represents the name of
  982. // the mobile carrier.
  983. //
  984. // Type: string
  985. // RequirementLevel: Optional
  986. // Stability: stable
  987. // Examples: 'sprint'
  988. NetworkCarrierNameKey = attribute.Key("network.carrier.name")
  989. // NetworkCarrierMccKey is the attribute Key conforming to the
  990. // "network.carrier.mcc" semantic conventions. It represents the mobile
  991. // carrier country code.
  992. //
  993. // Type: string
  994. // RequirementLevel: Optional
  995. // Stability: stable
  996. // Examples: '310'
  997. NetworkCarrierMccKey = attribute.Key("network.carrier.mcc")
  998. // NetworkCarrierMncKey is the attribute Key conforming to the
  999. // "network.carrier.mnc" semantic conventions. It represents the mobile
  1000. // carrier network code.
  1001. //
  1002. // Type: string
  1003. // RequirementLevel: Optional
  1004. // Stability: stable
  1005. // Examples: '001'
  1006. NetworkCarrierMncKey = attribute.Key("network.carrier.mnc")
  1007. // NetworkCarrierIccKey is the attribute Key conforming to the
  1008. // "network.carrier.icc" semantic conventions. It represents the ISO 3166-1
  1009. // alpha-2 2-character country code associated with the mobile carrier
  1010. // network.
  1011. //
  1012. // Type: string
  1013. // RequirementLevel: Optional
  1014. // Stability: stable
  1015. // Examples: 'DE'
  1016. NetworkCarrierIccKey = attribute.Key("network.carrier.icc")
  1017. )
  1018. var (
  1019. // wifi
  1020. NetworkConnectionTypeWifi = NetworkConnectionTypeKey.String("wifi")
  1021. // wired
  1022. NetworkConnectionTypeWired = NetworkConnectionTypeKey.String("wired")
  1023. // cell
  1024. NetworkConnectionTypeCell = NetworkConnectionTypeKey.String("cell")
  1025. // unavailable
  1026. NetworkConnectionTypeUnavailable = NetworkConnectionTypeKey.String("unavailable")
  1027. // unknown
  1028. NetworkConnectionTypeUnknown = NetworkConnectionTypeKey.String("unknown")
  1029. )
  1030. var (
  1031. // GPRS
  1032. NetworkConnectionSubtypeGprs = NetworkConnectionSubtypeKey.String("gprs")
  1033. // EDGE
  1034. NetworkConnectionSubtypeEdge = NetworkConnectionSubtypeKey.String("edge")
  1035. // UMTS
  1036. NetworkConnectionSubtypeUmts = NetworkConnectionSubtypeKey.String("umts")
  1037. // CDMA
  1038. NetworkConnectionSubtypeCdma = NetworkConnectionSubtypeKey.String("cdma")
  1039. // EVDO Rel. 0
  1040. NetworkConnectionSubtypeEvdo0 = NetworkConnectionSubtypeKey.String("evdo_0")
  1041. // EVDO Rev. A
  1042. NetworkConnectionSubtypeEvdoA = NetworkConnectionSubtypeKey.String("evdo_a")
  1043. // CDMA2000 1XRTT
  1044. NetworkConnectionSubtypeCdma20001xrtt = NetworkConnectionSubtypeKey.String("cdma2000_1xrtt")
  1045. // HSDPA
  1046. NetworkConnectionSubtypeHsdpa = NetworkConnectionSubtypeKey.String("hsdpa")
  1047. // HSUPA
  1048. NetworkConnectionSubtypeHsupa = NetworkConnectionSubtypeKey.String("hsupa")
  1049. // HSPA
  1050. NetworkConnectionSubtypeHspa = NetworkConnectionSubtypeKey.String("hspa")
  1051. // IDEN
  1052. NetworkConnectionSubtypeIden = NetworkConnectionSubtypeKey.String("iden")
  1053. // EVDO Rev. B
  1054. NetworkConnectionSubtypeEvdoB = NetworkConnectionSubtypeKey.String("evdo_b")
  1055. // LTE
  1056. NetworkConnectionSubtypeLte = NetworkConnectionSubtypeKey.String("lte")
  1057. // EHRPD
  1058. NetworkConnectionSubtypeEhrpd = NetworkConnectionSubtypeKey.String("ehrpd")
  1059. // HSPAP
  1060. NetworkConnectionSubtypeHspap = NetworkConnectionSubtypeKey.String("hspap")
  1061. // GSM
  1062. NetworkConnectionSubtypeGsm = NetworkConnectionSubtypeKey.String("gsm")
  1063. // TD-SCDMA
  1064. NetworkConnectionSubtypeTdScdma = NetworkConnectionSubtypeKey.String("td_scdma")
  1065. // IWLAN
  1066. NetworkConnectionSubtypeIwlan = NetworkConnectionSubtypeKey.String("iwlan")
  1067. // 5G NR (New Radio)
  1068. NetworkConnectionSubtypeNr = NetworkConnectionSubtypeKey.String("nr")
  1069. // 5G NRNSA (New Radio Non-Standalone)
  1070. NetworkConnectionSubtypeNrnsa = NetworkConnectionSubtypeKey.String("nrnsa")
  1071. // LTE CA
  1072. NetworkConnectionSubtypeLteCa = NetworkConnectionSubtypeKey.String("lte_ca")
  1073. )
  1074. // NetworkCarrierName returns an attribute KeyValue conforming to the
  1075. // "network.carrier.name" semantic conventions. It represents the name of the
  1076. // mobile carrier.
  1077. func NetworkCarrierName(val string) attribute.KeyValue {
  1078. return NetworkCarrierNameKey.String(val)
  1079. }
  1080. // NetworkCarrierMcc returns an attribute KeyValue conforming to the
  1081. // "network.carrier.mcc" semantic conventions. It represents the mobile carrier
  1082. // country code.
  1083. func NetworkCarrierMcc(val string) attribute.KeyValue {
  1084. return NetworkCarrierMccKey.String(val)
  1085. }
  1086. // NetworkCarrierMnc returns an attribute KeyValue conforming to the
  1087. // "network.carrier.mnc" semantic conventions. It represents the mobile carrier
  1088. // network code.
  1089. func NetworkCarrierMnc(val string) attribute.KeyValue {
  1090. return NetworkCarrierMncKey.String(val)
  1091. }
  1092. // NetworkCarrierIcc returns an attribute KeyValue conforming to the
  1093. // "network.carrier.icc" semantic conventions. It represents the ISO 3166-1
  1094. // alpha-2 2-character country code associated with the mobile carrier network.
  1095. func NetworkCarrierIcc(val string) attribute.KeyValue {
  1096. return NetworkCarrierIccKey.String(val)
  1097. }
  1098. // Semantic conventions for HTTP client and server Spans.
  1099. const (
  1100. // HTTPRequestMethodOriginalKey is the attribute Key conforming to the
  1101. // "http.request.method_original" semantic conventions. It represents the
  1102. // original HTTP method sent by the client in the request line.
  1103. //
  1104. // Type: string
  1105. // RequirementLevel: ConditionallyRequired (If and only if it's different
  1106. // than `http.request.method`.)
  1107. // Stability: stable
  1108. // Examples: 'GeT', 'ACL', 'foo'
  1109. HTTPRequestMethodOriginalKey = attribute.Key("http.request.method_original")
  1110. // HTTPRequestBodySizeKey is the attribute Key conforming to the
  1111. // "http.request.body.size" semantic conventions. It represents the size of
  1112. // the request payload body in bytes. This is the number of bytes
  1113. // transferred excluding headers and is often, but not always, present as
  1114. // the
  1115. // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
  1116. // header. For requests using transport encoding, this should be the
  1117. // compressed size.
  1118. //
  1119. // Type: int
  1120. // RequirementLevel: Optional
  1121. // Stability: stable
  1122. // Examples: 3495
  1123. HTTPRequestBodySizeKey = attribute.Key("http.request.body.size")
  1124. // HTTPResponseBodySizeKey is the attribute Key conforming to the
  1125. // "http.response.body.size" semantic conventions. It represents the size
  1126. // of the response payload body in bytes. This is the number of bytes
  1127. // transferred excluding headers and is often, but not always, present as
  1128. // the
  1129. // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
  1130. // header. For requests using transport encoding, this should be the
  1131. // compressed size.
  1132. //
  1133. // Type: int
  1134. // RequirementLevel: Optional
  1135. // Stability: stable
  1136. // Examples: 3495
  1137. HTTPResponseBodySizeKey = attribute.Key("http.response.body.size")
  1138. )
  1139. // HTTPRequestMethodOriginal returns an attribute KeyValue conforming to the
  1140. // "http.request.method_original" semantic conventions. It represents the
  1141. // original HTTP method sent by the client in the request line.
  1142. func HTTPRequestMethodOriginal(val string) attribute.KeyValue {
  1143. return HTTPRequestMethodOriginalKey.String(val)
  1144. }
  1145. // HTTPRequestBodySize returns an attribute KeyValue conforming to the
  1146. // "http.request.body.size" semantic conventions. It represents the size of the
  1147. // request payload body in bytes. This is the number of bytes transferred
  1148. // excluding headers and is often, but not always, present as the
  1149. // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
  1150. // header. For requests using transport encoding, this should be the compressed
  1151. // size.
  1152. func HTTPRequestBodySize(val int) attribute.KeyValue {
  1153. return HTTPRequestBodySizeKey.Int(val)
  1154. }
  1155. // HTTPResponseBodySize returns an attribute KeyValue conforming to the
  1156. // "http.response.body.size" semantic conventions. It represents the size of
  1157. // the response payload body in bytes. This is the number of bytes transferred
  1158. // excluding headers and is often, but not always, present as the
  1159. // [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length)
  1160. // header. For requests using transport encoding, this should be the compressed
  1161. // size.
  1162. func HTTPResponseBodySize(val int) attribute.KeyValue {
  1163. return HTTPResponseBodySizeKey.Int(val)
  1164. }
  1165. // Semantic convention describing per-message attributes populated on messaging
  1166. // spans or links.
  1167. const (
  1168. // MessagingMessageIDKey is the attribute Key conforming to the
  1169. // "messaging.message.id" semantic conventions. It represents a value used
  1170. // by the messaging system as an identifier for the message, represented as
  1171. // a string.
  1172. //
  1173. // Type: string
  1174. // RequirementLevel: Optional
  1175. // Stability: stable
  1176. // Examples: '452a7c7c7c7048c2f887f61572b18fc2'
  1177. MessagingMessageIDKey = attribute.Key("messaging.message.id")
  1178. // MessagingMessageConversationIDKey is the attribute Key conforming to the
  1179. // "messaging.message.conversation_id" semantic conventions. It represents
  1180. // the [conversation ID](#conversations) identifying the conversation to
  1181. // which the message belongs, represented as a string. Sometimes called
  1182. // "Correlation ID".
  1183. //
  1184. // Type: string
  1185. // RequirementLevel: Optional
  1186. // Stability: stable
  1187. // Examples: 'MyConversationID'
  1188. MessagingMessageConversationIDKey = attribute.Key("messaging.message.conversation_id")
  1189. // MessagingMessagePayloadSizeBytesKey is the attribute Key conforming to
  1190. // the "messaging.message.payload_size_bytes" semantic conventions. It
  1191. // represents the (uncompressed) size of the message payload in bytes. Also
  1192. // use this attribute if it is unknown whether the compressed or
  1193. // uncompressed payload size is reported.
  1194. //
  1195. // Type: int
  1196. // RequirementLevel: Optional
  1197. // Stability: stable
  1198. // Examples: 2738
  1199. MessagingMessagePayloadSizeBytesKey = attribute.Key("messaging.message.payload_size_bytes")
  1200. // MessagingMessagePayloadCompressedSizeBytesKey is the attribute Key
  1201. // conforming to the "messaging.message.payload_compressed_size_bytes"
  1202. // semantic conventions. It represents the compressed size of the message
  1203. // payload in bytes.
  1204. //
  1205. // Type: int
  1206. // RequirementLevel: Optional
  1207. // Stability: stable
  1208. // Examples: 2048
  1209. MessagingMessagePayloadCompressedSizeBytesKey = attribute.Key("messaging.message.payload_compressed_size_bytes")
  1210. )
  1211. // MessagingMessageID returns an attribute KeyValue conforming to the
  1212. // "messaging.message.id" semantic conventions. It represents a value used by
  1213. // the messaging system as an identifier for the message, represented as a
  1214. // string.
  1215. func MessagingMessageID(val string) attribute.KeyValue {
  1216. return MessagingMessageIDKey.String(val)
  1217. }
  1218. // MessagingMessageConversationID returns an attribute KeyValue conforming
  1219. // to the "messaging.message.conversation_id" semantic conventions. It
  1220. // represents the [conversation ID](#conversations) identifying the
  1221. // conversation to which the message belongs, represented as a string.
  1222. // Sometimes called "Correlation ID".
  1223. func MessagingMessageConversationID(val string) attribute.KeyValue {
  1224. return MessagingMessageConversationIDKey.String(val)
  1225. }
  1226. // MessagingMessagePayloadSizeBytes returns an attribute KeyValue conforming
  1227. // to the "messaging.message.payload_size_bytes" semantic conventions. It
  1228. // represents the (uncompressed) size of the message payload in bytes. Also use
  1229. // this attribute if it is unknown whether the compressed or uncompressed
  1230. // payload size is reported.
  1231. func MessagingMessagePayloadSizeBytes(val int) attribute.KeyValue {
  1232. return MessagingMessagePayloadSizeBytesKey.Int(val)
  1233. }
  1234. // MessagingMessagePayloadCompressedSizeBytes returns an attribute KeyValue
  1235. // conforming to the "messaging.message.payload_compressed_size_bytes" semantic
  1236. // conventions. It represents the compressed size of the message payload in
  1237. // bytes.
  1238. func MessagingMessagePayloadCompressedSizeBytes(val int) attribute.KeyValue {
  1239. return MessagingMessagePayloadCompressedSizeBytesKey.Int(val)
  1240. }
  1241. // Semantic convention for attributes that describe messaging destination on
  1242. // broker
  1243. const (
  1244. // MessagingDestinationNameKey is the attribute Key conforming to the
  1245. // "messaging.destination.name" semantic conventions. It represents the
  1246. // message destination name
  1247. //
  1248. // Type: string
  1249. // RequirementLevel: Optional
  1250. // Stability: stable
  1251. // Examples: 'MyQueue', 'MyTopic'
  1252. // Note: Destination name SHOULD uniquely identify a specific queue, topic
  1253. // or other entity within the broker. If
  1254. // the broker does not have such notion, the destination name SHOULD
  1255. // uniquely identify the broker.
  1256. MessagingDestinationNameKey = attribute.Key("messaging.destination.name")
  1257. // MessagingDestinationTemplateKey is the attribute Key conforming to the
  1258. // "messaging.destination.template" semantic conventions. It represents the
  1259. // low cardinality representation of the messaging destination name
  1260. //
  1261. // Type: string
  1262. // RequirementLevel: Optional
  1263. // Stability: stable
  1264. // Examples: '/customers/{customerID}'
  1265. // Note: Destination names could be constructed from templates. An example
  1266. // would be a destination name involving a user name or product id.
  1267. // Although the destination name in this case is of high cardinality, the
  1268. // underlying template is of low cardinality and can be effectively used
  1269. // for grouping and aggregation.
  1270. MessagingDestinationTemplateKey = attribute.Key("messaging.destination.template")
  1271. // MessagingDestinationTemporaryKey is the attribute Key conforming to the
  1272. // "messaging.destination.temporary" semantic conventions. It represents a
  1273. // boolean that is true if the message destination is temporary and might
  1274. // not exist anymore after messages are processed.
  1275. //
  1276. // Type: boolean
  1277. // RequirementLevel: Optional
  1278. // Stability: stable
  1279. MessagingDestinationTemporaryKey = attribute.Key("messaging.destination.temporary")
  1280. // MessagingDestinationAnonymousKey is the attribute Key conforming to the
  1281. // "messaging.destination.anonymous" semantic conventions. It represents a
  1282. // boolean that is true if the message destination is anonymous (could be
  1283. // unnamed or have auto-generated name).
  1284. //
  1285. // Type: boolean
  1286. // RequirementLevel: Optional
  1287. // Stability: stable
  1288. MessagingDestinationAnonymousKey = attribute.Key("messaging.destination.anonymous")
  1289. )
  1290. // MessagingDestinationName returns an attribute KeyValue conforming to the
  1291. // "messaging.destination.name" semantic conventions. It represents the message
  1292. // destination name
  1293. func MessagingDestinationName(val string) attribute.KeyValue {
  1294. return MessagingDestinationNameKey.String(val)
  1295. }
  1296. // MessagingDestinationTemplate returns an attribute KeyValue conforming to
  1297. // the "messaging.destination.template" semantic conventions. It represents the
  1298. // low cardinality representation of the messaging destination name
  1299. func MessagingDestinationTemplate(val string) attribute.KeyValue {
  1300. return MessagingDestinationTemplateKey.String(val)
  1301. }
  1302. // MessagingDestinationTemporary returns an attribute KeyValue conforming to
  1303. // the "messaging.destination.temporary" semantic conventions. It represents a
  1304. // boolean that is true if the message destination is temporary and might not
  1305. // exist anymore after messages are processed.
  1306. func MessagingDestinationTemporary(val bool) attribute.KeyValue {
  1307. return MessagingDestinationTemporaryKey.Bool(val)
  1308. }
  1309. // MessagingDestinationAnonymous returns an attribute KeyValue conforming to
  1310. // the "messaging.destination.anonymous" semantic conventions. It represents a
  1311. // boolean that is true if the message destination is anonymous (could be
  1312. // unnamed or have auto-generated name).
  1313. func MessagingDestinationAnonymous(val bool) attribute.KeyValue {
  1314. return MessagingDestinationAnonymousKey.Bool(val)
  1315. }
  1316. // Attributes for RabbitMQ
  1317. const (
  1318. // MessagingRabbitmqDestinationRoutingKeyKey is the attribute Key
  1319. // conforming to the "messaging.rabbitmq.destination.routing_key" semantic
  1320. // conventions. It represents the rabbitMQ message routing key.
  1321. //
  1322. // Type: string
  1323. // RequirementLevel: ConditionallyRequired (If not empty.)
  1324. // Stability: stable
  1325. // Examples: 'myKey'
  1326. MessagingRabbitmqDestinationRoutingKeyKey = attribute.Key("messaging.rabbitmq.destination.routing_key")
  1327. )
  1328. // MessagingRabbitmqDestinationRoutingKey returns an attribute KeyValue
  1329. // conforming to the "messaging.rabbitmq.destination.routing_key" semantic
  1330. // conventions. It represents the rabbitMQ message routing key.
  1331. func MessagingRabbitmqDestinationRoutingKey(val string) attribute.KeyValue {
  1332. return MessagingRabbitmqDestinationRoutingKeyKey.String(val)
  1333. }
  1334. // Attributes for Apache Kafka
  1335. const (
  1336. // MessagingKafkaMessageKeyKey is the attribute Key conforming to the
  1337. // "messaging.kafka.message.key" semantic conventions. It represents the
  1338. // message keys in Kafka are used for grouping alike messages to ensure
  1339. // they're processed on the same partition. They differ from
  1340. // `messaging.message.id` in that they're not unique. If the key is `null`,
  1341. // the attribute MUST NOT be set.
  1342. //
  1343. // Type: string
  1344. // RequirementLevel: Optional
  1345. // Stability: stable
  1346. // Examples: 'myKey'
  1347. // Note: If the key type is not string, it's string representation has to
  1348. // be supplied for the attribute. If the key has no unambiguous, canonical
  1349. // string form, don't include its value.
  1350. MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message.key")
  1351. // MessagingKafkaConsumerGroupKey is the attribute Key conforming to the
  1352. // "messaging.kafka.consumer.group" semantic conventions. It represents the
  1353. // name of the Kafka Consumer Group that is handling the message. Only
  1354. // applies to consumers, not producers.
  1355. //
  1356. // Type: string
  1357. // RequirementLevel: Optional
  1358. // Stability: stable
  1359. // Examples: 'my-group'
  1360. MessagingKafkaConsumerGroupKey = attribute.Key("messaging.kafka.consumer.group")
  1361. // MessagingKafkaDestinationPartitionKey is the attribute Key conforming to
  1362. // the "messaging.kafka.destination.partition" semantic conventions. It
  1363. // represents the partition the message is sent to.
  1364. //
  1365. // Type: int
  1366. // RequirementLevel: Optional
  1367. // Stability: stable
  1368. // Examples: 2
  1369. MessagingKafkaDestinationPartitionKey = attribute.Key("messaging.kafka.destination.partition")
  1370. // MessagingKafkaMessageOffsetKey is the attribute Key conforming to the
  1371. // "messaging.kafka.message.offset" semantic conventions. It represents the
  1372. // offset of a record in the corresponding Kafka partition.
  1373. //
  1374. // Type: int
  1375. // RequirementLevel: Optional
  1376. // Stability: stable
  1377. // Examples: 42
  1378. MessagingKafkaMessageOffsetKey = attribute.Key("messaging.kafka.message.offset")
  1379. // MessagingKafkaMessageTombstoneKey is the attribute Key conforming to the
  1380. // "messaging.kafka.message.tombstone" semantic conventions. It represents
  1381. // a boolean that is true if the message is a tombstone.
  1382. //
  1383. // Type: boolean
  1384. // RequirementLevel: ConditionallyRequired (If value is `true`. When
  1385. // missing, the value is assumed to be `false`.)
  1386. // Stability: stable
  1387. MessagingKafkaMessageTombstoneKey = attribute.Key("messaging.kafka.message.tombstone")
  1388. )
  1389. // MessagingKafkaMessageKey returns an attribute KeyValue conforming to the
  1390. // "messaging.kafka.message.key" semantic conventions. It represents the
  1391. // message keys in Kafka are used for grouping alike messages to ensure they're
  1392. // processed on the same partition. They differ from `messaging.message.id` in
  1393. // that they're not unique. If the key is `null`, the attribute MUST NOT be
  1394. // set.
  1395. func MessagingKafkaMessageKey(val string) attribute.KeyValue {
  1396. return MessagingKafkaMessageKeyKey.String(val)
  1397. }
  1398. // MessagingKafkaConsumerGroup returns an attribute KeyValue conforming to
  1399. // the "messaging.kafka.consumer.group" semantic conventions. It represents the
  1400. // name of the Kafka Consumer Group that is handling the message. Only applies
  1401. // to consumers, not producers.
  1402. func MessagingKafkaConsumerGroup(val string) attribute.KeyValue {
  1403. return MessagingKafkaConsumerGroupKey.String(val)
  1404. }
  1405. // MessagingKafkaDestinationPartition returns an attribute KeyValue
  1406. // conforming to the "messaging.kafka.destination.partition" semantic
  1407. // conventions. It represents the partition the message is sent to.
  1408. func MessagingKafkaDestinationPartition(val int) attribute.KeyValue {
  1409. return MessagingKafkaDestinationPartitionKey.Int(val)
  1410. }
  1411. // MessagingKafkaMessageOffset returns an attribute KeyValue conforming to
  1412. // the "messaging.kafka.message.offset" semantic conventions. It represents the
  1413. // offset of a record in the corresponding Kafka partition.
  1414. func MessagingKafkaMessageOffset(val int) attribute.KeyValue {
  1415. return MessagingKafkaMessageOffsetKey.Int(val)
  1416. }
  1417. // MessagingKafkaMessageTombstone returns an attribute KeyValue conforming
  1418. // to the "messaging.kafka.message.tombstone" semantic conventions. It
  1419. // represents a boolean that is true if the message is a tombstone.
  1420. func MessagingKafkaMessageTombstone(val bool) attribute.KeyValue {
  1421. return MessagingKafkaMessageTombstoneKey.Bool(val)
  1422. }
  1423. // Attributes for Apache RocketMQ
  1424. const (
  1425. // MessagingRocketmqNamespaceKey is the attribute Key conforming to the
  1426. // "messaging.rocketmq.namespace" semantic conventions. It represents the
  1427. // namespace of RocketMQ resources, resources in different namespaces are
  1428. // individual.
  1429. //
  1430. // Type: string
  1431. // RequirementLevel: Required
  1432. // Stability: stable
  1433. // Examples: 'myNamespace'
  1434. MessagingRocketmqNamespaceKey = attribute.Key("messaging.rocketmq.namespace")
  1435. // MessagingRocketmqClientGroupKey is the attribute Key conforming to the
  1436. // "messaging.rocketmq.client_group" semantic conventions. It represents
  1437. // the name of the RocketMQ producer/consumer group that is handling the
  1438. // message. The client type is identified by the SpanKind.
  1439. //
  1440. // Type: string
  1441. // RequirementLevel: Required
  1442. // Stability: stable
  1443. // Examples: 'myConsumerGroup'
  1444. MessagingRocketmqClientGroupKey = attribute.Key("messaging.rocketmq.client_group")
  1445. // MessagingRocketmqMessageDeliveryTimestampKey is the attribute Key
  1446. // conforming to the "messaging.rocketmq.message.delivery_timestamp"
  1447. // semantic conventions. It represents the timestamp in milliseconds that
  1448. // the delay message is expected to be delivered to consumer.
  1449. //
  1450. // Type: int
  1451. // RequirementLevel: ConditionallyRequired (If the message type is delay
  1452. // and delay time level is not specified.)
  1453. // Stability: stable
  1454. // Examples: 1665987217045
  1455. MessagingRocketmqMessageDeliveryTimestampKey = attribute.Key("messaging.rocketmq.message.delivery_timestamp")
  1456. // MessagingRocketmqMessageDelayTimeLevelKey is the attribute Key
  1457. // conforming to the "messaging.rocketmq.message.delay_time_level" semantic
  1458. // conventions. It represents the delay time level for delay message, which
  1459. // determines the message delay time.
  1460. //
  1461. // Type: int
  1462. // RequirementLevel: ConditionallyRequired (If the message type is delay
  1463. // and delivery timestamp is not specified.)
  1464. // Stability: stable
  1465. // Examples: 3
  1466. MessagingRocketmqMessageDelayTimeLevelKey = attribute.Key("messaging.rocketmq.message.delay_time_level")
  1467. // MessagingRocketmqMessageGroupKey is the attribute Key conforming to the
  1468. // "messaging.rocketmq.message.group" semantic conventions. It represents
  1469. // the it is essential for FIFO message. Messages that belong to the same
  1470. // message group are always processed one by one within the same consumer
  1471. // group.
  1472. //
  1473. // Type: string
  1474. // RequirementLevel: ConditionallyRequired (If the message type is FIFO.)
  1475. // Stability: stable
  1476. // Examples: 'myMessageGroup'
  1477. MessagingRocketmqMessageGroupKey = attribute.Key("messaging.rocketmq.message.group")
  1478. // MessagingRocketmqMessageTypeKey is the attribute Key conforming to the
  1479. // "messaging.rocketmq.message.type" semantic conventions. It represents
  1480. // the type of message.
  1481. //
  1482. // Type: Enum
  1483. // RequirementLevel: Optional
  1484. // Stability: stable
  1485. MessagingRocketmqMessageTypeKey = attribute.Key("messaging.rocketmq.message.type")
  1486. // MessagingRocketmqMessageTagKey is the attribute Key conforming to the
  1487. // "messaging.rocketmq.message.tag" semantic conventions. It represents the
  1488. // secondary classifier of message besides topic.
  1489. //
  1490. // Type: string
  1491. // RequirementLevel: Optional
  1492. // Stability: stable
  1493. // Examples: 'tagA'
  1494. MessagingRocketmqMessageTagKey = attribute.Key("messaging.rocketmq.message.tag")
  1495. // MessagingRocketmqMessageKeysKey is the attribute Key conforming to the
  1496. // "messaging.rocketmq.message.keys" semantic conventions. It represents
  1497. // the key(s) of message, another way to mark message besides message id.
  1498. //
  1499. // Type: string[]
  1500. // RequirementLevel: Optional
  1501. // Stability: stable
  1502. // Examples: 'keyA', 'keyB'
  1503. MessagingRocketmqMessageKeysKey = attribute.Key("messaging.rocketmq.message.keys")
  1504. // MessagingRocketmqConsumptionModelKey is the attribute Key conforming to
  1505. // the "messaging.rocketmq.consumption_model" semantic conventions. It
  1506. // represents the model of message consumption. This only applies to
  1507. // consumer spans.
  1508. //
  1509. // Type: Enum
  1510. // RequirementLevel: Optional
  1511. // Stability: stable
  1512. MessagingRocketmqConsumptionModelKey = attribute.Key("messaging.rocketmq.consumption_model")
  1513. )
  1514. var (
  1515. // Normal message
  1516. MessagingRocketmqMessageTypeNormal = MessagingRocketmqMessageTypeKey.String("normal")
  1517. // FIFO message
  1518. MessagingRocketmqMessageTypeFifo = MessagingRocketmqMessageTypeKey.String("fifo")
  1519. // Delay message
  1520. MessagingRocketmqMessageTypeDelay = MessagingRocketmqMessageTypeKey.String("delay")
  1521. // Transaction message
  1522. MessagingRocketmqMessageTypeTransaction = MessagingRocketmqMessageTypeKey.String("transaction")
  1523. )
  1524. var (
  1525. // Clustering consumption model
  1526. MessagingRocketmqConsumptionModelClustering = MessagingRocketmqConsumptionModelKey.String("clustering")
  1527. // Broadcasting consumption model
  1528. MessagingRocketmqConsumptionModelBroadcasting = MessagingRocketmqConsumptionModelKey.String("broadcasting")
  1529. )
  1530. // MessagingRocketmqNamespace returns an attribute KeyValue conforming to
  1531. // the "messaging.rocketmq.namespace" semantic conventions. It represents the
  1532. // namespace of RocketMQ resources, resources in different namespaces are
  1533. // individual.
  1534. func MessagingRocketmqNamespace(val string) attribute.KeyValue {
  1535. return MessagingRocketmqNamespaceKey.String(val)
  1536. }
  1537. // MessagingRocketmqClientGroup returns an attribute KeyValue conforming to
  1538. // the "messaging.rocketmq.client_group" semantic conventions. It represents
  1539. // the name of the RocketMQ producer/consumer group that is handling the
  1540. // message. The client type is identified by the SpanKind.
  1541. func MessagingRocketmqClientGroup(val string) attribute.KeyValue {
  1542. return MessagingRocketmqClientGroupKey.String(val)
  1543. }
  1544. // MessagingRocketmqMessageDeliveryTimestamp returns an attribute KeyValue
  1545. // conforming to the "messaging.rocketmq.message.delivery_timestamp" semantic
  1546. // conventions. It represents the timestamp in milliseconds that the delay
  1547. // message is expected to be delivered to consumer.
  1548. func MessagingRocketmqMessageDeliveryTimestamp(val int) attribute.KeyValue {
  1549. return MessagingRocketmqMessageDeliveryTimestampKey.Int(val)
  1550. }
  1551. // MessagingRocketmqMessageDelayTimeLevel returns an attribute KeyValue
  1552. // conforming to the "messaging.rocketmq.message.delay_time_level" semantic
  1553. // conventions. It represents the delay time level for delay message, which
  1554. // determines the message delay time.
  1555. func MessagingRocketmqMessageDelayTimeLevel(val int) attribute.KeyValue {
  1556. return MessagingRocketmqMessageDelayTimeLevelKey.Int(val)
  1557. }
  1558. // MessagingRocketmqMessageGroup returns an attribute KeyValue conforming to
  1559. // the "messaging.rocketmq.message.group" semantic conventions. It represents
  1560. // the it is essential for FIFO message. Messages that belong to the same
  1561. // message group are always processed one by one within the same consumer
  1562. // group.
  1563. func MessagingRocketmqMessageGroup(val string) attribute.KeyValue {
  1564. return MessagingRocketmqMessageGroupKey.String(val)
  1565. }
  1566. // MessagingRocketmqMessageTag returns an attribute KeyValue conforming to
  1567. // the "messaging.rocketmq.message.tag" semantic conventions. It represents the
  1568. // secondary classifier of message besides topic.
  1569. func MessagingRocketmqMessageTag(val string) attribute.KeyValue {
  1570. return MessagingRocketmqMessageTagKey.String(val)
  1571. }
  1572. // MessagingRocketmqMessageKeys returns an attribute KeyValue conforming to
  1573. // the "messaging.rocketmq.message.keys" semantic conventions. It represents
  1574. // the key(s) of message, another way to mark message besides message id.
  1575. func MessagingRocketmqMessageKeys(val ...string) attribute.KeyValue {
  1576. return MessagingRocketmqMessageKeysKey.StringSlice(val)
  1577. }
  1578. // Attributes describing URL.
  1579. const (
  1580. // URLSchemeKey is the attribute Key conforming to the "url.scheme"
  1581. // semantic conventions. It represents the [URI
  1582. // scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component
  1583. // identifying the used protocol.
  1584. //
  1585. // Type: string
  1586. // RequirementLevel: Optional
  1587. // Stability: stable
  1588. // Examples: 'https', 'ftp', 'telnet'
  1589. URLSchemeKey = attribute.Key("url.scheme")
  1590. // URLFullKey is the attribute Key conforming to the "url.full" semantic
  1591. // conventions. It represents the absolute URL describing a network
  1592. // resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986)
  1593. //
  1594. // Type: string
  1595. // RequirementLevel: Optional
  1596. // Stability: stable
  1597. // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv',
  1598. // '//localhost'
  1599. // Note: For network calls, URL usually has
  1600. // `scheme://host[:port][path][?query][#fragment]` format, where the
  1601. // fragment is not transmitted over HTTP, but if it is known, it should be
  1602. // included nevertheless.
  1603. // `url.full` MUST NOT contain credentials passed via URL in form of
  1604. // `https://username:password@www.example.com/`. In such case username and
  1605. // password should be redacted and attribute's value should be
  1606. // `https://REDACTED:REDACTED@www.example.com/`.
  1607. // `url.full` SHOULD capture the absolute URL when it is available (or can
  1608. // be reconstructed) and SHOULD NOT be validated or modified except for
  1609. // sanitizing purposes.
  1610. URLFullKey = attribute.Key("url.full")
  1611. // URLPathKey is the attribute Key conforming to the "url.path" semantic
  1612. // conventions. It represents the [URI
  1613. // path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component
  1614. //
  1615. // Type: string
  1616. // RequirementLevel: Optional
  1617. // Stability: stable
  1618. // Examples: '/search'
  1619. // Note: When missing, the value is assumed to be `/`
  1620. URLPathKey = attribute.Key("url.path")
  1621. // URLQueryKey is the attribute Key conforming to the "url.query" semantic
  1622. // conventions. It represents the [URI
  1623. // query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component
  1624. //
  1625. // Type: string
  1626. // RequirementLevel: Optional
  1627. // Stability: stable
  1628. // Examples: 'q=OpenTelemetry'
  1629. // Note: Sensitive content provided in query string SHOULD be scrubbed when
  1630. // instrumentations can identify it.
  1631. URLQueryKey = attribute.Key("url.query")
  1632. // URLFragmentKey is the attribute Key conforming to the "url.fragment"
  1633. // semantic conventions. It represents the [URI
  1634. // fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component
  1635. //
  1636. // Type: string
  1637. // RequirementLevel: Optional
  1638. // Stability: stable
  1639. // Examples: 'SemConv'
  1640. URLFragmentKey = attribute.Key("url.fragment")
  1641. )
  1642. // URLScheme returns an attribute KeyValue conforming to the "url.scheme"
  1643. // semantic conventions. It represents the [URI
  1644. // scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component
  1645. // identifying the used protocol.
  1646. func URLScheme(val string) attribute.KeyValue {
  1647. return URLSchemeKey.String(val)
  1648. }
  1649. // URLFull returns an attribute KeyValue conforming to the "url.full"
  1650. // semantic conventions. It represents the absolute URL describing a network
  1651. // resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986)
  1652. func URLFull(val string) attribute.KeyValue {
  1653. return URLFullKey.String(val)
  1654. }
  1655. // URLPath returns an attribute KeyValue conforming to the "url.path"
  1656. // semantic conventions. It represents the [URI
  1657. // path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component
  1658. func URLPath(val string) attribute.KeyValue {
  1659. return URLPathKey.String(val)
  1660. }
  1661. // URLQuery returns an attribute KeyValue conforming to the "url.query"
  1662. // semantic conventions. It represents the [URI
  1663. // query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component
  1664. func URLQuery(val string) attribute.KeyValue {
  1665. return URLQueryKey.String(val)
  1666. }
  1667. // URLFragment returns an attribute KeyValue conforming to the
  1668. // "url.fragment" semantic conventions. It represents the [URI
  1669. // fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component
  1670. func URLFragment(val string) attribute.KeyValue {
  1671. return URLFragmentKey.String(val)
  1672. }
  1673. // Describes user-agent attributes.
  1674. const (
  1675. // UserAgentOriginalKey is the attribute Key conforming to the
  1676. // "user_agent.original" semantic conventions. It represents the value of
  1677. // the [HTTP
  1678. // User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent)
  1679. // header sent by the client.
  1680. //
  1681. // Type: string
  1682. // RequirementLevel: Optional
  1683. // Stability: stable
  1684. // Examples: 'CERN-LineMode/2.15 libwww/2.17b3'
  1685. UserAgentOriginalKey = attribute.Key("user_agent.original")
  1686. )
  1687. // UserAgentOriginal returns an attribute KeyValue conforming to the
  1688. // "user_agent.original" semantic conventions. It represents the value of the
  1689. // [HTTP
  1690. // User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent)
  1691. // header sent by the client.
  1692. func UserAgentOriginal(val string) attribute.KeyValue {
  1693. return UserAgentOriginalKey.String(val)
  1694. }