| 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.23.1" |
| 7 |
|
| 8 |
import "go.opentelemetry.io/otel/attribute" |
| 9 |
|
| 10 |
// These attributes may be used to describe the client in a connection-based |
| 11 |
// network interaction where there is one side that initiates the connection |
| 12 |
// (the client is the side that initiates the connection). This covers all TCP |
| 13 |
// network interactions since TCP is connection-based and one side initiates |
| 14 |
// the connection (an exception is made for peer-to-peer communication over TCP |
| 15 |
// where the "user-facing" surface of the protocol / API doesn't expose a clear |
| 16 |
// notion of client and server). This also covers UDP network interactions |
| 17 |
// where one side initiates the interaction, e.g. QUIC (HTTP/3) and DNS. |
| 18 |
const ( |
| 19 |
// ClientAddressKey is the attribute Key conforming to the "client.address" |
| 20 |
// semantic conventions. It represents the client address - domain name if |
| 21 |
// available without reverse DNS lookup; otherwise, IP address or Unix |
| 22 |
// domain socket name. |
| 23 |
// |
| 24 |
// Type: string |
| 25 |
// RequirementLevel: Optional |
| 26 |
// Stability: stable |
| 27 |
// Examples: 'client.example.com', '10.1.2.80', '/tmp/my.sock' |
| 28 |
// Note: When observed from the server side, and when communicating through |
| 29 |
// an intermediary, `client.address` SHOULD represent the client address |
| 30 |
// behind any intermediaries, for example proxies, if it's available. |
| 31 |
ClientAddressKey = attribute.Key("client.address") |
| 32 |
|
| 33 |
// ClientPortKey is the attribute Key conforming to the "client.port" |
| 34 |
// semantic conventions. It represents the client port number. |
| 35 |
// |
| 36 |
// Type: int |
| 37 |
// RequirementLevel: Optional |
| 38 |
// Stability: stable |
| 39 |
// Examples: 65123 |
| 40 |
// Note: When observed from the server side, and when communicating through |
| 41 |
// an intermediary, `client.port` SHOULD represent the client port behind |
| 42 |
// any intermediaries, for example proxies, if it's available. |
| 43 |
ClientPortKey = attribute.Key("client.port") |
| 44 |
) |
| 45 |
|
| 46 |
// ClientAddress returns an attribute KeyValue conforming to the |
| 47 |
// "client.address" semantic conventions. It represents the client address - |
| 48 |
// domain name if available without reverse DNS lookup; otherwise, IP address |
| 49 |
// or Unix domain socket name. |
| 50 |
func ClientAddress(val string) attribute.KeyValue { |
| 51 |
return ClientAddressKey.String(val) |
| 52 |
} |
| 53 |
|
| 54 |
// ClientPort returns an attribute KeyValue conforming to the "client.port" |
| 55 |
// semantic conventions. It represents the client port number. |
| 56 |
func ClientPort(val int) attribute.KeyValue { |
| 57 |
return ClientPortKey.Int(val) |
| 58 |
} |
| 59 |
|
| 60 |
// These attributes may be used to describe the receiver of a network |
| 61 |
// exchange/packet. These should be used when there is no client/server |
| 62 |
// relationship between the two sides, or when that relationship is unknown. |
| 63 |
// This covers low-level network interactions (e.g. packet tracing) where you |
| 64 |
// don't know if there was a connection or which side initiated it. This also |
| 65 |
// covers unidirectional UDP flows and peer-to-peer communication where the |
| 66 |
// "user-facing" surface of the protocol / API doesn't expose a clear notion of |
| 67 |
// client and server. |
| 68 |
const ( |
| 69 |
// DestinationAddressKey is the attribute Key conforming to the |
| 70 |
// "destination.address" semantic conventions. It represents the |
| 71 |
// destination address - domain name if available without reverse DNS |
| 72 |
// lookup; otherwise, IP address or Unix domain socket name. |
| 73 |
// |
| 74 |
// Type: string |
| 75 |
// RequirementLevel: Optional |
| 76 |
// Stability: experimental |
| 77 |
// Examples: 'destination.example.com', '10.1.2.80', '/tmp/my.sock' |
| 78 |
// Note: When observed from the source side, and when communicating through |
| 79 |
// an intermediary, `destination.address` SHOULD represent the destination |
| 80 |
// address behind any intermediaries, for example proxies, if it's |
| 81 |
// available. |
| 82 |
DestinationAddressKey = attribute.Key("destination.address") |
| 83 |
|
| 84 |
// DestinationPortKey is the attribute Key conforming to the |
| 85 |
// "destination.port" semantic conventions. It represents the destination |
| 86 |
// port number |
| 87 |
// |
| 88 |
// Type: int |
| 89 |
// RequirementLevel: Optional |
| 90 |
// Stability: experimental |
| 91 |
// Examples: 3389, 2888 |
| 92 |
DestinationPortKey = attribute.Key("destination.port") |
| 93 |
) |
| 94 |
|
| 95 |
// DestinationAddress returns an attribute KeyValue conforming to the |
| 96 |
// "destination.address" semantic conventions. It represents the destination |
| 97 |
// address - domain name if available without reverse DNS lookup; otherwise, IP |
| 98 |
// address or Unix domain socket name. |
| 99 |
func DestinationAddress(val string) attribute.KeyValue { |
| 100 |
return DestinationAddressKey.String(val) |
| 101 |
} |
| 102 |
|
| 103 |
// DestinationPort returns an attribute KeyValue conforming to the |
| 104 |
// "destination.port" semantic conventions. It represents the destination port |
| 105 |
// number |
| 106 |
func DestinationPort(val int) attribute.KeyValue { |
| 107 |
return DestinationPortKey.Int(val) |
| 108 |
} |
| 109 |
|
| 110 |
// The shared attributes used to report an error. |
| 111 |
const ( |
| 112 |
// ErrorTypeKey is the attribute Key conforming to the "error.type" |
| 113 |
// semantic conventions. It represents the describes a class of error the |
| 114 |
// operation ended with. |
| 115 |
// |
| 116 |
// Type: Enum |
| 117 |
// RequirementLevel: Optional |
| 118 |
// Stability: stable |
| 119 |
// Examples: 'timeout', 'java.net.UnknownHostException', |
| 120 |
// 'server_certificate_invalid', '500' |
| 121 |
// Note: The `error.type` SHOULD be predictable and SHOULD have low |
| 122 |
// cardinality. |
| 123 |
// Instrumentations SHOULD document the list of errors they report. |
| 124 |
// |
| 125 |
// The cardinality of `error.type` within one instrumentation library |
| 126 |
// SHOULD be low. |
| 127 |
// Telemetry consumers that aggregate data from multiple instrumentation |
| 128 |
// libraries and applications |
| 129 |
// should be prepared for `error.type` to have high cardinality at query |
| 130 |
// time when no |
| 131 |
// additional filters are applied. |
| 132 |
// |
| 133 |
// If the operation has completed successfully, instrumentations SHOULD NOT |
| 134 |
// set `error.type`. |
| 135 |
// |
| 136 |
// If a specific domain defines its own set of error identifiers (such as |
| 137 |
// HTTP or gRPC status codes), |
| 138 |
// it's RECOMMENDED to: |
| 139 |
// * Use a domain-specific attribute |
| 140 |
// * Set `error.type` to capture all errors, regardless of whether they |
| 141 |
// are defined within the domain-specific set or not. |
| 142 |
ErrorTypeKey = attribute.Key("error.type") |
| 143 |
) |
| 144 |
|
| 145 |
var ( |
| 146 |
// A fallback error value to be used when the instrumentation doesn't define a custom value |
| 147 |
ErrorTypeOther = ErrorTypeKey.String("_OTHER") |
| 148 |
) |
| 149 |
|
| 150 |
// Describes FaaS attributes. |
| 151 |
const ( |
| 152 |
// FaaSInvokedNameKey is the attribute Key conforming to the |
| 153 |
// "faas.invoked_name" semantic conventions. It represents the name of the |
| 154 |
// invoked function. |
| 155 |
// |
| 156 |
// Type: string |
| 157 |
// RequirementLevel: Required |
| 158 |
// Stability: experimental |
| 159 |
// Examples: 'my-function' |
| 160 |
// Note: SHOULD be equal to the `faas.name` resource attribute of the |
| 161 |
// invoked function. |
| 162 |
FaaSInvokedNameKey = attribute.Key("faas.invoked_name") |
| 163 |
|
| 164 |
// FaaSInvokedProviderKey is the attribute Key conforming to the |
| 165 |
// "faas.invoked_provider" semantic conventions. It represents the cloud |
| 166 |
// provider of the invoked function. |
| 167 |
// |
| 168 |
// Type: Enum |
| 169 |
// RequirementLevel: Required |
| 170 |
// Stability: experimental |
| 171 |
// Note: SHOULD be equal to the `cloud.provider` resource attribute of the |
| 172 |
// invoked function. |
| 173 |
FaaSInvokedProviderKey = attribute.Key("faas.invoked_provider") |
| 174 |
|
| 175 |
// FaaSInvokedRegionKey is the attribute Key conforming to the |
| 176 |
// "faas.invoked_region" semantic conventions. It represents the cloud |
| 177 |
// region of the invoked function. |
| 178 |
// |
| 179 |
// Type: string |
| 180 |
// RequirementLevel: ConditionallyRequired (For some cloud providers, like |
| 181 |
// AWS or GCP, the region in which a function is hosted is essential to |
| 182 |
// uniquely identify the function and also part of its endpoint. Since it's |
| 183 |
// part of the endpoint being called, the region is always known to |
| 184 |
// clients. In these cases, `faas.invoked_region` MUST be set accordingly. |
| 185 |
// If the region is unknown to the client or not required for identifying |
| 186 |
// the invoked function, setting `faas.invoked_region` is optional.) |
| 187 |
// Stability: experimental |
| 188 |
// Examples: 'eu-central-1' |
| 189 |
// Note: SHOULD be equal to the `cloud.region` resource attribute of the |
| 190 |
// invoked function. |
| 191 |
FaaSInvokedRegionKey = attribute.Key("faas.invoked_region") |
| 192 |
|
| 193 |
// FaaSTriggerKey is the attribute Key conforming to the "faas.trigger" |
| 194 |
// semantic conventions. It represents the type of the trigger which caused |
| 195 |
// this function invocation. |
| 196 |
// |
| 197 |
// Type: Enum |
| 198 |
// RequirementLevel: Optional |
| 199 |
// Stability: experimental |
| 200 |
FaaSTriggerKey = attribute.Key("faas.trigger") |
| 201 |
) |
| 202 |
|
| 203 |
var ( |
| 204 |
// Alibaba Cloud |
| 205 |
FaaSInvokedProviderAlibabaCloud = FaaSInvokedProviderKey.String("alibaba_cloud") |
| 206 |
// Amazon Web Services |
| 207 |
FaaSInvokedProviderAWS = FaaSInvokedProviderKey.String("aws") |
| 208 |
// Microsoft Azure |
| 209 |
FaaSInvokedProviderAzure = FaaSInvokedProviderKey.String("azure") |
| 210 |
// Google Cloud Platform |
| 211 |
FaaSInvokedProviderGCP = FaaSInvokedProviderKey.String("gcp") |
| 212 |
// Tencent Cloud |
| 213 |
FaaSInvokedProviderTencentCloud = FaaSInvokedProviderKey.String("tencent_cloud") |
| 214 |
) |
| 215 |
|
| 216 |
var ( |
| 217 |
// A response to some data source operation such as a database or filesystem read/write |
| 218 |
FaaSTriggerDatasource = FaaSTriggerKey.String("datasource") |
| 219 |
// To provide an answer to an inbound HTTP request |
| 220 |
FaaSTriggerHTTP = FaaSTriggerKey.String("http") |
| 221 |
// A function is set to be executed when messages are sent to a messaging system |
| 222 |
FaaSTriggerPubsub = FaaSTriggerKey.String("pubsub") |
| 223 |
// A function is scheduled to be executed regularly |
| 224 |
FaaSTriggerTimer = FaaSTriggerKey.String("timer") |
| 225 |
// If none of the others apply |
| 226 |
FaaSTriggerOther = FaaSTriggerKey.String("other") |
| 227 |
) |
| 228 |
|
| 229 |
// FaaSInvokedName returns an attribute KeyValue conforming to the |
| 230 |
// "faas.invoked_name" semantic conventions. It represents the name of the |
| 231 |
// invoked function. |
| 232 |
func FaaSInvokedName(val string) attribute.KeyValue { |
| 233 |
return FaaSInvokedNameKey.String(val) |
| 234 |
} |
| 235 |
|
| 236 |
// FaaSInvokedRegion returns an attribute KeyValue conforming to the |
| 237 |
// "faas.invoked_region" semantic conventions. It represents the cloud region |
| 238 |
// of the invoked function. |
| 239 |
func FaaSInvokedRegion(val string) attribute.KeyValue { |
| 240 |
return FaaSInvokedRegionKey.String(val) |
| 241 |
} |
| 242 |
|
| 243 |
// Attributes for Events represented using Log Records. |
| 244 |
const ( |
| 245 |
// EventDomainKey is the attribute Key conforming to the "event.domain" |
| 246 |
// semantic conventions. It represents the domain identifies the business |
| 247 |
// context for the events. |
| 248 |
// |
| 249 |
// Type: Enum |
| 250 |
// RequirementLevel: Required |
| 251 |
// Stability: experimental |
| 252 |
// Note: Events across different domains may have same `event.name`, yet be |
| 253 |
// unrelated events. |
| 254 |
EventDomainKey = attribute.Key("event.domain") |
| 255 |
|
| 256 |
// EventNameKey is the attribute Key conforming to the "event.name" |
| 257 |
// semantic conventions. It represents the name identifies the event. |
| 258 |
// |
| 259 |
// Type: string |
| 260 |
// RequirementLevel: Required |
| 261 |
// Stability: experimental |
| 262 |
// Examples: 'click', 'exception' |
| 263 |
EventNameKey = attribute.Key("event.name") |
| 264 |
) |
| 265 |
|
| 266 |
var ( |
| 267 |
// Events from browser apps |
| 268 |
EventDomainBrowser = EventDomainKey.String("browser") |
| 269 |
// Events from mobile apps |
| 270 |
EventDomainDevice = EventDomainKey.String("device") |
| 271 |
// Events from Kubernetes |
| 272 |
EventDomainK8S = EventDomainKey.String("k8s") |
| 273 |
) |
| 274 |
|
| 275 |
// EventName returns an attribute KeyValue conforming to the "event.name" |
| 276 |
// semantic conventions. It represents the name identifies the event. |
| 277 |
func EventName(val string) attribute.KeyValue { |
| 278 |
return EventNameKey.String(val) |
| 279 |
} |
| 280 |
|
| 281 |
// The attributes described in this section are rather generic. They may be |
| 282 |
// used in any Log Record they apply to. |
| 283 |
const ( |
| 284 |
// LogRecordUIDKey is the attribute Key conforming to the "log.record.uid" |
| 285 |
// semantic conventions. It represents a unique identifier for the Log |
| 286 |
// Record. |
| 287 |
// |
| 288 |
// Type: string |
| 289 |
// RequirementLevel: Optional |
| 290 |
// Stability: experimental |
| 291 |
// Examples: '01ARZ3NDEKTSV4RRFFQ69G5FAV' |
| 292 |
// Note: If an id is provided, other log records with the same id will be |
| 293 |
// considered duplicates and can be removed safely. This means, that two |
| 294 |
// distinguishable log records MUST have different values. |
| 295 |
// The id MAY be an [Universally Unique Lexicographically Sortable |
| 296 |
// Identifier (ULID)](https://github.com/ulid/spec), but other identifiers |
| 297 |
// (e.g. UUID) may be used as needed. |
| 298 |
LogRecordUIDKey = attribute.Key("log.record.uid") |
| 299 |
) |
| 300 |
|
| 301 |
// LogRecordUID returns an attribute KeyValue conforming to the |
| 302 |
// "log.record.uid" semantic conventions. It represents a unique identifier for |
| 303 |
// the Log Record. |
| 304 |
func LogRecordUID(val string) attribute.KeyValue { |
| 305 |
return LogRecordUIDKey.String(val) |
| 306 |
} |
| 307 |
|
| 308 |
// Describes Log attributes |
| 309 |
const ( |
| 310 |
// LogIostreamKey is the attribute Key conforming to the "log.iostream" |
| 311 |
// semantic conventions. It represents the stream associated with the log. |
| 312 |
// See below for a list of well-known values. |
| 313 |
// |
| 314 |
// Type: Enum |
| 315 |
// RequirementLevel: Optional |
| 316 |
// Stability: experimental |
| 317 |
LogIostreamKey = attribute.Key("log.iostream") |
| 318 |
) |
| 319 |
|
| 320 |
var ( |
| 321 |
// Logs from stdout stream |
| 322 |
LogIostreamStdout = LogIostreamKey.String("stdout") |
| 323 |
// Events from stderr stream |
| 324 |
LogIostreamStderr = LogIostreamKey.String("stderr") |
| 325 |
) |
| 326 |
|
| 327 |
// A file to which log was emitted. |
| 328 |
const ( |
| 329 |
// LogFileNameKey is the attribute Key conforming to the "log.file.name" |
| 330 |
// semantic conventions. It represents the basename of the file. |
| 331 |
// |
| 332 |
// Type: string |
| 333 |
// RequirementLevel: Recommended |
| 334 |
// Stability: experimental |
| 335 |
// Examples: 'audit.log' |
| 336 |
LogFileNameKey = attribute.Key("log.file.name") |
| 337 |
|
| 338 |
// LogFileNameResolvedKey is the attribute Key conforming to the |
| 339 |
// "log.file.name_resolved" semantic conventions. It represents the |
| 340 |
// basename of the file, with symlinks resolved. |
| 341 |
// |
| 342 |
// Type: string |
| 343 |
// RequirementLevel: Optional |
| 344 |
// Stability: experimental |
| 345 |
// Examples: 'uuid.log' |
| 346 |
LogFileNameResolvedKey = attribute.Key("log.file.name_resolved") |
| 347 |
|
| 348 |
// LogFilePathKey is the attribute Key conforming to the "log.file.path" |
| 349 |
// semantic conventions. It represents the full path to the file. |
| 350 |
// |
| 351 |
// Type: string |
| 352 |
// RequirementLevel: Optional |
| 353 |
// Stability: experimental |
| 354 |
// Examples: '/var/log/mysql/audit.log' |
| 355 |
LogFilePathKey = attribute.Key("log.file.path") |
| 356 |
|
| 357 |
// LogFilePathResolvedKey is the attribute Key conforming to the |
| 358 |
// "log.file.path_resolved" semantic conventions. It represents the full |
| 359 |
// path to the file, with symlinks resolved. |
| 360 |
// |
| 361 |
// Type: string |
| 362 |
// RequirementLevel: Optional |
| 363 |
// Stability: experimental |
| 364 |
// Examples: '/var/lib/docker/uuid.log' |
| 365 |
LogFilePathResolvedKey = attribute.Key("log.file.path_resolved") |
| 366 |
) |
| 367 |
|
| 368 |
// LogFileName returns an attribute KeyValue conforming to the |
| 369 |
// "log.file.name" semantic conventions. It represents the basename of the |
| 370 |
// file. |
| 371 |
func LogFileName(val string) attribute.KeyValue { |
| 372 |
return LogFileNameKey.String(val) |
| 373 |
} |
| 374 |
|
| 375 |
// LogFileNameResolved returns an attribute KeyValue conforming to the |
| 376 |
// "log.file.name_resolved" semantic conventions. It represents the basename of |
| 377 |
// the file, with symlinks resolved. |
| 378 |
func LogFileNameResolved(val string) attribute.KeyValue { |
| 379 |
return LogFileNameResolvedKey.String(val) |
| 380 |
} |
| 381 |
|
| 382 |
// LogFilePath returns an attribute KeyValue conforming to the |
| 383 |
// "log.file.path" semantic conventions. It represents the full path to the |
| 384 |
// file. |
| 385 |
func LogFilePath(val string) attribute.KeyValue { |
| 386 |
return LogFilePathKey.String(val) |
| 387 |
} |
| 388 |
|
| 389 |
// LogFilePathResolved returns an attribute KeyValue conforming to the |
| 390 |
// "log.file.path_resolved" semantic conventions. It represents the full path |
| 391 |
// to the file, with symlinks resolved. |
| 392 |
func LogFilePathResolved(val string) attribute.KeyValue { |
| 393 |
return LogFilePathResolvedKey.String(val) |
| 394 |
} |
| 395 |
|
| 396 |
// Describes Database attributes |
| 397 |
const ( |
| 398 |
// PoolNameKey is the attribute Key conforming to the "pool.name" semantic |
| 399 |
// conventions. It represents the name of the connection pool; unique |
| 400 |
// within the instrumented application. In case the connection pool |
| 401 |
// implementation doesn't provide a name, then the |
| 402 |
// [db.connection_string](/docs/database/database-spans.md#connection-level-attributes) |
| 403 |
// should be used |
| 404 |
// |
| 405 |
// Type: string |
| 406 |
// RequirementLevel: Required |
| 407 |
// Stability: experimental |
| 408 |
// Examples: 'myDataSource' |
| 409 |
PoolNameKey = attribute.Key("pool.name") |
| 410 |
|
| 411 |
// StateKey is the attribute Key conforming to the "state" semantic |
| 412 |
// conventions. It represents the state of a connection in the pool |
| 413 |
// |
| 414 |
// Type: Enum |
| 415 |
// RequirementLevel: Required |
| 416 |
// Stability: experimental |
| 417 |
// Examples: 'idle' |
| 418 |
StateKey = attribute.Key("state") |
| 419 |
) |
| 420 |
|
| 421 |
var ( |
| 422 |
// idle |
| 423 |
StateIdle = StateKey.String("idle") |
| 424 |
// used |
| 425 |
StateUsed = StateKey.String("used") |
| 426 |
) |
| 427 |
|
| 428 |
// PoolName returns an attribute KeyValue conforming to the "pool.name" |
| 429 |
// semantic conventions. It represents the name of the connection pool; unique |
| 430 |
// within the instrumented application. In case the connection pool |
| 431 |
// implementation doesn't provide a name, then the |
| 432 |
// [db.connection_string](/docs/database/database-spans.md#connection-level-attributes) |
| 433 |
// should be used |
| 434 |
func PoolName(val string) attribute.KeyValue { |
| 435 |
return PoolNameKey.String(val) |
| 436 |
} |
| 437 |
|
| 438 |
// Describes JVM buffer metric attributes. |
| 439 |
const ( |
| 440 |
// JvmBufferPoolNameKey is the attribute Key conforming to the |
| 441 |
// "jvm.buffer.pool.name" semantic conventions. It represents the name of |
| 442 |
// the buffer pool. |
| 443 |
// |
| 444 |
// Type: string |
| 445 |
// RequirementLevel: Recommended |
| 446 |
// Stability: experimental |
| 447 |
// Examples: 'mapped', 'direct' |
| 448 |
// Note: Pool names are generally obtained via |
| 449 |
// [BufferPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/BufferPoolMXBean.html#getName()). |
| 450 |
JvmBufferPoolNameKey = attribute.Key("jvm.buffer.pool.name") |
| 451 |
) |
| 452 |
|
| 453 |
// JvmBufferPoolName returns an attribute KeyValue conforming to the |
| 454 |
// "jvm.buffer.pool.name" semantic conventions. It represents the name of the |
| 455 |
// buffer pool. |
| 456 |
func JvmBufferPoolName(val string) attribute.KeyValue { |
| 457 |
return JvmBufferPoolNameKey.String(val) |
| 458 |
} |
| 459 |
|
| 460 |
// Describes JVM memory metric attributes. |
| 461 |
const ( |
| 462 |
// JvmMemoryPoolNameKey is the attribute Key conforming to the |
| 463 |
// "jvm.memory.pool.name" semantic conventions. It represents the name of |
| 464 |
// the memory pool. |
| 465 |
// |
| 466 |
// Type: string |
| 467 |
// RequirementLevel: Recommended |
| 468 |
// Stability: experimental |
| 469 |
// Examples: 'G1 Old Gen', 'G1 Eden space', 'G1 Survivor Space' |
| 470 |
// Note: Pool names are generally obtained via |
| 471 |
// [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()). |
| 472 |
JvmMemoryPoolNameKey = attribute.Key("jvm.memory.pool.name") |
| 473 |
|
| 474 |
// JvmMemoryTypeKey is the attribute Key conforming to the |
| 475 |
// "jvm.memory.type" semantic conventions. It represents the type of |
| 476 |
// memory. |
| 477 |
// |
| 478 |
// Type: Enum |
| 479 |
// RequirementLevel: Recommended |
| 480 |
// Stability: experimental |
| 481 |
// Examples: 'heap', 'non_heap' |
| 482 |
JvmMemoryTypeKey = attribute.Key("jvm.memory.type") |
| 483 |
) |
| 484 |
|
| 485 |
var ( |
| 486 |
// Heap memory |
| 487 |
JvmMemoryTypeHeap = JvmMemoryTypeKey.String("heap") |
| 488 |
// Non-heap memory |
| 489 |
JvmMemoryTypeNonHeap = JvmMemoryTypeKey.String("non_heap") |
| 490 |
) |
| 491 |
|
| 492 |
// JvmMemoryPoolName returns an attribute KeyValue conforming to the |
| 493 |
// "jvm.memory.pool.name" semantic conventions. It represents the name of the |
| 494 |
// memory pool. |
| 495 |
func JvmMemoryPoolName(val string) attribute.KeyValue { |
| 496 |
return JvmMemoryPoolNameKey.String(val) |
| 497 |
} |
| 498 |
|
| 499 |
// Describes System metric attributes |
| 500 |
const ( |
| 501 |
// SystemDeviceKey is the attribute Key conforming to the "system.device" |
| 502 |
// semantic conventions. It represents the device identifier |
| 503 |
// |
| 504 |
// Type: string |
| 505 |
// RequirementLevel: Optional |
| 506 |
// Stability: experimental |
| 507 |
// Examples: '(identifier)' |
| 508 |
SystemDeviceKey = attribute.Key("system.device") |
| 509 |
) |
| 510 |
|
| 511 |
// SystemDevice returns an attribute KeyValue conforming to the |
| 512 |
// "system.device" semantic conventions. It represents the device identifier |
| 513 |
func SystemDevice(val string) attribute.KeyValue { |
| 514 |
return SystemDeviceKey.String(val) |
| 515 |
} |
| 516 |
|
| 517 |
// Describes System CPU metric attributes |
| 518 |
const ( |
| 519 |
// SystemCPULogicalNumberKey is the attribute Key conforming to the |
| 520 |
// "system.cpu.logical_number" semantic conventions. It represents the |
| 521 |
// logical CPU number [0..n-1] |
| 522 |
// |
| 523 |
// Type: int |
| 524 |
// RequirementLevel: Optional |
| 525 |
// Stability: experimental |
| 526 |
// Examples: 1 |
| 527 |
SystemCPULogicalNumberKey = attribute.Key("system.cpu.logical_number") |
| 528 |
|
| 529 |
// SystemCPUStateKey is the attribute Key conforming to the |
| 530 |
// "system.cpu.state" semantic conventions. It represents the state of the |
| 531 |
// CPU |
| 532 |
// |
| 533 |
// Type: Enum |
| 534 |
// RequirementLevel: Optional |
| 535 |
// Stability: experimental |
| 536 |
// Examples: 'idle', 'interrupt' |
| 537 |
SystemCPUStateKey = attribute.Key("system.cpu.state") |
| 538 |
) |
| 539 |
|
| 540 |
var ( |
| 541 |
// user |
| 542 |
SystemCPUStateUser = SystemCPUStateKey.String("user") |
| 543 |
// system |
| 544 |
SystemCPUStateSystem = SystemCPUStateKey.String("system") |
| 545 |
// nice |
| 546 |
SystemCPUStateNice = SystemCPUStateKey.String("nice") |
| 547 |
// idle |
| 548 |
SystemCPUStateIdle = SystemCPUStateKey.String("idle") |
| 549 |
// iowait |
| 550 |
SystemCPUStateIowait = SystemCPUStateKey.String("iowait") |
| 551 |
// interrupt |
| 552 |
SystemCPUStateInterrupt = SystemCPUStateKey.String("interrupt") |
| 553 |
// steal |
| 554 |
SystemCPUStateSteal = SystemCPUStateKey.String("steal") |
| 555 |
) |
| 556 |
|
| 557 |
// SystemCPULogicalNumber returns an attribute KeyValue conforming to the |
| 558 |
// "system.cpu.logical_number" semantic conventions. It represents the logical |
| 559 |
// CPU number [0..n-1] |
| 560 |
func SystemCPULogicalNumber(val int) attribute.KeyValue { |
| 561 |
return SystemCPULogicalNumberKey.Int(val) |
| 562 |
} |
| 563 |
|
| 564 |
// Describes System Memory metric attributes |
| 565 |
const ( |
| 566 |
// SystemMemoryStateKey is the attribute Key conforming to the |
| 567 |
// "system.memory.state" semantic conventions. It represents the memory |
| 568 |
// state |
| 569 |
// |
| 570 |
// Type: Enum |
| 571 |
// RequirementLevel: Optional |
| 572 |
// Stability: experimental |
| 573 |
// Examples: 'free', 'cached' |
| 574 |
SystemMemoryStateKey = attribute.Key("system.memory.state") |
| 575 |
) |
| 576 |
|
| 577 |
var ( |
| 578 |
// used |
| 579 |
SystemMemoryStateUsed = SystemMemoryStateKey.String("used") |
| 580 |
// free |
| 581 |
SystemMemoryStateFree = SystemMemoryStateKey.String("free") |
| 582 |
// shared |
| 583 |
SystemMemoryStateShared = SystemMemoryStateKey.String("shared") |
| 584 |
// buffers |
| 585 |
SystemMemoryStateBuffers = SystemMemoryStateKey.String("buffers") |
| 586 |
// cached |
| 587 |
SystemMemoryStateCached = SystemMemoryStateKey.String("cached") |
| 588 |
) |
| 589 |
|
| 590 |
// Describes System Memory Paging metric attributes |
| 591 |
const ( |
| 592 |
// SystemPagingDirectionKey is the attribute Key conforming to the |
| 593 |
// "system.paging.direction" semantic conventions. It represents the paging |
| 594 |
// access direction |
| 595 |
// |
| 596 |
// Type: Enum |
| 597 |
// RequirementLevel: Optional |
| 598 |
// Stability: experimental |
| 599 |
// Examples: 'in' |
| 600 |
SystemPagingDirectionKey = attribute.Key("system.paging.direction") |
| 601 |
|
| 602 |
// SystemPagingStateKey is the attribute Key conforming to the |
| 603 |
// "system.paging.state" semantic conventions. It represents the memory |
| 604 |
// paging state |
| 605 |
// |
| 606 |
// Type: Enum |
| 607 |
// RequirementLevel: Optional |
| 608 |
// Stability: experimental |
| 609 |
// Examples: 'free' |
| 610 |
SystemPagingStateKey = attribute.Key("system.paging.state") |
| 611 |
|
| 612 |
// SystemPagingTypeKey is the attribute Key conforming to the |
| 613 |
// "system.paging.type" semantic conventions. It represents the memory |
| 614 |
// paging type |
| 615 |
// |
| 616 |
// Type: Enum |
| 617 |
// RequirementLevel: Optional |
| 618 |
// Stability: experimental |
| 619 |
// Examples: 'minor' |
| 620 |
SystemPagingTypeKey = attribute.Key("system.paging.type") |
| 621 |
) |
| 622 |
|
| 623 |
var ( |
| 624 |
// in |
| 625 |
SystemPagingDirectionIn = SystemPagingDirectionKey.String("in") |
| 626 |
// out |
| 627 |
SystemPagingDirectionOut = SystemPagingDirectionKey.String("out") |
| 628 |
) |
| 629 |
|
| 630 |
var ( |
| 631 |
// used |
| 632 |
SystemPagingStateUsed = SystemPagingStateKey.String("used") |
| 633 |
// free |
| 634 |
SystemPagingStateFree = SystemPagingStateKey.String("free") |
| 635 |
) |
| 636 |
|
| 637 |
var ( |
| 638 |
// major |
| 639 |
SystemPagingTypeMajor = SystemPagingTypeKey.String("major") |
| 640 |
// minor |
| 641 |
SystemPagingTypeMinor = SystemPagingTypeKey.String("minor") |
| 642 |
) |
| 643 |
|
| 644 |
// Describes System Disk metric attributes |
| 645 |
const ( |
| 646 |
// SystemDiskDirectionKey is the attribute Key conforming to the |
| 647 |
// "system.disk.direction" semantic conventions. It represents the disk |
| 648 |
// operation direction |
| 649 |
// |
| 650 |
// Type: Enum |
| 651 |
// RequirementLevel: Optional |
| 652 |
// Stability: experimental |
| 653 |
// Examples: 'read' |
| 654 |
SystemDiskDirectionKey = attribute.Key("system.disk.direction") |
| 655 |
) |
| 656 |
|
| 657 |
var ( |
| 658 |
// read |
| 659 |
SystemDiskDirectionRead = SystemDiskDirectionKey.String("read") |
| 660 |
// write |
| 661 |
SystemDiskDirectionWrite = SystemDiskDirectionKey.String("write") |
| 662 |
) |
| 663 |
|
| 664 |
// Describes Filesystem metric attributes |
| 665 |
const ( |
| 666 |
// SystemFilesystemModeKey is the attribute Key conforming to the |
| 667 |
// "system.filesystem.mode" semantic conventions. It represents the |
| 668 |
// filesystem mode |
| 669 |
// |
| 670 |
// Type: string |
| 671 |
// RequirementLevel: Optional |
| 672 |
// Stability: experimental |
| 673 |
// Examples: 'rw, ro' |
| 674 |
SystemFilesystemModeKey = attribute.Key("system.filesystem.mode") |
| 675 |
|
| 676 |
// SystemFilesystemMountpointKey is the attribute Key conforming to the |
| 677 |
// "system.filesystem.mountpoint" semantic conventions. It represents the |
| 678 |
// filesystem mount path |
| 679 |
// |
| 680 |
// Type: string |
| 681 |
// RequirementLevel: Optional |
| 682 |
// Stability: experimental |
| 683 |
// Examples: '/mnt/data' |
| 684 |
SystemFilesystemMountpointKey = attribute.Key("system.filesystem.mountpoint") |
| 685 |
|
| 686 |
// SystemFilesystemStateKey is the attribute Key conforming to the |
| 687 |
// "system.filesystem.state" semantic conventions. It represents the |
| 688 |
// filesystem state |
| 689 |
// |
| 690 |
// Type: Enum |
| 691 |
// RequirementLevel: Optional |
| 692 |
// Stability: experimental |
| 693 |
// Examples: 'used' |
| 694 |
SystemFilesystemStateKey = attribute.Key("system.filesystem.state") |
| 695 |
|
| 696 |
// SystemFilesystemTypeKey is the attribute Key conforming to the |
| 697 |
// "system.filesystem.type" semantic conventions. It represents the |
| 698 |
// filesystem type |
| 699 |
// |
| 700 |
// Type: Enum |
| 701 |
// RequirementLevel: Optional |
| 702 |
// Stability: experimental |
| 703 |
// Examples: 'ext4' |
| 704 |
SystemFilesystemTypeKey = attribute.Key("system.filesystem.type") |
| 705 |
) |
| 706 |
|
| 707 |
var ( |
| 708 |
// used |
| 709 |
SystemFilesystemStateUsed = SystemFilesystemStateKey.String("used") |
| 710 |
// free |
| 711 |
SystemFilesystemStateFree = SystemFilesystemStateKey.String("free") |
| 712 |
// reserved |
| 713 |
SystemFilesystemStateReserved = SystemFilesystemStateKey.String("reserved") |
| 714 |
) |
| 715 |
|
| 716 |
var ( |
| 717 |
// fat32 |
| 718 |
SystemFilesystemTypeFat32 = SystemFilesystemTypeKey.String("fat32") |
| 719 |
// exfat |
| 720 |
SystemFilesystemTypeExfat = SystemFilesystemTypeKey.String("exfat") |
| 721 |
// ntfs |
| 722 |
SystemFilesystemTypeNtfs = SystemFilesystemTypeKey.String("ntfs") |
| 723 |
// refs |
| 724 |
SystemFilesystemTypeRefs = SystemFilesystemTypeKey.String("refs") |
| 725 |
// hfsplus |
| 726 |
SystemFilesystemTypeHfsplus = SystemFilesystemTypeKey.String("hfsplus") |
| 727 |
// ext4 |
| 728 |
SystemFilesystemTypeExt4 = SystemFilesystemTypeKey.String("ext4") |
| 729 |
) |
| 730 |
|
| 731 |
// SystemFilesystemMode returns an attribute KeyValue conforming to the |
| 732 |
// "system.filesystem.mode" semantic conventions. It represents the filesystem |
| 733 |
// mode |
| 734 |
func SystemFilesystemMode(val string) attribute.KeyValue { |
| 735 |
return SystemFilesystemModeKey.String(val) |
| 736 |
} |
| 737 |
|
| 738 |
// SystemFilesystemMountpoint returns an attribute KeyValue conforming to |
| 739 |
// the "system.filesystem.mountpoint" semantic conventions. It represents the |
| 740 |
// filesystem mount path |
| 741 |
func SystemFilesystemMountpoint(val string) attribute.KeyValue { |
| 742 |
return SystemFilesystemMountpointKey.String(val) |
| 743 |
} |
| 744 |
|
| 745 |
// Describes Network metric attributes |
| 746 |
const ( |
| 747 |
// SystemNetworkDirectionKey is the attribute Key conforming to the |
| 748 |
// "system.network.direction" semantic conventions. It represents the |
| 749 |
// |
| 750 |
// Type: Enum |
| 751 |
// RequirementLevel: Optional |
| 752 |
// Stability: experimental |
| 753 |
// Examples: 'transmit' |
| 754 |
SystemNetworkDirectionKey = attribute.Key("system.network.direction") |
| 755 |
|
| 756 |
// SystemNetworkStateKey is the attribute Key conforming to the |
| 757 |
// "system.network.state" semantic conventions. It represents a stateless |
| 758 |
// protocol MUST NOT set this attribute |
| 759 |
// |
| 760 |
// Type: Enum |
| 761 |
// RequirementLevel: Optional |
| 762 |
// Stability: experimental |
| 763 |
// Examples: 'close_wait' |
| 764 |
SystemNetworkStateKey = attribute.Key("system.network.state") |
| 765 |
) |
| 766 |
|
| 767 |
var ( |
| 768 |
// transmit |
| 769 |
SystemNetworkDirectionTransmit = SystemNetworkDirectionKey.String("transmit") |
| 770 |
// receive |
| 771 |
SystemNetworkDirectionReceive = SystemNetworkDirectionKey.String("receive") |
| 772 |
) |
| 773 |
|
| 774 |
var ( |
| 775 |
// close |
| 776 |
SystemNetworkStateClose = SystemNetworkStateKey.String("close") |
| 777 |
// close_wait |
| 778 |
SystemNetworkStateCloseWait = SystemNetworkStateKey.String("close_wait") |
| 779 |
// closing |
| 780 |
SystemNetworkStateClosing = SystemNetworkStateKey.String("closing") |
| 781 |
// delete |
| 782 |
SystemNetworkStateDelete = SystemNetworkStateKey.String("delete") |
| 783 |
// established |
| 784 |
SystemNetworkStateEstablished = SystemNetworkStateKey.String("established") |
| 785 |
// fin_wait_1 |
| 786 |
SystemNetworkStateFinWait1 = SystemNetworkStateKey.String("fin_wait_1") |
| 787 |
// fin_wait_2 |
| 788 |
SystemNetworkStateFinWait2 = SystemNetworkStateKey.String("fin_wait_2") |
| 789 |
// last_ack |
| 790 |
SystemNetworkStateLastAck = SystemNetworkStateKey.String("last_ack") |
| 791 |
// listen |
| 792 |
SystemNetworkStateListen = SystemNetworkStateKey.String("listen") |
| 793 |
// syn_recv |
| 794 |
SystemNetworkStateSynRecv = SystemNetworkStateKey.String("syn_recv") |
| 795 |
// syn_sent |
| 796 |
SystemNetworkStateSynSent = SystemNetworkStateKey.String("syn_sent") |
| 797 |
// time_wait |
| 798 |
SystemNetworkStateTimeWait = SystemNetworkStateKey.String("time_wait") |
| 799 |
) |
| 800 |
|
| 801 |
// Describes System Process metric attributes |
| 802 |
const ( |
| 803 |
// SystemProcessesStatusKey is the attribute Key conforming to the |
| 804 |
// "system.processes.status" semantic conventions. It represents the |
| 805 |
// process state, e.g., [Linux Process State |
| 806 |
// Codes](https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES) |
| 807 |
// |
| 808 |
// Type: Enum |
| 809 |
// RequirementLevel: Optional |
| 810 |
// Stability: experimental |
| 811 |
// Examples: 'running' |
| 812 |
SystemProcessesStatusKey = attribute.Key("system.processes.status") |
| 813 |
) |
| 814 |
|
| 815 |
var ( |
| 816 |
// running |
| 817 |
SystemProcessesStatusRunning = SystemProcessesStatusKey.String("running") |
| 818 |
// sleeping |
| 819 |
SystemProcessesStatusSleeping = SystemProcessesStatusKey.String("sleeping") |
| 820 |
// stopped |
| 821 |
SystemProcessesStatusStopped = SystemProcessesStatusKey.String("stopped") |
| 822 |
// defunct |
| 823 |
SystemProcessesStatusDefunct = SystemProcessesStatusKey.String("defunct") |
| 824 |
) |
| 825 |
|
| 826 |
// Describes deprecated HTTP attributes. |
| 827 |
const ( |
| 828 |
// HTTPMethodKey is the attribute Key conforming to the "http.method" |
| 829 |
// semantic conventions. |
| 830 |
// |
| 831 |
// Type: string |
| 832 |
// RequirementLevel: Optional |
| 833 |
// Stability: deprecated |
| 834 |
// Examples: 'GET', 'POST', 'HEAD' |
| 835 |
// Deprecated: use `http.request.method` instead. |
| 836 |
HTTPMethodKey = attribute.Key("http.method") |
| 837 |
|
| 838 |
// HTTPRequestContentLengthKey is the attribute Key conforming to the |
| 839 |
// "http.request_content_length" semantic conventions. |
| 840 |
// |
| 841 |
// Type: int |
| 842 |
// RequirementLevel: Optional |
| 843 |
// Stability: deprecated |
| 844 |
// Examples: 3495 |
| 845 |
// Deprecated: use `http.request.header.content-length` instead. |
| 846 |
HTTPRequestContentLengthKey = attribute.Key("http.request_content_length") |
| 847 |
|
| 848 |
// HTTPResponseContentLengthKey is the attribute Key conforming to the |
| 849 |
// "http.response_content_length" semantic conventions. |
| 850 |
// |
| 851 |
// Type: int |
| 852 |
// RequirementLevel: Optional |
| 853 |
// Stability: deprecated |
| 854 |
// Examples: 3495 |
| 855 |
// Deprecated: use `http.response.header.content-length` instead. |
| 856 |
HTTPResponseContentLengthKey = attribute.Key("http.response_content_length") |
| 857 |
|
| 858 |
// HTTPSchemeKey is the attribute Key conforming to the "http.scheme" |
| 859 |
// semantic conventions. |
| 860 |
// |
| 861 |
// Type: string |
| 862 |
// RequirementLevel: Optional |
| 863 |
// Stability: deprecated |
| 864 |
// Examples: 'http', 'https' |
| 865 |
// Deprecated: use `url.scheme` instead. |
| 866 |
HTTPSchemeKey = attribute.Key("http.scheme") |
| 867 |
|
| 868 |
// HTTPStatusCodeKey is the attribute Key conforming to the |
| 869 |
// "http.status_code" semantic conventions. |
| 870 |
// |
| 871 |
// Type: int |
| 872 |
// RequirementLevel: Optional |
| 873 |
// Stability: deprecated |
| 874 |
// Examples: 200 |
| 875 |
// Deprecated: use `http.response.status_code` instead. |
| 876 |
HTTPStatusCodeKey = attribute.Key("http.status_code") |
| 877 |
|
| 878 |
// HTTPTargetKey is the attribute Key conforming to the "http.target" |
| 879 |
// semantic conventions. |
| 880 |
// |
| 881 |
// Type: string |
| 882 |
// RequirementLevel: Optional |
| 883 |
// Stability: deprecated |
| 884 |
// Examples: '/search?q=OpenTelemetry#SemConv' |
| 885 |
// Deprecated: use `url.path` and `url.query` instead. |
| 886 |
HTTPTargetKey = attribute.Key("http.target") |
| 887 |
|
| 888 |
// HTTPURLKey is the attribute Key conforming to the "http.url" semantic |
| 889 |
// conventions. |
| 890 |
// |
| 891 |
// Type: string |
| 892 |
// RequirementLevel: Optional |
| 893 |
// Stability: deprecated |
| 894 |
// Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv' |
| 895 |
// Deprecated: use `url.full` instead. |
| 896 |
HTTPURLKey = attribute.Key("http.url") |
| 897 |
) |
| 898 |
|
| 899 |
// HTTPMethod returns an attribute KeyValue conforming to the "http.method" |
| 900 |
// semantic conventions. |
| 901 |
// |
| 902 |
// Deprecated: use `http.request.method` instead. |
| 903 |
func HTTPMethod(val string) attribute.KeyValue { |
| 904 |
return HTTPMethodKey.String(val) |
| 905 |
} |
| 906 |
|
| 907 |
// HTTPRequestContentLength returns an attribute KeyValue conforming to the |
| 908 |
// "http.request_content_length" semantic conventions. |
| 909 |
// |
| 910 |
// Deprecated: use `http.request.header.content-length` instead. |
| 911 |
func HTTPRequestContentLength(val int) attribute.KeyValue { |
| 912 |
return HTTPRequestContentLengthKey.Int(val) |
| 913 |
} |
| 914 |
|
| 915 |
// HTTPResponseContentLength returns an attribute KeyValue conforming to the |
| 916 |
// "http.response_content_length" semantic conventions. |
| 917 |
// |
| 918 |
// Deprecated: use `http.response.header.content-length` instead. |
| 919 |
func HTTPResponseContentLength(val int) attribute.KeyValue { |
| 920 |
return HTTPResponseContentLengthKey.Int(val) |
| 921 |
} |
| 922 |
|
| 923 |
// HTTPScheme returns an attribute KeyValue conforming to the "http.scheme" |
| 924 |
// semantic conventions. |
| 925 |
// |
| 926 |
// Deprecated: use `url.scheme` instead. |
| 927 |
func HTTPScheme(val string) attribute.KeyValue { |
| 928 |
return HTTPSchemeKey.String(val) |
| 929 |
} |
| 930 |
|
| 931 |
// HTTPStatusCode returns an attribute KeyValue conforming to the |
| 932 |
// "http.status_code" semantic conventions. |
| 933 |
// |
| 934 |
// Deprecated: use `http.response.status_code` instead. |
| 935 |
func HTTPStatusCode(val int) attribute.KeyValue { |
| 936 |
return HTTPStatusCodeKey.Int(val) |
| 937 |
} |
| 938 |
|
| 939 |
// HTTPTarget returns an attribute KeyValue conforming to the "http.target" |
| 940 |
// semantic conventions. |
| 941 |
// |
| 942 |
// Deprecated: use `url.path` and `url.query` instead. |
| 943 |
func HTTPTarget(val string) attribute.KeyValue { |
| 944 |
return HTTPTargetKey.String(val) |
| 945 |
} |
| 946 |
|
| 947 |
// HTTPURL returns an attribute KeyValue conforming to the "http.url" |
| 948 |
// semantic conventions. |
| 949 |
// |
| 950 |
// Deprecated: use `url.full` instead. |
| 951 |
func HTTPURL(val string) attribute.KeyValue { |
| 952 |
return HTTPURLKey.String(val) |
| 953 |
} |
| 954 |
|
| 955 |
// These attributes may be used for any network related operation. |
| 956 |
const ( |
| 957 |
// NetHostNameKey is the attribute Key conforming to the "net.host.name" |
| 958 |
// semantic conventions. |
| 959 |
// |
| 960 |
// Type: string |
| 961 |
// RequirementLevel: Optional |
| 962 |
// Stability: deprecated |
| 963 |
// Examples: 'example.com' |
| 964 |
// Deprecated: use `server.address`. |
| 965 |
NetHostNameKey = attribute.Key("net.host.name") |
| 966 |
|
| 967 |
// NetHostPortKey is the attribute Key conforming to the "net.host.port" |
| 968 |
// semantic conventions. |
| 969 |
// |
| 970 |
// Type: int |
| 971 |
// RequirementLevel: Optional |
| 972 |
// Stability: deprecated |
| 973 |
// Examples: 8080 |
| 974 |
// Deprecated: use `server.port`. |
| 975 |
NetHostPortKey = attribute.Key("net.host.port") |
| 976 |
|
| 977 |
// NetPeerNameKey is the attribute Key conforming to the "net.peer.name" |
| 978 |
// semantic conventions. |
| 979 |
// |
| 980 |
// Type: string |
| 981 |
// RequirementLevel: Optional |
| 982 |
// Stability: deprecated |
| 983 |
// Examples: 'example.com' |
| 984 |
// Deprecated: use `server.address` on client spans and `client.address` on |
| 985 |
// server spans. |
| 986 |
NetPeerNameKey = attribute.Key("net.peer.name") |
| 987 |
|
| 988 |
// NetPeerPortKey is the attribute Key conforming to the "net.peer.port" |
| 989 |
// semantic conventions. |
| 990 |
// |
| 991 |
// Type: int |
| 992 |
// RequirementLevel: Optional |
| 993 |
// Stability: deprecated |
| 994 |
// Examples: 8080 |
| 995 |
// Deprecated: use `server.port` on client spans and `client.port` on |
| 996 |
// server spans. |
| 997 |
NetPeerPortKey = attribute.Key("net.peer.port") |
| 998 |
|
| 999 |
// NetProtocolNameKey is the attribute Key conforming to the |
| 1000 |
// "net.protocol.name" semantic conventions. |
| 1001 |
// |
| 1002 |
// Type: string |
| 1003 |
// RequirementLevel: Optional |
| 1004 |
// Stability: deprecated |
| 1005 |
// Examples: 'amqp', 'http', 'mqtt' |
| 1006 |
// Deprecated: use `network.protocol.name`. |
| 1007 |
NetProtocolNameKey = attribute.Key("net.protocol.name") |
| 1008 |
|
| 1009 |
// NetProtocolVersionKey is the attribute Key conforming to the |
| 1010 |
// "net.protocol.version" semantic conventions. |
| 1011 |
// |
| 1012 |
// Type: string |
| 1013 |
// RequirementLevel: Optional |
| 1014 |
// Stability: deprecated |
| 1015 |
// Examples: '3.1.1' |
| 1016 |
// Deprecated: use `network.protocol.version`. |
| 1017 |
NetProtocolVersionKey = attribute.Key("net.protocol.version") |
| 1018 |
|
| 1019 |
// NetSockFamilyKey is the attribute Key conforming to the |
| 1020 |
// "net.sock.family" semantic conventions. |
| 1021 |
// |
| 1022 |
// Type: Enum |
| 1023 |
// RequirementLevel: Optional |
| 1024 |
// Stability: deprecated |
| 1025 |
// Deprecated: use `network.transport` and `network.type`. |
| 1026 |
NetSockFamilyKey = attribute.Key("net.sock.family") |
| 1027 |
|
| 1028 |
// NetSockHostAddrKey is the attribute Key conforming to the |
| 1029 |
// "net.sock.host.addr" semantic conventions. |
| 1030 |
// |
| 1031 |
// Type: string |
| 1032 |
// RequirementLevel: Optional |
| 1033 |
// Stability: deprecated |
| 1034 |
// Examples: '/var/my.sock' |
| 1035 |
// Deprecated: use `network.local.address`. |
| 1036 |
NetSockHostAddrKey = attribute.Key("net.sock.host.addr") |
| 1037 |
|
| 1038 |
// NetSockHostPortKey is the attribute Key conforming to the |
| 1039 |
// "net.sock.host.port" semantic conventions. |
| 1040 |
// |
| 1041 |
// Type: int |
| 1042 |
// RequirementLevel: Optional |
| 1043 |
// Stability: deprecated |
| 1044 |
// Examples: 8080 |
| 1045 |
// Deprecated: use `network.local.port`. |
| 1046 |
NetSockHostPortKey = attribute.Key("net.sock.host.port") |
| 1047 |
|
| 1048 |
// NetSockPeerAddrKey is the attribute Key conforming to the |
| 1049 |
// "net.sock.peer.addr" semantic conventions. |
| 1050 |
// |
| 1051 |
// Type: string |
| 1052 |
// RequirementLevel: Optional |
| 1053 |
// Stability: deprecated |
| 1054 |
// Examples: '192.168.0.1' |
| 1055 |
// Deprecated: use `network.peer.address`. |
| 1056 |
NetSockPeerAddrKey = attribute.Key("net.sock.peer.addr") |
| 1057 |
|
| 1058 |
// NetSockPeerNameKey is the attribute Key conforming to the |
| 1059 |
// "net.sock.peer.name" semantic conventions. |
| 1060 |
// |
| 1061 |
// Type: string |
| 1062 |
// RequirementLevel: Optional |
| 1063 |
// Stability: deprecated |
| 1064 |
// Examples: '/var/my.sock' |
| 1065 |
// Deprecated: no replacement at this time. |
| 1066 |
NetSockPeerNameKey = attribute.Key("net.sock.peer.name") |
| 1067 |
|
| 1068 |
// NetSockPeerPortKey is the attribute Key conforming to the |
| 1069 |
// "net.sock.peer.port" semantic conventions. |
| 1070 |
// |
| 1071 |
// Type: int |
| 1072 |
// RequirementLevel: Optional |
| 1073 |
// Stability: deprecated |
| 1074 |
// Examples: 65531 |
| 1075 |
// Deprecated: use `network.peer.port`. |
| 1076 |
NetSockPeerPortKey = attribute.Key("net.sock.peer.port") |
| 1077 |
|
| 1078 |
// NetTransportKey is the attribute Key conforming to the "net.transport" |
| 1079 |
// semantic conventions. |
| 1080 |
// |
| 1081 |
// Type: Enum |
| 1082 |
// RequirementLevel: Optional |
| 1083 |
// Stability: deprecated |
| 1084 |
// Deprecated: use `network.transport`. |
| 1085 |
NetTransportKey = attribute.Key("net.transport") |
| 1086 |
) |
| 1087 |
|
| 1088 |
var ( |
| 1089 |
// IPv4 address |
| 1090 |
// |
| 1091 |
// Deprecated: use `network.transport` and `network.type`. |
| 1092 |
NetSockFamilyInet = NetSockFamilyKey.String("inet") |
| 1093 |
// IPv6 address |
| 1094 |
// |
| 1095 |
// Deprecated: use `network.transport` and `network.type`. |
| 1096 |
NetSockFamilyInet6 = NetSockFamilyKey.String("inet6") |
| 1097 |
// Unix domain socket path |
| 1098 |
// |
| 1099 |
// Deprecated: use `network.transport` and `network.type`. |
| 1100 |
NetSockFamilyUnix = NetSockFamilyKey.String("unix") |
| 1101 |
) |
| 1102 |
|
| 1103 |
var ( |
| 1104 |
// ip_tcp |
| 1105 |
// |
| 1106 |
// Deprecated: use `network.transport`. |
| 1107 |
NetTransportTCP = NetTransportKey.String("ip_tcp") |
| 1108 |
// ip_udp |
| 1109 |
// |
| 1110 |
// Deprecated: use `network.transport`. |
| 1111 |
NetTransportUDP = NetTransportKey.String("ip_udp") |
| 1112 |
// Named or anonymous pipe |
| 1113 |
// |
| 1114 |
// Deprecated: use `network.transport`. |
| 1115 |
NetTransportPipe = NetTransportKey.String("pipe") |
| 1116 |
// In-process communication |
| 1117 |
// |
| 1118 |
// Deprecated: use `network.transport`. |
| 1119 |
NetTransportInProc = NetTransportKey.String("inproc") |
| 1120 |
// Something else (non IP-based) |
| 1121 |
// |
| 1122 |
// Deprecated: use `network.transport`. |
| 1123 |
NetTransportOther = NetTransportKey.String("other") |
| 1124 |
) |
| 1125 |
|
| 1126 |
// NetHostName returns an attribute KeyValue conforming to the |
| 1127 |
// "net.host.name" semantic conventions. |
| 1128 |
// |
| 1129 |
// Deprecated: use `server.address`. |
| 1130 |
func NetHostName(val string) attribute.KeyValue { |
| 1131 |
return NetHostNameKey.String(val) |
| 1132 |
} |
| 1133 |
|
| 1134 |
// NetHostPort returns an attribute KeyValue conforming to the |
| 1135 |
// "net.host.port" semantic conventions. |
| 1136 |
// |
| 1137 |
// Deprecated: use `server.port`. |
| 1138 |
func NetHostPort(val int) attribute.KeyValue { |
| 1139 |
return NetHostPortKey.Int(val) |
| 1140 |
} |
| 1141 |
|
| 1142 |
// NetPeerName returns an attribute KeyValue conforming to the |
| 1143 |
// "net.peer.name" semantic conventions. |
| 1144 |
// |
| 1145 |
// Deprecated: use `server.address` on client spans and `client.address` on |
| 1146 |
// server spans. |
| 1147 |
func NetPeerName(val string) attribute.KeyValue { |
| 1148 |
return NetPeerNameKey.String(val) |
| 1149 |
} |
| 1150 |
|
| 1151 |
// NetPeerPort returns an attribute KeyValue conforming to the |
| 1152 |
// "net.peer.port" semantic conventions. |
| 1153 |
// |
| 1154 |
// Deprecated: use `server.port` on client spans and `client.port` on server |
| 1155 |
// spans. |
| 1156 |
func NetPeerPort(val int) attribute.KeyValue { |
| 1157 |
return NetPeerPortKey.Int(val) |
| 1158 |
} |
| 1159 |
|
| 1160 |
// NetProtocolName returns an attribute KeyValue conforming to the |
| 1161 |
// "net.protocol.name" semantic conventions. |
| 1162 |
// |
| 1163 |
// Deprecated: use `network.protocol.name`. |
| 1164 |
func NetProtocolName(val string) attribute.KeyValue { |
| 1165 |
return NetProtocolNameKey.String(val) |
| 1166 |
} |
| 1167 |
|
| 1168 |
// NetProtocolVersion returns an attribute KeyValue conforming to the |
| 1169 |
// "net.protocol.version" semantic conventions. |
| 1170 |
// |
| 1171 |
// Deprecated: use `network.protocol.version`. |
| 1172 |
func NetProtocolVersion(val string) attribute.KeyValue { |
| 1173 |
return NetProtocolVersionKey.String(val) |
| 1174 |
} |
| 1175 |
|
| 1176 |
// NetSockHostAddr returns an attribute KeyValue conforming to the |
| 1177 |
// "net.sock.host.addr" semantic conventions. |
| 1178 |
// |
| 1179 |
// Deprecated: use `network.local.address`. |
| 1180 |
func NetSockHostAddr(val string) attribute.KeyValue { |
| 1181 |
return NetSockHostAddrKey.String(val) |
| 1182 |
} |
| 1183 |
|
| 1184 |
// NetSockHostPort returns an attribute KeyValue conforming to the |
| 1185 |
// "net.sock.host.port" semantic conventions. |
| 1186 |
// |
| 1187 |
// Deprecated: use `network.local.port`. |
| 1188 |
func NetSockHostPort(val int) attribute.KeyValue { |
| 1189 |
return NetSockHostPortKey.Int(val) |
| 1190 |
} |
| 1191 |
|
| 1192 |
// NetSockPeerAddr returns an attribute KeyValue conforming to the |
| 1193 |
// "net.sock.peer.addr" semantic conventions. |
| 1194 |
// |
| 1195 |
// Deprecated: use `network.peer.address`. |
| 1196 |
func NetSockPeerAddr(val string) attribute.KeyValue { |
| 1197 |
return NetSockPeerAddrKey.String(val) |
| 1198 |
} |
| 1199 |
|
| 1200 |
// NetSockPeerName returns an attribute KeyValue conforming to the |
| 1201 |
// "net.sock.peer.name" semantic conventions. |
| 1202 |
// |
| 1203 |
// Deprecated: no replacement at this time. |
| 1204 |
func NetSockPeerName(val string) attribute.KeyValue { |
| 1205 |
return NetSockPeerNameKey.String(val) |
| 1206 |
} |
| 1207 |
|
| 1208 |
// NetSockPeerPort returns an attribute KeyValue conforming to the |
| 1209 |
// "net.sock.peer.port" semantic conventions. |
| 1210 |
// |
| 1211 |
// Deprecated: use `network.peer.port`. |
| 1212 |
func NetSockPeerPort(val int) attribute.KeyValue { |
| 1213 |
return NetSockPeerPortKey.Int(val) |
| 1214 |
} |
| 1215 |
|
| 1216 |
// Semantic convention attributes in the HTTP namespace. |
| 1217 |
const ( |
| 1218 |
// HTTPRequestBodySizeKey is the attribute Key conforming to the |
| 1219 |
// "http.request.body.size" semantic conventions. It represents the size of |
| 1220 |
// the request payload body in bytes. This is the number of bytes |
| 1221 |
// transferred excluding headers and is often, but not always, present as |
| 1222 |
// the |
| 1223 |
// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) |
| 1224 |
// header. For requests using transport encoding, this should be the |
| 1225 |
// compressed size. |
| 1226 |
// |
| 1227 |
// Type: int |
| 1228 |
// RequirementLevel: Optional |
| 1229 |
// Stability: experimental |
| 1230 |
// Examples: 3495 |
| 1231 |
HTTPRequestBodySizeKey = attribute.Key("http.request.body.size") |
| 1232 |
|
| 1233 |
// HTTPRequestMethodKey is the attribute Key conforming to the |
| 1234 |
// "http.request.method" semantic conventions. It represents the hTTP |
| 1235 |
// request method. |
| 1236 |
// |
| 1237 |
// Type: Enum |
| 1238 |
// RequirementLevel: Optional |
| 1239 |
// Stability: stable |
| 1240 |
// Examples: 'GET', 'POST', 'HEAD' |
| 1241 |
// Note: HTTP request method value SHOULD be "known" to the |
| 1242 |
// instrumentation. |
| 1243 |
// By default, this convention defines "known" methods as the ones listed |
| 1244 |
// in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods) |
| 1245 |
// and the PATCH method defined in |
| 1246 |
// [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html). |
| 1247 |
// |
| 1248 |
// If the HTTP request method is not known to instrumentation, it MUST set |
| 1249 |
// the `http.request.method` attribute to `_OTHER`. |
| 1250 |
// |
| 1251 |
// If the HTTP instrumentation could end up converting valid HTTP request |
| 1252 |
// methods to `_OTHER`, then it MUST provide a way to override |
| 1253 |
// the list of known HTTP methods. If this override is done via environment |
| 1254 |
// variable, then the environment variable MUST be named |
| 1255 |
// OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated |
| 1256 |
// list of case-sensitive known HTTP methods |
| 1257 |
// (this list MUST be a full override of the default known method, it is |
| 1258 |
// not a list of known methods in addition to the defaults). |
| 1259 |
// |
| 1260 |
// HTTP method names are case-sensitive and `http.request.method` attribute |
| 1261 |
// value MUST match a known HTTP method name exactly. |
| 1262 |
// Instrumentations for specific web frameworks that consider HTTP methods |
| 1263 |
// to be case insensitive, SHOULD populate a canonical equivalent. |
| 1264 |
// Tracing instrumentations that do so, MUST also set |
| 1265 |
// `http.request.method_original` to the original value. |
| 1266 |
HTTPRequestMethodKey = attribute.Key("http.request.method") |
| 1267 |
|
| 1268 |
// HTTPRequestMethodOriginalKey is the attribute Key conforming to the |
| 1269 |
// "http.request.method_original" semantic conventions. It represents the |
| 1270 |
// original HTTP method sent by the client in the request line. |
| 1271 |
// |
| 1272 |
// Type: string |
| 1273 |
// RequirementLevel: Optional |
| 1274 |
// Stability: stable |
| 1275 |
// Examples: 'GeT', 'ACL', 'foo' |
| 1276 |
HTTPRequestMethodOriginalKey = attribute.Key("http.request.method_original") |
| 1277 |
|
| 1278 |
// HTTPRequestResendCountKey is the attribute Key conforming to the |
| 1279 |
// "http.request.resend_count" semantic conventions. It represents the |
| 1280 |
// ordinal number of request resending attempt (for any reason, including |
| 1281 |
// redirects). |
| 1282 |
// |
| 1283 |
// Type: int |
| 1284 |
// RequirementLevel: Optional |
| 1285 |
// Stability: stable |
| 1286 |
// Examples: 3 |
| 1287 |
// Note: The resend count SHOULD be updated each time an HTTP request gets |
| 1288 |
// resent by the client, regardless of what was the cause of the resending |
| 1289 |
// (e.g. redirection, authorization failure, 503 Server Unavailable, |
| 1290 |
// network issues, or any other). |
| 1291 |
HTTPRequestResendCountKey = attribute.Key("http.request.resend_count") |
| 1292 |
|
| 1293 |
// HTTPResponseBodySizeKey is the attribute Key conforming to the |
| 1294 |
// "http.response.body.size" semantic conventions. It represents the size |
| 1295 |
// of the response payload body in bytes. This is the number of bytes |
| 1296 |
// transferred excluding headers and is often, but not always, present as |
| 1297 |
// the |
| 1298 |
// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) |
| 1299 |
// header. For requests using transport encoding, this should be the |
| 1300 |
// compressed size. |
| 1301 |
// |
| 1302 |
// Type: int |
| 1303 |
// RequirementLevel: Optional |
| 1304 |
// Stability: experimental |
| 1305 |
// Examples: 3495 |
| 1306 |
HTTPResponseBodySizeKey = attribute.Key("http.response.body.size") |
| 1307 |
|
| 1308 |
// HTTPResponseStatusCodeKey is the attribute Key conforming to the |
| 1309 |
// "http.response.status_code" semantic conventions. It represents the |
| 1310 |
// [HTTP response status |
| 1311 |
// code](https://tools.ietf.org/html/rfc7231#section-6). |
| 1312 |
// |
| 1313 |
// Type: int |
| 1314 |
// RequirementLevel: Optional |
| 1315 |
// Stability: stable |
| 1316 |
// Examples: 200 |
| 1317 |
HTTPResponseStatusCodeKey = attribute.Key("http.response.status_code") |
| 1318 |
|
| 1319 |
// HTTPRouteKey is the attribute Key conforming to the "http.route" |
| 1320 |
// semantic conventions. It represents the matched route, that is, the path |
| 1321 |
// template in the format used by the respective server framework. |
| 1322 |
// |
| 1323 |
// Type: string |
| 1324 |
// RequirementLevel: Optional |
| 1325 |
// Stability: stable |
| 1326 |
// Examples: '/users/:userID?', '{controller}/{action}/{id?}' |
| 1327 |
// Note: MUST NOT be populated when this is not supported by the HTTP |
| 1328 |
// server framework as the route attribute should have low-cardinality and |
| 1329 |
// the URI path can NOT substitute it. |
| 1330 |
// SHOULD include the [application |
| 1331 |
// root](/docs/http/http-spans.md#http-server-definitions) if there is one. |
| 1332 |
HTTPRouteKey = attribute.Key("http.route") |
| 1333 |
) |
| 1334 |
|
| 1335 |
var ( |
| 1336 |
// CONNECT method |
| 1337 |
HTTPRequestMethodConnect = HTTPRequestMethodKey.String("CONNECT") |
| 1338 |
// DELETE method |
| 1339 |
HTTPRequestMethodDelete = HTTPRequestMethodKey.String("DELETE") |
| 1340 |
// GET method |
| 1341 |
HTTPRequestMethodGet = HTTPRequestMethodKey.String("GET") |
| 1342 |
// HEAD method |
| 1343 |
HTTPRequestMethodHead = HTTPRequestMethodKey.String("HEAD") |
| 1344 |
// OPTIONS method |
| 1345 |
HTTPRequestMethodOptions = HTTPRequestMethodKey.String("OPTIONS") |
| 1346 |
// PATCH method |
| 1347 |
HTTPRequestMethodPatch = HTTPRequestMethodKey.String("PATCH") |
| 1348 |
// POST method |
| 1349 |
HTTPRequestMethodPost = HTTPRequestMethodKey.String("POST") |
| 1350 |
// PUT method |
| 1351 |
HTTPRequestMethodPut = HTTPRequestMethodKey.String("PUT") |
| 1352 |
// TRACE method |
| 1353 |
HTTPRequestMethodTrace = HTTPRequestMethodKey.String("TRACE") |
| 1354 |
// Any HTTP method that the instrumentation has no prior knowledge of |
| 1355 |
HTTPRequestMethodOther = HTTPRequestMethodKey.String("_OTHER") |
| 1356 |
) |
| 1357 |
|
| 1358 |
// HTTPRequestBodySize returns an attribute KeyValue conforming to the |
| 1359 |
// "http.request.body.size" semantic conventions. It represents the size of the |
| 1360 |
// request payload body in bytes. This is the number of bytes transferred |
| 1361 |
// excluding headers and is often, but not always, present as the |
| 1362 |
// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) |
| 1363 |
// header. For requests using transport encoding, this should be the compressed |
| 1364 |
// size. |
| 1365 |
func HTTPRequestBodySize(val int) attribute.KeyValue { |
| 1366 |
return HTTPRequestBodySizeKey.Int(val) |
| 1367 |
} |
| 1368 |
|
| 1369 |
// HTTPRequestMethodOriginal returns an attribute KeyValue conforming to the |
| 1370 |
// "http.request.method_original" semantic conventions. It represents the |
| 1371 |
// original HTTP method sent by the client in the request line. |
| 1372 |
func HTTPRequestMethodOriginal(val string) attribute.KeyValue { |
| 1373 |
return HTTPRequestMethodOriginalKey.String(val) |
| 1374 |
} |
| 1375 |
|
| 1376 |
// HTTPRequestResendCount returns an attribute KeyValue conforming to the |
| 1377 |
// "http.request.resend_count" semantic conventions. It represents the ordinal |
| 1378 |
// number of request resending attempt (for any reason, including redirects). |
| 1379 |
func HTTPRequestResendCount(val int) attribute.KeyValue { |
| 1380 |
return HTTPRequestResendCountKey.Int(val) |
| 1381 |
} |
| 1382 |
|
| 1383 |
// HTTPResponseBodySize returns an attribute KeyValue conforming to the |
| 1384 |
// "http.response.body.size" semantic conventions. It represents the size of |
| 1385 |
// the response payload body in bytes. This is the number of bytes transferred |
| 1386 |
// excluding headers and is often, but not always, present as the |
| 1387 |
// [Content-Length](https://www.rfc-editor.org/rfc/rfc9110.html#field.content-length) |
| 1388 |
// header. For requests using transport encoding, this should be the compressed |
| 1389 |
// size. |
| 1390 |
func HTTPResponseBodySize(val int) attribute.KeyValue { |
| 1391 |
return HTTPResponseBodySizeKey.Int(val) |
| 1392 |
} |
| 1393 |
|
| 1394 |
// HTTPResponseStatusCode returns an attribute KeyValue conforming to the |
| 1395 |
// "http.response.status_code" semantic conventions. It represents the [HTTP |
| 1396 |
// response status code](https://tools.ietf.org/html/rfc7231#section-6). |
| 1397 |
func HTTPResponseStatusCode(val int) attribute.KeyValue { |
| 1398 |
return HTTPResponseStatusCodeKey.Int(val) |
| 1399 |
} |
| 1400 |
|
| 1401 |
// HTTPRoute returns an attribute KeyValue conforming to the "http.route" |
| 1402 |
// semantic conventions. It represents the matched route, that is, the path |
| 1403 |
// template in the format used by the respective server framework. |
| 1404 |
func HTTPRoute(val string) attribute.KeyValue { |
| 1405 |
return HTTPRouteKey.String(val) |
| 1406 |
} |
| 1407 |
|
| 1408 |
// Attributes describing telemetry around messaging systems and messaging |
| 1409 |
// activities. |
| 1410 |
const ( |
| 1411 |
// MessagingBatchMessageCountKey is the attribute Key conforming to the |
| 1412 |
// "messaging.batch.message_count" semantic conventions. It represents the |
| 1413 |
// number of messages sent, received, or processed in the scope of the |
| 1414 |
// batching operation. |
| 1415 |
// |
| 1416 |
// Type: int |
| 1417 |
// RequirementLevel: Optional |
| 1418 |
// Stability: experimental |
| 1419 |
// Examples: 0, 1, 2 |
| 1420 |
// Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on |
| 1421 |
// spans that operate with a single message. When a messaging client |
| 1422 |
// library supports both batch and single-message API for the same |
| 1423 |
// operation, instrumentations SHOULD use `messaging.batch.message_count` |
| 1424 |
// for batching APIs and SHOULD NOT use it for single-message APIs. |
| 1425 |
MessagingBatchMessageCountKey = attribute.Key("messaging.batch.message_count") |
| 1426 |
|
| 1427 |
// MessagingClientIDKey is the attribute Key conforming to the |
| 1428 |
// "messaging.client_id" semantic conventions. It represents a unique |
| 1429 |
// identifier for the client that consumes or produces a message. |
| 1430 |
// |
| 1431 |
// Type: string |
| 1432 |
// RequirementLevel: Optional |
| 1433 |
// Stability: experimental |
| 1434 |
// Examples: 'client-5', 'myhost@8742@s8083jm' |
| 1435 |
MessagingClientIDKey = attribute.Key("messaging.client_id") |
| 1436 |
|
| 1437 |
// MessagingDestinationAnonymousKey is the attribute Key conforming to the |
| 1438 |
// "messaging.destination.anonymous" semantic conventions. It represents a |
| 1439 |
// boolean that is true if the message destination is anonymous (could be |
| 1440 |
// unnamed or have auto-generated name). |
| 1441 |
// |
| 1442 |
// Type: boolean |
| 1443 |
// RequirementLevel: Optional |
| 1444 |
// Stability: experimental |
| 1445 |
MessagingDestinationAnonymousKey = attribute.Key("messaging.destination.anonymous") |
| 1446 |
|
| 1447 |
// MessagingDestinationNameKey is the attribute Key conforming to the |
| 1448 |
// "messaging.destination.name" semantic conventions. It represents the |
| 1449 |
// message destination name |
| 1450 |
// |
| 1451 |
// Type: string |
| 1452 |
// RequirementLevel: Optional |
| 1453 |
// Stability: experimental |
| 1454 |
// Examples: 'MyQueue', 'MyTopic' |
| 1455 |
// Note: Destination name SHOULD uniquely identify a specific queue, topic |
| 1456 |
// or other entity within the broker. If |
| 1457 |
// the broker doesn't have such notion, the destination name SHOULD |
| 1458 |
// uniquely identify the broker. |
| 1459 |
MessagingDestinationNameKey = attribute.Key("messaging.destination.name") |
| 1460 |
|
| 1461 |
// MessagingDestinationTemplateKey is the attribute Key conforming to the |
| 1462 |
// "messaging.destination.template" semantic conventions. It represents the |
| 1463 |
// low cardinality representation of the messaging destination name |
| 1464 |
// |
| 1465 |
// Type: string |
| 1466 |
// RequirementLevel: Optional |
| 1467 |
// Stability: experimental |
| 1468 |
// Examples: '/customers/{customerID}' |
| 1469 |
// Note: Destination names could be constructed from templates. An example |
| 1470 |
// would be a destination name involving a user name or product id. |
| 1471 |
// Although the destination name in this case is of high cardinality, the |
| 1472 |
// underlying template is of low cardinality and can be effectively used |
| 1473 |
// for grouping and aggregation. |
| 1474 |
MessagingDestinationTemplateKey = attribute.Key("messaging.destination.template") |
| 1475 |
|
| 1476 |
// MessagingDestinationTemporaryKey is the attribute Key conforming to the |
| 1477 |
// "messaging.destination.temporary" semantic conventions. It represents a |
| 1478 |
// boolean that is true if the message destination is temporary and might |
| 1479 |
// not exist anymore after messages are processed. |
| 1480 |
// |
| 1481 |
// Type: boolean |
| 1482 |
// RequirementLevel: Optional |
| 1483 |
// Stability: experimental |
| 1484 |
MessagingDestinationTemporaryKey = attribute.Key("messaging.destination.temporary") |
| 1485 |
|
| 1486 |
// MessagingDestinationPublishAnonymousKey is the attribute Key conforming |
| 1487 |
// to the "messaging.destination_publish.anonymous" semantic conventions. |
| 1488 |
// It represents a boolean that is true if the publish message destination |
| 1489 |
// is anonymous (could be unnamed or have auto-generated name). |
| 1490 |
// |
| 1491 |
// Type: boolean |
| 1492 |
// RequirementLevel: Optional |
| 1493 |
// Stability: experimental |
| 1494 |
MessagingDestinationPublishAnonymousKey = attribute.Key("messaging.destination_publish.anonymous") |
| 1495 |
|
| 1496 |
// MessagingDestinationPublishNameKey is the attribute Key conforming to |
| 1497 |
// the "messaging.destination_publish.name" semantic conventions. It |
| 1498 |
// represents the name of the original destination the message was |
| 1499 |
// published to |
| 1500 |
// |
| 1501 |
// Type: string |
| 1502 |
// RequirementLevel: Optional |
| 1503 |
// Stability: experimental |
| 1504 |
// Examples: 'MyQueue', 'MyTopic' |
| 1505 |
// Note: The name SHOULD uniquely identify a specific queue, topic, or |
| 1506 |
// other entity within the broker. If |
| 1507 |
// the broker doesn't have such notion, the original destination name |
| 1508 |
// SHOULD uniquely identify the broker. |
| 1509 |
MessagingDestinationPublishNameKey = attribute.Key("messaging.destination_publish.name") |
| 1510 |
|
| 1511 |
// MessagingKafkaConsumerGroupKey is the attribute Key conforming to the |
| 1512 |
// "messaging.kafka.consumer.group" semantic conventions. It represents the |
| 1513 |
// name of the Kafka Consumer Group that is handling the message. Only |
| 1514 |
// applies to consumers, not producers. |
| 1515 |
// |
| 1516 |
// Type: string |
| 1517 |
// RequirementLevel: Optional |
| 1518 |
// Stability: experimental |
| 1519 |
// Examples: 'my-group' |
| 1520 |
MessagingKafkaConsumerGroupKey = attribute.Key("messaging.kafka.consumer.group") |
| 1521 |
|
| 1522 |
// MessagingKafkaDestinationPartitionKey is the attribute Key conforming to |
| 1523 |
// the "messaging.kafka.destination.partition" semantic conventions. It |
| 1524 |
// represents the partition the message is sent to. |
| 1525 |
// |
| 1526 |
// Type: int |
| 1527 |
// RequirementLevel: Optional |
| 1528 |
// Stability: experimental |
| 1529 |
// Examples: 2 |
| 1530 |
MessagingKafkaDestinationPartitionKey = attribute.Key("messaging.kafka.destination.partition") |
| 1531 |
|
| 1532 |
// MessagingKafkaMessageKeyKey is the attribute Key conforming to the |
| 1533 |
// "messaging.kafka.message.key" semantic conventions. It represents the |
| 1534 |
// message keys in Kafka are used for grouping alike messages to ensure |
| 1535 |
// they're processed on the same partition. They differ from |
| 1536 |
// `messaging.message.id` in that they're not unique. If the key is `null`, |
| 1537 |
// the attribute MUST NOT be set. |
| 1538 |
// |
| 1539 |
// Type: string |
| 1540 |
// RequirementLevel: Optional |
| 1541 |
// Stability: experimental |
| 1542 |
// Examples: 'myKey' |
| 1543 |
// Note: If the key type is not string, it's string representation has to |
| 1544 |
// be supplied for the attribute. If the key has no unambiguous, canonical |
| 1545 |
// string form, don't include its value. |
| 1546 |
MessagingKafkaMessageKeyKey = attribute.Key("messaging.kafka.message.key") |
| 1547 |
|
| 1548 |
// MessagingKafkaMessageOffsetKey is the attribute Key conforming to the |
| 1549 |
// "messaging.kafka.message.offset" semantic conventions. It represents the |
| 1550 |
// offset of a record in the corresponding Kafka partition. |
| 1551 |
// |
| 1552 |
// Type: int |
| 1553 |
// RequirementLevel: Optional |
| 1554 |
// Stability: experimental |
| 1555 |
// Examples: 42 |
| 1556 |
MessagingKafkaMessageOffsetKey = attribute.Key("messaging.kafka.message.offset") |
| 1557 |
|
| 1558 |
// MessagingKafkaMessageTombstoneKey is the attribute Key conforming to the |
| 1559 |
// "messaging.kafka.message.tombstone" semantic conventions. It represents |
| 1560 |
// a boolean that is true if the message is a tombstone. |
| 1561 |
// |
| 1562 |
// Type: boolean |
| 1563 |
// RequirementLevel: Optional |
| 1564 |
// Stability: experimental |
| 1565 |
MessagingKafkaMessageTombstoneKey = attribute.Key("messaging.kafka.message.tombstone") |
| 1566 |
|
| 1567 |
// MessagingMessageBodySizeKey is the attribute Key conforming to the |
| 1568 |
// "messaging.message.body.size" semantic conventions. It represents the |
| 1569 |
// size of the message body in bytes. |
| 1570 |
// |
| 1571 |
// Type: int |
| 1572 |
// RequirementLevel: Optional |
| 1573 |
// Stability: experimental |
| 1574 |
// Examples: 1439 |
| 1575 |
// Note: This can refer to both the compressed or uncompressed body size. |
| 1576 |
// If both sizes are known, the uncompressed |
| 1577 |
// body size should be used. |
| 1578 |
MessagingMessageBodySizeKey = attribute.Key("messaging.message.body.size") |
| 1579 |
|
| 1580 |
// MessagingMessageConversationIDKey is the attribute Key conforming to the |
| 1581 |
// "messaging.message.conversation_id" semantic conventions. It represents |
| 1582 |
// the conversation ID identifying the conversation to which the message |
| 1583 |
// belongs, represented as a string. Sometimes called "Correlation ID". |
| 1584 |
// |
| 1585 |
// Type: string |
| 1586 |
// RequirementLevel: Optional |
| 1587 |
// Stability: experimental |
| 1588 |
// Examples: 'MyConversationID' |
| 1589 |
MessagingMessageConversationIDKey = attribute.Key("messaging.message.conversation_id") |
| 1590 |
|
| 1591 |
// MessagingMessageEnvelopeSizeKey is the attribute Key conforming to the |
| 1592 |
// "messaging.message.envelope.size" semantic conventions. It represents |
| 1593 |
// the size of the message body and metadata in bytes. |
| 1594 |
// |
| 1595 |
// Type: int |
| 1596 |
// RequirementLevel: Optional |
| 1597 |
// Stability: experimental |
| 1598 |
// Examples: 2738 |
| 1599 |
// Note: This can refer to both the compressed or uncompressed size. If |
| 1600 |
// both sizes are known, the uncompressed |
| 1601 |
// size should be used. |
| 1602 |
MessagingMessageEnvelopeSizeKey = attribute.Key("messaging.message.envelope.size") |
| 1603 |
|
| 1604 |
// MessagingMessageIDKey is the attribute Key conforming to the |
| 1605 |
// "messaging.message.id" semantic conventions. It represents a value used |
| 1606 |
// by the messaging system as an identifier for the message, represented as |
| 1607 |
// a string. |
| 1608 |
// |
| 1609 |
// Type: string |
| 1610 |
// RequirementLevel: Optional |
| 1611 |
// Stability: experimental |
| 1612 |
// Examples: '452a7c7c7c7048c2f887f61572b18fc2' |
| 1613 |
MessagingMessageIDKey = attribute.Key("messaging.message.id") |
| 1614 |
|
| 1615 |
// MessagingOperationKey is the attribute Key conforming to the |
| 1616 |
// "messaging.operation" semantic conventions. It represents a string |
| 1617 |
// identifying the kind of messaging operation. |
| 1618 |
// |
| 1619 |
// Type: Enum |
| 1620 |
// RequirementLevel: Optional |
| 1621 |
// Stability: experimental |
| 1622 |
// Note: If a custom value is used, it MUST be of low cardinality. |
| 1623 |
MessagingOperationKey = attribute.Key("messaging.operation") |
| 1624 |
|
| 1625 |
// MessagingRabbitmqDestinationRoutingKeyKey is the attribute Key |
| 1626 |
// conforming to the "messaging.rabbitmq.destination.routing_key" semantic |
| 1627 |
// conventions. It represents the rabbitMQ message routing key. |
| 1628 |
// |
| 1629 |
// Type: string |
| 1630 |
// RequirementLevel: Optional |
| 1631 |
// Stability: experimental |
| 1632 |
// Examples: 'myKey' |
| 1633 |
MessagingRabbitmqDestinationRoutingKeyKey = attribute.Key("messaging.rabbitmq.destination.routing_key") |
| 1634 |
|
| 1635 |
// MessagingRocketmqClientGroupKey is the attribute Key conforming to the |
| 1636 |
// "messaging.rocketmq.client_group" semantic conventions. It represents |
| 1637 |
// the name of the RocketMQ producer/consumer group that is handling the |
| 1638 |
// message. The client type is identified by the SpanKind. |
| 1639 |
// |
| 1640 |
// Type: string |
| 1641 |
// RequirementLevel: Optional |
| 1642 |
// Stability: experimental |
| 1643 |
// Examples: 'myConsumerGroup' |
| 1644 |
MessagingRocketmqClientGroupKey = attribute.Key("messaging.rocketmq.client_group") |
| 1645 |
|
| 1646 |
// MessagingRocketmqConsumptionModelKey is the attribute Key conforming to |
| 1647 |
// the "messaging.rocketmq.consumption_model" semantic conventions. It |
| 1648 |
// represents the model of message consumption. This only applies to |
| 1649 |
// consumer spans. |
| 1650 |
// |
| 1651 |
// Type: Enum |
| 1652 |
// RequirementLevel: Optional |
| 1653 |
// Stability: experimental |
| 1654 |
MessagingRocketmqConsumptionModelKey = attribute.Key("messaging.rocketmq.consumption_model") |
| 1655 |
|
| 1656 |
// MessagingRocketmqMessageDelayTimeLevelKey is the attribute Key |
| 1657 |
// conforming to the "messaging.rocketmq.message.delay_time_level" semantic |
| 1658 |
// conventions. It represents the delay time level for delay message, which |
| 1659 |
// determines the message delay time. |
| 1660 |
// |
| 1661 |
// Type: int |
| 1662 |
// RequirementLevel: Optional |
| 1663 |
// Stability: experimental |
| 1664 |
// Examples: 3 |
| 1665 |
MessagingRocketmqMessageDelayTimeLevelKey = attribute.Key("messaging.rocketmq.message.delay_time_level") |
| 1666 |
|
| 1667 |
// MessagingRocketmqMessageDeliveryTimestampKey is the attribute Key |
| 1668 |
// conforming to the "messaging.rocketmq.message.delivery_timestamp" |
| 1669 |
// semantic conventions. It represents the timestamp in milliseconds that |
| 1670 |
// the delay message is expected to be delivered to consumer. |
| 1671 |
// |
| 1672 |
// Type: int |
| 1673 |
// RequirementLevel: Optional |
| 1674 |
// Stability: experimental |
| 1675 |
// Examples: 1665987217045 |
| 1676 |
MessagingRocketmqMessageDeliveryTimestampKey = attribute.Key("messaging.rocketmq.message.delivery_timestamp") |
| 1677 |
|
| 1678 |
// MessagingRocketmqMessageGroupKey is the attribute Key conforming to the |
| 1679 |
// "messaging.rocketmq.message.group" semantic conventions. It represents |
| 1680 |
// the it is essential for FIFO message. Messages that belong to the same |
| 1681 |
// message group are always processed one by one within the same consumer |
| 1682 |
// group. |
| 1683 |
// |
| 1684 |
// Type: string |
| 1685 |
// RequirementLevel: Optional |
| 1686 |
// Stability: experimental |
| 1687 |
// Examples: 'myMessageGroup' |
| 1688 |
MessagingRocketmqMessageGroupKey = attribute.Key("messaging.rocketmq.message.group") |
| 1689 |
|
| 1690 |
// MessagingRocketmqMessageKeysKey is the attribute Key conforming to the |
| 1691 |
// "messaging.rocketmq.message.keys" semantic conventions. It represents |
| 1692 |
// the key(s) of message, another way to mark message besides message id. |
| 1693 |
// |
| 1694 |
// Type: string[] |
| 1695 |
// RequirementLevel: Optional |
| 1696 |
// Stability: experimental |
| 1697 |
// Examples: 'keyA', 'keyB' |
| 1698 |
MessagingRocketmqMessageKeysKey = attribute.Key("messaging.rocketmq.message.keys") |
| 1699 |
|
| 1700 |
// MessagingRocketmqMessageTagKey is the attribute Key conforming to the |
| 1701 |
// "messaging.rocketmq.message.tag" semantic conventions. It represents the |
| 1702 |
// secondary classifier of message besides topic. |
| 1703 |
// |
| 1704 |
// Type: string |
| 1705 |
// RequirementLevel: Optional |
| 1706 |
// Stability: experimental |
| 1707 |
// Examples: 'tagA' |
| 1708 |
MessagingRocketmqMessageTagKey = attribute.Key("messaging.rocketmq.message.tag") |
| 1709 |
|
| 1710 |
// MessagingRocketmqMessageTypeKey is the attribute Key conforming to the |
| 1711 |
// "messaging.rocketmq.message.type" semantic conventions. It represents |
| 1712 |
// the type of message. |
| 1713 |
// |
| 1714 |
// Type: Enum |
| 1715 |
// RequirementLevel: Optional |
| 1716 |
// Stability: experimental |
| 1717 |
MessagingRocketmqMessageTypeKey = attribute.Key("messaging.rocketmq.message.type") |
| 1718 |
|
| 1719 |
// MessagingRocketmqNamespaceKey is the attribute Key conforming to the |
| 1720 |
// "messaging.rocketmq.namespace" semantic conventions. It represents the |
| 1721 |
// namespace of RocketMQ resources, resources in different namespaces are |
| 1722 |
// individual. |
| 1723 |
// |
| 1724 |
// Type: string |
| 1725 |
// RequirementLevel: Optional |
| 1726 |
// Stability: experimental |
| 1727 |
// Examples: 'myNamespace' |
| 1728 |
MessagingRocketmqNamespaceKey = attribute.Key("messaging.rocketmq.namespace") |
| 1729 |
|
| 1730 |
// MessagingSystemKey is the attribute Key conforming to the |
| 1731 |
// "messaging.system" semantic conventions. It represents a string |
| 1732 |
// identifying the messaging system. |
| 1733 |
// |
| 1734 |
// Type: string |
| 1735 |
// RequirementLevel: Optional |
| 1736 |
// Stability: experimental |
| 1737 |
// Examples: 'kafka', 'rabbitmq', 'rocketmq', 'activemq', 'AmazonSQS' |
| 1738 |
MessagingSystemKey = attribute.Key("messaging.system") |
| 1739 |
) |
| 1740 |
|
| 1741 |
var ( |
| 1742 |
// One or more messages are provided for publishing to an intermediary. If a single message is published, the context of the "Publish" span can be used as the creation context and no "Create" span needs to be created |
| 1743 |
MessagingOperationPublish = MessagingOperationKey.String("publish") |
| 1744 |
// A message is created. "Create" spans always refer to a single message and are used to provide a unique creation context for messages in batch publishing scenarios |
| 1745 |
MessagingOperationCreate = MessagingOperationKey.String("create") |
| 1746 |
// One or more messages are requested by a consumer. This operation refers to pull-based scenarios, where consumers explicitly call methods of messaging SDKs to receive messages |
| 1747 |
MessagingOperationReceive = MessagingOperationKey.String("receive") |
| 1748 |
// One or more messages are passed to a consumer. This operation refers to push-based scenarios, where consumer register callbacks which get called by messaging SDKs |
| 1749 |
MessagingOperationDeliver = MessagingOperationKey.String("deliver") |
| 1750 |
) |
| 1751 |
|
| 1752 |
var ( |
| 1753 |
// Clustering consumption model |
| 1754 |
MessagingRocketmqConsumptionModelClustering = MessagingRocketmqConsumptionModelKey.String("clustering") |
| 1755 |
// Broadcasting consumption model |
| 1756 |
MessagingRocketmqConsumptionModelBroadcasting = MessagingRocketmqConsumptionModelKey.String("broadcasting") |
| 1757 |
) |
| 1758 |
|
| 1759 |
var ( |
| 1760 |
// Normal message |
| 1761 |
MessagingRocketmqMessageTypeNormal = MessagingRocketmqMessageTypeKey.String("normal") |
| 1762 |
// FIFO message |
| 1763 |
MessagingRocketmqMessageTypeFifo = MessagingRocketmqMessageTypeKey.String("fifo") |
| 1764 |
// Delay message |
| 1765 |
MessagingRocketmqMessageTypeDelay = MessagingRocketmqMessageTypeKey.String("delay") |
| 1766 |
// Transaction message |
| 1767 |
MessagingRocketmqMessageTypeTransaction = MessagingRocketmqMessageTypeKey.String("transaction") |
| 1768 |
) |
| 1769 |
|
| 1770 |
// MessagingBatchMessageCount returns an attribute KeyValue conforming to |
| 1771 |
// the "messaging.batch.message_count" semantic conventions. It represents the |
| 1772 |
// number of messages sent, received, or processed in the scope of the batching |
| 1773 |
// operation. |
| 1774 |
func MessagingBatchMessageCount(val int) attribute.KeyValue { |
| 1775 |
return MessagingBatchMessageCountKey.Int(val) |
| 1776 |
} |
| 1777 |
|
| 1778 |
// MessagingClientID returns an attribute KeyValue conforming to the |
| 1779 |
// "messaging.client_id" semantic conventions. It represents a unique |
| 1780 |
// identifier for the client that consumes or produces a message. |
| 1781 |
func MessagingClientID(val string) attribute.KeyValue { |
| 1782 |
return MessagingClientIDKey.String(val) |
| 1783 |
} |
| 1784 |
|
| 1785 |
// MessagingDestinationAnonymous returns an attribute KeyValue conforming to |
| 1786 |
// the "messaging.destination.anonymous" semantic conventions. It represents a |
| 1787 |
// boolean that is true if the message destination is anonymous (could be |
| 1788 |
// unnamed or have auto-generated name). |
| 1789 |
func MessagingDestinationAnonymous(val bool) attribute.KeyValue { |
| 1790 |
return MessagingDestinationAnonymousKey.Bool(val) |
| 1791 |
} |
| 1792 |
|
| 1793 |
// MessagingDestinationName returns an attribute KeyValue conforming to the |
| 1794 |
// "messaging.destination.name" semantic conventions. It represents the message |
| 1795 |
// destination name |
| 1796 |
func MessagingDestinationName(val string) attribute.KeyValue { |
| 1797 |
return MessagingDestinationNameKey.String(val) |
| 1798 |
} |
| 1799 |
|
| 1800 |
// MessagingDestinationTemplate returns an attribute KeyValue conforming to |
| 1801 |
// the "messaging.destination.template" semantic conventions. It represents the |
| 1802 |
// low cardinality representation of the messaging destination name |
| 1803 |
func MessagingDestinationTemplate(val string) attribute.KeyValue { |
| 1804 |
return MessagingDestinationTemplateKey.String(val) |
| 1805 |
} |
| 1806 |
|
| 1807 |
// MessagingDestinationTemporary returns an attribute KeyValue conforming to |
| 1808 |
// the "messaging.destination.temporary" semantic conventions. It represents a |
| 1809 |
// boolean that is true if the message destination is temporary and might not |
| 1810 |
// exist anymore after messages are processed. |
| 1811 |
func MessagingDestinationTemporary(val bool) attribute.KeyValue { |
| 1812 |
return MessagingDestinationTemporaryKey.Bool(val) |
| 1813 |
} |
| 1814 |
|
| 1815 |
// MessagingDestinationPublishAnonymous returns an attribute KeyValue |
| 1816 |
// conforming to the "messaging.destination_publish.anonymous" semantic |
| 1817 |
// conventions. It represents a boolean that is true if the publish message |
| 1818 |
// destination is anonymous (could be unnamed or have auto-generated name). |
| 1819 |
func MessagingDestinationPublishAnonymous(val bool) attribute.KeyValue { |
| 1820 |
return MessagingDestinationPublishAnonymousKey.Bool(val) |
| 1821 |
} |
| 1822 |
|
| 1823 |
// MessagingDestinationPublishName returns an attribute KeyValue conforming |
| 1824 |
// to the "messaging.destination_publish.name" semantic conventions. It |
| 1825 |
// represents the name of the original destination the message was published to |
| 1826 |
func MessagingDestinationPublishName(val string) attribute.KeyValue { |
| 1827 |
return MessagingDestinationPublishNameKey.String(val) |
| 1828 |
} |
| 1829 |
|
| 1830 |
// MessagingKafkaConsumerGroup returns an attribute KeyValue conforming to |
| 1831 |
// the "messaging.kafka.consumer.group" semantic conventions. It represents the |
| 1832 |
// name of the Kafka Consumer Group that is handling the message. Only applies |
| 1833 |
// to consumers, not producers. |
| 1834 |
func MessagingKafkaConsumerGroup(val string) attribute.KeyValue { |
| 1835 |
return MessagingKafkaConsumerGroupKey.String(val) |
| 1836 |
} |
| 1837 |
|
| 1838 |
// MessagingKafkaDestinationPartition returns an attribute KeyValue |
| 1839 |
// conforming to the "messaging.kafka.destination.partition" semantic |
| 1840 |
// conventions. It represents the partition the message is sent to. |
| 1841 |
func MessagingKafkaDestinationPartition(val int) attribute.KeyValue { |
| 1842 |
return MessagingKafkaDestinationPartitionKey.Int(val) |
| 1843 |
} |
| 1844 |
|
| 1845 |
// MessagingKafkaMessageKey returns an attribute KeyValue conforming to the |
| 1846 |
// "messaging.kafka.message.key" semantic conventions. It represents the |
| 1847 |
// message keys in Kafka are used for grouping alike messages to ensure they're |
| 1848 |
// processed on the same partition. They differ from `messaging.message.id` in |
| 1849 |
// that they're not unique. If the key is `null`, the attribute MUST NOT be |
| 1850 |
// set. |
| 1851 |
func MessagingKafkaMessageKey(val string) attribute.KeyValue { |
| 1852 |
return MessagingKafkaMessageKeyKey.String(val) |
| 1853 |
} |
| 1854 |
|
| 1855 |
// MessagingKafkaMessageOffset returns an attribute KeyValue conforming to |
| 1856 |
// the "messaging.kafka.message.offset" semantic conventions. It represents the |
| 1857 |
// offset of a record in the corresponding Kafka partition. |
| 1858 |
func MessagingKafkaMessageOffset(val int) attribute.KeyValue { |
| 1859 |
return MessagingKafkaMessageOffsetKey.Int(val) |
| 1860 |
} |
| 1861 |
|
| 1862 |
// MessagingKafkaMessageTombstone returns an attribute KeyValue conforming |
| 1863 |
// to the "messaging.kafka.message.tombstone" semantic conventions. It |
| 1864 |
// represents a boolean that is true if the message is a tombstone. |
| 1865 |
func MessagingKafkaMessageTombstone(val bool) attribute.KeyValue { |
| 1866 |
return MessagingKafkaMessageTombstoneKey.Bool(val) |
| 1867 |
} |
| 1868 |
|
| 1869 |
// MessagingMessageBodySize returns an attribute KeyValue conforming to the |
| 1870 |
// "messaging.message.body.size" semantic conventions. It represents the size |
| 1871 |
// of the message body in bytes. |
| 1872 |
func MessagingMessageBodySize(val int) attribute.KeyValue { |
| 1873 |
return MessagingMessageBodySizeKey.Int(val) |
| 1874 |
} |
| 1875 |
|
| 1876 |
// MessagingMessageConversationID returns an attribute KeyValue conforming |
| 1877 |
// to the "messaging.message.conversation_id" semantic conventions. It |
| 1878 |
// represents the conversation ID identifying the conversation to which the |
| 1879 |
// message belongs, represented as a string. Sometimes called "Correlation ID". |
| 1880 |
func MessagingMessageConversationID(val string) attribute.KeyValue { |
| 1881 |
return MessagingMessageConversationIDKey.String(val) |
| 1882 |
} |
| 1883 |
|
| 1884 |
// MessagingMessageEnvelopeSize returns an attribute KeyValue conforming to |
| 1885 |
// the "messaging.message.envelope.size" semantic conventions. It represents |
| 1886 |
// the size of the message body and metadata in bytes. |
| 1887 |
func MessagingMessageEnvelopeSize(val int) attribute.KeyValue { |
| 1888 |
return MessagingMessageEnvelopeSizeKey.Int(val) |
| 1889 |
} |
| 1890 |
|
| 1891 |
// MessagingMessageID returns an attribute KeyValue conforming to the |
| 1892 |
// "messaging.message.id" semantic conventions. It represents a value used by |
| 1893 |
// the messaging system as an identifier for the message, represented as a |
| 1894 |
// string. |
| 1895 |
func MessagingMessageID(val string) attribute.KeyValue { |
| 1896 |
return MessagingMessageIDKey.String(val) |
| 1897 |
} |
| 1898 |
|
| 1899 |
// MessagingRabbitmqDestinationRoutingKey returns an attribute KeyValue |
| 1900 |
// conforming to the "messaging.rabbitmq.destination.routing_key" semantic |
| 1901 |
// conventions. It represents the rabbitMQ message routing key. |
| 1902 |
func MessagingRabbitmqDestinationRoutingKey(val string) attribute.KeyValue { |
| 1903 |
return MessagingRabbitmqDestinationRoutingKeyKey.String(val) |
| 1904 |
} |
| 1905 |
|
| 1906 |
// MessagingRocketmqClientGroup returns an attribute KeyValue conforming to |
| 1907 |
// the "messaging.rocketmq.client_group" semantic conventions. It represents |
| 1908 |
// the name of the RocketMQ producer/consumer group that is handling the |
| 1909 |
// message. The client type is identified by the SpanKind. |
| 1910 |
func MessagingRocketmqClientGroup(val string) attribute.KeyValue { |
| 1911 |
return MessagingRocketmqClientGroupKey.String(val) |
| 1912 |
} |
| 1913 |
|
| 1914 |
// MessagingRocketmqMessageDelayTimeLevel returns an attribute KeyValue |
| 1915 |
// conforming to the "messaging.rocketmq.message.delay_time_level" semantic |
| 1916 |
// conventions. It represents the delay time level for delay message, which |
| 1917 |
// determines the message delay time. |
| 1918 |
func MessagingRocketmqMessageDelayTimeLevel(val int) attribute.KeyValue { |
| 1919 |
return MessagingRocketmqMessageDelayTimeLevelKey.Int(val) |
| 1920 |
} |
| 1921 |
|
| 1922 |
// MessagingRocketmqMessageDeliveryTimestamp returns an attribute KeyValue |
| 1923 |
// conforming to the "messaging.rocketmq.message.delivery_timestamp" semantic |
| 1924 |
// conventions. It represents the timestamp in milliseconds that the delay |
| 1925 |
// message is expected to be delivered to consumer. |
| 1926 |
func MessagingRocketmqMessageDeliveryTimestamp(val int) attribute.KeyValue { |
| 1927 |
return MessagingRocketmqMessageDeliveryTimestampKey.Int(val) |
| 1928 |
} |
| 1929 |
|
| 1930 |
// MessagingRocketmqMessageGroup returns an attribute KeyValue conforming to |
| 1931 |
// the "messaging.rocketmq.message.group" semantic conventions. It represents |
| 1932 |
// the it is essential for FIFO message. Messages that belong to the same |
| 1933 |
// message group are always processed one by one within the same consumer |
| 1934 |
// group. |
| 1935 |
func MessagingRocketmqMessageGroup(val string) attribute.KeyValue { |
| 1936 |
return MessagingRocketmqMessageGroupKey.String(val) |
| 1937 |
} |
| 1938 |
|
| 1939 |
// MessagingRocketmqMessageKeys returns an attribute KeyValue conforming to |
| 1940 |
// the "messaging.rocketmq.message.keys" semantic conventions. It represents |
| 1941 |
// the key(s) of message, another way to mark message besides message id. |
| 1942 |
func MessagingRocketmqMessageKeys(val ...string) attribute.KeyValue { |
| 1943 |
return MessagingRocketmqMessageKeysKey.StringSlice(val) |
| 1944 |
} |
| 1945 |
|
| 1946 |
// MessagingRocketmqMessageTag returns an attribute KeyValue conforming to |
| 1947 |
// the "messaging.rocketmq.message.tag" semantic conventions. It represents the |
| 1948 |
// secondary classifier of message besides topic. |
| 1949 |
func MessagingRocketmqMessageTag(val string) attribute.KeyValue { |
| 1950 |
return MessagingRocketmqMessageTagKey.String(val) |
| 1951 |
} |
| 1952 |
|
| 1953 |
// MessagingRocketmqNamespace returns an attribute KeyValue conforming to |
| 1954 |
// the "messaging.rocketmq.namespace" semantic conventions. It represents the |
| 1955 |
// namespace of RocketMQ resources, resources in different namespaces are |
| 1956 |
// individual. |
| 1957 |
func MessagingRocketmqNamespace(val string) attribute.KeyValue { |
| 1958 |
return MessagingRocketmqNamespaceKey.String(val) |
| 1959 |
} |
| 1960 |
|
| 1961 |
// MessagingSystem returns an attribute KeyValue conforming to the |
| 1962 |
// "messaging.system" semantic conventions. It represents a string identifying |
| 1963 |
// the messaging system. |
| 1964 |
func MessagingSystem(val string) attribute.KeyValue { |
| 1965 |
return MessagingSystemKey.String(val) |
| 1966 |
} |
| 1967 |
|
| 1968 |
// These attributes may be used for any network related operation. |
| 1969 |
const ( |
| 1970 |
// NetworkCarrierIccKey is the attribute Key conforming to the |
| 1971 |
// "network.carrier.icc" semantic conventions. It represents the ISO 3166-1 |
| 1972 |
// alpha-2 2-character country code associated with the mobile carrier |
| 1973 |
// network. |
| 1974 |
// |
| 1975 |
// Type: string |
| 1976 |
// RequirementLevel: Optional |
| 1977 |
// Stability: experimental |
| 1978 |
// Examples: 'DE' |
| 1979 |
NetworkCarrierIccKey = attribute.Key("network.carrier.icc") |
| 1980 |
|
| 1981 |
// NetworkCarrierMccKey is the attribute Key conforming to the |
| 1982 |
// "network.carrier.mcc" semantic conventions. It represents the mobile |
| 1983 |
// carrier country code. |
| 1984 |
// |
| 1985 |
// Type: string |
| 1986 |
// RequirementLevel: Optional |
| 1987 |
// Stability: experimental |
| 1988 |
// Examples: '310' |
| 1989 |
NetworkCarrierMccKey = attribute.Key("network.carrier.mcc") |
| 1990 |
|
| 1991 |
// NetworkCarrierMncKey is the attribute Key conforming to the |
| 1992 |
// "network.carrier.mnc" semantic conventions. It represents the mobile |
| 1993 |
// carrier network code. |
| 1994 |
// |
| 1995 |
// Type: string |
| 1996 |
// RequirementLevel: Optional |
| 1997 |
// Stability: experimental |
| 1998 |
// Examples: '001' |
| 1999 |
NetworkCarrierMncKey = attribute.Key("network.carrier.mnc") |
| 2000 |
|
| 2001 |
// NetworkCarrierNameKey is the attribute Key conforming to the |
| 2002 |
// "network.carrier.name" semantic conventions. It represents the name of |
| 2003 |
// the mobile carrier. |
| 2004 |
// |
| 2005 |
// Type: string |
| 2006 |
// RequirementLevel: Optional |
| 2007 |
// Stability: experimental |
| 2008 |
// Examples: 'sprint' |
| 2009 |
NetworkCarrierNameKey = attribute.Key("network.carrier.name") |
| 2010 |
|
| 2011 |
// NetworkConnectionSubtypeKey is the attribute Key conforming to the |
| 2012 |
// "network.connection.subtype" semantic conventions. It represents the |
| 2013 |
// this describes more details regarding the connection.type. It may be the |
| 2014 |
// type of cell technology connection, but it could be used for describing |
| 2015 |
// details about a wifi connection. |
| 2016 |
// |
| 2017 |
// Type: Enum |
| 2018 |
// RequirementLevel: Optional |
| 2019 |
// Stability: experimental |
| 2020 |
// Examples: 'LTE' |
| 2021 |
NetworkConnectionSubtypeKey = attribute.Key("network.connection.subtype") |
| 2022 |
|
| 2023 |
// NetworkConnectionTypeKey is the attribute Key conforming to the |
| 2024 |
// "network.connection.type" semantic conventions. It represents the |
| 2025 |
// internet connection type. |
| 2026 |
// |
| 2027 |
// Type: Enum |
| 2028 |
// RequirementLevel: Optional |
| 2029 |
// Stability: experimental |
| 2030 |
// Examples: 'wifi' |
| 2031 |
NetworkConnectionTypeKey = attribute.Key("network.connection.type") |
| 2032 |
|
| 2033 |
// NetworkLocalAddressKey is the attribute Key conforming to the |
| 2034 |
// "network.local.address" semantic conventions. It represents the local |
| 2035 |
// address of the network connection - IP address or Unix domain socket |
| 2036 |
// name. |
| 2037 |
// |
| 2038 |
// Type: string |
| 2039 |
// RequirementLevel: Optional |
| 2040 |
// Stability: stable |
| 2041 |
// Examples: '10.1.2.80', '/tmp/my.sock' |
| 2042 |
NetworkLocalAddressKey = attribute.Key("network.local.address") |
| 2043 |
|
| 2044 |
// NetworkLocalPortKey is the attribute Key conforming to the |
| 2045 |
// "network.local.port" semantic conventions. It represents the local port |
| 2046 |
// number of the network connection. |
| 2047 |
// |
| 2048 |
// Type: int |
| 2049 |
// RequirementLevel: Optional |
| 2050 |
// Stability: stable |
| 2051 |
// Examples: 65123 |
| 2052 |
NetworkLocalPortKey = attribute.Key("network.local.port") |
| 2053 |
|
| 2054 |
// NetworkPeerAddressKey is the attribute Key conforming to the |
| 2055 |
// "network.peer.address" semantic conventions. It represents the peer |
| 2056 |
// address of the network connection - IP address or Unix domain socket |
| 2057 |
// name. |
| 2058 |
// |
| 2059 |
// Type: string |
| 2060 |
// RequirementLevel: Optional |
| 2061 |
// Stability: stable |
| 2062 |
// Examples: '10.1.2.80', '/tmp/my.sock' |
| 2063 |
NetworkPeerAddressKey = attribute.Key("network.peer.address") |
| 2064 |
|
| 2065 |
// NetworkPeerPortKey is the attribute Key conforming to the |
| 2066 |
// "network.peer.port" semantic conventions. It represents the peer port |
| 2067 |
// number of the network connection. |
| 2068 |
// |
| 2069 |
// Type: int |
| 2070 |
// RequirementLevel: Optional |
| 2071 |
// Stability: stable |
| 2072 |
// Examples: 65123 |
| 2073 |
NetworkPeerPortKey = attribute.Key("network.peer.port") |
| 2074 |
|
| 2075 |
// NetworkProtocolNameKey is the attribute Key conforming to the |
| 2076 |
// "network.protocol.name" semantic conventions. It represents the [OSI |
| 2077 |
// application layer](https://osi-model.com/application-layer/) or non-OSI |
| 2078 |
// equivalent. |
| 2079 |
// |
| 2080 |
// Type: string |
| 2081 |
// RequirementLevel: Optional |
| 2082 |
// Stability: stable |
| 2083 |
// Examples: 'amqp', 'http', 'mqtt' |
| 2084 |
// Note: The value SHOULD be normalized to lowercase. |
| 2085 |
NetworkProtocolNameKey = attribute.Key("network.protocol.name") |
| 2086 |
|
| 2087 |
// NetworkProtocolVersionKey is the attribute Key conforming to the |
| 2088 |
// "network.protocol.version" semantic conventions. It represents the |
| 2089 |
// version of the protocol specified in `network.protocol.name`. |
| 2090 |
// |
| 2091 |
// Type: string |
| 2092 |
// RequirementLevel: Optional |
| 2093 |
// Stability: stable |
| 2094 |
// Examples: '3.1.1' |
| 2095 |
// Note: `network.protocol.version` refers to the version of the protocol |
| 2096 |
// used and might be different from the protocol client's version. If the |
| 2097 |
// HTTP client has a version of `0.27.2`, but sends HTTP version `1.1`, |
| 2098 |
// this attribute should be set to `1.1`. |
| 2099 |
NetworkProtocolVersionKey = attribute.Key("network.protocol.version") |
| 2100 |
|
| 2101 |
// NetworkTransportKey is the attribute Key conforming to the |
| 2102 |
// "network.transport" semantic conventions. It represents the [OSI |
| 2103 |
// transport layer](https://osi-model.com/transport-layer/) or |
| 2104 |
// [inter-process communication |
| 2105 |
// method](https://wikipedia.org/wiki/Inter-process_communication). |
| 2106 |
// |
| 2107 |
// Type: Enum |
| 2108 |
// RequirementLevel: Optional |
| 2109 |
// Stability: stable |
| 2110 |
// Examples: 'tcp', 'udp' |
| 2111 |
// Note: The value SHOULD be normalized to lowercase. |
| 2112 |
// |
| 2113 |
// Consider always setting the transport when setting a port number, since |
| 2114 |
// a port number is ambiguous without knowing the transport. For example |
| 2115 |
// different processes could be listening on TCP port 12345 and UDP port |
| 2116 |
// 12345. |
| 2117 |
NetworkTransportKey = attribute.Key("network.transport") |
| 2118 |
|
| 2119 |
// NetworkTypeKey is the attribute Key conforming to the "network.type" |
| 2120 |
// semantic conventions. It represents the [OSI network |
| 2121 |
// layer](https://osi-model.com/network-layer/) or non-OSI equivalent. |
| 2122 |
// |
| 2123 |
// Type: Enum |
| 2124 |
// RequirementLevel: Optional |
| 2125 |
// Stability: stable |
| 2126 |
// Examples: 'ipv4', 'ipv6' |
| 2127 |
// Note: The value SHOULD be normalized to lowercase. |
| 2128 |
NetworkTypeKey = attribute.Key("network.type") |
| 2129 |
) |
| 2130 |
|
| 2131 |
var ( |
| 2132 |
// GPRS |
| 2133 |
NetworkConnectionSubtypeGprs = NetworkConnectionSubtypeKey.String("gprs") |
| 2134 |
// EDGE |
| 2135 |
NetworkConnectionSubtypeEdge = NetworkConnectionSubtypeKey.String("edge") |
| 2136 |
// UMTS |
| 2137 |
NetworkConnectionSubtypeUmts = NetworkConnectionSubtypeKey.String("umts") |
| 2138 |
// CDMA |
| 2139 |
NetworkConnectionSubtypeCdma = NetworkConnectionSubtypeKey.String("cdma") |
| 2140 |
// EVDO Rel. 0 |
| 2141 |
NetworkConnectionSubtypeEvdo0 = NetworkConnectionSubtypeKey.String("evdo_0") |
| 2142 |
// EVDO Rev. A |
| 2143 |
NetworkConnectionSubtypeEvdoA = NetworkConnectionSubtypeKey.String("evdo_a") |
| 2144 |
// CDMA2000 1XRTT |
| 2145 |
NetworkConnectionSubtypeCdma20001xrtt = NetworkConnectionSubtypeKey.String("cdma2000_1xrtt") |
| 2146 |
// HSDPA |
| 2147 |
NetworkConnectionSubtypeHsdpa = NetworkConnectionSubtypeKey.String("hsdpa") |
| 2148 |
// HSUPA |
| 2149 |
NetworkConnectionSubtypeHsupa = NetworkConnectionSubtypeKey.String("hsupa") |
| 2150 |
// HSPA |
| 2151 |
NetworkConnectionSubtypeHspa = NetworkConnectionSubtypeKey.String("hspa") |
| 2152 |
// IDEN |
| 2153 |
NetworkConnectionSubtypeIden = NetworkConnectionSubtypeKey.String("iden") |
| 2154 |
// EVDO Rev. B |
| 2155 |
NetworkConnectionSubtypeEvdoB = NetworkConnectionSubtypeKey.String("evdo_b") |
| 2156 |
// LTE |
| 2157 |
NetworkConnectionSubtypeLte = NetworkConnectionSubtypeKey.String("lte") |
| 2158 |
// EHRPD |
| 2159 |
NetworkConnectionSubtypeEhrpd = NetworkConnectionSubtypeKey.String("ehrpd") |
| 2160 |
// HSPAP |
| 2161 |
NetworkConnectionSubtypeHspap = NetworkConnectionSubtypeKey.String("hspap") |
| 2162 |
// GSM |
| 2163 |
NetworkConnectionSubtypeGsm = NetworkConnectionSubtypeKey.String("gsm") |
| 2164 |
// TD-SCDMA |
| 2165 |
NetworkConnectionSubtypeTdScdma = NetworkConnectionSubtypeKey.String("td_scdma") |
| 2166 |
// IWLAN |
| 2167 |
NetworkConnectionSubtypeIwlan = NetworkConnectionSubtypeKey.String("iwlan") |
| 2168 |
// 5G NR (New Radio) |
| 2169 |
NetworkConnectionSubtypeNr = NetworkConnectionSubtypeKey.String("nr") |
| 2170 |
// 5G NRNSA (New Radio Non-Standalone) |
| 2171 |
NetworkConnectionSubtypeNrnsa = NetworkConnectionSubtypeKey.String("nrnsa") |
| 2172 |
// LTE CA |
| 2173 |
NetworkConnectionSubtypeLteCa = NetworkConnectionSubtypeKey.String("lte_ca") |
| 2174 |
) |
| 2175 |
|
| 2176 |
var ( |
| 2177 |
// wifi |
| 2178 |
NetworkConnectionTypeWifi = NetworkConnectionTypeKey.String("wifi") |
| 2179 |
// wired |
| 2180 |
NetworkConnectionTypeWired = NetworkConnectionTypeKey.String("wired") |
| 2181 |
// cell |
| 2182 |
NetworkConnectionTypeCell = NetworkConnectionTypeKey.String("cell") |
| 2183 |
// unavailable |
| 2184 |
NetworkConnectionTypeUnavailable = NetworkConnectionTypeKey.String("unavailable") |
| 2185 |
// unknown |
| 2186 |
NetworkConnectionTypeUnknown = NetworkConnectionTypeKey.String("unknown") |
| 2187 |
) |
| 2188 |
|
| 2189 |
var ( |
| 2190 |
// TCP |
| 2191 |
NetworkTransportTCP = NetworkTransportKey.String("tcp") |
| 2192 |
// UDP |
| 2193 |
NetworkTransportUDP = NetworkTransportKey.String("udp") |
| 2194 |
// Named or anonymous pipe |
| 2195 |
NetworkTransportPipe = NetworkTransportKey.String("pipe") |
| 2196 |
// Unix domain socket |
| 2197 |
NetworkTransportUnix = NetworkTransportKey.String("unix") |
| 2198 |
) |
| 2199 |
|
| 2200 |
var ( |
| 2201 |
// IPv4 |
| 2202 |
NetworkTypeIpv4 = NetworkTypeKey.String("ipv4") |
| 2203 |
// IPv6 |
| 2204 |
NetworkTypeIpv6 = NetworkTypeKey.String("ipv6") |
| 2205 |
) |
| 2206 |
|
| 2207 |
// NetworkCarrierIcc returns an attribute KeyValue conforming to the |
| 2208 |
// "network.carrier.icc" semantic conventions. It represents the ISO 3166-1 |
| 2209 |
// alpha-2 2-character country code associated with the mobile carrier network. |
| 2210 |
func NetworkCarrierIcc(val string) attribute.KeyValue { |
| 2211 |
return NetworkCarrierIccKey.String(val) |
| 2212 |
} |
| 2213 |
|
| 2214 |
// NetworkCarrierMcc returns an attribute KeyValue conforming to the |
| 2215 |
// "network.carrier.mcc" semantic conventions. It represents the mobile carrier |
| 2216 |
// country code. |
| 2217 |
func NetworkCarrierMcc(val string) attribute.KeyValue { |
| 2218 |
return NetworkCarrierMccKey.String(val) |
| 2219 |
} |
| 2220 |
|
| 2221 |
// NetworkCarrierMnc returns an attribute KeyValue conforming to the |
| 2222 |
// "network.carrier.mnc" semantic conventions. It represents the mobile carrier |
| 2223 |
// network code. |
| 2224 |
func NetworkCarrierMnc(val string) attribute.KeyValue { |
| 2225 |
return NetworkCarrierMncKey.String(val) |
| 2226 |
} |
| 2227 |
|
| 2228 |
// NetworkCarrierName returns an attribute KeyValue conforming to the |
| 2229 |
// "network.carrier.name" semantic conventions. It represents the name of the |
| 2230 |
// mobile carrier. |
| 2231 |
func NetworkCarrierName(val string) attribute.KeyValue { |
| 2232 |
return NetworkCarrierNameKey.String(val) |
| 2233 |
} |
| 2234 |
|
| 2235 |
// NetworkLocalAddress returns an attribute KeyValue conforming to the |
| 2236 |
// "network.local.address" semantic conventions. It represents the local |
| 2237 |
// address of the network connection - IP address or Unix domain socket name. |
| 2238 |
func NetworkLocalAddress(val string) attribute.KeyValue { |
| 2239 |
return NetworkLocalAddressKey.String(val) |
| 2240 |
} |
| 2241 |
|
| 2242 |
// NetworkLocalPort returns an attribute KeyValue conforming to the |
| 2243 |
// "network.local.port" semantic conventions. It represents the local port |
| 2244 |
// number of the network connection. |
| 2245 |
func NetworkLocalPort(val int) attribute.KeyValue { |
| 2246 |
return NetworkLocalPortKey.Int(val) |
| 2247 |
} |
| 2248 |
|
| 2249 |
// NetworkPeerAddress returns an attribute KeyValue conforming to the |
| 2250 |
// "network.peer.address" semantic conventions. It represents the peer address |
| 2251 |
// of the network connection - IP address or Unix domain socket name. |
| 2252 |
func NetworkPeerAddress(val string) attribute.KeyValue { |
| 2253 |
return NetworkPeerAddressKey.String(val) |
| 2254 |
} |
| 2255 |
|
| 2256 |
// NetworkPeerPort returns an attribute KeyValue conforming to the |
| 2257 |
// "network.peer.port" semantic conventions. It represents the peer port number |
| 2258 |
// of the network connection. |
| 2259 |
func NetworkPeerPort(val int) attribute.KeyValue { |
| 2260 |
return NetworkPeerPortKey.Int(val) |
| 2261 |
} |
| 2262 |
|
| 2263 |
// NetworkProtocolName returns an attribute KeyValue conforming to the |
| 2264 |
// "network.protocol.name" semantic conventions. It represents the [OSI |
| 2265 |
// application layer](https://osi-model.com/application-layer/) or non-OSI |
| 2266 |
// equivalent. |
| 2267 |
func NetworkProtocolName(val string) attribute.KeyValue { |
| 2268 |
return NetworkProtocolNameKey.String(val) |
| 2269 |
} |
| 2270 |
|
| 2271 |
// NetworkProtocolVersion returns an attribute KeyValue conforming to the |
| 2272 |
// "network.protocol.version" semantic conventions. It represents the version |
| 2273 |
// of the protocol specified in `network.protocol.name`. |
| 2274 |
func NetworkProtocolVersion(val string) attribute.KeyValue { |
| 2275 |
return NetworkProtocolVersionKey.String(val) |
| 2276 |
} |
| 2277 |
|
| 2278 |
// Attributes for remote procedure calls. |
| 2279 |
const ( |
| 2280 |
// RPCConnectRPCErrorCodeKey is the attribute Key conforming to the |
| 2281 |
// "rpc.connect_rpc.error_code" semantic conventions. It represents the |
| 2282 |
// [error codes](https://connect.build/docs/protocol/#error-codes) of the |
| 2283 |
// Connect request. Error codes are always string values. |
| 2284 |
// |
| 2285 |
// Type: Enum |
| 2286 |
// RequirementLevel: Optional |
| 2287 |
// Stability: experimental |
| 2288 |
RPCConnectRPCErrorCodeKey = attribute.Key("rpc.connect_rpc.error_code") |
| 2289 |
|
| 2290 |
// RPCGRPCStatusCodeKey is the attribute Key conforming to the |
| 2291 |
// "rpc.grpc.status_code" semantic conventions. It represents the [numeric |
| 2292 |
// status |
| 2293 |
// code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of |
| 2294 |
// the gRPC request. |
| 2295 |
// |
| 2296 |
// Type: Enum |
| 2297 |
// RequirementLevel: Optional |
| 2298 |
// Stability: experimental |
| 2299 |
RPCGRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code") |
| 2300 |
|
| 2301 |
// RPCJsonrpcErrorCodeKey is the attribute Key conforming to the |
| 2302 |
// "rpc.jsonrpc.error_code" semantic conventions. It represents the |
| 2303 |
// `error.code` property of response if it is an error response. |
| 2304 |
// |
| 2305 |
// Type: int |
| 2306 |
// RequirementLevel: Optional |
| 2307 |
// Stability: experimental |
| 2308 |
// Examples: -32700, 100 |
| 2309 |
RPCJsonrpcErrorCodeKey = attribute.Key("rpc.jsonrpc.error_code") |
| 2310 |
|
| 2311 |
// RPCJsonrpcErrorMessageKey is the attribute Key conforming to the |
| 2312 |
// "rpc.jsonrpc.error_message" semantic conventions. It represents the |
| 2313 |
// `error.message` property of response if it is an error response. |
| 2314 |
// |
| 2315 |
// Type: string |
| 2316 |
// RequirementLevel: Optional |
| 2317 |
// Stability: experimental |
| 2318 |
// Examples: 'Parse error', 'User already exists' |
| 2319 |
RPCJsonrpcErrorMessageKey = attribute.Key("rpc.jsonrpc.error_message") |
| 2320 |
|
| 2321 |
// RPCJsonrpcRequestIDKey is the attribute Key conforming to the |
| 2322 |
// "rpc.jsonrpc.request_id" semantic conventions. It represents the `id` |
| 2323 |
// property of request or response. Since protocol allows id to be int, |
| 2324 |
// string, `null` or missing (for notifications), value is expected to be |
| 2325 |
// cast to string for simplicity. Use empty string in case of `null` value. |
| 2326 |
// Omit entirely if this is a notification. |
| 2327 |
// |
| 2328 |
// Type: string |
| 2329 |
// RequirementLevel: Optional |
| 2330 |
// Stability: experimental |
| 2331 |
// Examples: '10', 'request-7', '' |
| 2332 |
RPCJsonrpcRequestIDKey = attribute.Key("rpc.jsonrpc.request_id") |
| 2333 |
|
| 2334 |
// RPCJsonrpcVersionKey is the attribute Key conforming to the |
| 2335 |
// "rpc.jsonrpc.version" semantic conventions. It represents the protocol |
| 2336 |
// version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 |
| 2337 |
// doesn't specify this, the value can be omitted. |
| 2338 |
// |
| 2339 |
// Type: string |
| 2340 |
// RequirementLevel: Optional |
| 2341 |
// Stability: experimental |
| 2342 |
// Examples: '2.0', '1.0' |
| 2343 |
RPCJsonrpcVersionKey = attribute.Key("rpc.jsonrpc.version") |
| 2344 |
|
| 2345 |
// RPCMethodKey is the attribute Key conforming to the "rpc.method" |
| 2346 |
// semantic conventions. It represents the name of the (logical) method |
| 2347 |
// being called, must be equal to the $method part in the span name. |
| 2348 |
// |
| 2349 |
// Type: string |
| 2350 |
// RequirementLevel: Optional |
| 2351 |
// Stability: experimental |
| 2352 |
// Examples: 'exampleMethod' |
| 2353 |
// Note: This is the logical name of the method from the RPC interface |
| 2354 |
// perspective, which can be different from the name of any implementing |
| 2355 |
// method/function. The `code.function` attribute may be used to store the |
| 2356 |
// latter (e.g., method actually executing the call on the server side, RPC |
| 2357 |
// client stub method on the client side). |
| 2358 |
RPCMethodKey = attribute.Key("rpc.method") |
| 2359 |
|
| 2360 |
// RPCServiceKey is the attribute Key conforming to the "rpc.service" |
| 2361 |
// semantic conventions. It represents the full (logical) name of the |
| 2362 |
// service being called, including its package name, if applicable. |
| 2363 |
// |
| 2364 |
// Type: string |
| 2365 |
// RequirementLevel: Optional |
| 2366 |
// Stability: experimental |
| 2367 |
// Examples: 'myservice.EchoService' |
| 2368 |
// Note: This is the logical name of the service from the RPC interface |
| 2369 |
// perspective, which can be different from the name of any implementing |
| 2370 |
// class. The `code.namespace` attribute may be used to store the latter |
| 2371 |
// (despite the attribute name, it may include a class name; e.g., class |
| 2372 |
// with method actually executing the call on the server side, RPC client |
| 2373 |
// stub class on the client side). |
| 2374 |
RPCServiceKey = attribute.Key("rpc.service") |
| 2375 |
|
| 2376 |
// RPCSystemKey is the attribute Key conforming to the "rpc.system" |
| 2377 |
// semantic conventions. It represents a string identifying the remoting |
| 2378 |
// system. See below for a list of well-known identifiers. |
| 2379 |
// |
| 2380 |
// Type: Enum |
| 2381 |
// RequirementLevel: Optional |
| 2382 |
// Stability: experimental |
| 2383 |
RPCSystemKey = attribute.Key("rpc.system") |
| 2384 |
) |
| 2385 |
|
| 2386 |
var ( |
| 2387 |
// cancelled |
| 2388 |
RPCConnectRPCErrorCodeCancelled = RPCConnectRPCErrorCodeKey.String("cancelled") |
| 2389 |
// unknown |
| 2390 |
RPCConnectRPCErrorCodeUnknown = RPCConnectRPCErrorCodeKey.String("unknown") |
| 2391 |
// invalid_argument |
| 2392 |
RPCConnectRPCErrorCodeInvalidArgument = RPCConnectRPCErrorCodeKey.String("invalid_argument") |
| 2393 |
// deadline_exceeded |
| 2394 |
RPCConnectRPCErrorCodeDeadlineExceeded = RPCConnectRPCErrorCodeKey.String("deadline_exceeded") |
| 2395 |
// not_found |
| 2396 |
RPCConnectRPCErrorCodeNotFound = RPCConnectRPCErrorCodeKey.String("not_found") |
| 2397 |
// already_exists |
| 2398 |
RPCConnectRPCErrorCodeAlreadyExists = RPCConnectRPCErrorCodeKey.String("already_exists") |
| 2399 |
// permission_denied |
| 2400 |
RPCConnectRPCErrorCodePermissionDenied = RPCConnectRPCErrorCodeKey.String("permission_denied") |
| 2401 |
// resource_exhausted |
| 2402 |
RPCConnectRPCErrorCodeResourceExhausted = RPCConnectRPCErrorCodeKey.String("resource_exhausted") |
| 2403 |
// failed_precondition |
| 2404 |
RPCConnectRPCErrorCodeFailedPrecondition = RPCConnectRPCErrorCodeKey.String("failed_precondition") |
| 2405 |
// aborted |
| 2406 |
RPCConnectRPCErrorCodeAborted = RPCConnectRPCErrorCodeKey.String("aborted") |
| 2407 |
// out_of_range |
| 2408 |
RPCConnectRPCErrorCodeOutOfRange = RPCConnectRPCErrorCodeKey.String("out_of_range") |
| 2409 |
// unimplemented |
| 2410 |
RPCConnectRPCErrorCodeUnimplemented = RPCConnectRPCErrorCodeKey.String("unimplemented") |
| 2411 |
// internal |
| 2412 |
RPCConnectRPCErrorCodeInternal = RPCConnectRPCErrorCodeKey.String("internal") |
| 2413 |
// unavailable |
| 2414 |
RPCConnectRPCErrorCodeUnavailable = RPCConnectRPCErrorCodeKey.String("unavailable") |
| 2415 |
// data_loss |
| 2416 |
RPCConnectRPCErrorCodeDataLoss = RPCConnectRPCErrorCodeKey.String("data_loss") |
| 2417 |
// unauthenticated |
| 2418 |
RPCConnectRPCErrorCodeUnauthenticated = RPCConnectRPCErrorCodeKey.String("unauthenticated") |
| 2419 |
) |
| 2420 |
|
| 2421 |
var ( |
| 2422 |
// OK |
| 2423 |
RPCGRPCStatusCodeOk = RPCGRPCStatusCodeKey.Int(0) |
| 2424 |
// CANCELLED |
| 2425 |
RPCGRPCStatusCodeCancelled = RPCGRPCStatusCodeKey.Int(1) |
| 2426 |
// UNKNOWN |
| 2427 |
RPCGRPCStatusCodeUnknown = RPCGRPCStatusCodeKey.Int(2) |
| 2428 |
// INVALID_ARGUMENT |
| 2429 |
RPCGRPCStatusCodeInvalidArgument = RPCGRPCStatusCodeKey.Int(3) |
| 2430 |
// DEADLINE_EXCEEDED |
| 2431 |
RPCGRPCStatusCodeDeadlineExceeded = RPCGRPCStatusCodeKey.Int(4) |
| 2432 |
// NOT_FOUND |
| 2433 |
RPCGRPCStatusCodeNotFound = RPCGRPCStatusCodeKey.Int(5) |
| 2434 |
// ALREADY_EXISTS |
| 2435 |
RPCGRPCStatusCodeAlreadyExists = RPCGRPCStatusCodeKey.Int(6) |
| 2436 |
// PERMISSION_DENIED |
| 2437 |
RPCGRPCStatusCodePermissionDenied = RPCGRPCStatusCodeKey.Int(7) |
| 2438 |
// RESOURCE_EXHAUSTED |
| 2439 |
RPCGRPCStatusCodeResourceExhausted = RPCGRPCStatusCodeKey.Int(8) |
| 2440 |
// FAILED_PRECONDITION |
| 2441 |
RPCGRPCStatusCodeFailedPrecondition = RPCGRPCStatusCodeKey.Int(9) |
| 2442 |
// ABORTED |
| 2443 |
RPCGRPCStatusCodeAborted = RPCGRPCStatusCodeKey.Int(10) |
| 2444 |
// OUT_OF_RANGE |
| 2445 |
RPCGRPCStatusCodeOutOfRange = RPCGRPCStatusCodeKey.Int(11) |
| 2446 |
// UNIMPLEMENTED |
| 2447 |
RPCGRPCStatusCodeUnimplemented = RPCGRPCStatusCodeKey.Int(12) |
| 2448 |
// INTERNAL |
| 2449 |
RPCGRPCStatusCodeInternal = RPCGRPCStatusCodeKey.Int(13) |
| 2450 |
// UNAVAILABLE |
| 2451 |
RPCGRPCStatusCodeUnavailable = RPCGRPCStatusCodeKey.Int(14) |
| 2452 |
// DATA_LOSS |
| 2453 |
RPCGRPCStatusCodeDataLoss = RPCGRPCStatusCodeKey.Int(15) |
| 2454 |
// UNAUTHENTICATED |
| 2455 |
RPCGRPCStatusCodeUnauthenticated = RPCGRPCStatusCodeKey.Int(16) |
| 2456 |
) |
| 2457 |
|
| 2458 |
var ( |
| 2459 |
// gRPC |
| 2460 |
RPCSystemGRPC = RPCSystemKey.String("grpc") |
| 2461 |
// Java RMI |
| 2462 |
RPCSystemJavaRmi = RPCSystemKey.String("java_rmi") |
| 2463 |
// .NET WCF |
| 2464 |
RPCSystemDotnetWcf = RPCSystemKey.String("dotnet_wcf") |
| 2465 |
// Apache Dubbo |
| 2466 |
RPCSystemApacheDubbo = RPCSystemKey.String("apache_dubbo") |
| 2467 |
// Connect RPC |
| 2468 |
RPCSystemConnectRPC = RPCSystemKey.String("connect_rpc") |
| 2469 |
) |
| 2470 |
|
| 2471 |
// RPCJsonrpcErrorCode returns an attribute KeyValue conforming to the |
| 2472 |
// "rpc.jsonrpc.error_code" semantic conventions. It represents the |
| 2473 |
// `error.code` property of response if it is an error response. |
| 2474 |
func RPCJsonrpcErrorCode(val int) attribute.KeyValue { |
| 2475 |
return RPCJsonrpcErrorCodeKey.Int(val) |
| 2476 |
} |
| 2477 |
|
| 2478 |
// RPCJsonrpcErrorMessage returns an attribute KeyValue conforming to the |
| 2479 |
// "rpc.jsonrpc.error_message" semantic conventions. It represents the |
| 2480 |
// `error.message` property of response if it is an error response. |
| 2481 |
func RPCJsonrpcErrorMessage(val string) attribute.KeyValue { |
| 2482 |
return RPCJsonrpcErrorMessageKey.String(val) |
| 2483 |
} |
| 2484 |
|
| 2485 |
// RPCJsonrpcRequestID returns an attribute KeyValue conforming to the |
| 2486 |
// "rpc.jsonrpc.request_id" semantic conventions. It represents the `id` |
| 2487 |
// property of request or response. Since protocol allows id to be int, string, |
| 2488 |
// `null` or missing (for notifications), value is expected to be cast to |
| 2489 |
// string for simplicity. Use empty string in case of `null` value. Omit |
| 2490 |
// entirely if this is a notification. |
| 2491 |
func RPCJsonrpcRequestID(val string) attribute.KeyValue { |
| 2492 |
return RPCJsonrpcRequestIDKey.String(val) |
| 2493 |
} |
| 2494 |
|
| 2495 |
// RPCJsonrpcVersion returns an attribute KeyValue conforming to the |
| 2496 |
// "rpc.jsonrpc.version" semantic conventions. It represents the protocol |
| 2497 |
// version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 |
| 2498 |
// doesn't specify this, the value can be omitted. |
| 2499 |
func RPCJsonrpcVersion(val string) attribute.KeyValue { |
| 2500 |
return RPCJsonrpcVersionKey.String(val) |
| 2501 |
} |
| 2502 |
|
| 2503 |
// RPCMethod returns an attribute KeyValue conforming to the "rpc.method" |
| 2504 |
// semantic conventions. It represents the name of the (logical) method being |
| 2505 |
// called, must be equal to the $method part in the span name. |
| 2506 |
func RPCMethod(val string) attribute.KeyValue { |
| 2507 |
return RPCMethodKey.String(val) |
| 2508 |
} |
| 2509 |
|
| 2510 |
// RPCService returns an attribute KeyValue conforming to the "rpc.service" |
| 2511 |
// semantic conventions. It represents the full (logical) name of the service |
| 2512 |
// being called, including its package name, if applicable. |
| 2513 |
func RPCService(val string) attribute.KeyValue { |
| 2514 |
return RPCServiceKey.String(val) |
| 2515 |
} |
| 2516 |
|
| 2517 |
// Attributes describing URL. |
| 2518 |
const ( |
| 2519 |
// URLFragmentKey is the attribute Key conforming to the "url.fragment" |
| 2520 |
// semantic conventions. It represents the [URI |
| 2521 |
// fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component |
| 2522 |
// |
| 2523 |
// Type: string |
| 2524 |
// RequirementLevel: Optional |
| 2525 |
// Stability: stable |
| 2526 |
// Examples: 'SemConv' |
| 2527 |
URLFragmentKey = attribute.Key("url.fragment") |
| 2528 |
|
| 2529 |
// URLFullKey is the attribute Key conforming to the "url.full" semantic |
| 2530 |
// conventions. It represents the absolute URL describing a network |
| 2531 |
// resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) |
| 2532 |
// |
| 2533 |
// Type: string |
| 2534 |
// RequirementLevel: Optional |
| 2535 |
// Stability: stable |
| 2536 |
// Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv', |
| 2537 |
// '//localhost' |
| 2538 |
// Note: For network calls, URL usually has |
| 2539 |
// `scheme://host[:port][path][?query][#fragment]` format, where the |
| 2540 |
// fragment is not transmitted over HTTP, but if it is known, it SHOULD be |
| 2541 |
// included nevertheless. |
| 2542 |
// `url.full` MUST NOT contain credentials passed via URL in form of |
| 2543 |
// `https://username:[email protected]/`. In such case username and |
| 2544 |
// password SHOULD be redacted and attribute's value SHOULD be |
| 2545 |
// `https://REDACTED:[email protected]/`. |
| 2546 |
// `url.full` SHOULD capture the absolute URL when it is available (or can |
| 2547 |
// be reconstructed) and SHOULD NOT be validated or modified except for |
| 2548 |
// sanitizing purposes. |
| 2549 |
URLFullKey = attribute.Key("url.full") |
| 2550 |
|
| 2551 |
// URLPathKey is the attribute Key conforming to the "url.path" semantic |
| 2552 |
// conventions. It represents the [URI |
| 2553 |
// path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component |
| 2554 |
// |
| 2555 |
// Type: string |
| 2556 |
// RequirementLevel: Optional |
| 2557 |
// Stability: stable |
| 2558 |
// Examples: '/search' |
| 2559 |
URLPathKey = attribute.Key("url.path") |
| 2560 |
|
| 2561 |
// URLQueryKey is the attribute Key conforming to the "url.query" semantic |
| 2562 |
// conventions. It represents the [URI |
| 2563 |
// query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component |
| 2564 |
// |
| 2565 |
// Type: string |
| 2566 |
// RequirementLevel: Optional |
| 2567 |
// Stability: stable |
| 2568 |
// Examples: 'q=OpenTelemetry' |
| 2569 |
// Note: Sensitive content provided in query string SHOULD be scrubbed when |
| 2570 |
// instrumentations can identify it. |
| 2571 |
URLQueryKey = attribute.Key("url.query") |
| 2572 |
|
| 2573 |
// URLSchemeKey is the attribute Key conforming to the "url.scheme" |
| 2574 |
// semantic conventions. It represents the [URI |
| 2575 |
// scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component |
| 2576 |
// identifying the used protocol. |
| 2577 |
// |
| 2578 |
// Type: string |
| 2579 |
// RequirementLevel: Optional |
| 2580 |
// Stability: stable |
| 2581 |
// Examples: 'https', 'ftp', 'telnet' |
| 2582 |
URLSchemeKey = attribute.Key("url.scheme") |
| 2583 |
) |
| 2584 |
|
| 2585 |
// URLFragment returns an attribute KeyValue conforming to the |
| 2586 |
// "url.fragment" semantic conventions. It represents the [URI |
| 2587 |
// fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component |
| 2588 |
func URLFragment(val string) attribute.KeyValue { |
| 2589 |
return URLFragmentKey.String(val) |
| 2590 |
} |
| 2591 |
|
| 2592 |
// URLFull returns an attribute KeyValue conforming to the "url.full" |
| 2593 |
// semantic conventions. It represents the absolute URL describing a network |
| 2594 |
// resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) |
| 2595 |
func URLFull(val string) attribute.KeyValue { |
| 2596 |
return URLFullKey.String(val) |
| 2597 |
} |
| 2598 |
|
| 2599 |
// URLPath returns an attribute KeyValue conforming to the "url.path" |
| 2600 |
// semantic conventions. It represents the [URI |
| 2601 |
// path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component |
| 2602 |
func URLPath(val string) attribute.KeyValue { |
| 2603 |
return URLPathKey.String(val) |
| 2604 |
} |
| 2605 |
|
| 2606 |
// URLQuery returns an attribute KeyValue conforming to the "url.query" |
| 2607 |
// semantic conventions. It represents the [URI |
| 2608 |
// query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component |
| 2609 |
func URLQuery(val string) attribute.KeyValue { |
| 2610 |
return URLQueryKey.String(val) |
| 2611 |
} |
| 2612 |
|
| 2613 |
// URLScheme returns an attribute KeyValue conforming to the "url.scheme" |
| 2614 |
// semantic conventions. It represents the [URI |
| 2615 |
// scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component |
| 2616 |
// identifying the used protocol. |
| 2617 |
func URLScheme(val string) attribute.KeyValue { |
| 2618 |
return URLSchemeKey.String(val) |
| 2619 |
} |
| 2620 |
|
| 2621 |
// Describes user-agent attributes. |
| 2622 |
const ( |
| 2623 |
// UserAgentOriginalKey is the attribute Key conforming to the |
| 2624 |
// "user_agent.original" semantic conventions. It represents the value of |
| 2625 |
// the [HTTP |
| 2626 |
// User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) |
| 2627 |
// header sent by the client. |
| 2628 |
// |
| 2629 |
// Type: string |
| 2630 |
// RequirementLevel: Optional |
| 2631 |
// Stability: stable |
| 2632 |
// Examples: 'CERN-LineMode/2.15 libwww/2.17b3', 'Mozilla/5.0 (iPhone; CPU |
| 2633 |
// iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) |
| 2634 |
// Version/14.1.2 Mobile/15E148 Safari/604.1' |
| 2635 |
UserAgentOriginalKey = attribute.Key("user_agent.original") |
| 2636 |
) |
| 2637 |
|
| 2638 |
// UserAgentOriginal returns an attribute KeyValue conforming to the |
| 2639 |
// "user_agent.original" semantic conventions. It represents the value of the |
| 2640 |
// [HTTP |
| 2641 |
// User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) |
| 2642 |
// header sent by the client. |
| 2643 |
func UserAgentOriginal(val string) attribute.KeyValue { |
| 2644 |
return UserAgentOriginalKey.String(val) |
| 2645 |
} |
| 2646 |
|
| 2647 |
// These attributes may be used to describe the server in a connection-based |
| 2648 |
// network interaction where there is one side that initiates the connection |
| 2649 |
// (the client is the side that initiates the connection). This covers all TCP |
| 2650 |
// network interactions since TCP is connection-based and one side initiates |
| 2651 |
// the connection (an exception is made for peer-to-peer communication over TCP |
| 2652 |
// where the "user-facing" surface of the protocol / API doesn't expose a clear |
| 2653 |
// notion of client and server). This also covers UDP network interactions |
| 2654 |
// where one side initiates the interaction, e.g. QUIC (HTTP/3) and DNS. |
| 2655 |
const ( |
| 2656 |
// ServerAddressKey is the attribute Key conforming to the "server.address" |
| 2657 |
// semantic conventions. It represents the server domain name if available |
| 2658 |
// without reverse DNS lookup; otherwise, IP address or Unix domain socket |
| 2659 |
// name. |
| 2660 |
// |
| 2661 |
// Type: string |
| 2662 |
// RequirementLevel: Optional |
| 2663 |
// Stability: stable |
| 2664 |
// Examples: 'example.com', '10.1.2.80', '/tmp/my.sock' |
| 2665 |
// Note: When observed from the client side, and when communicating through |
| 2666 |
// an intermediary, `server.address` SHOULD represent the server address |
| 2667 |
// behind any intermediaries, for example proxies, if it's available. |
| 2668 |
ServerAddressKey = attribute.Key("server.address") |
| 2669 |
|
| 2670 |
// ServerPortKey is the attribute Key conforming to the "server.port" |
| 2671 |
// semantic conventions. It represents the server port number. |
| 2672 |
// |
| 2673 |
// Type: int |
| 2674 |
// RequirementLevel: Optional |
| 2675 |
// Stability: stable |
| 2676 |
// Examples: 80, 8080, 443 |
| 2677 |
// Note: When observed from the client side, and when communicating through |
| 2678 |
// an intermediary, `server.port` SHOULD represent the server port behind |
| 2679 |
// any intermediaries, for example proxies, if it's available. |
| 2680 |
ServerPortKey = attribute.Key("server.port") |
| 2681 |
) |
| 2682 |
|
| 2683 |
// ServerAddress returns an attribute KeyValue conforming to the |
| 2684 |
// "server.address" semantic conventions. It represents the server domain name |
| 2685 |
// if available without reverse DNS lookup; otherwise, IP address or Unix |
| 2686 |
// domain socket name. |
| 2687 |
func ServerAddress(val string) attribute.KeyValue { |
| 2688 |
return ServerAddressKey.String(val) |
| 2689 |
} |
| 2690 |
|
| 2691 |
// ServerPort returns an attribute KeyValue conforming to the "server.port" |
| 2692 |
// semantic conventions. It represents the server port number. |
| 2693 |
func ServerPort(val int) attribute.KeyValue { |
| 2694 |
return ServerPortKey.Int(val) |
| 2695 |
} |
| 2696 |
|
| 2697 |
// Session is defined as the period of time encompassing all activities |
| 2698 |
// performed by the application and the actions executed by the end user. |
| 2699 |
// Consequently, a Session is represented as a collection of Logs, Events, and |
| 2700 |
// Spans emitted by the Client Application throughout the Session's duration. |
| 2701 |
// Each Session is assigned a unique identifier, which is included as an |
| 2702 |
// attribute in the Logs, Events, and Spans generated during the Session's |
| 2703 |
// lifecycle. |
| 2704 |
// When a session reaches end of life, typically due to user inactivity or |
| 2705 |
// session timeout, a new session identifier will be assigned. The previous |
| 2706 |
// session identifier may be provided by the instrumentation so that telemetry |
| 2707 |
// backends can link the two sessions. |
| 2708 |
const ( |
| 2709 |
// SessionIDKey is the attribute Key conforming to the "session.id" |
| 2710 |
// semantic conventions. It represents a unique id to identify a session. |
| 2711 |
// |
| 2712 |
// Type: string |
| 2713 |
// RequirementLevel: Optional |
| 2714 |
// Stability: experimental |
| 2715 |
// Examples: '00112233-4455-6677-8899-aabbccddeeff' |
| 2716 |
SessionIDKey = attribute.Key("session.id") |
| 2717 |
|
| 2718 |
// SessionPreviousIDKey is the attribute Key conforming to the |
| 2719 |
// "session.previous_id" semantic conventions. It represents the previous |
| 2720 |
// `session.id` for this user, when known. |
| 2721 |
// |
| 2722 |
// Type: string |
| 2723 |
// RequirementLevel: Optional |
| 2724 |
// Stability: experimental |
| 2725 |
// Examples: '00112233-4455-6677-8899-aabbccddeeff' |
| 2726 |
SessionPreviousIDKey = attribute.Key("session.previous_id") |
| 2727 |
) |
| 2728 |
|
| 2729 |
// SessionID returns an attribute KeyValue conforming to the "session.id" |
| 2730 |
// semantic conventions. It represents a unique id to identify a session. |
| 2731 |
func SessionID(val string) attribute.KeyValue { |
| 2732 |
return SessionIDKey.String(val) |
| 2733 |
} |
| 2734 |
|
| 2735 |
// SessionPreviousID returns an attribute KeyValue conforming to the |
| 2736 |
// "session.previous_id" semantic conventions. It represents the previous |
| 2737 |
// `session.id` for this user, when known. |
| 2738 |
func SessionPreviousID(val string) attribute.KeyValue { |
| 2739 |
return SessionPreviousIDKey.String(val) |
| 2740 |
} |
| 2741 |
|
| 2742 |
// These attributes may be used to describe the sender of a network |
| 2743 |
// exchange/packet. These should be used when there is no client/server |
| 2744 |
// relationship between the two sides, or when that relationship is unknown. |
| 2745 |
// This covers low-level network interactions (e.g. packet tracing) where you |
| 2746 |
// don't know if there was a connection or which side initiated it. This also |
| 2747 |
// covers unidirectional UDP flows and peer-to-peer communication where the |
| 2748 |
// "user-facing" surface of the protocol / API doesn't expose a clear notion of |
| 2749 |
// client and server. |
| 2750 |
const ( |
| 2751 |
// SourceAddressKey is the attribute Key conforming to the "source.address" |
| 2752 |
// semantic conventions. It represents the source address - domain name if |
| 2753 |
// available without reverse DNS lookup; otherwise, IP address or Unix |
| 2754 |
// domain socket name. |
| 2755 |
// |
| 2756 |
// Type: string |
| 2757 |
// RequirementLevel: Optional |
| 2758 |
// Stability: experimental |
| 2759 |
// Examples: 'source.example.com', '10.1.2.80', '/tmp/my.sock' |
| 2760 |
// Note: When observed from the destination side, and when communicating |
| 2761 |
// through an intermediary, `source.address` SHOULD represent the source |
| 2762 |
// address behind any intermediaries, for example proxies, if it's |
| 2763 |
// available. |
| 2764 |
SourceAddressKey = attribute.Key("source.address") |
| 2765 |
|
| 2766 |
// SourcePortKey is the attribute Key conforming to the "source.port" |
| 2767 |
// semantic conventions. It represents the source port number |
| 2768 |
// |
| 2769 |
// Type: int |
| 2770 |
// RequirementLevel: Optional |
| 2771 |
// Stability: experimental |
| 2772 |
// Examples: 3389, 2888 |
| 2773 |
SourcePortKey = attribute.Key("source.port") |
| 2774 |
) |
| 2775 |
|
| 2776 |
// SourceAddress returns an attribute KeyValue conforming to the |
| 2777 |
// "source.address" semantic conventions. It represents the source address - |
| 2778 |
// domain name if available without reverse DNS lookup; otherwise, IP address |
| 2779 |
// or Unix domain socket name. |
| 2780 |
func SourceAddress(val string) attribute.KeyValue { |
| 2781 |
return SourceAddressKey.String(val) |
| 2782 |
} |
| 2783 |
|
| 2784 |
// SourcePort returns an attribute KeyValue conforming to the "source.port" |
| 2785 |
// semantic conventions. It represents the source port number |
| 2786 |
func SourcePort(val int) attribute.KeyValue { |
| 2787 |
return SourcePortKey.Int(val) |
| 2788 |
} |