| 1 |
// Copyright The OpenTelemetry Authors |
| 2 |
// SPDX-License-Identifier: Apache-2.0 |
| 3 |
|
| 4 |
// Code generated from semantic convention specification. DO NOT EDIT. |
| 5 |
|
| 6 |
package semconv // import "go.opentelemetry.io/otel/semconv/v1.19.0" |
| 7 |
|
| 8 |
import "go.opentelemetry.io/otel/attribute" |
| 9 |
|
| 10 |
// Describes HTTP attributes. |
| 11 |
const ( |
| 12 |
// HTTPMethodKey is the attribute Key conforming to the "http.method" |
| 13 |
// semantic conventions. It represents the hTTP request method. |
| 14 |
// |
| 15 |
// Type: string |
| 16 |
// RequirementLevel: Required |
| 17 |
// Stability: stable |
| 18 |
// Examples: 'GET', 'POST', 'HEAD' |
| 19 |
HTTPMethodKey = attribute.Key("http.method") |
| 20 |
|
| 21 |
// HTTPStatusCodeKey is the attribute Key conforming to the |
| 22 |
// "http.status_code" semantic conventions. It represents the [HTTP |
| 23 |
// response status code](https://tools.ietf.org/html/rfc7231#section-6). |
| 24 |
// |
| 25 |
// Type: int |
| 26 |
// RequirementLevel: ConditionallyRequired (If and only if one was |
| 27 |
// received/sent.) |
| 28 |
// Stability: stable |
| 29 |
// Examples: 200 |
| 30 |
HTTPStatusCodeKey = attribute.Key("http.status_code") |
| 31 |
|
| 32 |
// HTTPFlavorKey is the attribute Key conforming to the "http.flavor" |
| 33 |
// semantic conventions. It represents the kind of HTTP protocol used. |
| 34 |
// |
| 35 |
// Type: Enum |
| 36 |
// RequirementLevel: Optional |
| 37 |
// Stability: stable |
| 38 |
HTTPFlavorKey = attribute.Key("http.flavor") |
| 39 |
) |
| 40 |
|
| 41 |
var ( |
| 42 |
// HTTP/1.0 |
| 43 |
HTTPFlavorHTTP10 = HTTPFlavorKey.String("1.0") |
| 44 |
// HTTP/1.1 |
| 45 |
HTTPFlavorHTTP11 = HTTPFlavorKey.String("1.1") |
| 46 |
// HTTP/2 |
| 47 |
HTTPFlavorHTTP20 = HTTPFlavorKey.String("2.0") |
| 48 |
// HTTP/3 |
| 49 |
HTTPFlavorHTTP30 = HTTPFlavorKey.String("3.0") |
| 50 |
// SPDY protocol |
| 51 |
HTTPFlavorSPDY = HTTPFlavorKey.String("SPDY") |
| 52 |
// QUIC protocol |
| 53 |
HTTPFlavorQUIC = HTTPFlavorKey.String("QUIC") |
| 54 |
) |
| 55 |
|
| 56 |
// HTTPMethod returns an attribute KeyValue conforming to the "http.method" |
| 57 |
// semantic conventions. It represents the hTTP request method. |
| 58 |
func HTTPMethod(val string) attribute.KeyValue { |
| 59 |
return HTTPMethodKey.String(val) |
| 60 |
} |
| 61 |
|
| 62 |
// HTTPStatusCode returns an attribute KeyValue conforming to the |
| 63 |
// "http.status_code" semantic conventions. It represents the [HTTP response |
| 64 |
// status code](https://tools.ietf.org/html/rfc7231#section-6). |
| 65 |
func HTTPStatusCode(val int) attribute.KeyValue { |
| 66 |
return HTTPStatusCodeKey.Int(val) |
| 67 |
} |
| 68 |
|
| 69 |
// HTTP Server spans attributes |
| 70 |
const ( |
| 71 |
// HTTPSchemeKey is the attribute Key conforming to the "http.scheme" |
| 72 |
// semantic conventions. It represents the URI scheme identifying the used |
| 73 |
// protocol. |
| 74 |
// |
| 75 |
// Type: string |
| 76 |
// RequirementLevel: Required |
| 77 |
// Stability: stable |
| 78 |
// Examples: 'http', 'https' |
| 79 |
HTTPSchemeKey = attribute.Key("http.scheme") |
| 80 |
|
| 81 |
// HTTPRouteKey is the attribute Key conforming to the "http.route" |
| 82 |
// semantic conventions. It represents the matched route (path template in |
| 83 |
// the format used by the respective server framework). See note below |
| 84 |
// |
| 85 |
// Type: string |
| 86 |
// RequirementLevel: ConditionallyRequired (If and only if it's available) |
| 87 |
// Stability: stable |
| 88 |
// Examples: '/users/:userID?', '{controller}/{action}/{id?}' |
| 89 |
// Note: MUST NOT be populated when this is not supported by the HTTP |
| 90 |
// server framework as the route attribute should have low-cardinality and |
| 91 |
// the URI path can NOT substitute it. |
| 92 |
// SHOULD include the [application |
| 93 |
// root](/specification/trace/semantic_conventions/http.md#http-server-definitions) |
| 94 |
// if there is one. |
| 95 |
HTTPRouteKey = attribute.Key("http.route") |
| 96 |
) |
| 97 |
|
| 98 |
// HTTPScheme returns an attribute KeyValue conforming to the "http.scheme" |
| 99 |
// semantic conventions. It represents the URI scheme identifying the used |
| 100 |
// protocol. |
| 101 |
func HTTPScheme(val string) attribute.KeyValue { |
| 102 |
return HTTPSchemeKey.String(val) |
| 103 |
} |
| 104 |
|
| 105 |
// HTTPRoute returns an attribute KeyValue conforming to the "http.route" |
| 106 |
// semantic conventions. It represents the matched route (path template in the |
| 107 |
// format used by the respective server framework). See note below |
| 108 |
func HTTPRoute(val string) attribute.KeyValue { |
| 109 |
return HTTPRouteKey.String(val) |
| 110 |
} |
| 111 |
|
| 112 |
// Attributes for Events represented using Log Records. |
| 113 |
const ( |
| 114 |
// EventNameKey is the attribute Key conforming to the "event.name" |
| 115 |
// semantic conventions. It represents the name identifies the event. |
| 116 |
// |
| 117 |
// Type: string |
| 118 |
// RequirementLevel: Required |
| 119 |
// Stability: stable |
| 120 |
// Examples: 'click', 'exception' |
| 121 |
EventNameKey = attribute.Key("event.name") |
| 122 |
|
| 123 |
// EventDomainKey is the attribute Key conforming to the "event.domain" |
| 124 |
// semantic conventions. It represents the domain identifies the business |
| 125 |
// context for the events. |
| 126 |
// |
| 127 |
// Type: Enum |
| 128 |
// RequirementLevel: Required |
| 129 |
// Stability: stable |
| 130 |
// Note: Events across different domains may have same `event.name`, yet be |
| 131 |
// unrelated events. |
| 132 |
EventDomainKey = attribute.Key("event.domain") |
| 133 |
) |
| 134 |
|
| 135 |
var ( |
| 136 |
// Events from browser apps |
| 137 |
EventDomainBrowser = EventDomainKey.String("browser") |
| 138 |
// Events from mobile apps |
| 139 |
EventDomainDevice = EventDomainKey.String("device") |
| 140 |
// Events from Kubernetes |
| 141 |
EventDomainK8S = EventDomainKey.String("k8s") |
| 142 |
) |
| 143 |
|
| 144 |
// EventName returns an attribute KeyValue conforming to the "event.name" |
| 145 |
// semantic conventions. It represents the name identifies the event. |
| 146 |
func EventName(val string) attribute.KeyValue { |
| 147 |
return EventNameKey.String(val) |
| 148 |
} |
| 149 |
|
| 150 |
// These attributes may be used for any network related operation. |
| 151 |
const ( |
| 152 |
// NetTransportKey is the attribute Key conforming to the "net.transport" |
| 153 |
// semantic conventions. It represents the transport protocol used. See |
| 154 |
// note below. |
| 155 |
// |
| 156 |
// Type: Enum |
| 157 |
// RequirementLevel: Optional |
| 158 |
// Stability: stable |
| 159 |
NetTransportKey = attribute.Key("net.transport") |
| 160 |
|
| 161 |
// NetAppProtocolNameKey is the attribute Key conforming to the |
| 162 |
// "net.app.protocol.name" semantic conventions. It represents the |
| 163 |
// application layer protocol used. The value SHOULD be normalized to |
| 164 |
// lowercase. |
| 165 |
// |
| 166 |
// Type: string |
| 167 |
// RequirementLevel: Optional |
| 168 |
// Stability: stable |
| 169 |
// Examples: 'amqp', 'http', 'mqtt' |
| 170 |
NetAppProtocolNameKey = attribute.Key("net.app.protocol.name") |
| 171 |
|
| 172 |
// NetAppProtocolVersionKey is the attribute Key conforming to the |
| 173 |
// "net.app.protocol.version" semantic conventions. It represents the |
| 174 |
// version of the application layer protocol used. See note below. |
| 175 |
// |
| 176 |
// Type: string |
| 177 |
// RequirementLevel: Optional |
| 178 |
// Stability: stable |
| 179 |
// Examples: '3.1.1' |
| 180 |
// Note: `net.app.protocol.version` refers to the version of the protocol |
| 181 |
// used and might be different from the protocol client's version. If the |
| 182 |
// HTTP client used has a version of `0.27.2`, but sends HTTP version |
| 183 |
// `1.1`, this attribute should be set to `1.1`. |
| 184 |
NetAppProtocolVersionKey = attribute.Key("net.app.protocol.version") |
| 185 |
|
| 186 |
// NetSockPeerNameKey is the attribute Key conforming to the |
| 187 |
// "net.sock.peer.name" semantic conventions. It represents the remote |
| 188 |
// socket peer name. |
| 189 |
// |
| 190 |
// Type: string |
| 191 |
// RequirementLevel: Recommended (If available and different from |
| 192 |
// `net.peer.name` and if `net.sock.peer.addr` is set.) |
| 193 |
// Stability: stable |
| 194 |
// Examples: 'proxy.example.com' |
| 195 |
NetSockPeerNameKey = attribute.Key("net.sock.peer.name") |
| 196 |
|
| 197 |
// NetSockPeerAddrKey is the attribute Key conforming to the |
| 198 |
// "net.sock.peer.addr" semantic conventions. It represents the remote |
| 199 |
// socket peer address: IPv4 or IPv6 for internet protocols, path for local |
| 200 |
// communication, |
| 201 |
// [etc](https://man7.org/linux/man-pages/man7/address_families.7.html). |
| 202 |
// |
| 203 |
// Type: string |
| 204 |
// RequirementLevel: Optional |
| 205 |
// Stability: stable |
| 206 |
// Examples: '127.0.0.1', '/tmp/mysql.sock' |
| 207 |
NetSockPeerAddrKey = attribute.Key("net.sock.peer.addr") |
| 208 |
|
| 209 |
// NetSockPeerPortKey is the attribute Key conforming to the |
| 210 |
// "net.sock.peer.port" semantic conventions. It represents the remote |
| 211 |
// socket peer port. |
| 212 |
// |
| 213 |
// Type: int |
| 214 |
// RequirementLevel: Recommended (If defined for the address family and if |
| 215 |
// different than `net.peer.port` and if `net.sock.peer.addr` is set.) |
| 216 |
// Stability: stable |
| 217 |
// Examples: 16456 |
| 218 |
NetSockPeerPortKey = attribute.Key("net.sock.peer.port") |
| 219 |
|
| 220 |
// NetSockFamilyKey is the attribute Key conforming to the |
| 221 |
// "net.sock.family" semantic conventions. It represents the protocol |
| 222 |
// [address |
| 223 |
// family](https://man7.org/linux/man-pages/man7/address_families.7.html) |
| 224 |
// which is used for communication. |
| 225 |
// |
| 226 |
// Type: Enum |
| 227 |
// RequirementLevel: ConditionallyRequired (If different than `inet` and if |
| 228 |
// any of `net.sock.peer.addr` or `net.sock.host.addr` are set. Consumers |
| 229 |
// of telemetry SHOULD accept both IPv4 and IPv6 formats for the address in |
| 230 |
// `net.sock.peer.addr` if `net.sock.family` is not set. This is to support |
| 231 |
// instrumentations that follow previous versions of this document.) |
| 232 |
// Stability: stable |
| 233 |
// Examples: 'inet6', 'bluetooth' |
| 234 |
NetSockFamilyKey = attribute.Key("net.sock.family") |
| 235 |
|
| 236 |
// NetPeerNameKey is the attribute Key conforming to the "net.peer.name" |
| 237 |
// semantic conventions. It represents the logical remote hostname, see |
| 238 |
// note below. |
| 239 |
// |
| 240 |
// Type: string |
| 241 |
// RequirementLevel: Optional |
| 242 |
// Stability: stable |
| 243 |
// Examples: 'example.com' |
| 244 |
// Note: `net.peer.name` SHOULD NOT be set if capturing it would require an |
| 245 |
// extra DNS lookup. |
| 246 |
NetPeerNameKey = attribute.Key("net.peer.name") |
| 247 |
|
| 248 |
// NetPeerPortKey is the attribute Key conforming to the "net.peer.port" |
| 249 |
// semantic conventions. It represents the logical remote port number |
| 250 |
// |
| 251 |
// Type: int |
| 252 |
// RequirementLevel: Optional |
| 253 |
// Stability: stable |
| 254 |
// Examples: 80, 8080, 443 |
| 255 |
NetPeerPortKey = attribute.Key("net.peer.port") |
| 256 |
|
| 257 |
// NetHostNameKey is the attribute Key conforming to the "net.host.name" |
| 258 |
// semantic conventions. It represents the logical local hostname or |
| 259 |
// similar, see note below. |
| 260 |
// |
| 261 |
// Type: string |
| 262 |
// RequirementLevel: Optional |
| 263 |
// Stability: stable |
| 264 |
// Examples: 'localhost' |
| 265 |
NetHostNameKey = attribute.Key("net.host.name") |
| 266 |
|
| 267 |
// NetHostPortKey is the attribute Key conforming to the "net.host.port" |
| 268 |
// semantic conventions. It represents the logical local port number, |
| 269 |
// preferably the one that the peer used to connect |
| 270 |
// |
| 271 |
// Type: int |
| 272 |
// RequirementLevel: Optional |
| 273 |
// Stability: stable |
| 274 |
// Examples: 8080 |
| 275 |
NetHostPortKey = attribute.Key("net.host.port") |
| 276 |
|
| 277 |
// NetSockHostAddrKey is the attribute Key conforming to the |
| 278 |
// "net.sock.host.addr" semantic conventions. It represents the local |
| 279 |
// socket address. Useful in case of a multi-IP host. |
| 280 |
// |
| 281 |
// Type: string |
| 282 |
// RequirementLevel: Optional |
| 283 |
// Stability: stable |
| 284 |
// Examples: '192.168.0.1' |
| 285 |
NetSockHostAddrKey = attribute.Key("net.sock.host.addr") |
| 286 |
|
| 287 |
// NetSockHostPortKey is the attribute Key conforming to the |
| 288 |
// "net.sock.host.port" semantic conventions. It represents the local |
| 289 |
// socket port number. |
| 290 |
// |
| 291 |
// Type: int |
| 292 |
// RequirementLevel: ConditionallyRequired (If defined for the address |
| 293 |
// family and if different than `net.host.port` and if `net.sock.host.addr` |
| 294 |
// is set. In other cases, it is still recommended to set this.) |
| 295 |
// Stability: stable |
| 296 |
// Examples: 35555 |
| 297 |
NetSockHostPortKey = attribute.Key("net.sock.host.port") |
| 298 |
|
| 299 |
// NetHostConnectionTypeKey is the attribute Key conforming to the |
| 300 |
// "net.host.connection.type" semantic conventions. It represents the |
| 301 |
// internet connection type currently being used by the host. |
| 302 |
// |
| 303 |
// Type: Enum |
| 304 |
// RequirementLevel: Optional |
| 305 |
// Stability: stable |
| 306 |
// Examples: 'wifi' |
| 307 |
NetHostConnectionTypeKey = attribute.Key("net.host.connection.type") |
| 308 |
|
| 309 |
// NetHostConnectionSubtypeKey is the attribute Key conforming to the |
| 310 |
// "net.host.connection.subtype" semantic conventions. It represents the |
| 311 |
// this describes more details regarding the connection.type. It may be the |
| 312 |
// type of cell technology connection, but it could be used for describing |
| 313 |
// details about a wifi connection. |
| 314 |
// |
| 315 |
// Type: Enum |
| 316 |
// RequirementLevel: Optional |
| 317 |
// Stability: stable |
| 318 |
// Examples: 'LTE' |
| 319 |
NetHostConnectionSubtypeKey = attribute.Key("net.host.connection.subtype") |
| 320 |
|
| 321 |
// NetHostCarrierNameKey is the attribute Key conforming to the |
| 322 |
// "net.host.carrier.name" semantic conventions. It represents the name of |
| 323 |
// the mobile carrier. |
| 324 |
// |
| 325 |
// Type: string |
| 326 |
// RequirementLevel: Optional |
| 327 |
// Stability: stable |
| 328 |
// Examples: 'sprint' |
| 329 |
NetHostCarrierNameKey = attribute.Key("net.host.carrier.name") |
| 330 |
|
| 331 |
// NetHostCarrierMccKey is the attribute Key conforming to the |
| 332 |
// "net.host.carrier.mcc" semantic conventions. It represents the mobile |
| 333 |
// carrier country code. |
| 334 |
// |
| 335 |
// Type: string |
| 336 |
// RequirementLevel: Optional |
| 337 |
// Stability: stable |
| 338 |
// Examples: '310' |
| 339 |
NetHostCarrierMccKey = attribute.Key("net.host.carrier.mcc") |
| 340 |
|
| 341 |
// NetHostCarrierMncKey is the attribute Key conforming to the |
| 342 |
// "net.host.carrier.mnc" semantic conventions. It represents the mobile |
| 343 |
// carrier network code. |
| 344 |
// |
| 345 |
// Type: string |
| 346 |
// RequirementLevel: Optional |
| 347 |
// Stability: stable |
| 348 |
// Examples: '001' |
| 349 |
NetHostCarrierMncKey = attribute.Key("net.host.carrier.mnc") |
| 350 |
|
| 351 |
// NetHostCarrierIccKey is the attribute Key conforming to the |
| 352 |
// "net.host.carrier.icc" semantic conventions. It represents the ISO |
| 353 |
// 3166-1 alpha-2 2-character country code associated with the mobile |
| 354 |
// carrier network. |
| 355 |
// |
| 356 |
// Type: string |
| 357 |
// RequirementLevel: Optional |
| 358 |
// Stability: stable |
| 359 |
// Examples: 'DE' |
| 360 |
NetHostCarrierIccKey = attribute.Key("net.host.carrier.icc") |
| 361 |
) |
| 362 |
|
| 363 |
var ( |
| 364 |
// ip_tcp |
| 365 |
NetTransportTCP = NetTransportKey.String("ip_tcp") |
| 366 |
// ip_udp |
| 367 |
NetTransportUDP = NetTransportKey.String("ip_udp") |
| 368 |
// Named or anonymous pipe. See note below |
| 369 |
NetTransportPipe = NetTransportKey.String("pipe") |
| 370 |
// In-process communication |
| 371 |
NetTransportInProc = NetTransportKey.String("inproc") |
| 372 |
// Something else (non IP-based) |
| 373 |
NetTransportOther = NetTransportKey.String("other") |
| 374 |
) |
| 375 |
|
| 376 |
var ( |
| 377 |
// IPv4 address |
| 378 |
NetSockFamilyInet = NetSockFamilyKey.String("inet") |
| 379 |
// IPv6 address |
| 380 |
NetSockFamilyInet6 = NetSockFamilyKey.String("inet6") |
| 381 |
// Unix domain socket path |
| 382 |
NetSockFamilyUnix = NetSockFamilyKey.String("unix") |
| 383 |
) |
| 384 |
|
| 385 |
var ( |
| 386 |
// wifi |
| 387 |
NetHostConnectionTypeWifi = NetHostConnectionTypeKey.String("wifi") |
| 388 |
// wired |
| 389 |
NetHostConnectionTypeWired = NetHostConnectionTypeKey.String("wired") |
| 390 |
// cell |
| 391 |
NetHostConnectionTypeCell = NetHostConnectionTypeKey.String("cell") |
| 392 |
// unavailable |
| 393 |
NetHostConnectionTypeUnavailable = NetHostConnectionTypeKey.String("unavailable") |
| 394 |
// unknown |
| 395 |
NetHostConnectionTypeUnknown = NetHostConnectionTypeKey.String("unknown") |
| 396 |
) |
| 397 |
|
| 398 |
var ( |
| 399 |
// GPRS |
| 400 |
NetHostConnectionSubtypeGprs = NetHostConnectionSubtypeKey.String("gprs") |
| 401 |
// EDGE |
| 402 |
NetHostConnectionSubtypeEdge = NetHostConnectionSubtypeKey.String("edge") |
| 403 |
// UMTS |
| 404 |
NetHostConnectionSubtypeUmts = NetHostConnectionSubtypeKey.String("umts") |
| 405 |
// CDMA |
| 406 |
NetHostConnectionSubtypeCdma = NetHostConnectionSubtypeKey.String("cdma") |
| 407 |
// EVDO Rel. 0 |
| 408 |
NetHostConnectionSubtypeEvdo0 = NetHostConnectionSubtypeKey.String("evdo_0") |
| 409 |
// EVDO Rev. A |
| 410 |
NetHostConnectionSubtypeEvdoA = NetHostConnectionSubtypeKey.String("evdo_a") |
| 411 |
// CDMA2000 1XRTT |
| 412 |
NetHostConnectionSubtypeCdma20001xrtt = NetHostConnectionSubtypeKey.String("cdma2000_1xrtt") |
| 413 |
// HSDPA |
| 414 |
NetHostConnectionSubtypeHsdpa = NetHostConnectionSubtypeKey.String("hsdpa") |
| 415 |
// HSUPA |
| 416 |
NetHostConnectionSubtypeHsupa = NetHostConnectionSubtypeKey.String("hsupa") |
| 417 |
// HSPA |
| 418 |
NetHostConnectionSubtypeHspa = NetHostConnectionSubtypeKey.String("hspa") |
| 419 |
// IDEN |
| 420 |
NetHostConnectionSubtypeIden = NetHostConnectionSubtypeKey.String("iden") |
| 421 |
// EVDO Rev. B |
| 422 |
NetHostConnectionSubtypeEvdoB = NetHostConnectionSubtypeKey.String("evdo_b") |
| 423 |
// LTE |
| 424 |
NetHostConnectionSubtypeLte = NetHostConnectionSubtypeKey.String("lte") |
| 425 |
// EHRPD |
| 426 |
NetHostConnectionSubtypeEhrpd = NetHostConnectionSubtypeKey.String("ehrpd") |
| 427 |
// HSPAP |
| 428 |
NetHostConnectionSubtypeHspap = NetHostConnectionSubtypeKey.String("hspap") |
| 429 |
// GSM |
| 430 |
NetHostConnectionSubtypeGsm = NetHostConnectionSubtypeKey.String("gsm") |
| 431 |
// TD-SCDMA |
| 432 |
NetHostConnectionSubtypeTdScdma = NetHostConnectionSubtypeKey.String("td_scdma") |
| 433 |
// IWLAN |
| 434 |
NetHostConnectionSubtypeIwlan = NetHostConnectionSubtypeKey.String("iwlan") |
| 435 |
// 5G NR (New Radio) |
| 436 |
NetHostConnectionSubtypeNr = NetHostConnectionSubtypeKey.String("nr") |
| 437 |
// 5G NRNSA (New Radio Non-Standalone) |
| 438 |
NetHostConnectionSubtypeNrnsa = NetHostConnectionSubtypeKey.String("nrnsa") |
| 439 |
// LTE CA |
| 440 |
NetHostConnectionSubtypeLteCa = NetHostConnectionSubtypeKey.String("lte_ca") |
| 441 |
) |
| 442 |
|
| 443 |
// NetAppProtocolName returns an attribute KeyValue conforming to the |
| 444 |
// "net.app.protocol.name" semantic conventions. It represents the application |
| 445 |
// layer protocol used. The value SHOULD be normalized to lowercase. |
| 446 |
func NetAppProtocolName(val string) attribute.KeyValue { |
| 447 |
return NetAppProtocolNameKey.String(val) |
| 448 |
} |
| 449 |
|
| 450 |
// NetAppProtocolVersion returns an attribute KeyValue conforming to the |
| 451 |
// "net.app.protocol.version" semantic conventions. It represents the version |
| 452 |
// of the application layer protocol used. See note below. |
| 453 |
func NetAppProtocolVersion(val string) attribute.KeyValue { |
| 454 |
return NetAppProtocolVersionKey.String(val) |
| 455 |
} |
| 456 |
|
| 457 |
// NetSockPeerName returns an attribute KeyValue conforming to the |
| 458 |
// "net.sock.peer.name" semantic conventions. It represents the remote socket |
| 459 |
// peer name. |
| 460 |
func NetSockPeerName(val string) attribute.KeyValue { |
| 461 |
return NetSockPeerNameKey.String(val) |
| 462 |
} |
| 463 |
|
| 464 |
// NetSockPeerAddr returns an attribute KeyValue conforming to the |
| 465 |
// "net.sock.peer.addr" semantic conventions. It represents the remote socket |
| 466 |
// peer address: IPv4 or IPv6 for internet protocols, path for local |
| 467 |
// communication, |
| 468 |
// [etc](https://man7.org/linux/man-pages/man7/address_families.7.html). |
| 469 |
func NetSockPeerAddr(val string) attribute.KeyValue { |
| 470 |
return NetSockPeerAddrKey.String(val) |
| 471 |
} |
| 472 |
|
| 473 |
// NetSockPeerPort returns an attribute KeyValue conforming to the |
| 474 |
// "net.sock.peer.port" semantic conventions. It represents the remote socket |
| 475 |
// peer port. |
| 476 |
func NetSockPeerPort(val int) attribute.KeyValue { |
| 477 |
return NetSockPeerPortKey.Int(val) |
| 478 |
} |
| 479 |
|
| 480 |
// NetPeerName returns an attribute KeyValue conforming to the |
| 481 |
// "net.peer.name" semantic conventions. It represents the logical remote |
| 482 |
// hostname, see note below. |
| 483 |
func NetPeerName(val string) attribute.KeyValue { |
| 484 |
return NetPeerNameKey.String(val) |
| 485 |
} |
| 486 |
|
| 487 |
// NetPeerPort returns an attribute KeyValue conforming to the |
| 488 |
// "net.peer.port" semantic conventions. It represents the logical remote port |
| 489 |
// number |
| 490 |
func NetPeerPort(val int) attribute.KeyValue { |
| 491 |
return NetPeerPortKey.Int(val) |
| 492 |
} |
| 493 |
|
| 494 |
// NetHostName returns an attribute KeyValue conforming to the |
| 495 |
// "net.host.name" semantic conventions. It represents the logical local |
| 496 |
// hostname or similar, see note below. |
| 497 |
func NetHostName(val string) attribute.KeyValue { |
| 498 |
return NetHostNameKey.String(val) |
| 499 |
} |
| 500 |
|
| 501 |
// NetHostPort returns an attribute KeyValue conforming to the |
| 502 |
// "net.host.port" semantic conventions. It represents the logical local port |
| 503 |
// number, preferably the one that the peer used to connect |
| 504 |
func NetHostPort(val int) attribute.KeyValue { |
| 505 |
return NetHostPortKey.Int(val) |
| 506 |
} |
| 507 |
|
| 508 |
// NetSockHostAddr returns an attribute KeyValue conforming to the |
| 509 |
// "net.sock.host.addr" semantic conventions. It represents the local socket |
| 510 |
// address. Useful in case of a multi-IP host. |
| 511 |
func NetSockHostAddr(val string) attribute.KeyValue { |
| 512 |
return NetSockHostAddrKey.String(val) |
| 513 |
} |
| 514 |
|
| 515 |
// NetSockHostPort returns an attribute KeyValue conforming to the |
| 516 |
// "net.sock.host.port" semantic conventions. It represents the local socket |
| 517 |
// port number. |
| 518 |
func NetSockHostPort(val int) attribute.KeyValue { |
| 519 |
return NetSockHostPortKey.Int(val) |
| 520 |
} |
| 521 |
|
| 522 |
// NetHostCarrierName returns an attribute KeyValue conforming to the |
| 523 |
// "net.host.carrier.name" semantic conventions. It represents the name of the |
| 524 |
// mobile carrier. |
| 525 |
func NetHostCarrierName(val string) attribute.KeyValue { |
| 526 |
return NetHostCarrierNameKey.String(val) |
| 527 |
} |
| 528 |
|
| 529 |
// NetHostCarrierMcc returns an attribute KeyValue conforming to the |
| 530 |
// "net.host.carrier.mcc" semantic conventions. It represents the mobile |
| 531 |
// carrier country code. |
| 532 |
func NetHostCarrierMcc(val string) attribute.KeyValue { |
| 533 |
return NetHostCarrierMccKey.String(val) |
| 534 |
} |
| 535 |
|
| 536 |
// NetHostCarrierMnc returns an attribute KeyValue conforming to the |
| 537 |
// "net.host.carrier.mnc" semantic conventions. It represents the mobile |
| 538 |
// carrier network code. |
| 539 |
func NetHostCarrierMnc(val string) attribute.KeyValue { |
| 540 |
return NetHostCarrierMncKey.String(val) |
| 541 |
} |
| 542 |
|
| 543 |
// NetHostCarrierIcc returns an attribute KeyValue conforming to the |
| 544 |
// "net.host.carrier.icc" semantic conventions. It represents the ISO 3166-1 |
| 545 |
// alpha-2 2-character country code associated with the mobile carrier network. |
| 546 |
func NetHostCarrierIcc(val string) attribute.KeyValue { |
| 547 |
return NetHostCarrierIccKey.String(val) |
| 548 |
} |
| 549 |
|
| 550 |
// Semantic conventions for HTTP client and server Spans. |
| 551 |
const ( |
| 552 |
// HTTPRequestContentLengthKey is the attribute Key conforming to the |
| 553 |
// "http.request_content_length" semantic conventions. It represents the |
| 554 |
// size of the request payload body in bytes. This is the number of bytes |
| 555 |
// transferred excluding headers and is often, but not always, present as |
| 556 |
// the |
| 557 |
// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) |
| 558 |
// header. For requests using transport encoding, this should be the |
| 559 |
// compressed size. |
| 560 |
// |
| 561 |
// Type: int |
| 562 |
// RequirementLevel: Optional |
| 563 |
// Stability: stable |
| 564 |
// Examples: 3495 |
| 565 |
HTTPRequestContentLengthKey = attribute.Key("http.request_content_length") |
| 566 |
|
| 567 |
// HTTPResponseContentLengthKey is the attribute Key conforming to the |
| 568 |
// "http.response_content_length" semantic conventions. It represents the |
| 569 |
// size of the response payload body in bytes. This is the number of bytes |
| 570 |
// transferred excluding headers and is often, but not always, present as |
| 571 |
// the |
| 572 |
// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) |
| 573 |
// header. For requests using transport encoding, this should be the |
| 574 |
// compressed size. |
| 575 |
// |
| 576 |
// Type: int |
| 577 |
// RequirementLevel: Optional |
| 578 |
// Stability: stable |
| 579 |
// Examples: 3495 |
| 580 |
HTTPResponseContentLengthKey = attribute.Key("http.response_content_length") |
| 581 |
) |
| 582 |
|
| 583 |
// HTTPRequestContentLength returns an attribute KeyValue conforming to the |
| 584 |
// "http.request_content_length" semantic conventions. It represents the size |
| 585 |
// of the request payload body in bytes. This is the number of bytes |
| 586 |
// transferred excluding headers and is often, but not always, present as the |
| 587 |
// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) |
| 588 |
// header. For requests using transport encoding, this should be the compressed |
| 589 |
// size. |
| 590 |
func HTTPRequestContentLength(val int) attribute.KeyValue { |
| 591 |
return HTTPRequestContentLengthKey.Int(val) |
| 592 |
} |
| 593 |
|
| 594 |
// HTTPResponseContentLength returns an attribute KeyValue conforming to the |
| 595 |
// "http.response_content_length" semantic conventions. It represents the size |
| 596 |
// of the response payload body in bytes. This is the number of bytes |
| 597 |
// transferred excluding headers and is often, but not always, present as the |
| 598 |
// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) |
| 599 |
// header. For requests using transport encoding, this should be the compressed |
| 600 |
// size. |
| 601 |
func HTTPResponseContentLength(val int) attribute.KeyValue { |
| 602 |
return HTTPResponseContentLengthKey.Int(val) |
| 603 |
} |
| 604 |
|
| 605 |
// Semantic convention describing per-message attributes populated on messaging |
| 606 |
// spans or links. |
| 607 |
const ( |
| 608 |
// MessagingMessageIDKey is the attribute Key conforming to the |
| 609 |
// "messaging.message.id" semantic conventions. It represents a value used |
| 610 |
// by the messaging system as an identifier for the message, represented as |
| 611 |
// a string. |
| 612 |
// |
| 613 |
// Type: string |
| 614 |
// RequirementLevel: Optional |
| 615 |
// Stability: stable |
| 616 |
// Examples: '452a7c7c7c7048c2f887f61572b18fc2' |
| 617 |
MessagingMessageIDKey = attribute.Key("messaging.message.id") |
| 618 |
|
| 619 |
// MessagingMessageConversationIDKey is the attribute Key conforming to the |
| 620 |
// "messaging.message.conversation_id" semantic conventions. It represents |
| 621 |
// the [conversation ID](#conversations) identifying the conversation to |
| 622 |
// which the message belongs, represented as a string. Sometimes called |
| 623 |
// "Correlation ID". |
| 624 |
// |
| 625 |
// Type: string |
| 626 |
// RequirementLevel: Optional |
| 627 |
// Stability: stable |
| 628 |
// Examples: 'MyConversationID' |
| 629 |
MessagingMessageConversationIDKey = attribute.Key("messaging.message.conversation_id") |
| 630 |
|
| 631 |
// MessagingMessagePayloadSizeBytesKey is the attribute Key conforming to |
| 632 |
// the "messaging.message.payload_size_bytes" semantic conventions. It |
| 633 |
// represents the (uncompressed) size of the message payload in bytes. Also |
| 634 |
// use this attribute if it is unknown whether the compressed or |
| 635 |
// uncompressed payload size is reported. |
| 636 |
// |
| 637 |
// Type: int |
| 638 |
// RequirementLevel: Optional |
| 639 |
// Stability: stable |
| 640 |
// Examples: 2738 |
| 641 |
MessagingMessagePayloadSizeBytesKey = attribute.Key("messaging.message.payload_size_bytes") |
| 642 |
|
| 643 |
// MessagingMessagePayloadCompressedSizeBytesKey is the attribute Key |
| 644 |
// conforming to the "messaging.message.payload_compressed_size_bytes" |
| 645 |
// semantic conventions. It represents the compressed size of the message |
| 646 |
// payload in bytes. |
| 647 |
// |
| 648 |
// Type: int |
| 649 |
// RequirementLevel: Optional |
| 650 |
// Stability: stable |
| 651 |
// Examples: 2048 |
| 652 |
MessagingMessagePayloadCompressedSizeBytesKey = attribute.Key("messaging.message.payload_compressed_size_bytes") |
| 653 |
) |
| 654 |
|
| 655 |
// MessagingMessageID returns an attribute KeyValue conforming to the |
| 656 |
// "messaging.message.id" semantic conventions. It represents a value used by |
| 657 |
// the messaging system as an identifier for the message, represented as a |
| 658 |
// string. |
| 659 |
func MessagingMessageID(val string) attribute.KeyValue { |
| 660 |
return MessagingMessageIDKey.String(val) |
| 661 |
} |
| 662 |
|
| 663 |
// MessagingMessageConversationID returns an attribute KeyValue conforming |
| 664 |
// to the "messaging.message.conversation_id" semantic conventions. It |
| 665 |
// represents the [conversation ID](#conversations) identifying the |
| 666 |
// conversation to which the message belongs, represented as a string. |
| 667 |
// Sometimes called "Correlation ID". |
| 668 |
func MessagingMessageConversationID(val string) attribute.KeyValue { |
| 669 |
return MessagingMessageConversationIDKey.String(val) |
| 670 |
} |
| 671 |
|
| 672 |
// MessagingMessagePayloadSizeBytes returns an attribute KeyValue conforming |
| 673 |
// to the "messaging.message.payload_size_bytes" semantic conventions. It |
| 674 |
// represents the (uncompressed) size of the message payload in bytes. Also use |
| 675 |
// this attribute if it is unknown whether the compressed or uncompressed |
| 676 |
// payload size is reported. |
| 677 |
func MessagingMessagePayloadSizeBytes(val int) attribute.KeyValue { |
| 678 |
return MessagingMessagePayloadSizeBytesKey.Int(val) |
| 679 |
} |
| 680 |
|
| 681 |
// MessagingMessagePayloadCompressedSizeBytes returns an attribute KeyValue |
| 682 |
// conforming to the "messaging.message.payload_compressed_size_bytes" semantic |
| 683 |
// conventions. It represents the compressed size of the message payload in |
| 684 |
// bytes. |
| 685 |
func MessagingMessagePayloadCompressedSizeBytes(val int) attribute.KeyValue { |
| 686 |
return MessagingMessagePayloadCompressedSizeBytesKey.Int(val) |
| 687 |
} |
| 688 |
|
| 689 |
// Semantic convention for attributes that describe messaging destination on |
| 690 |
// broker |
| 691 |
const ( |
| 692 |
// MessagingDestinationNameKey is the attribute Key conforming to the |
| 693 |
// "messaging.destination.name" semantic conventions. It represents the |
| 694 |
// message destination name |
| 695 |
// |
| 696 |
// Type: string |
| 697 |
// RequirementLevel: Optional |
| 698 |
// Stability: stable |
| 699 |
// Examples: 'MyQueue', 'MyTopic' |
| 700 |
// Note: Destination name SHOULD uniquely identify a specific queue, topic |
| 701 |
// or other entity within the broker. If |
| 702 |
// the broker does not have such notion, the destination name SHOULD |
| 703 |
// uniquely identify the broker. |
| 704 |
MessagingDestinationNameKey = attribute.Key("messaging.destination.name") |
| 705 |
|
| 706 |
// MessagingDestinationKindKey is the attribute Key conforming to the |
| 707 |
// "messaging.destination.kind" semantic conventions. It represents the |
| 708 |
// kind of message destination |
| 709 |
// |
| 710 |
// Type: Enum |
| 711 |
// RequirementLevel: Optional |
| 712 |
// Stability: stable |
| 713 |
MessagingDestinationKindKey = attribute.Key("messaging.destination.kind") |
| 714 |
|
| 715 |
// MessagingDestinationTemplateKey is the attribute Key conforming to the |
| 716 |
// "messaging.destination.template" semantic conventions. It represents the |
| 717 |
// low cardinality representation of the messaging destination name |
| 718 |
// |
| 719 |
// Type: string |
| 720 |
// RequirementLevel: Optional |
| 721 |
// Stability: stable |
| 722 |
// Examples: '/customers/{customerID}' |
| 723 |
// Note: Destination names could be constructed from templates. An example |
| 724 |
// would be a destination name involving a user name or product id. |
| 725 |
// Although the destination name in this case is of high cardinality, the |
| 726 |
// underlying template is of low cardinality and can be effectively used |
| 727 |
// for grouping and aggregation. |
| 728 |
MessagingDestinationTemplateKey = attribute.Key("messaging.destination.template") |
| 729 |
|
| 730 |
// MessagingDestinationTemporaryKey is the attribute Key conforming to the |
| 731 |
// "messaging.destination.temporary" semantic conventions. It represents a |
| 732 |
// boolean that is true if the message destination is temporary and might |
| 733 |
// not exist anymore after messages are processed. |
| 734 |
// |
| 735 |
// Type: boolean |
| 736 |
// RequirementLevel: Optional |
| 737 |
// Stability: stable |
| 738 |
MessagingDestinationTemporaryKey = attribute.Key("messaging.destination.temporary") |
| 739 |
|
| 740 |
// MessagingDestinationAnonymousKey is the attribute Key conforming to the |
| 741 |
// "messaging.destination.anonymous" semantic conventions. It represents a |
| 742 |
// boolean that is true if the message destination is anonymous (could be |
| 743 |
// unnamed or have auto-generated name). |
| 744 |
// |
| 745 |
// Type: boolean |
| 746 |
// RequirementLevel: Optional |
| 747 |
// Stability: stable |
| 748 |
MessagingDestinationAnonymousKey = attribute.Key("messaging.destination.anonymous") |
| 749 |
) |
| 750 |
|
| 751 |
var ( |
| 752 |
// A message sent to a queue |
| 753 |
MessagingDestinationKindQueue = MessagingDestinationKindKey.String("queue") |
| 754 |
// A message sent to a topic |
| 755 |
MessagingDestinationKindTopic = MessagingDestinationKindKey.String("topic") |
| 756 |
) |
| 757 |
|
| 758 |
// MessagingDestinationName returns an attribute KeyValue conforming to the |
| 759 |
// "messaging.destination.name" semantic conventions. It represents the message |
| 760 |
// destination name |
| 761 |
func MessagingDestinationName(val string) attribute.KeyValue { |
| 762 |
return MessagingDestinationNameKey.String(val) |
| 763 |
} |
| 764 |
|
| 765 |
// MessagingDestinationTemplate returns an attribute KeyValue conforming to |
| 766 |
// the "messaging.destination.template" semantic conventions. It represents the |
| 767 |
// low cardinality representation of the messaging destination name |
| 768 |
func MessagingDestinationTemplate(val string) attribute.KeyValue { |
| 769 |
return MessagingDestinationTemplateKey.String(val) |
| 770 |
} |
| 771 |
|
| 772 |
// MessagingDestinationTemporary returns an attribute KeyValue conforming to |
| 773 |
// the "messaging.destination.temporary" semantic conventions. It represents a |
| 774 |
// boolean that is true if the message destination is temporary and might not |
| 775 |
// exist anymore after messages are processed. |
| 776 |
func MessagingDestinationTemporary(val bool) attribute.KeyValue { |
| 777 |
return MessagingDestinationTemporaryKey.Bool(val) |
| 778 |
} |
| 779 |
|
| 780 |
// MessagingDestinationAnonymous returns an attribute KeyValue conforming to |
| 781 |
// the "messaging.destination.anonymous" semantic conventions. It represents a |
| 782 |
// boolean that is true if the message destination is anonymous (could be |
| 783 |
// unnamed or have auto-generated name). |
| 784 |
func MessagingDestinationAnonymous(val bool) attribute.KeyValue { |
| 785 |
return MessagingDestinationAnonymousKey.Bool(val) |
| 786 |
} |
| 787 |
|
| 788 |
// Semantic convention for attributes that describe messaging source on broker |
| 789 |
const ( |
| 790 |
// MessagingSourceNameKey is the attribute Key conforming to the |
| 791 |
// "messaging.source.name" semantic conventions. It represents the message |
| 792 |
// source name |
| 793 |
// |
| 794 |
// Type: string |
| 795 |
// RequirementLevel: Optional |
| 796 |
// Stability: stable |
| 797 |
// Examples: 'MyQueue', 'MyTopic' |
| 798 |
// Note: Source name SHOULD uniquely identify a specific queue, topic, or |
| 799 |
// other entity within the broker. If |
| 800 |
// the broker does not have such notion, the source name SHOULD uniquely |
| 801 |
// identify the broker. |
| 802 |
MessagingSourceNameKey = attribute.Key("messaging.source.name") |
| 803 |
|
| 804 |
// MessagingSourceKindKey is the attribute Key conforming to the |
| 805 |
// "messaging.source.kind" semantic conventions. It represents the kind of |
| 806 |
// message source |
| 807 |
// |
| 808 |
// Type: Enum |
| 809 |
// RequirementLevel: Optional |
| 810 |
// Stability: stable |
| 811 |
MessagingSourceKindKey = attribute.Key("messaging.source.kind") |
| 812 |
|
| 813 |
// MessagingSourceTemplateKey is the attribute Key conforming to the |
| 814 |
// "messaging.source.template" semantic conventions. It represents the low |
| 815 |
// cardinality representation of the messaging source name |
| 816 |
// |
| 817 |
// Type: string |
| 818 |
// RequirementLevel: Optional |
| 819 |
// Stability: stable |
| 820 |
// Examples: '/customers/{customerID}' |
| 821 |
// Note: Source names could be constructed from templates. An example would |
| 822 |
// be a source name involving a user name or product id. Although the |
| 823 |
// source name in this case is of high cardinality, the underlying template |
| 824 |
// is of low cardinality and can be effectively used for grouping and |
| 825 |
// aggregation. |
| 826 |
MessagingSourceTemplateKey = attribute.Key("messaging.source.template") |
| 827 |
|
| 828 |
// MessagingSourceTemporaryKey is the attribute Key conforming to the |
| 829 |
// "messaging.source.temporary" semantic conventions. It represents a |
| 830 |
// boolean that is true if the message source is temporary and might not |
| 831 |
// exist anymore after messages are processed. |
| 832 |
// |
| 833 |
// Type: boolean |
| 834 |
// RequirementLevel: Optional |
| 835 |
// Stability: stable |
| 836 |
MessagingSourceTemporaryKey = attribute.Key("messaging.source.temporary") |
| 837 |
|
| 838 |
// MessagingSourceAnonymousKey is the attribute Key conforming to the |
| 839 |
// "messaging.source.anonymous" semantic conventions. It represents a |
| 840 |
// boolean that is true if the message source is anonymous (could be |
| 841 |
// unnamed or have auto-generated name). |
| 842 |
// |
| 843 |
// Type: boolean |
| 844 |
// RequirementLevel: Optional |
| 845 |
// Stability: stable |
| 846 |
MessagingSourceAnonymousKey = attribute.Key("messaging.source.anonymous") |
| 847 |
) |
| 848 |
|
| 849 |
var ( |
| 850 |
// A message received from a queue |
| 851 |
MessagingSourceKindQueue = MessagingSourceKindKey.String("queue") |
| 852 |
// A message received from a topic |
| 853 |
MessagingSourceKindTopic = MessagingSourceKindKey.String("topic") |
| 854 |
) |
| 855 |
|
| 856 |
// MessagingSourceName returns an attribute KeyValue conforming to the |
| 857 |
// "messaging.source.name" semantic conventions. It represents the message |
| 858 |
// source name |
| 859 |
func MessagingSourceName(val string) attribute.KeyValue { |
| 860 |
return MessagingSourceNameKey.String(val) |
| 861 |
} |
| 862 |
|
| 863 |
// MessagingSourceTemplate returns an attribute KeyValue conforming to the |
| 864 |
// "messaging.source.template" semantic conventions. It represents the low |
| 865 |
// cardinality representation of the messaging source name |
| 866 |
func MessagingSourceTemplate(val string) attribute.KeyValue { |
| 867 |
return MessagingSourceTemplateKey.String(val) |
| 868 |
} |
| 869 |
|
| 870 |
// MessagingSourceTemporary returns an attribute KeyValue conforming to the |
| 871 |
// "messaging.source.temporary" semantic conventions. It represents a boolean |
| 872 |
// that is true if the message source is temporary and might not exist anymore |
| 873 |
// after messages are processed. |
| 874 |
func MessagingSourceTemporary(val bool) attribute.KeyValue { |
| 875 |
return MessagingSourceTemporaryKey.Bool(val) |
| 876 |
} |
| 877 |
|
| 878 |
// MessagingSourceAnonymous returns an attribute KeyValue conforming to the |
| 879 |
// "messaging.source.anonymous" semantic conventions. It represents a boolean |
| 880 |
// that is true if the message source is anonymous (could be unnamed or have |
| 881 |
// auto-generated name). |
| 882 |
func MessagingSourceAnonymous(val bool) attribute.KeyValue { |
| 883 |
return MessagingSourceAnonymousKey.Bool(val) |
| 884 |
} |
| 885 |
|
| 886 |
// Attributes for RabbitMQ |
| 887 |
const ( |
| 888 |
// MessagingRabbitmqDestinationRoutingKeyKey is the attribute Key |
| 889 |
// conforming to the "messaging.rabbitmq.destination.routing_key" semantic |
| 890 |
// conventions. It represents the rabbitMQ message routing key. |
| 891 |
// |
| 892 |
// Type: string |
| 893 |
// RequirementLevel: ConditionallyRequired (If not empty.) |
| 894 |
// Stability: stable |
| 895 |
// Examples: 'myKey' |
| 896 |
MessagingRabbitmqDestinationRoutingKeyKey = attribute.Key("messaging.rabbitmq.destination.routing_key") |
| 897 |
) |
| 898 |
|
| 899 |
// MessagingRabbitmqDestinationRoutingKey returns an attribute KeyValue |
| 900 |
// conforming to the "messaging.rabbitmq.destination.routing_key" semantic |
| 901 |
// conventions. It represents the rabbitMQ message routing key. |
| 902 |
func MessagingRabbitmqDestinationRoutingKey(val string) attribute.KeyValue { |
| 903 |
return MessagingRabbitmqDestinationRoutingKeyKey.String(val) |
| 904 |
} |
| 905 |
|
| 906 |
// Attributes for Apache Kafka |
| 907 |
const ( |
| 908 |
// MessagingKafkaMessageKeyKey is the attribute Key conforming to the |
| 909 |
// "messaging.kafka.message.key" semantic conventions. It represents the |
| 910 |
// message keys in Kafka are used for grouping alike messages to ensure |
| 911 |
// they're processed on the same partition. They differ from |
| 912 |
// `messaging.message.id` in that they're not unique. If the key is `null`, |
| 913 |
// the attribute MUST NOT be set. |
| 914 |
// |
| 915 |
// Type: string |
| 916 |
// RequirementLevel: Optional |
| 917 |
// Stability: stable |
| 918 |
// Examples: 'myKey' |
| 919 |
// Note: If the key type is not string, it's string representation has to |
| 920 |
// be supplied for the attribute. If the key has no unambiguous, canonical |
| 921 |
// string form, don't include its value. |
| 922 |
MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message.key") |
| 923 |
|
| 924 |
// MessagingKafkaConsumerGroupKey is the attribute Key conforming to the |
| 925 |
// "messaging.kafka.consumer.group" semantic conventions. It represents the |
| 926 |
// name of the Kafka Consumer Group that is handling the message. Only |
| 927 |
// applies to consumers, not producers. |
| 928 |
// |
| 929 |
// Type: string |
| 930 |
// RequirementLevel: Optional |
| 931 |
// Stability: stable |
| 932 |
// Examples: 'my-group' |
| 933 |
MessagingKafkaConsumerGroupKey = attribute.Key("messaging.kafka.consumer.group") |
| 934 |
|
| 935 |
// MessagingKafkaClientIDKey is the attribute Key conforming to the |
| 936 |
// "messaging.kafka.client_id" semantic conventions. It represents the |
| 937 |
// client ID for the Consumer or Producer that is handling the message. |
| 938 |
// |
| 939 |
// Type: string |
| 940 |
// RequirementLevel: Optional |
| 941 |
// Stability: stable |
| 942 |
// Examples: 'client-5' |
| 943 |
MessagingKafkaClientIDKey = attribute.Key("messaging.kafka.client_id") |
| 944 |
|
| 945 |
// MessagingKafkaDestinationPartitionKey is the attribute Key conforming to |
| 946 |
// the "messaging.kafka.destination.partition" semantic conventions. It |
| 947 |
// represents the partition the message is sent to. |
| 948 |
// |
| 949 |
// Type: int |
| 950 |
// RequirementLevel: Optional |
| 951 |
// Stability: stable |
| 952 |
// Examples: 2 |
| 953 |
MessagingKafkaDestinationPartitionKey = attribute.Key("messaging.kafka.destination.partition") |
| 954 |
|
| 955 |
// MessagingKafkaSourcePartitionKey is the attribute Key conforming to the |
| 956 |
// "messaging.kafka.source.partition" semantic conventions. It represents |
| 957 |
// the partition the message is received from. |
| 958 |
// |
| 959 |
// Type: int |
| 960 |
// RequirementLevel: Optional |
| 961 |
// Stability: stable |
| 962 |
// Examples: 2 |
| 963 |
MessagingKafkaSourcePartitionKey = attribute.Key("messaging.kafka.source.partition") |
| 964 |
|
| 965 |
// MessagingKafkaMessageOffsetKey is the attribute Key conforming to the |
| 966 |
// "messaging.kafka.message.offset" semantic conventions. It represents the |
| 967 |
// offset of a record in the corresponding Kafka partition. |
| 968 |
// |
| 969 |
// Type: int |
| 970 |
// RequirementLevel: Optional |
| 971 |
// Stability: stable |
| 972 |
// Examples: 42 |
| 973 |
MessagingKafkaMessageOffsetKey = attribute.Key("messaging.kafka.message.offset") |
| 974 |
|
| 975 |
// MessagingKafkaMessageTombstoneKey is the attribute Key conforming to the |
| 976 |
// "messaging.kafka.message.tombstone" semantic conventions. It represents |
| 977 |
// a boolean that is true if the message is a tombstone. |
| 978 |
// |
| 979 |
// Type: boolean |
| 980 |
// RequirementLevel: ConditionallyRequired (If value is `true`. When |
| 981 |
// missing, the value is assumed to be `false`.) |
| 982 |
// Stability: stable |
| 983 |
MessagingKafkaMessageTombstoneKey = attribute.Key("messaging.kafka.message.tombstone") |
| 984 |
) |
| 985 |
|
| 986 |
// MessagingKafkaMessageKey returns an attribute KeyValue conforming to the |
| 987 |
// "messaging.kafka.message.key" semantic conventions. It represents the |
| 988 |
// message keys in Kafka are used for grouping alike messages to ensure they're |
| 989 |
// processed on the same partition. They differ from `messaging.message.id` in |
| 990 |
// that they're not unique. If the key is `null`, the attribute MUST NOT be |
| 991 |
// set. |
| 992 |
func MessagingKafkaMessageKey(val string) attribute.KeyValue { |
| 993 |
return MessagingKafkaMessageKeyKey.String(val) |
| 994 |
} |
| 995 |
|
| 996 |
// MessagingKafkaConsumerGroup returns an attribute KeyValue conforming to |
| 997 |
// the "messaging.kafka.consumer.group" semantic conventions. It represents the |
| 998 |
// name of the Kafka Consumer Group that is handling the message. Only applies |
| 999 |
// to consumers, not producers. |
| 1000 |
func MessagingKafkaConsumerGroup(val string) attribute.KeyValue { |
| 1001 |
return MessagingKafkaConsumerGroupKey.String(val) |
| 1002 |
} |
| 1003 |
|
| 1004 |
// MessagingKafkaClientID returns an attribute KeyValue conforming to the |
| 1005 |
// "messaging.kafka.client_id" semantic conventions. It represents the client |
| 1006 |
// ID for the Consumer or Producer that is handling the message. |
| 1007 |
func MessagingKafkaClientID(val string) attribute.KeyValue { |
| 1008 |
return MessagingKafkaClientIDKey.String(val) |
| 1009 |
} |
| 1010 |
|
| 1011 |
// MessagingKafkaDestinationPartition returns an attribute KeyValue |
| 1012 |
// conforming to the "messaging.kafka.destination.partition" semantic |
| 1013 |
// conventions. It represents the partition the message is sent to. |
| 1014 |
func MessagingKafkaDestinationPartition(val int) attribute.KeyValue { |
| 1015 |
return MessagingKafkaDestinationPartitionKey.Int(val) |
| 1016 |
} |
| 1017 |
|
| 1018 |
// MessagingKafkaSourcePartition returns an attribute KeyValue conforming to |
| 1019 |
// the "messaging.kafka.source.partition" semantic conventions. It represents |
| 1020 |
// the partition the message is received from. |
| 1021 |
func MessagingKafkaSourcePartition(val int) attribute.KeyValue { |
| 1022 |
return MessagingKafkaSourcePartitionKey.Int(val) |
| 1023 |
} |
| 1024 |
|
| 1025 |
// MessagingKafkaMessageOffset returns an attribute KeyValue conforming to |
| 1026 |
// the "messaging.kafka.message.offset" semantic conventions. It represents the |
| 1027 |
// offset of a record in the corresponding Kafka partition. |
| 1028 |
func MessagingKafkaMessageOffset(val int) attribute.KeyValue { |
| 1029 |
return MessagingKafkaMessageOffsetKey.Int(val) |
| 1030 |
} |
| 1031 |
|
| 1032 |
// MessagingKafkaMessageTombstone returns an attribute KeyValue conforming |
| 1033 |
// to the "messaging.kafka.message.tombstone" semantic conventions. It |
| 1034 |
// represents a boolean that is true if the message is a tombstone. |
| 1035 |
func MessagingKafkaMessageTombstone(val bool) attribute.KeyValue { |
| 1036 |
return MessagingKafkaMessageTombstoneKey.Bool(val) |
| 1037 |
} |
| 1038 |
|
| 1039 |
// Attributes for Apache RocketMQ |
| 1040 |
const ( |
| 1041 |
// MessagingRocketmqNamespaceKey is the attribute Key conforming to the |
| 1042 |
// "messaging.rocketmq.namespace" semantic conventions. It represents the |
| 1043 |
// namespace of RocketMQ resources, resources in different namespaces are |
| 1044 |
// individual. |
| 1045 |
// |
| 1046 |
// Type: string |
| 1047 |
// RequirementLevel: Required |
| 1048 |
// Stability: stable |
| 1049 |
// Examples: 'myNamespace' |
| 1050 |
MessagingRocketmqNamespaceKey = attribute.Key("messaging.rocketmq.namespace") |
| 1051 |
|
| 1052 |
// MessagingRocketmqClientGroupKey is the attribute Key conforming to the |
| 1053 |
// "messaging.rocketmq.client_group" semantic conventions. It represents |
| 1054 |
// the name of the RocketMQ producer/consumer group that is handling the |
| 1055 |
// message. The client type is identified by the SpanKind. |
| 1056 |
// |
| 1057 |
// Type: string |
| 1058 |
// RequirementLevel: Required |
| 1059 |
// Stability: stable |
| 1060 |
// Examples: 'myConsumerGroup' |
| 1061 |
MessagingRocketmqClientGroupKey = attribute.Key("messaging.rocketmq.client_group") |
| 1062 |
|
| 1063 |
// MessagingRocketmqClientIDKey is the attribute Key conforming to the |
| 1064 |
// "messaging.rocketmq.client_id" semantic conventions. It represents the |
| 1065 |
// unique identifier for each client. |
| 1066 |
// |
| 1067 |
// Type: string |
| 1068 |
// RequirementLevel: Required |
| 1069 |
// Stability: stable |
| 1070 |
// Examples: 'myhost@8742@s8083jm' |
| 1071 |
MessagingRocketmqClientIDKey = attribute.Key("messaging.rocketmq.client_id") |
| 1072 |
|
| 1073 |
// MessagingRocketmqMessageDeliveryTimestampKey is the attribute Key |
| 1074 |
// conforming to the "messaging.rocketmq.message.delivery_timestamp" |
| 1075 |
// semantic conventions. It represents the timestamp in milliseconds that |
| 1076 |
// the delay message is expected to be delivered to consumer. |
| 1077 |
// |
| 1078 |
// Type: int |
| 1079 |
// RequirementLevel: ConditionallyRequired (If the message type is delay |
| 1080 |
// and delay time level is not specified.) |
| 1081 |
// Stability: stable |
| 1082 |
// Examples: 1665987217045 |
| 1083 |
MessagingRocketmqMessageDeliveryTimestampKey = attribute.Key("messaging.rocketmq.message.delivery_timestamp") |
| 1084 |
|
| 1085 |
// MessagingRocketmqMessageDelayTimeLevelKey is the attribute Key |
| 1086 |
// conforming to the "messaging.rocketmq.message.delay_time_level" semantic |
| 1087 |
// conventions. It represents the delay time level for delay message, which |
| 1088 |
// determines the message delay time. |
| 1089 |
// |
| 1090 |
// Type: int |
| 1091 |
// RequirementLevel: ConditionallyRequired (If the message type is delay |
| 1092 |
// and delivery timestamp is not specified.) |
| 1093 |
// Stability: stable |
| 1094 |
// Examples: 3 |
| 1095 |
MessagingRocketmqMessageDelayTimeLevelKey = attribute.Key("messaging.rocketmq.message.delay_time_level") |
| 1096 |
|
| 1097 |
// MessagingRocketmqMessageGroupKey is the attribute Key conforming to the |
| 1098 |
// "messaging.rocketmq.message.group" semantic conventions. It represents |
| 1099 |
// the it is essential for FIFO message. Messages that belong to the same |
| 1100 |
// message group are always processed one by one within the same consumer |
| 1101 |
// group. |
| 1102 |
// |
| 1103 |
// Type: string |
| 1104 |
// RequirementLevel: ConditionallyRequired (If the message type is FIFO.) |
| 1105 |
// Stability: stable |
| 1106 |
// Examples: 'myMessageGroup' |
| 1107 |
MessagingRocketmqMessageGroupKey = attribute.Key("messaging.rocketmq.message.group") |
| 1108 |
|
| 1109 |
// MessagingRocketmqMessageTypeKey is the attribute Key conforming to the |
| 1110 |
// "messaging.rocketmq.message.type" semantic conventions. It represents |
| 1111 |
// the type of message. |
| 1112 |
// |
| 1113 |
// Type: Enum |
| 1114 |
// RequirementLevel: Optional |
| 1115 |
// Stability: stable |
| 1116 |
MessagingRocketmqMessageTypeKey = attribute.Key("messaging.rocketmq.message.type") |
| 1117 |
|
| 1118 |
// MessagingRocketmqMessageTagKey is the attribute Key conforming to the |
| 1119 |
// "messaging.rocketmq.message.tag" semantic conventions. It represents the |
| 1120 |
// secondary classifier of message besides topic. |
| 1121 |
// |
| 1122 |
// Type: string |
| 1123 |
// RequirementLevel: Optional |
| 1124 |
// Stability: stable |
| 1125 |
// Examples: 'tagA' |
| 1126 |
MessagingRocketmqMessageTagKey = attribute.Key("messaging.rocketmq.message.tag") |
| 1127 |
|
| 1128 |
// MessagingRocketmqMessageKeysKey is the attribute Key conforming to the |
| 1129 |
// "messaging.rocketmq.message.keys" semantic conventions. It represents |
| 1130 |
// the key(s) of message, another way to mark message besides message id. |
| 1131 |
// |
| 1132 |
// Type: string[] |
| 1133 |
// RequirementLevel: Optional |
| 1134 |
// Stability: stable |
| 1135 |
// Examples: 'keyA', 'keyB' |
| 1136 |
MessagingRocketmqMessageKeysKey = attribute.Key("messaging.rocketmq.message.keys") |
| 1137 |
|
| 1138 |
// MessagingRocketmqConsumptionModelKey is the attribute Key conforming to |
| 1139 |
// the "messaging.rocketmq.consumption_model" semantic conventions. It |
| 1140 |
// represents the model of message consumption. This only applies to |
| 1141 |
// consumer spans. |
| 1142 |
// |
| 1143 |
// Type: Enum |
| 1144 |
// RequirementLevel: Optional |
| 1145 |
// Stability: stable |
| 1146 |
MessagingRocketmqConsumptionModelKey = attribute.Key("messaging.rocketmq.consumption_model") |
| 1147 |
) |
| 1148 |
|
| 1149 |
var ( |
| 1150 |
// Normal message |
| 1151 |
MessagingRocketmqMessageTypeNormal = MessagingRocketmqMessageTypeKey.String("normal") |
| 1152 |
// FIFO message |
| 1153 |
MessagingRocketmqMessageTypeFifo = MessagingRocketmqMessageTypeKey.String("fifo") |
| 1154 |
// Delay message |
| 1155 |
MessagingRocketmqMessageTypeDelay = MessagingRocketmqMessageTypeKey.String("delay") |
| 1156 |
// Transaction message |
| 1157 |
MessagingRocketmqMessageTypeTransaction = MessagingRocketmqMessageTypeKey.String("transaction") |
| 1158 |
) |
| 1159 |
|
| 1160 |
var ( |
| 1161 |
// Clustering consumption model |
| 1162 |
MessagingRocketmqConsumptionModelClustering = MessagingRocketmqConsumptionModelKey.String("clustering") |
| 1163 |
// Broadcasting consumption model |
| 1164 |
MessagingRocketmqConsumptionModelBroadcasting = MessagingRocketmqConsumptionModelKey.String("broadcasting") |
| 1165 |
) |
| 1166 |
|
| 1167 |
// MessagingRocketmqNamespace returns an attribute KeyValue conforming to |
| 1168 |
// the "messaging.rocketmq.namespace" semantic conventions. It represents the |
| 1169 |
// namespace of RocketMQ resources, resources in different namespaces are |
| 1170 |
// individual. |
| 1171 |
func MessagingRocketmqNamespace(val string) attribute.KeyValue { |
| 1172 |
return MessagingRocketmqNamespaceKey.String(val) |
| 1173 |
} |
| 1174 |
|
| 1175 |
// MessagingRocketmqClientGroup returns an attribute KeyValue conforming to |
| 1176 |
// the "messaging.rocketmq.client_group" semantic conventions. It represents |
| 1177 |
// the name of the RocketMQ producer/consumer group that is handling the |
| 1178 |
// message. The client type is identified by the SpanKind. |
| 1179 |
func MessagingRocketmqClientGroup(val string) attribute.KeyValue { |
| 1180 |
return MessagingRocketmqClientGroupKey.String(val) |
| 1181 |
} |
| 1182 |
|
| 1183 |
// MessagingRocketmqClientID returns an attribute KeyValue conforming to the |
| 1184 |
// "messaging.rocketmq.client_id" semantic conventions. It represents the |
| 1185 |
// unique identifier for each client. |
| 1186 |
func MessagingRocketmqClientID(val string) attribute.KeyValue { |
| 1187 |
return MessagingRocketmqClientIDKey.String(val) |
| 1188 |
} |
| 1189 |
|
| 1190 |
// MessagingRocketmqMessageDeliveryTimestamp returns an attribute KeyValue |
| 1191 |
// conforming to the "messaging.rocketmq.message.delivery_timestamp" semantic |
| 1192 |
// conventions. It represents the timestamp in milliseconds that the delay |
| 1193 |
// message is expected to be delivered to consumer. |
| 1194 |
func MessagingRocketmqMessageDeliveryTimestamp(val int) attribute.KeyValue { |
| 1195 |
return MessagingRocketmqMessageDeliveryTimestampKey.Int(val) |
| 1196 |
} |
| 1197 |
|
| 1198 |
// MessagingRocketmqMessageDelayTimeLevel returns an attribute KeyValue |
| 1199 |
// conforming to the "messaging.rocketmq.message.delay_time_level" semantic |
| 1200 |
// conventions. It represents the delay time level for delay message, which |
| 1201 |
// determines the message delay time. |
| 1202 |
func MessagingRocketmqMessageDelayTimeLevel(val int) attribute.KeyValue { |
| 1203 |
return MessagingRocketmqMessageDelayTimeLevelKey.Int(val) |
| 1204 |
} |
| 1205 |
|
| 1206 |
// MessagingRocketmqMessageGroup returns an attribute KeyValue conforming to |
| 1207 |
// the "messaging.rocketmq.message.group" semantic conventions. It represents |
| 1208 |
// the it is essential for FIFO message. Messages that belong to the same |
| 1209 |
// message group are always processed one by one within the same consumer |
| 1210 |
// group. |
| 1211 |
func MessagingRocketmqMessageGroup(val string) attribute.KeyValue { |
| 1212 |
return MessagingRocketmqMessageGroupKey.String(val) |
| 1213 |
} |
| 1214 |
|
| 1215 |
// MessagingRocketmqMessageTag returns an attribute KeyValue conforming to |
| 1216 |
// the "messaging.rocketmq.message.tag" semantic conventions. It represents the |
| 1217 |
// secondary classifier of message besides topic. |
| 1218 |
func MessagingRocketmqMessageTag(val string) attribute.KeyValue { |
| 1219 |
return MessagingRocketmqMessageTagKey.String(val) |
| 1220 |
} |
| 1221 |
|
| 1222 |
// MessagingRocketmqMessageKeys returns an attribute KeyValue conforming to |
| 1223 |
// the "messaging.rocketmq.message.keys" semantic conventions. It represents |
| 1224 |
// the key(s) of message, another way to mark message besides message id. |
| 1225 |
func MessagingRocketmqMessageKeys(val ...string) attribute.KeyValue { |
| 1226 |
return MessagingRocketmqMessageKeysKey.StringSlice(val) |
| 1227 |
} |
| 1228 |
|
| 1229 |
// Describes user-agent attributes. |
| 1230 |
const ( |
| 1231 |
// UserAgentOriginalKey is the attribute Key conforming to the |
| 1232 |
// "user_agent.original" semantic conventions. It represents the value of |
| 1233 |
// the [HTTP |
| 1234 |
// User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) |
| 1235 |
// header sent by the client. |
| 1236 |
// |
| 1237 |
// Type: string |
| 1238 |
// RequirementLevel: Optional |
| 1239 |
// Stability: stable |
| 1240 |
// Examples: 'CERN-LineMode/2.15 libwww/2.17b3' |
| 1241 |
UserAgentOriginalKey = attribute.Key("user_agent.original") |
| 1242 |
) |
| 1243 |
|
| 1244 |
// UserAgentOriginal returns an attribute KeyValue conforming to the |
| 1245 |
// "user_agent.original" semantic conventions. It represents the value of the |
| 1246 |
// [HTTP |
| 1247 |
// User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) |
| 1248 |
// header sent by the client. |
| 1249 |
func UserAgentOriginal(val string) attribute.KeyValue { |
| 1250 |
return UserAgentOriginalKey.String(val) |
| 1251 |
} |