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