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.21.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 // Span attributes used by AWS Lambda (in addition to general `faas` 88 // attributes). 89 const ( 90 // AWSLambdaInvokedARNKey is the attribute Key conforming to the 91 // "aws.lambda.invoked_arn" semantic conventions. It represents the full 92 // invoked ARN as provided on the `Context` passed to the function 93 // (`Lambda-Runtime-Invoked-Function-ARN` header on the 94 // `/runtime/invocation/next` applicable). 95 // 96 // Type: string 97 // RequirementLevel: Optional 98 // Stability: stable 99 // Examples: 'arn:aws:lambda:us-east-1:123456:function:myfunction:myalias' 100 // Note: This may be different from `cloud.resource_id` if an alias is 101 // involved. 102 AWSLambdaInvokedARNKey = attribute.Key("aws.lambda.invoked_arn") 103 ) 104 105 // AWSLambdaInvokedARN returns an attribute KeyValue conforming to the 106 // "aws.lambda.invoked_arn" semantic conventions. It represents the full 107 // invoked ARN as provided on the `Context` passed to the function 108 // (`Lambda-Runtime-Invoked-Function-ARN` header on the 109 // `/runtime/invocation/next` applicable). 110 func AWSLambdaInvokedARN(val string) attribute.KeyValue { 111 return AWSLambdaInvokedARNKey.String(val) 112 } 113 114 // Attributes for CloudEvents. CloudEvents is a specification on how to define 115 // event data in a standard way. These attributes can be attached to spans when 116 // performing operations with CloudEvents, regardless of the protocol being 117 // used. 118 const ( 119 // CloudeventsEventIDKey is the attribute Key conforming to the 120 // "cloudevents.event_id" semantic conventions. It represents the 121 // [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) 122 // uniquely identifies the event. 123 // 124 // Type: string 125 // RequirementLevel: Required 126 // Stability: stable 127 // Examples: '123e4567-e89b-12d3-a456-426614174000', '0001' 128 CloudeventsEventIDKey = attribute.Key("cloudevents.event_id") 129 130 // CloudeventsEventSourceKey is the attribute Key conforming to the 131 // "cloudevents.event_source" semantic conventions. It represents the 132 // [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) 133 // identifies the context in which an event happened. 134 // 135 // Type: string 136 // RequirementLevel: Required 137 // Stability: stable 138 // Examples: 'https://github.com/cloudevents', 139 // '/cloudevents/spec/pull/123', 'my-service' 140 CloudeventsEventSourceKey = attribute.Key("cloudevents.event_source") 141 142 // CloudeventsEventSpecVersionKey is the attribute Key conforming to the 143 // "cloudevents.event_spec_version" semantic conventions. It represents the 144 // [version of the CloudEvents 145 // specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) 146 // which the event uses. 147 // 148 // Type: string 149 // RequirementLevel: Optional 150 // Stability: stable 151 // Examples: '1.0' 152 CloudeventsEventSpecVersionKey = attribute.Key("cloudevents.event_spec_version") 153 154 // CloudeventsEventTypeKey is the attribute Key conforming to the 155 // "cloudevents.event_type" semantic conventions. It represents the 156 // [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) 157 // contains a value describing the type of event related to the originating 158 // occurrence. 159 // 160 // Type: string 161 // RequirementLevel: Optional 162 // Stability: stable 163 // Examples: 'com.github.pull_request.opened', 164 // 'com.example.object.deleted.v2' 165 CloudeventsEventTypeKey = attribute.Key("cloudevents.event_type") 166 167 // CloudeventsEventSubjectKey is the attribute Key conforming to the 168 // "cloudevents.event_subject" semantic conventions. It represents the 169 // [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) 170 // of the event in the context of the event producer (identified by 171 // source). 172 // 173 // Type: string 174 // RequirementLevel: Optional 175 // Stability: stable 176 // Examples: 'mynewfile.jpg' 177 CloudeventsEventSubjectKey = attribute.Key("cloudevents.event_subject") 178 ) 179 180 // CloudeventsEventID returns an attribute KeyValue conforming to the 181 // "cloudevents.event_id" semantic conventions. It represents the 182 // [event_id](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id) 183 // uniquely identifies the event. 184 func CloudeventsEventID(val string) attribute.KeyValue { 185 return CloudeventsEventIDKey.String(val) 186 } 187 188 // CloudeventsEventSource returns an attribute KeyValue conforming to the 189 // "cloudevents.event_source" semantic conventions. It represents the 190 // [source](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1) 191 // identifies the context in which an event happened. 192 func CloudeventsEventSource(val string) attribute.KeyValue { 193 return CloudeventsEventSourceKey.String(val) 194 } 195 196 // CloudeventsEventSpecVersion returns an attribute KeyValue conforming to 197 // the "cloudevents.event_spec_version" semantic conventions. It represents the 198 // [version of the CloudEvents 199 // specification](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion) 200 // which the event uses. 201 func CloudeventsEventSpecVersion(val string) attribute.KeyValue { 202 return CloudeventsEventSpecVersionKey.String(val) 203 } 204 205 // CloudeventsEventType returns an attribute KeyValue conforming to the 206 // "cloudevents.event_type" semantic conventions. It represents the 207 // [event_type](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type) 208 // contains a value describing the type of event related to the originating 209 // occurrence. 210 func CloudeventsEventType(val string) attribute.KeyValue { 211 return CloudeventsEventTypeKey.String(val) 212 } 213 214 // CloudeventsEventSubject returns an attribute KeyValue conforming to the 215 // "cloudevents.event_subject" semantic conventions. It represents the 216 // [subject](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject) 217 // of the event in the context of the event producer (identified by source). 218 func CloudeventsEventSubject(val string) attribute.KeyValue { 219 return CloudeventsEventSubjectKey.String(val) 220 } 221 222 // Semantic conventions for the OpenTracing Shim 223 const ( 224 // OpentracingRefTypeKey is the attribute Key conforming to the 225 // "opentracing.ref_type" semantic conventions. It represents the 226 // parent-child Reference type 227 // 228 // Type: Enum 229 // RequirementLevel: Optional 230 // Stability: stable 231 // Note: The causal relationship between a child Span and a parent Span. 232 OpentracingRefTypeKey = attribute.Key("opentracing.ref_type") 233 ) 234 235 var ( 236 // The parent Span depends on the child Span in some capacity 237 OpentracingRefTypeChildOf = OpentracingRefTypeKey.String("child_of") 238 // The parent Span does not depend in any way on the result of the child Span 239 OpentracingRefTypeFollowsFrom = OpentracingRefTypeKey.String("follows_from") 240 ) 241 242 // The attributes used to perform database client calls. 243 const ( 244 // DBSystemKey is the attribute Key conforming to the "db.system" semantic 245 // conventions. It represents an identifier for the database management 246 // system (DBMS) product being used. See below for a list of well-known 247 // identifiers. 248 // 249 // Type: Enum 250 // RequirementLevel: Required 251 // Stability: stable 252 DBSystemKey = attribute.Key("db.system") 253 254 // DBConnectionStringKey is the attribute Key conforming to the 255 // "db.connection_string" semantic conventions. It represents the 256 // connection string used to connect to the database. It is recommended to 257 // remove embedded credentials. 258 // 259 // Type: string 260 // RequirementLevel: Optional 261 // Stability: stable 262 // Examples: 'Server=(localdb)\\v11.0;Integrated Security=true;' 263 DBConnectionStringKey = attribute.Key("db.connection_string") 264 265 // DBUserKey is the attribute Key conforming to the "db.user" semantic 266 // conventions. It represents the username for accessing the database. 267 // 268 // Type: string 269 // RequirementLevel: Optional 270 // Stability: stable 271 // Examples: 'readonly_user', 'reporting_user' 272 DBUserKey = attribute.Key("db.user") 273 274 // DBJDBCDriverClassnameKey is the attribute Key conforming to the 275 // "db.jdbc.driver_classname" semantic conventions. It represents the 276 // fully-qualified class name of the [Java Database Connectivity 277 // (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) 278 // driver used to connect. 279 // 280 // Type: string 281 // RequirementLevel: Optional 282 // Stability: stable 283 // Examples: 'org.postgresql.Driver', 284 // 'com.microsoft.sqlserver.jdbc.SQLServerDriver' 285 DBJDBCDriverClassnameKey = attribute.Key("db.jdbc.driver_classname") 286 287 // DBNameKey is the attribute Key conforming to the "db.name" semantic 288 // conventions. It represents the this attribute is used to report the name 289 // of the database being accessed. For commands that switch the database, 290 // this should be set to the target database (even if the command fails). 291 // 292 // Type: string 293 // RequirementLevel: ConditionallyRequired (If applicable.) 294 // Stability: stable 295 // Examples: 'customers', 'main' 296 // Note: In some SQL databases, the database name to be used is called 297 // "schema name". In case there are multiple layers that could be 298 // considered for database name (e.g. Oracle instance name and schema 299 // name), the database name to be used is the more specific layer (e.g. 300 // Oracle schema name). 301 DBNameKey = attribute.Key("db.name") 302 303 // DBStatementKey is the attribute Key conforming to the "db.statement" 304 // semantic conventions. It represents the database statement being 305 // executed. 306 // 307 // Type: string 308 // RequirementLevel: Recommended (Should be collected by default only if 309 // there is sanitization that excludes sensitive information.) 310 // Stability: stable 311 // Examples: 'SELECT * FROM wuser_table', 'SET mykey "WuValue"' 312 DBStatementKey = attribute.Key("db.statement") 313 314 // DBOperationKey is the attribute Key conforming to the "db.operation" 315 // semantic conventions. It represents the name of the operation being 316 // executed, e.g. the [MongoDB command 317 // name](https://docs.mongodb.com/manual/reference/command/#database-operations) 318 // such as `findAndModify`, or the SQL keyword. 319 // 320 // Type: string 321 // RequirementLevel: ConditionallyRequired (If `db.statement` is not 322 // applicable.) 323 // Stability: stable 324 // Examples: 'findAndModify', 'HMSET', 'SELECT' 325 // Note: When setting this to an SQL keyword, it is not recommended to 326 // attempt any client-side parsing of `db.statement` just to get this 327 // property, but it should be set if the operation name is provided by the 328 // library being instrumented. If the SQL statement has an ambiguous 329 // operation, or performs more than one operation, this value may be 330 // omitted. 331 DBOperationKey = attribute.Key("db.operation") 332 ) 333 334 var ( 335 // Some other SQL database. Fallback only. See notes 336 DBSystemOtherSQL = DBSystemKey.String("other_sql") 337 // Microsoft SQL Server 338 DBSystemMSSQL = DBSystemKey.String("mssql") 339 // Microsoft SQL Server Compact 340 DBSystemMssqlcompact = DBSystemKey.String("mssqlcompact") 341 // MySQL 342 DBSystemMySQL = DBSystemKey.String("mysql") 343 // Oracle Database 344 DBSystemOracle = DBSystemKey.String("oracle") 345 // IBM DB2 346 DBSystemDB2 = DBSystemKey.String("db2") 347 // PostgreSQL 348 DBSystemPostgreSQL = DBSystemKey.String("postgresql") 349 // Amazon Redshift 350 DBSystemRedshift = DBSystemKey.String("redshift") 351 // Apache Hive 352 DBSystemHive = DBSystemKey.String("hive") 353 // Cloudscape 354 DBSystemCloudscape = DBSystemKey.String("cloudscape") 355 // HyperSQL DataBase 356 DBSystemHSQLDB = DBSystemKey.String("hsqldb") 357 // Progress Database 358 DBSystemProgress = DBSystemKey.String("progress") 359 // SAP MaxDB 360 DBSystemMaxDB = DBSystemKey.String("maxdb") 361 // SAP HANA 362 DBSystemHanaDB = DBSystemKey.String("hanadb") 363 // Ingres 364 DBSystemIngres = DBSystemKey.String("ingres") 365 // FirstSQL 366 DBSystemFirstSQL = DBSystemKey.String("firstsql") 367 // EnterpriseDB 368 DBSystemEDB = DBSystemKey.String("edb") 369 // InterSystems Caché 370 DBSystemCache = DBSystemKey.String("cache") 371 // Adabas (Adaptable Database System) 372 DBSystemAdabas = DBSystemKey.String("adabas") 373 // Firebird 374 DBSystemFirebird = DBSystemKey.String("firebird") 375 // Apache Derby 376 DBSystemDerby = DBSystemKey.String("derby") 377 // FileMaker 378 DBSystemFilemaker = DBSystemKey.String("filemaker") 379 // Informix 380 DBSystemInformix = DBSystemKey.String("informix") 381 // InstantDB 382 DBSystemInstantDB = DBSystemKey.String("instantdb") 383 // InterBase 384 DBSystemInterbase = DBSystemKey.String("interbase") 385 // MariaDB 386 DBSystemMariaDB = DBSystemKey.String("mariadb") 387 // Netezza 388 DBSystemNetezza = DBSystemKey.String("netezza") 389 // Pervasive PSQL 390 DBSystemPervasive = DBSystemKey.String("pervasive") 391 // PointBase 392 DBSystemPointbase = DBSystemKey.String("pointbase") 393 // SQLite 394 DBSystemSqlite = DBSystemKey.String("sqlite") 395 // Sybase 396 DBSystemSybase = DBSystemKey.String("sybase") 397 // Teradata 398 DBSystemTeradata = DBSystemKey.String("teradata") 399 // Vertica 400 DBSystemVertica = DBSystemKey.String("vertica") 401 // H2 402 DBSystemH2 = DBSystemKey.String("h2") 403 // ColdFusion IMQ 404 DBSystemColdfusion = DBSystemKey.String("coldfusion") 405 // Apache Cassandra 406 DBSystemCassandra = DBSystemKey.String("cassandra") 407 // Apache HBase 408 DBSystemHBase = DBSystemKey.String("hbase") 409 // MongoDB 410 DBSystemMongoDB = DBSystemKey.String("mongodb") 411 // Redis 412 DBSystemRedis = DBSystemKey.String("redis") 413 // Couchbase 414 DBSystemCouchbase = DBSystemKey.String("couchbase") 415 // CouchDB 416 DBSystemCouchDB = DBSystemKey.String("couchdb") 417 // Microsoft Azure Cosmos DB 418 DBSystemCosmosDB = DBSystemKey.String("cosmosdb") 419 // Amazon DynamoDB 420 DBSystemDynamoDB = DBSystemKey.String("dynamodb") 421 // Neo4j 422 DBSystemNeo4j = DBSystemKey.String("neo4j") 423 // Apache Geode 424 DBSystemGeode = DBSystemKey.String("geode") 425 // Elasticsearch 426 DBSystemElasticsearch = DBSystemKey.String("elasticsearch") 427 // Memcached 428 DBSystemMemcached = DBSystemKey.String("memcached") 429 // CockroachDB 430 DBSystemCockroachdb = DBSystemKey.String("cockroachdb") 431 // OpenSearch 432 DBSystemOpensearch = DBSystemKey.String("opensearch") 433 // ClickHouse 434 DBSystemClickhouse = DBSystemKey.String("clickhouse") 435 // Cloud Spanner 436 DBSystemSpanner = DBSystemKey.String("spanner") 437 // Trino 438 DBSystemTrino = DBSystemKey.String("trino") 439 ) 440 441 // DBConnectionString returns an attribute KeyValue conforming to the 442 // "db.connection_string" semantic conventions. It represents the connection 443 // string used to connect to the database. It is recommended to remove embedded 444 // credentials. 445 func DBConnectionString(val string) attribute.KeyValue { 446 return DBConnectionStringKey.String(val) 447 } 448 449 // DBUser returns an attribute KeyValue conforming to the "db.user" semantic 450 // conventions. It represents the username for accessing the database. 451 func DBUser(val string) attribute.KeyValue { 452 return DBUserKey.String(val) 453 } 454 455 // DBJDBCDriverClassname returns an attribute KeyValue conforming to the 456 // "db.jdbc.driver_classname" semantic conventions. It represents the 457 // fully-qualified class name of the [Java Database Connectivity 458 // (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver 459 // used to connect. 460 func DBJDBCDriverClassname(val string) attribute.KeyValue { 461 return DBJDBCDriverClassnameKey.String(val) 462 } 463 464 // DBName returns an attribute KeyValue conforming to the "db.name" semantic 465 // conventions. It represents the this attribute is used to report the name of 466 // the database being accessed. For commands that switch the database, this 467 // should be set to the target database (even if the command fails). 468 func DBName(val string) attribute.KeyValue { 469 return DBNameKey.String(val) 470 } 471 472 // DBStatement returns an attribute KeyValue conforming to the 473 // "db.statement" semantic conventions. It represents the database statement 474 // being executed. 475 func DBStatement(val string) attribute.KeyValue { 476 return DBStatementKey.String(val) 477 } 478 479 // DBOperation returns an attribute KeyValue conforming to the 480 // "db.operation" semantic conventions. It represents the name of the operation 481 // being executed, e.g. the [MongoDB command 482 // name](https://docs.mongodb.com/manual/reference/command/#database-operations) 483 // such as `findAndModify`, or the SQL keyword. 484 func DBOperation(val string) attribute.KeyValue { 485 return DBOperationKey.String(val) 486 } 487 488 // Connection-level attributes for Microsoft SQL Server 489 const ( 490 // DBMSSQLInstanceNameKey is the attribute Key conforming to the 491 // "db.mssql.instance_name" semantic conventions. It represents the 492 // Microsoft SQL Server [instance 493 // name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) 494 // connecting to. This name is used to determine the port of a named 495 // instance. 496 // 497 // Type: string 498 // RequirementLevel: Optional 499 // Stability: stable 500 // Examples: 'MSSQLSERVER' 501 // Note: If setting a `db.mssql.instance_name`, `server.port` is no longer 502 // required (but still recommended if non-standard). 503 DBMSSQLInstanceNameKey = attribute.Key("db.mssql.instance_name") 504 ) 505 506 // DBMSSQLInstanceName returns an attribute KeyValue conforming to the 507 // "db.mssql.instance_name" semantic conventions. It represents the Microsoft 508 // SQL Server [instance 509 // name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) 510 // connecting to. This name is used to determine the port of a named instance. 511 func DBMSSQLInstanceName(val string) attribute.KeyValue { 512 return DBMSSQLInstanceNameKey.String(val) 513 } 514 515 // Call-level attributes for Cassandra 516 const ( 517 // DBCassandraPageSizeKey is the attribute Key conforming to the 518 // "db.cassandra.page_size" semantic conventions. It represents the fetch 519 // size used for paging, i.e. how many rows will be returned at once. 520 // 521 // Type: int 522 // RequirementLevel: Optional 523 // Stability: stable 524 // Examples: 5000 525 DBCassandraPageSizeKey = attribute.Key("db.cassandra.page_size") 526 527 // DBCassandraConsistencyLevelKey is the attribute Key conforming to the 528 // "db.cassandra.consistency_level" semantic conventions. It represents the 529 // consistency level of the query. Based on consistency values from 530 // [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). 531 // 532 // Type: Enum 533 // RequirementLevel: Optional 534 // Stability: stable 535 DBCassandraConsistencyLevelKey = attribute.Key("db.cassandra.consistency_level") 536 537 // DBCassandraTableKey is the attribute Key conforming to the 538 // "db.cassandra.table" semantic conventions. It represents the name of the 539 // primary table that the operation is acting upon, including the keyspace 540 // name (if applicable). 541 // 542 // Type: string 543 // RequirementLevel: Recommended 544 // Stability: stable 545 // Examples: 'mytable' 546 // Note: This mirrors the db.sql.table attribute but references cassandra 547 // rather than sql. It is not recommended to attempt any client-side 548 // parsing of `db.statement` just to get this property, but it should be 549 // set if it is provided by the library being instrumented. If the 550 // operation is acting upon an anonymous table, or more than one table, 551 // this value MUST NOT be set. 552 DBCassandraTableKey = attribute.Key("db.cassandra.table") 553 554 // DBCassandraIdempotenceKey is the attribute Key conforming to the 555 // "db.cassandra.idempotence" semantic conventions. It represents the 556 // whether or not the query is idempotent. 557 // 558 // Type: boolean 559 // RequirementLevel: Optional 560 // Stability: stable 561 DBCassandraIdempotenceKey = attribute.Key("db.cassandra.idempotence") 562 563 // DBCassandraSpeculativeExecutionCountKey is the attribute Key conforming 564 // to the "db.cassandra.speculative_execution_count" semantic conventions. 565 // It represents the number of times a query was speculatively executed. 566 // Not set or `0` if the query was not executed speculatively. 567 // 568 // Type: int 569 // RequirementLevel: Optional 570 // Stability: stable 571 // Examples: 0, 2 572 DBCassandraSpeculativeExecutionCountKey = attribute.Key("db.cassandra.speculative_execution_count") 573 574 // DBCassandraCoordinatorIDKey is the attribute Key conforming to the 575 // "db.cassandra.coordinator.id" semantic conventions. It represents the ID 576 // of the coordinating node for a query. 577 // 578 // Type: string 579 // RequirementLevel: Optional 580 // Stability: stable 581 // Examples: 'be13faa2-8574-4d71-926d-27f16cf8a7af' 582 DBCassandraCoordinatorIDKey = attribute.Key("db.cassandra.coordinator.id") 583 584 // DBCassandraCoordinatorDCKey is the attribute Key conforming to the 585 // "db.cassandra.coordinator.dc" semantic conventions. It represents the 586 // data center of the coordinating node for a query. 587 // 588 // Type: string 589 // RequirementLevel: Optional 590 // Stability: stable 591 // Examples: 'us-west-2' 592 DBCassandraCoordinatorDCKey = attribute.Key("db.cassandra.coordinator.dc") 593 ) 594 595 var ( 596 // all 597 DBCassandraConsistencyLevelAll = DBCassandraConsistencyLevelKey.String("all") 598 // each_quorum 599 DBCassandraConsistencyLevelEachQuorum = DBCassandraConsistencyLevelKey.String("each_quorum") 600 // quorum 601 DBCassandraConsistencyLevelQuorum = DBCassandraConsistencyLevelKey.String("quorum") 602 // local_quorum 603 DBCassandraConsistencyLevelLocalQuorum = DBCassandraConsistencyLevelKey.String("local_quorum") 604 // one 605 DBCassandraConsistencyLevelOne = DBCassandraConsistencyLevelKey.String("one") 606 // two 607 DBCassandraConsistencyLevelTwo = DBCassandraConsistencyLevelKey.String("two") 608 // three 609 DBCassandraConsistencyLevelThree = DBCassandraConsistencyLevelKey.String("three") 610 // local_one 611 DBCassandraConsistencyLevelLocalOne = DBCassandraConsistencyLevelKey.String("local_one") 612 // any 613 DBCassandraConsistencyLevelAny = DBCassandraConsistencyLevelKey.String("any") 614 // serial 615 DBCassandraConsistencyLevelSerial = DBCassandraConsistencyLevelKey.String("serial") 616 // local_serial 617 DBCassandraConsistencyLevelLocalSerial = DBCassandraConsistencyLevelKey.String("local_serial") 618 ) 619 620 // DBCassandraPageSize returns an attribute KeyValue conforming to the 621 // "db.cassandra.page_size" semantic conventions. It represents the fetch size 622 // used for paging, i.e. how many rows will be returned at once. 623 func DBCassandraPageSize(val int) attribute.KeyValue { 624 return DBCassandraPageSizeKey.Int(val) 625 } 626 627 // DBCassandraTable returns an attribute KeyValue conforming to the 628 // "db.cassandra.table" semantic conventions. It represents the name of the 629 // primary table that the operation is acting upon, including the keyspace name 630 // (if applicable). 631 func DBCassandraTable(val string) attribute.KeyValue { 632 return DBCassandraTableKey.String(val) 633 } 634 635 // DBCassandraIdempotence returns an attribute KeyValue conforming to the 636 // "db.cassandra.idempotence" semantic conventions. It represents the whether 637 // or not the query is idempotent. 638 func DBCassandraIdempotence(val bool) attribute.KeyValue { 639 return DBCassandraIdempotenceKey.Bool(val) 640 } 641 642 // DBCassandraSpeculativeExecutionCount returns an attribute KeyValue 643 // conforming to the "db.cassandra.speculative_execution_count" semantic 644 // conventions. It represents the number of times a query was speculatively 645 // executed. Not set or `0` if the query was not executed speculatively. 646 func DBCassandraSpeculativeExecutionCount(val int) attribute.KeyValue { 647 return DBCassandraSpeculativeExecutionCountKey.Int(val) 648 } 649 650 // DBCassandraCoordinatorID returns an attribute KeyValue conforming to the 651 // "db.cassandra.coordinator.id" semantic conventions. It represents the ID of 652 // the coordinating node for a query. 653 func DBCassandraCoordinatorID(val string) attribute.KeyValue { 654 return DBCassandraCoordinatorIDKey.String(val) 655 } 656 657 // DBCassandraCoordinatorDC returns an attribute KeyValue conforming to the 658 // "db.cassandra.coordinator.dc" semantic conventions. It represents the data 659 // center of the coordinating node for a query. 660 func DBCassandraCoordinatorDC(val string) attribute.KeyValue { 661 return DBCassandraCoordinatorDCKey.String(val) 662 } 663 664 // Call-level attributes for Redis 665 const ( 666 // DBRedisDBIndexKey is the attribute Key conforming to the 667 // "db.redis.database_index" semantic conventions. It represents the index 668 // of the database being accessed as used in the [`SELECT` 669 // command](https://redis.io/commands/select), provided as an integer. To 670 // be used instead of the generic `db.name` attribute. 671 // 672 // Type: int 673 // RequirementLevel: ConditionallyRequired (If other than the default 674 // database (`0`).) 675 // Stability: stable 676 // Examples: 0, 1, 15 677 DBRedisDBIndexKey = attribute.Key("db.redis.database_index") 678 ) 679 680 // DBRedisDBIndex returns an attribute KeyValue conforming to the 681 // "db.redis.database_index" semantic conventions. It represents the index of 682 // the database being accessed as used in the [`SELECT` 683 // command](https://redis.io/commands/select), provided as an integer. To be 684 // used instead of the generic `db.name` attribute. 685 func DBRedisDBIndex(val int) attribute.KeyValue { 686 return DBRedisDBIndexKey.Int(val) 687 } 688 689 // Call-level attributes for MongoDB 690 const ( 691 // DBMongoDBCollectionKey is the attribute Key conforming to the 692 // "db.mongodb.collection" semantic conventions. It represents the 693 // collection being accessed within the database stated in `db.name`. 694 // 695 // Type: string 696 // RequirementLevel: Required 697 // Stability: stable 698 // Examples: 'customers', 'products' 699 DBMongoDBCollectionKey = attribute.Key("db.mongodb.collection") 700 ) 701 702 // DBMongoDBCollection returns an attribute KeyValue conforming to the 703 // "db.mongodb.collection" semantic conventions. It represents the collection 704 // being accessed within the database stated in `db.name`. 705 func DBMongoDBCollection(val string) attribute.KeyValue { 706 return DBMongoDBCollectionKey.String(val) 707 } 708 709 // Call-level attributes for SQL databases 710 const ( 711 // DBSQLTableKey is the attribute Key conforming to the "db.sql.table" 712 // semantic conventions. It represents the name of the primary table that 713 // the operation is acting upon, including the database name (if 714 // applicable). 715 // 716 // Type: string 717 // RequirementLevel: Recommended 718 // Stability: stable 719 // Examples: 'public.users', 'customers' 720 // Note: It is not recommended to attempt any client-side parsing of 721 // `db.statement` just to get this property, but it should be set if it is 722 // provided by the library being instrumented. If the operation is acting 723 // upon an anonymous table, or more than one table, this value MUST NOT be 724 // set. 725 DBSQLTableKey = attribute.Key("db.sql.table") 726 ) 727 728 // DBSQLTable returns an attribute KeyValue conforming to the "db.sql.table" 729 // semantic conventions. It represents the name of the primary table that the 730 // operation is acting upon, including the database name (if applicable). 731 func DBSQLTable(val string) attribute.KeyValue { 732 return DBSQLTableKey.String(val) 733 } 734 735 // Call-level attributes for Cosmos DB. 736 const ( 737 // DBCosmosDBClientIDKey is the attribute Key conforming to the 738 // "db.cosmosdb.client_id" semantic conventions. It represents the unique 739 // Cosmos client instance id. 740 // 741 // Type: string 742 // RequirementLevel: Optional 743 // Stability: stable 744 // Examples: '3ba4827d-4422-483f-b59f-85b74211c11d' 745 DBCosmosDBClientIDKey = attribute.Key("db.cosmosdb.client_id") 746 747 // DBCosmosDBOperationTypeKey is the attribute Key conforming to the 748 // "db.cosmosdb.operation_type" semantic conventions. It represents the 749 // cosmosDB Operation Type. 750 // 751 // Type: Enum 752 // RequirementLevel: ConditionallyRequired (when performing one of the 753 // operations in this list) 754 // Stability: stable 755 DBCosmosDBOperationTypeKey = attribute.Key("db.cosmosdb.operation_type") 756 757 // DBCosmosDBConnectionModeKey is the attribute Key conforming to the 758 // "db.cosmosdb.connection_mode" semantic conventions. It represents the 759 // cosmos client connection mode. 760 // 761 // Type: Enum 762 // RequirementLevel: ConditionallyRequired (if not `direct` (or pick gw as 763 // default)) 764 // Stability: stable 765 DBCosmosDBConnectionModeKey = attribute.Key("db.cosmosdb.connection_mode") 766 767 // DBCosmosDBContainerKey is the attribute Key conforming to the 768 // "db.cosmosdb.container" semantic conventions. It represents the cosmos 769 // DB container name. 770 // 771 // Type: string 772 // RequirementLevel: ConditionallyRequired (if available) 773 // Stability: stable 774 // Examples: 'anystring' 775 DBCosmosDBContainerKey = attribute.Key("db.cosmosdb.container") 776 777 // DBCosmosDBRequestContentLengthKey is the attribute Key conforming to the 778 // "db.cosmosdb.request_content_length" semantic conventions. It represents 779 // the request payload size in bytes 780 // 781 // Type: int 782 // RequirementLevel: Optional 783 // Stability: stable 784 DBCosmosDBRequestContentLengthKey = attribute.Key("db.cosmosdb.request_content_length") 785 786 // DBCosmosDBStatusCodeKey is the attribute Key conforming to the 787 // "db.cosmosdb.status_code" semantic conventions. It represents the cosmos 788 // DB status code. 789 // 790 // Type: int 791 // RequirementLevel: ConditionallyRequired (if response was received) 792 // Stability: stable 793 // Examples: 200, 201 794 DBCosmosDBStatusCodeKey = attribute.Key("db.cosmosdb.status_code") 795 796 // DBCosmosDBSubStatusCodeKey is the attribute Key conforming to the 797 // "db.cosmosdb.sub_status_code" semantic conventions. It represents the 798 // cosmos DB sub status code. 799 // 800 // Type: int 801 // RequirementLevel: ConditionallyRequired (when response was received and 802 // contained sub-code.) 803 // Stability: stable 804 // Examples: 1000, 1002 805 DBCosmosDBSubStatusCodeKey = attribute.Key("db.cosmosdb.sub_status_code") 806 807 // DBCosmosDBRequestChargeKey is the attribute Key conforming to the 808 // "db.cosmosdb.request_charge" semantic conventions. It represents the rU 809 // consumed for that operation 810 // 811 // Type: double 812 // RequirementLevel: ConditionallyRequired (when available) 813 // Stability: stable 814 // Examples: 46.18, 1.0 815 DBCosmosDBRequestChargeKey = attribute.Key("db.cosmosdb.request_charge") 816 ) 817 818 var ( 819 // invalid 820 DBCosmosDBOperationTypeInvalid = DBCosmosDBOperationTypeKey.String("Invalid") 821 // create 822 DBCosmosDBOperationTypeCreate = DBCosmosDBOperationTypeKey.String("Create") 823 // patch 824 DBCosmosDBOperationTypePatch = DBCosmosDBOperationTypeKey.String("Patch") 825 // read 826 DBCosmosDBOperationTypeRead = DBCosmosDBOperationTypeKey.String("Read") 827 // read_feed 828 DBCosmosDBOperationTypeReadFeed = DBCosmosDBOperationTypeKey.String("ReadFeed") 829 // delete 830 DBCosmosDBOperationTypeDelete = DBCosmosDBOperationTypeKey.String("Delete") 831 // replace 832 DBCosmosDBOperationTypeReplace = DBCosmosDBOperationTypeKey.String("Replace") 833 // execute 834 DBCosmosDBOperationTypeExecute = DBCosmosDBOperationTypeKey.String("Execute") 835 // query 836 DBCosmosDBOperationTypeQuery = DBCosmosDBOperationTypeKey.String("Query") 837 // head 838 DBCosmosDBOperationTypeHead = DBCosmosDBOperationTypeKey.String("Head") 839 // head_feed 840 DBCosmosDBOperationTypeHeadFeed = DBCosmosDBOperationTypeKey.String("HeadFeed") 841 // upsert 842 DBCosmosDBOperationTypeUpsert = DBCosmosDBOperationTypeKey.String("Upsert") 843 // batch 844 DBCosmosDBOperationTypeBatch = DBCosmosDBOperationTypeKey.String("Batch") 845 // query_plan 846 DBCosmosDBOperationTypeQueryPlan = DBCosmosDBOperationTypeKey.String("QueryPlan") 847 // execute_javascript 848 DBCosmosDBOperationTypeExecuteJavascript = DBCosmosDBOperationTypeKey.String("ExecuteJavaScript") 849 ) 850 851 var ( 852 // Gateway (HTTP) connections mode 853 DBCosmosDBConnectionModeGateway = DBCosmosDBConnectionModeKey.String("gateway") 854 // Direct connection 855 DBCosmosDBConnectionModeDirect = DBCosmosDBConnectionModeKey.String("direct") 856 ) 857 858 // DBCosmosDBClientID returns an attribute KeyValue conforming to the 859 // "db.cosmosdb.client_id" semantic conventions. It represents the unique 860 // Cosmos client instance id. 861 func DBCosmosDBClientID(val string) attribute.KeyValue { 862 return DBCosmosDBClientIDKey.String(val) 863 } 864 865 // DBCosmosDBContainer returns an attribute KeyValue conforming to the 866 // "db.cosmosdb.container" semantic conventions. It represents the cosmos DB 867 // container name. 868 func DBCosmosDBContainer(val string) attribute.KeyValue { 869 return DBCosmosDBContainerKey.String(val) 870 } 871 872 // DBCosmosDBRequestContentLength returns an attribute KeyValue conforming 873 // to the "db.cosmosdb.request_content_length" semantic conventions. It 874 // represents the request payload size in bytes 875 func DBCosmosDBRequestContentLength(val int) attribute.KeyValue { 876 return DBCosmosDBRequestContentLengthKey.Int(val) 877 } 878 879 // DBCosmosDBStatusCode returns an attribute KeyValue conforming to the 880 // "db.cosmosdb.status_code" semantic conventions. It represents the cosmos DB 881 // status code. 882 func DBCosmosDBStatusCode(val int) attribute.KeyValue { 883 return DBCosmosDBStatusCodeKey.Int(val) 884 } 885 886 // DBCosmosDBSubStatusCode returns an attribute KeyValue conforming to the 887 // "db.cosmosdb.sub_status_code" semantic conventions. It represents the cosmos 888 // DB sub status code. 889 func DBCosmosDBSubStatusCode(val int) attribute.KeyValue { 890 return DBCosmosDBSubStatusCodeKey.Int(val) 891 } 892 893 // DBCosmosDBRequestCharge returns an attribute KeyValue conforming to the 894 // "db.cosmosdb.request_charge" semantic conventions. It represents the rU 895 // consumed for that operation 896 func DBCosmosDBRequestCharge(val float64) attribute.KeyValue { 897 return DBCosmosDBRequestChargeKey.Float64(val) 898 } 899 900 // Span attributes used by non-OTLP exporters to represent OpenTelemetry Span's 901 // concepts. 902 const ( 903 // OTelStatusCodeKey is the attribute Key conforming to the 904 // "otel.status_code" semantic conventions. It represents the name of the 905 // code, either "OK" or "ERROR". MUST NOT be set if the status code is 906 // UNSET. 907 // 908 // Type: Enum 909 // RequirementLevel: Optional 910 // Stability: stable 911 OTelStatusCodeKey = attribute.Key("otel.status_code") 912 913 // OTelStatusDescriptionKey is the attribute Key conforming to the 914 // "otel.status_description" semantic conventions. It represents the 915 // description of the Status if it has a value, otherwise not set. 916 // 917 // Type: string 918 // RequirementLevel: Optional 919 // Stability: stable 920 // Examples: 'resource not found' 921 OTelStatusDescriptionKey = attribute.Key("otel.status_description") 922 ) 923 924 var ( 925 // The operation has been validated by an Application developer or Operator to have completed successfully 926 OTelStatusCodeOk = OTelStatusCodeKey.String("OK") 927 // The operation contains an error 928 OTelStatusCodeError = OTelStatusCodeKey.String("ERROR") 929 ) 930 931 // OTelStatusDescription returns an attribute KeyValue conforming to the 932 // "otel.status_description" semantic conventions. It represents the 933 // description of the Status if it has a value, otherwise not set. 934 func OTelStatusDescription(val string) attribute.KeyValue { 935 return OTelStatusDescriptionKey.String(val) 936 } 937 938 // This semantic convention describes an instance of a function that runs 939 // without provisioning or managing of servers (also known as serverless 940 // functions or Function as a Service (FaaS)) with spans. 941 const ( 942 // FaaSTriggerKey is the attribute Key conforming to the "faas.trigger" 943 // semantic conventions. It represents the type of the trigger which caused 944 // this function invocation. 945 // 946 // Type: Enum 947 // RequirementLevel: Optional 948 // Stability: stable 949 // Note: For the server/consumer span on the incoming side, 950 // `faas.trigger` MUST be set. 951 // 952 // Clients invoking FaaS instances usually cannot set `faas.trigger`, 953 // since they would typically need to look in the payload to determine 954 // the event type. If clients set it, it should be the same as the 955 // trigger that corresponding incoming would have (i.e., this has 956 // nothing to do with the underlying transport used to make the API 957 // call to invoke the lambda, which is often HTTP). 958 FaaSTriggerKey = attribute.Key("faas.trigger") 959 960 // FaaSInvocationIDKey is the attribute Key conforming to the 961 // "faas.invocation_id" semantic conventions. It represents the invocation 962 // ID of the current function invocation. 963 // 964 // Type: string 965 // RequirementLevel: Optional 966 // Stability: stable 967 // Examples: 'af9d5aa4-a685-4c5f-a22b-444f80b3cc28' 968 FaaSInvocationIDKey = attribute.Key("faas.invocation_id") 969 ) 970 971 var ( 972 // A response to some data source operation such as a database or filesystem read/write 973 FaaSTriggerDatasource = FaaSTriggerKey.String("datasource") 974 // To provide an answer to an inbound HTTP request 975 FaaSTriggerHTTP = FaaSTriggerKey.String("http") 976 // A function is set to be executed when messages are sent to a messaging system 977 FaaSTriggerPubsub = FaaSTriggerKey.String("pubsub") 978 // A function is scheduled to be executed regularly 979 FaaSTriggerTimer = FaaSTriggerKey.String("timer") 980 // If none of the others apply 981 FaaSTriggerOther = FaaSTriggerKey.String("other") 982 ) 983 984 // FaaSInvocationID returns an attribute KeyValue conforming to the 985 // "faas.invocation_id" semantic conventions. It represents the invocation ID 986 // of the current function invocation. 987 func FaaSInvocationID(val string) attribute.KeyValue { 988 return FaaSInvocationIDKey.String(val) 989 } 990 991 // Semantic Convention for FaaS triggered as a response to some data source 992 // operation such as a database or filesystem read/write. 993 const ( 994 // FaaSDocumentCollectionKey is the attribute Key conforming to the 995 // "faas.document.collection" semantic conventions. It represents the name 996 // of the source on which the triggering operation was performed. For 997 // example, in Cloud Storage or S3 corresponds to the bucket name, and in 998 // Cosmos DB to the database name. 999 // 1000 // Type: string 1001 // RequirementLevel: Required 1002 // Stability: stable 1003 // Examples: 'myBucketName', 'myDBName' 1004 FaaSDocumentCollectionKey = attribute.Key("faas.document.collection") 1005 1006 // FaaSDocumentOperationKey is the attribute Key conforming to the 1007 // "faas.document.operation" semantic conventions. It represents the 1008 // describes the type of the operation that was performed on the data. 1009 // 1010 // Type: Enum 1011 // RequirementLevel: Required 1012 // Stability: stable 1013 FaaSDocumentOperationKey = attribute.Key("faas.document.operation") 1014 1015 // FaaSDocumentTimeKey is the attribute Key conforming to the 1016 // "faas.document.time" semantic conventions. It represents a string 1017 // containing the time when the data was accessed in the [ISO 1018 // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format 1019 // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). 1020 // 1021 // Type: string 1022 // RequirementLevel: Optional 1023 // Stability: stable 1024 // Examples: '2020-01-23T13:47:06Z' 1025 FaaSDocumentTimeKey = attribute.Key("faas.document.time") 1026 1027 // FaaSDocumentNameKey is the attribute Key conforming to the 1028 // "faas.document.name" semantic conventions. It represents the document 1029 // name/table subjected to the operation. For example, in Cloud Storage or 1030 // S3 is the name of the file, and in Cosmos DB the table name. 1031 // 1032 // Type: string 1033 // RequirementLevel: Optional 1034 // Stability: stable 1035 // Examples: 'myFile.txt', 'myTableName' 1036 FaaSDocumentNameKey = attribute.Key("faas.document.name") 1037 ) 1038 1039 var ( 1040 // When a new object is created 1041 FaaSDocumentOperationInsert = FaaSDocumentOperationKey.String("insert") 1042 // When an object is modified 1043 FaaSDocumentOperationEdit = FaaSDocumentOperationKey.String("edit") 1044 // When an object is deleted 1045 FaaSDocumentOperationDelete = FaaSDocumentOperationKey.String("delete") 1046 ) 1047 1048 // FaaSDocumentCollection returns an attribute KeyValue conforming to the 1049 // "faas.document.collection" semantic conventions. It represents the name of 1050 // the source on which the triggering operation was performed. For example, in 1051 // Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the 1052 // database name. 1053 func FaaSDocumentCollection(val string) attribute.KeyValue { 1054 return FaaSDocumentCollectionKey.String(val) 1055 } 1056 1057 // FaaSDocumentTime returns an attribute KeyValue conforming to the 1058 // "faas.document.time" semantic conventions. It represents a string containing 1059 // the time when the data was accessed in the [ISO 1060 // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format 1061 // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). 1062 func FaaSDocumentTime(val string) attribute.KeyValue { 1063 return FaaSDocumentTimeKey.String(val) 1064 } 1065 1066 // FaaSDocumentName returns an attribute KeyValue conforming to the 1067 // "faas.document.name" semantic conventions. It represents the document 1068 // name/table subjected to the operation. For example, in Cloud Storage or S3 1069 // is the name of the file, and in Cosmos DB the table name. 1070 func FaaSDocumentName(val string) attribute.KeyValue { 1071 return FaaSDocumentNameKey.String(val) 1072 } 1073 1074 // Semantic Convention for FaaS scheduled to be executed regularly. 1075 const ( 1076 // FaaSTimeKey is the attribute Key conforming to the "faas.time" semantic 1077 // conventions. It represents a string containing the function invocation 1078 // time in the [ISO 1079 // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format 1080 // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). 1081 // 1082 // Type: string 1083 // RequirementLevel: Optional 1084 // Stability: stable 1085 // Examples: '2020-01-23T13:47:06Z' 1086 FaaSTimeKey = attribute.Key("faas.time") 1087 1088 // FaaSCronKey is the attribute Key conforming to the "faas.cron" semantic 1089 // conventions. It represents a string containing the schedule period as 1090 // [Cron 1091 // Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). 1092 // 1093 // Type: string 1094 // RequirementLevel: Optional 1095 // Stability: stable 1096 // Examples: '0/5 * * * ? *' 1097 FaaSCronKey = attribute.Key("faas.cron") 1098 ) 1099 1100 // FaaSTime returns an attribute KeyValue conforming to the "faas.time" 1101 // semantic conventions. It represents a string containing the function 1102 // invocation time in the [ISO 1103 // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format 1104 // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). 1105 func FaaSTime(val string) attribute.KeyValue { 1106 return FaaSTimeKey.String(val) 1107 } 1108 1109 // FaaSCron returns an attribute KeyValue conforming to the "faas.cron" 1110 // semantic conventions. It represents a string containing the schedule period 1111 // as [Cron 1112 // Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). 1113 func FaaSCron(val string) attribute.KeyValue { 1114 return FaaSCronKey.String(val) 1115 } 1116 1117 // Contains additional attributes for incoming FaaS spans. 1118 const ( 1119 // FaaSColdstartKey is the attribute Key conforming to the "faas.coldstart" 1120 // semantic conventions. It represents a boolean that is true if the 1121 // serverless function is executed for the first time (aka cold-start). 1122 // 1123 // Type: boolean 1124 // RequirementLevel: Optional 1125 // Stability: stable 1126 FaaSColdstartKey = attribute.Key("faas.coldstart") 1127 ) 1128 1129 // FaaSColdstart returns an attribute KeyValue conforming to the 1130 // "faas.coldstart" semantic conventions. It represents a boolean that is true 1131 // if the serverless function is executed for the first time (aka cold-start). 1132 func FaaSColdstart(val bool) attribute.KeyValue { 1133 return FaaSColdstartKey.Bool(val) 1134 } 1135 1136 // Contains additional attributes for outgoing FaaS spans. 1137 const ( 1138 // FaaSInvokedNameKey is the attribute Key conforming to the 1139 // "faas.invoked_name" semantic conventions. It represents the name of the 1140 // invoked function. 1141 // 1142 // Type: string 1143 // RequirementLevel: Required 1144 // Stability: stable 1145 // Examples: 'my-function' 1146 // Note: SHOULD be equal to the `faas.name` resource attribute of the 1147 // invoked function. 1148 FaaSInvokedNameKey = attribute.Key("faas.invoked_name") 1149 1150 // FaaSInvokedProviderKey is the attribute Key conforming to the 1151 // "faas.invoked_provider" semantic conventions. It represents the cloud 1152 // provider of the invoked function. 1153 // 1154 // Type: Enum 1155 // RequirementLevel: Required 1156 // Stability: stable 1157 // Note: SHOULD be equal to the `cloud.provider` resource attribute of the 1158 // invoked function. 1159 FaaSInvokedProviderKey = attribute.Key("faas.invoked_provider") 1160 1161 // FaaSInvokedRegionKey is the attribute Key conforming to the 1162 // "faas.invoked_region" semantic conventions. It represents the cloud 1163 // region of the invoked function. 1164 // 1165 // Type: string 1166 // RequirementLevel: ConditionallyRequired (For some cloud providers, like 1167 // AWS or GCP, the region in which a function is hosted is essential to 1168 // uniquely identify the function and also part of its endpoint. Since it's 1169 // part of the endpoint being called, the region is always known to 1170 // clients. In these cases, `faas.invoked_region` MUST be set accordingly. 1171 // If the region is unknown to the client or not required for identifying 1172 // the invoked function, setting `faas.invoked_region` is optional.) 1173 // Stability: stable 1174 // Examples: 'eu-central-1' 1175 // Note: SHOULD be equal to the `cloud.region` resource attribute of the 1176 // invoked function. 1177 FaaSInvokedRegionKey = attribute.Key("faas.invoked_region") 1178 ) 1179 1180 var ( 1181 // Alibaba Cloud 1182 FaaSInvokedProviderAlibabaCloud = FaaSInvokedProviderKey.String("alibaba_cloud") 1183 // Amazon Web Services 1184 FaaSInvokedProviderAWS = FaaSInvokedProviderKey.String("aws") 1185 // Microsoft Azure 1186 FaaSInvokedProviderAzure = FaaSInvokedProviderKey.String("azure") 1187 // Google Cloud Platform 1188 FaaSInvokedProviderGCP = FaaSInvokedProviderKey.String("gcp") 1189 // Tencent Cloud 1190 FaaSInvokedProviderTencentCloud = FaaSInvokedProviderKey.String("tencent_cloud") 1191 ) 1192 1193 // FaaSInvokedName returns an attribute KeyValue conforming to the 1194 // "faas.invoked_name" semantic conventions. It represents the name of the 1195 // invoked function. 1196 func FaaSInvokedName(val string) attribute.KeyValue { 1197 return FaaSInvokedNameKey.String(val) 1198 } 1199 1200 // FaaSInvokedRegion returns an attribute KeyValue conforming to the 1201 // "faas.invoked_region" semantic conventions. It represents the cloud region 1202 // of the invoked function. 1203 func FaaSInvokedRegion(val string) attribute.KeyValue { 1204 return FaaSInvokedRegionKey.String(val) 1205 } 1206 1207 // Operations that access some remote service. 1208 const ( 1209 // PeerServiceKey is the attribute Key conforming to the "peer.service" 1210 // semantic conventions. It represents the 1211 // [`service.name`](/docs/resource/README.md#service) of the remote 1212 // service. SHOULD be equal to the actual `service.name` resource attribute 1213 // of the remote service if any. 1214 // 1215 // Type: string 1216 // RequirementLevel: Optional 1217 // Stability: stable 1218 // Examples: 'AuthTokenCache' 1219 PeerServiceKey = attribute.Key("peer.service") 1220 ) 1221 1222 // PeerService returns an attribute KeyValue conforming to the 1223 // "peer.service" semantic conventions. It represents the 1224 // [`service.name`](/docs/resource/README.md#service) of the remote service. 1225 // SHOULD be equal to the actual `service.name` resource attribute of the 1226 // remote service if any. 1227 func PeerService(val string) attribute.KeyValue { 1228 return PeerServiceKey.String(val) 1229 } 1230 1231 // These attributes may be used for any operation with an authenticated and/or 1232 // authorized enduser. 1233 const ( 1234 // EnduserIDKey is the attribute Key conforming to the "enduser.id" 1235 // semantic conventions. It represents the username or client_id extracted 1236 // from the access token or 1237 // [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header 1238 // in the inbound request from outside the system. 1239 // 1240 // Type: string 1241 // RequirementLevel: Optional 1242 // Stability: stable 1243 // Examples: 'username' 1244 EnduserIDKey = attribute.Key("enduser.id") 1245 1246 // EnduserRoleKey is the attribute Key conforming to the "enduser.role" 1247 // semantic conventions. It represents the actual/assumed role the client 1248 // is making the request under extracted from token or application security 1249 // context. 1250 // 1251 // Type: string 1252 // RequirementLevel: Optional 1253 // Stability: stable 1254 // Examples: 'admin' 1255 EnduserRoleKey = attribute.Key("enduser.role") 1256 1257 // EnduserScopeKey is the attribute Key conforming to the "enduser.scope" 1258 // semantic conventions. It represents the scopes or granted authorities 1259 // the client currently possesses extracted from token or application 1260 // security context. The value would come from the scope associated with an 1261 // [OAuth 2.0 Access 1262 // Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute 1263 // value in a [SAML 2.0 1264 // Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). 1265 // 1266 // Type: string 1267 // RequirementLevel: Optional 1268 // Stability: stable 1269 // Examples: 'read:message, write:files' 1270 EnduserScopeKey = attribute.Key("enduser.scope") 1271 ) 1272 1273 // EnduserID returns an attribute KeyValue conforming to the "enduser.id" 1274 // semantic conventions. It represents the username or client_id extracted from 1275 // the access token or 1276 // [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in 1277 // the inbound request from outside the system. 1278 func EnduserID(val string) attribute.KeyValue { 1279 return EnduserIDKey.String(val) 1280 } 1281 1282 // EnduserRole returns an attribute KeyValue conforming to the 1283 // "enduser.role" semantic conventions. It represents the actual/assumed role 1284 // the client is making the request under extracted from token or application 1285 // security context. 1286 func EnduserRole(val string) attribute.KeyValue { 1287 return EnduserRoleKey.String(val) 1288 } 1289 1290 // EnduserScope returns an attribute KeyValue conforming to the 1291 // "enduser.scope" semantic conventions. It represents the scopes or granted 1292 // authorities the client currently possesses extracted from token or 1293 // application security context. The value would come from the scope associated 1294 // with an [OAuth 2.0 Access 1295 // Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute 1296 // value in a [SAML 2.0 1297 // Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). 1298 func EnduserScope(val string) attribute.KeyValue { 1299 return EnduserScopeKey.String(val) 1300 } 1301 1302 // These attributes may be used for any operation to store information about a 1303 // thread that started a span. 1304 const ( 1305 // ThreadIDKey is the attribute Key conforming to the "thread.id" semantic 1306 // conventions. It represents the current "managed" thread ID (as opposed 1307 // to OS thread ID). 1308 // 1309 // Type: int 1310 // RequirementLevel: Optional 1311 // Stability: stable 1312 // Examples: 42 1313 ThreadIDKey = attribute.Key("thread.id") 1314 1315 // ThreadNameKey is the attribute Key conforming to the "thread.name" 1316 // semantic conventions. It represents the current thread name. 1317 // 1318 // Type: string 1319 // RequirementLevel: Optional 1320 // Stability: stable 1321 // Examples: 'main' 1322 ThreadNameKey = attribute.Key("thread.name") 1323 ) 1324 1325 // ThreadID returns an attribute KeyValue conforming to the "thread.id" 1326 // semantic conventions. It represents the current "managed" thread ID (as 1327 // opposed to OS thread ID). 1328 func ThreadID(val int) attribute.KeyValue { 1329 return ThreadIDKey.Int(val) 1330 } 1331 1332 // ThreadName returns an attribute KeyValue conforming to the "thread.name" 1333 // semantic conventions. It represents the current thread name. 1334 func ThreadName(val string) attribute.KeyValue { 1335 return ThreadNameKey.String(val) 1336 } 1337 1338 // These attributes allow to report this unit of code and therefore to provide 1339 // more context about the span. 1340 const ( 1341 // CodeFunctionKey is the attribute Key conforming to the "code.function" 1342 // semantic conventions. It represents the method or function name, or 1343 // equivalent (usually rightmost part of the code unit's name). 1344 // 1345 // Type: string 1346 // RequirementLevel: Optional 1347 // Stability: stable 1348 // Examples: 'serveRequest' 1349 CodeFunctionKey = attribute.Key("code.function") 1350 1351 // CodeNamespaceKey is the attribute Key conforming to the "code.namespace" 1352 // semantic conventions. It represents the "namespace" within which 1353 // `code.function` is defined. Usually the qualified class or module name, 1354 // such that `code.namespace` + some separator + `code.function` form a 1355 // unique identifier for the code unit. 1356 // 1357 // Type: string 1358 // RequirementLevel: Optional 1359 // Stability: stable 1360 // Examples: 'com.example.MyHTTPService' 1361 CodeNamespaceKey = attribute.Key("code.namespace") 1362 1363 // CodeFilepathKey is the attribute Key conforming to the "code.filepath" 1364 // semantic conventions. It represents the source code file name that 1365 // identifies the code unit as uniquely as possible (preferably an absolute 1366 // file path). 1367 // 1368 // Type: string 1369 // RequirementLevel: Optional 1370 // Stability: stable 1371 // Examples: '/usr/local/MyApplication/content_root/app/index.php' 1372 CodeFilepathKey = attribute.Key("code.filepath") 1373 1374 // CodeLineNumberKey is the attribute Key conforming to the "code.lineno" 1375 // semantic conventions. It represents the line number in `code.filepath` 1376 // best representing the operation. It SHOULD point within the code unit 1377 // named in `code.function`. 1378 // 1379 // Type: int 1380 // RequirementLevel: Optional 1381 // Stability: stable 1382 // Examples: 42 1383 CodeLineNumberKey = attribute.Key("code.lineno") 1384 1385 // CodeColumnKey is the attribute Key conforming to the "code.column" 1386 // semantic conventions. It represents the column number in `code.filepath` 1387 // best representing the operation. It SHOULD point within the code unit 1388 // named in `code.function`. 1389 // 1390 // Type: int 1391 // RequirementLevel: Optional 1392 // Stability: stable 1393 // Examples: 16 1394 CodeColumnKey = attribute.Key("code.column") 1395 ) 1396 1397 // CodeFunction returns an attribute KeyValue conforming to the 1398 // "code.function" semantic conventions. It represents the method or function 1399 // name, or equivalent (usually rightmost part of the code unit's name). 1400 func CodeFunction(val string) attribute.KeyValue { 1401 return CodeFunctionKey.String(val) 1402 } 1403 1404 // CodeNamespace returns an attribute KeyValue conforming to the 1405 // "code.namespace" semantic conventions. It represents the "namespace" within 1406 // which `code.function` is defined. Usually the qualified class or module 1407 // name, such that `code.namespace` + some separator + `code.function` form a 1408 // unique identifier for the code unit. 1409 func CodeNamespace(val string) attribute.KeyValue { 1410 return CodeNamespaceKey.String(val) 1411 } 1412 1413 // CodeFilepath returns an attribute KeyValue conforming to the 1414 // "code.filepath" semantic conventions. It represents the source code file 1415 // name that identifies the code unit as uniquely as possible (preferably an 1416 // absolute file path). 1417 func CodeFilepath(val string) attribute.KeyValue { 1418 return CodeFilepathKey.String(val) 1419 } 1420 1421 // CodeLineNumber returns an attribute KeyValue conforming to the "code.lineno" 1422 // semantic conventions. It represents the line number in `code.filepath` best 1423 // representing the operation. It SHOULD point within the code unit named in 1424 // `code.function`. 1425 func CodeLineNumber(val int) attribute.KeyValue { 1426 return CodeLineNumberKey.Int(val) 1427 } 1428 1429 // CodeColumn returns an attribute KeyValue conforming to the "code.column" 1430 // semantic conventions. It represents the column number in `code.filepath` 1431 // best representing the operation. It SHOULD point within the code unit named 1432 // in `code.function`. 1433 func CodeColumn(val int) attribute.KeyValue { 1434 return CodeColumnKey.Int(val) 1435 } 1436 1437 // Semantic Convention for HTTP Client 1438 const ( 1439 // HTTPResendCountKey is the attribute Key conforming to the 1440 // "http.resend_count" semantic conventions. It represents the ordinal 1441 // number of request resending attempt (for any reason, including 1442 // redirects). 1443 // 1444 // Type: int 1445 // RequirementLevel: Recommended (if and only if request was retried.) 1446 // Stability: stable 1447 // Examples: 3 1448 // Note: The resend count SHOULD be updated each time an HTTP request gets 1449 // resent by the client, regardless of what was the cause of the resending 1450 // (e.g. redirection, authorization failure, 503 Server Unavailable, 1451 // network issues, or any other). 1452 HTTPResendCountKey = attribute.Key("http.resend_count") 1453 ) 1454 1455 // HTTPResendCount returns an attribute KeyValue conforming to the 1456 // "http.resend_count" semantic conventions. It represents the ordinal number 1457 // of request resending attempt (for any reason, including redirects). 1458 func HTTPResendCount(val int) attribute.KeyValue { 1459 return HTTPResendCountKey.Int(val) 1460 } 1461 1462 // The `aws` conventions apply to operations using the AWS SDK. They map 1463 // request or response parameters in AWS SDK API calls to attributes on a Span. 1464 // The conventions have been collected over time based on feedback from AWS 1465 // users of tracing and will continue to evolve as new interesting conventions 1466 // are found. 1467 // Some descriptions are also provided for populating general OpenTelemetry 1468 // semantic conventions based on these APIs. 1469 const ( 1470 // AWSRequestIDKey is the attribute Key conforming to the "aws.request_id" 1471 // semantic conventions. It represents the AWS request ID as returned in 1472 // the response headers `x-amz-request-id` or `x-amz-requestid`. 1473 // 1474 // Type: string 1475 // RequirementLevel: Optional 1476 // Stability: stable 1477 // Examples: '79b9da39-b7ae-508a-a6bc-864b2829c622', 'C9ER4AJX75574TDJ' 1478 AWSRequestIDKey = attribute.Key("aws.request_id") 1479 ) 1480 1481 // AWSRequestID returns an attribute KeyValue conforming to the 1482 // "aws.request_id" semantic conventions. It represents the AWS request ID as 1483 // returned in the response headers `x-amz-request-id` or `x-amz-requestid`. 1484 func AWSRequestID(val string) attribute.KeyValue { 1485 return AWSRequestIDKey.String(val) 1486 } 1487 1488 // Attributes that exist for multiple DynamoDB request types. 1489 const ( 1490 // AWSDynamoDBTableNamesKey is the attribute Key conforming to the 1491 // "aws.dynamodb.table_names" semantic conventions. It represents the keys 1492 // in the `RequestItems` object field. 1493 // 1494 // Type: string[] 1495 // RequirementLevel: Optional 1496 // Stability: stable 1497 // Examples: 'Users', 'Cats' 1498 AWSDynamoDBTableNamesKey = attribute.Key("aws.dynamodb.table_names") 1499 1500 // AWSDynamoDBConsumedCapacityKey is the attribute Key conforming to the 1501 // "aws.dynamodb.consumed_capacity" semantic conventions. It represents the 1502 // JSON-serialized value of each item in the `ConsumedCapacity` response 1503 // field. 1504 // 1505 // Type: string[] 1506 // RequirementLevel: Optional 1507 // Stability: stable 1508 // Examples: '{ "CapacityUnits": number, "GlobalSecondaryIndexes": { 1509 // "string" : { "CapacityUnits": number, "ReadCapacityUnits": number, 1510 // "WriteCapacityUnits": number } }, "LocalSecondaryIndexes": { "string" : 1511 // { "CapacityUnits": number, "ReadCapacityUnits": number, 1512 // "WriteCapacityUnits": number } }, "ReadCapacityUnits": number, "Table": 1513 // { "CapacityUnits": number, "ReadCapacityUnits": number, 1514 // "WriteCapacityUnits": number }, "TableName": "string", 1515 // "WriteCapacityUnits": number }' 1516 AWSDynamoDBConsumedCapacityKey = attribute.Key("aws.dynamodb.consumed_capacity") 1517 1518 // AWSDynamoDBItemCollectionMetricsKey is the attribute Key conforming to 1519 // the "aws.dynamodb.item_collection_metrics" semantic conventions. It 1520 // represents the JSON-serialized value of the `ItemCollectionMetrics` 1521 // response field. 1522 // 1523 // Type: string 1524 // RequirementLevel: Optional 1525 // Stability: stable 1526 // Examples: '{ "string" : [ { "ItemCollectionKey": { "string" : { "B": 1527 // blob, "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": { 1528 // "string" : "AttributeValue" }, "N": "string", "NS": [ "string" ], 1529 // "NULL": boolean, "S": "string", "SS": [ "string" ] } }, 1530 // "SizeEstimateRangeGB": [ number ] } ] }' 1531 AWSDynamoDBItemCollectionMetricsKey = attribute.Key("aws.dynamodb.item_collection_metrics") 1532 1533 // AWSDynamoDBProvisionedReadCapacityKey is the attribute Key conforming to 1534 // the "aws.dynamodb.provisioned_read_capacity" semantic conventions. It 1535 // represents the value of the `ProvisionedThroughput.ReadCapacityUnits` 1536 // request parameter. 1537 // 1538 // Type: double 1539 // RequirementLevel: Optional 1540 // Stability: stable 1541 // Examples: 1.0, 2.0 1542 AWSDynamoDBProvisionedReadCapacityKey = attribute.Key("aws.dynamodb.provisioned_read_capacity") 1543 1544 // AWSDynamoDBProvisionedWriteCapacityKey is the attribute Key conforming 1545 // to the "aws.dynamodb.provisioned_write_capacity" semantic conventions. 1546 // It represents the value of the 1547 // `ProvisionedThroughput.WriteCapacityUnits` request parameter. 1548 // 1549 // Type: double 1550 // RequirementLevel: Optional 1551 // Stability: stable 1552 // Examples: 1.0, 2.0 1553 AWSDynamoDBProvisionedWriteCapacityKey = attribute.Key("aws.dynamodb.provisioned_write_capacity") 1554 1555 // AWSDynamoDBConsistentReadKey is the attribute Key conforming to the 1556 // "aws.dynamodb.consistent_read" semantic conventions. It represents the 1557 // value of the `ConsistentRead` request parameter. 1558 // 1559 // Type: boolean 1560 // RequirementLevel: Optional 1561 // Stability: stable 1562 AWSDynamoDBConsistentReadKey = attribute.Key("aws.dynamodb.consistent_read") 1563 1564 // AWSDynamoDBProjectionKey is the attribute Key conforming to the 1565 // "aws.dynamodb.projection" semantic conventions. It represents the value 1566 // of the `ProjectionExpression` request parameter. 1567 // 1568 // Type: string 1569 // RequirementLevel: Optional 1570 // Stability: stable 1571 // Examples: 'Title', 'Title, Price, Color', 'Title, Description, 1572 // RelatedItems, ProductReviews' 1573 AWSDynamoDBProjectionKey = attribute.Key("aws.dynamodb.projection") 1574 1575 // AWSDynamoDBLimitKey is the attribute Key conforming to the 1576 // "aws.dynamodb.limit" semantic conventions. It represents the value of 1577 // the `Limit` request parameter. 1578 // 1579 // Type: int 1580 // RequirementLevel: Optional 1581 // Stability: stable 1582 // Examples: 10 1583 AWSDynamoDBLimitKey = attribute.Key("aws.dynamodb.limit") 1584 1585 // AWSDynamoDBAttributesToGetKey is the attribute Key conforming to the 1586 // "aws.dynamodb.attributes_to_get" semantic conventions. It represents the 1587 // value of the `AttributesToGet` request parameter. 1588 // 1589 // Type: string[] 1590 // RequirementLevel: Optional 1591 // Stability: stable 1592 // Examples: 'lives', 'id' 1593 AWSDynamoDBAttributesToGetKey = attribute.Key("aws.dynamodb.attributes_to_get") 1594 1595 // AWSDynamoDBIndexNameKey is the attribute Key conforming to the 1596 // "aws.dynamodb.index_name" semantic conventions. It represents the value 1597 // of the `IndexName` request parameter. 1598 // 1599 // Type: string 1600 // RequirementLevel: Optional 1601 // Stability: stable 1602 // Examples: 'name_to_group' 1603 AWSDynamoDBIndexNameKey = attribute.Key("aws.dynamodb.index_name") 1604 1605 // AWSDynamoDBSelectKey is the attribute Key conforming to the 1606 // "aws.dynamodb.select" semantic conventions. It represents the value of 1607 // the `Select` request parameter. 1608 // 1609 // Type: string 1610 // RequirementLevel: Optional 1611 // Stability: stable 1612 // Examples: 'ALL_ATTRIBUTES', 'COUNT' 1613 AWSDynamoDBSelectKey = attribute.Key("aws.dynamodb.select") 1614 ) 1615 1616 // AWSDynamoDBTableNames returns an attribute KeyValue conforming to the 1617 // "aws.dynamodb.table_names" semantic conventions. It represents the keys in 1618 // the `RequestItems` object field. 1619 func AWSDynamoDBTableNames(val ...string) attribute.KeyValue { 1620 return AWSDynamoDBTableNamesKey.StringSlice(val) 1621 } 1622 1623 // AWSDynamoDBConsumedCapacity returns an attribute KeyValue conforming to 1624 // the "aws.dynamodb.consumed_capacity" semantic conventions. It represents the 1625 // JSON-serialized value of each item in the `ConsumedCapacity` response field. 1626 func AWSDynamoDBConsumedCapacity(val ...string) attribute.KeyValue { 1627 return AWSDynamoDBConsumedCapacityKey.StringSlice(val) 1628 } 1629 1630 // AWSDynamoDBItemCollectionMetrics returns an attribute KeyValue conforming 1631 // to the "aws.dynamodb.item_collection_metrics" semantic conventions. It 1632 // represents the JSON-serialized value of the `ItemCollectionMetrics` response 1633 // field. 1634 func AWSDynamoDBItemCollectionMetrics(val string) attribute.KeyValue { 1635 return AWSDynamoDBItemCollectionMetricsKey.String(val) 1636 } 1637 1638 // AWSDynamoDBProvisionedReadCapacity returns an attribute KeyValue 1639 // conforming to the "aws.dynamodb.provisioned_read_capacity" semantic 1640 // conventions. It represents the value of the 1641 // `ProvisionedThroughput.ReadCapacityUnits` request parameter. 1642 func AWSDynamoDBProvisionedReadCapacity(val float64) attribute.KeyValue { 1643 return AWSDynamoDBProvisionedReadCapacityKey.Float64(val) 1644 } 1645 1646 // AWSDynamoDBProvisionedWriteCapacity returns an attribute KeyValue 1647 // conforming to the "aws.dynamodb.provisioned_write_capacity" semantic 1648 // conventions. It represents the value of the 1649 // `ProvisionedThroughput.WriteCapacityUnits` request parameter. 1650 func AWSDynamoDBProvisionedWriteCapacity(val float64) attribute.KeyValue { 1651 return AWSDynamoDBProvisionedWriteCapacityKey.Float64(val) 1652 } 1653 1654 // AWSDynamoDBConsistentRead returns an attribute KeyValue conforming to the 1655 // "aws.dynamodb.consistent_read" semantic conventions. It represents the value 1656 // of the `ConsistentRead` request parameter. 1657 func AWSDynamoDBConsistentRead(val bool) attribute.KeyValue { 1658 return AWSDynamoDBConsistentReadKey.Bool(val) 1659 } 1660 1661 // AWSDynamoDBProjection returns an attribute KeyValue conforming to the 1662 // "aws.dynamodb.projection" semantic conventions. It represents the value of 1663 // the `ProjectionExpression` request parameter. 1664 func AWSDynamoDBProjection(val string) attribute.KeyValue { 1665 return AWSDynamoDBProjectionKey.String(val) 1666 } 1667 1668 // AWSDynamoDBLimit returns an attribute KeyValue conforming to the 1669 // "aws.dynamodb.limit" semantic conventions. It represents the value of the 1670 // `Limit` request parameter. 1671 func AWSDynamoDBLimit(val int) attribute.KeyValue { 1672 return AWSDynamoDBLimitKey.Int(val) 1673 } 1674 1675 // AWSDynamoDBAttributesToGet returns an attribute KeyValue conforming to 1676 // the "aws.dynamodb.attributes_to_get" semantic conventions. It represents the 1677 // value of the `AttributesToGet` request parameter. 1678 func AWSDynamoDBAttributesToGet(val ...string) attribute.KeyValue { 1679 return AWSDynamoDBAttributesToGetKey.StringSlice(val) 1680 } 1681 1682 // AWSDynamoDBIndexName returns an attribute KeyValue conforming to the 1683 // "aws.dynamodb.index_name" semantic conventions. It represents the value of 1684 // the `IndexName` request parameter. 1685 func AWSDynamoDBIndexName(val string) attribute.KeyValue { 1686 return AWSDynamoDBIndexNameKey.String(val) 1687 } 1688 1689 // AWSDynamoDBSelect returns an attribute KeyValue conforming to the 1690 // "aws.dynamodb.select" semantic conventions. It represents the value of the 1691 // `Select` request parameter. 1692 func AWSDynamoDBSelect(val string) attribute.KeyValue { 1693 return AWSDynamoDBSelectKey.String(val) 1694 } 1695 1696 // DynamoDB.CreateTable 1697 const ( 1698 // AWSDynamoDBGlobalSecondaryIndexesKey is the attribute Key conforming to 1699 // the "aws.dynamodb.global_secondary_indexes" semantic conventions. It 1700 // represents the JSON-serialized value of each item of the 1701 // `GlobalSecondaryIndexes` request field 1702 // 1703 // Type: string[] 1704 // RequirementLevel: Optional 1705 // Stability: stable 1706 // Examples: '{ "IndexName": "string", "KeySchema": [ { "AttributeName": 1707 // "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ 1708 // "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": { 1709 // "ReadCapacityUnits": number, "WriteCapacityUnits": number } }' 1710 AWSDynamoDBGlobalSecondaryIndexesKey = attribute.Key("aws.dynamodb.global_secondary_indexes") 1711 1712 // AWSDynamoDBLocalSecondaryIndexesKey is the attribute Key conforming to 1713 // the "aws.dynamodb.local_secondary_indexes" semantic conventions. It 1714 // represents the JSON-serialized value of each item of the 1715 // `LocalSecondaryIndexes` request field. 1716 // 1717 // Type: string[] 1718 // RequirementLevel: Optional 1719 // Stability: stable 1720 // Examples: '{ "IndexARN": "string", "IndexName": "string", 1721 // "IndexSizeBytes": number, "ItemCount": number, "KeySchema": [ { 1722 // "AttributeName": "string", "KeyType": "string" } ], "Projection": { 1723 // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" } }' 1724 AWSDynamoDBLocalSecondaryIndexesKey = attribute.Key("aws.dynamodb.local_secondary_indexes") 1725 ) 1726 1727 // AWSDynamoDBGlobalSecondaryIndexes returns an attribute KeyValue 1728 // conforming to the "aws.dynamodb.global_secondary_indexes" semantic 1729 // conventions. It represents the JSON-serialized value of each item of the 1730 // `GlobalSecondaryIndexes` request field 1731 func AWSDynamoDBGlobalSecondaryIndexes(val ...string) attribute.KeyValue { 1732 return AWSDynamoDBGlobalSecondaryIndexesKey.StringSlice(val) 1733 } 1734 1735 // AWSDynamoDBLocalSecondaryIndexes returns an attribute KeyValue conforming 1736 // to the "aws.dynamodb.local_secondary_indexes" semantic conventions. It 1737 // represents the JSON-serialized value of each item of the 1738 // `LocalSecondaryIndexes` request field. 1739 func AWSDynamoDBLocalSecondaryIndexes(val ...string) attribute.KeyValue { 1740 return AWSDynamoDBLocalSecondaryIndexesKey.StringSlice(val) 1741 } 1742 1743 // DynamoDB.ListTables 1744 const ( 1745 // AWSDynamoDBExclusiveStartTableKey is the attribute Key conforming to the 1746 // "aws.dynamodb.exclusive_start_table" semantic conventions. It represents 1747 // the value of the `ExclusiveStartTableName` request parameter. 1748 // 1749 // Type: string 1750 // RequirementLevel: Optional 1751 // Stability: stable 1752 // Examples: 'Users', 'CatsTable' 1753 AWSDynamoDBExclusiveStartTableKey = attribute.Key("aws.dynamodb.exclusive_start_table") 1754 1755 // AWSDynamoDBTableCountKey is the attribute Key conforming to the 1756 // "aws.dynamodb.table_count" semantic conventions. It represents the the 1757 // number of items in the `TableNames` response parameter. 1758 // 1759 // Type: int 1760 // RequirementLevel: Optional 1761 // Stability: stable 1762 // Examples: 20 1763 AWSDynamoDBTableCountKey = attribute.Key("aws.dynamodb.table_count") 1764 ) 1765 1766 // AWSDynamoDBExclusiveStartTable returns an attribute KeyValue conforming 1767 // to the "aws.dynamodb.exclusive_start_table" semantic conventions. It 1768 // represents the value of the `ExclusiveStartTableName` request parameter. 1769 func AWSDynamoDBExclusiveStartTable(val string) attribute.KeyValue { 1770 return AWSDynamoDBExclusiveStartTableKey.String(val) 1771 } 1772 1773 // AWSDynamoDBTableCount returns an attribute KeyValue conforming to the 1774 // "aws.dynamodb.table_count" semantic conventions. It represents the the 1775 // number of items in the `TableNames` response parameter. 1776 func AWSDynamoDBTableCount(val int) attribute.KeyValue { 1777 return AWSDynamoDBTableCountKey.Int(val) 1778 } 1779 1780 // DynamoDB.Query 1781 const ( 1782 // AWSDynamoDBScanForwardKey is the attribute Key conforming to the 1783 // "aws.dynamodb.scan_forward" semantic conventions. It represents the 1784 // value of the `ScanIndexForward` request parameter. 1785 // 1786 // Type: boolean 1787 // RequirementLevel: Optional 1788 // Stability: stable 1789 AWSDynamoDBScanForwardKey = attribute.Key("aws.dynamodb.scan_forward") 1790 ) 1791 1792 // AWSDynamoDBScanForward returns an attribute KeyValue conforming to the 1793 // "aws.dynamodb.scan_forward" semantic conventions. It represents the value of 1794 // the `ScanIndexForward` request parameter. 1795 func AWSDynamoDBScanForward(val bool) attribute.KeyValue { 1796 return AWSDynamoDBScanForwardKey.Bool(val) 1797 } 1798 1799 // DynamoDB.Scan 1800 const ( 1801 // AWSDynamoDBSegmentKey is the attribute Key conforming to the 1802 // "aws.dynamodb.segment" semantic conventions. It represents the value of 1803 // the `Segment` request parameter. 1804 // 1805 // Type: int 1806 // RequirementLevel: Optional 1807 // Stability: stable 1808 // Examples: 10 1809 AWSDynamoDBSegmentKey = attribute.Key("aws.dynamodb.segment") 1810 1811 // AWSDynamoDBTotalSegmentsKey is the attribute Key conforming to the 1812 // "aws.dynamodb.total_segments" semantic conventions. It represents the 1813 // value of the `TotalSegments` request parameter. 1814 // 1815 // Type: int 1816 // RequirementLevel: Optional 1817 // Stability: stable 1818 // Examples: 100 1819 AWSDynamoDBTotalSegmentsKey = attribute.Key("aws.dynamodb.total_segments") 1820 1821 // AWSDynamoDBCountKey is the attribute Key conforming to the 1822 // "aws.dynamodb.count" semantic conventions. It represents the value of 1823 // the `Count` response parameter. 1824 // 1825 // Type: int 1826 // RequirementLevel: Optional 1827 // Stability: stable 1828 // Examples: 10 1829 AWSDynamoDBCountKey = attribute.Key("aws.dynamodb.count") 1830 1831 // AWSDynamoDBScannedCountKey is the attribute Key conforming to the 1832 // "aws.dynamodb.scanned_count" semantic conventions. It represents the 1833 // value of the `ScannedCount` response parameter. 1834 // 1835 // Type: int 1836 // RequirementLevel: Optional 1837 // Stability: stable 1838 // Examples: 50 1839 AWSDynamoDBScannedCountKey = attribute.Key("aws.dynamodb.scanned_count") 1840 ) 1841 1842 // AWSDynamoDBSegment returns an attribute KeyValue conforming to the 1843 // "aws.dynamodb.segment" semantic conventions. It represents the value of the 1844 // `Segment` request parameter. 1845 func AWSDynamoDBSegment(val int) attribute.KeyValue { 1846 return AWSDynamoDBSegmentKey.Int(val) 1847 } 1848 1849 // AWSDynamoDBTotalSegments returns an attribute KeyValue conforming to the 1850 // "aws.dynamodb.total_segments" semantic conventions. It represents the value 1851 // of the `TotalSegments` request parameter. 1852 func AWSDynamoDBTotalSegments(val int) attribute.KeyValue { 1853 return AWSDynamoDBTotalSegmentsKey.Int(val) 1854 } 1855 1856 // AWSDynamoDBCount returns an attribute KeyValue conforming to the 1857 // "aws.dynamodb.count" semantic conventions. It represents the value of the 1858 // `Count` response parameter. 1859 func AWSDynamoDBCount(val int) attribute.KeyValue { 1860 return AWSDynamoDBCountKey.Int(val) 1861 } 1862 1863 // AWSDynamoDBScannedCount returns an attribute KeyValue conforming to the 1864 // "aws.dynamodb.scanned_count" semantic conventions. It represents the value 1865 // of the `ScannedCount` response parameter. 1866 func AWSDynamoDBScannedCount(val int) attribute.KeyValue { 1867 return AWSDynamoDBScannedCountKey.Int(val) 1868 } 1869 1870 // DynamoDB.UpdateTable 1871 const ( 1872 // AWSDynamoDBAttributeDefinitionsKey is the attribute Key conforming to 1873 // the "aws.dynamodb.attribute_definitions" semantic conventions. It 1874 // represents the JSON-serialized value of each item in the 1875 // `AttributeDefinitions` request field. 1876 // 1877 // Type: string[] 1878 // RequirementLevel: Optional 1879 // Stability: stable 1880 // Examples: '{ "AttributeName": "string", "AttributeType": "string" }' 1881 AWSDynamoDBAttributeDefinitionsKey = attribute.Key("aws.dynamodb.attribute_definitions") 1882 1883 // AWSDynamoDBGlobalSecondaryIndexUpdatesKey is the attribute Key 1884 // conforming to the "aws.dynamodb.global_secondary_index_updates" semantic 1885 // conventions. It represents the JSON-serialized value of each item in the 1886 // the `GlobalSecondaryIndexUpdates` request field. 1887 // 1888 // Type: string[] 1889 // RequirementLevel: Optional 1890 // Stability: stable 1891 // Examples: '{ "Create": { "IndexName": "string", "KeySchema": [ { 1892 // "AttributeName": "string", "KeyType": "string" } ], "Projection": { 1893 // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" }, 1894 // "ProvisionedThroughput": { "ReadCapacityUnits": number, 1895 // "WriteCapacityUnits": number } }' 1896 AWSDynamoDBGlobalSecondaryIndexUpdatesKey = attribute.Key("aws.dynamodb.global_secondary_index_updates") 1897 ) 1898 1899 // AWSDynamoDBAttributeDefinitions returns an attribute KeyValue conforming 1900 // to the "aws.dynamodb.attribute_definitions" semantic conventions. It 1901 // represents the JSON-serialized value of each item in the 1902 // `AttributeDefinitions` request field. 1903 func AWSDynamoDBAttributeDefinitions(val ...string) attribute.KeyValue { 1904 return AWSDynamoDBAttributeDefinitionsKey.StringSlice(val) 1905 } 1906 1907 // AWSDynamoDBGlobalSecondaryIndexUpdates returns an attribute KeyValue 1908 // conforming to the "aws.dynamodb.global_secondary_index_updates" semantic 1909 // conventions. It represents the JSON-serialized value of each item in the the 1910 // `GlobalSecondaryIndexUpdates` request field. 1911 func AWSDynamoDBGlobalSecondaryIndexUpdates(val ...string) attribute.KeyValue { 1912 return AWSDynamoDBGlobalSecondaryIndexUpdatesKey.StringSlice(val) 1913 } 1914 1915 // Attributes that exist for S3 request types. 1916 const ( 1917 // AWSS3BucketKey is the attribute Key conforming to the "aws.s3.bucket" 1918 // semantic conventions. It represents the S3 bucket name the request 1919 // refers to. Corresponds to the `--bucket` parameter of the [S3 1920 // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) 1921 // operations. 1922 // 1923 // Type: string 1924 // RequirementLevel: Optional 1925 // Stability: stable 1926 // Examples: 'some-bucket-name' 1927 // Note: The `bucket` attribute is applicable to all S3 operations that 1928 // reference a bucket, i.e. that require the bucket name as a mandatory 1929 // parameter. 1930 // This applies to almost all S3 operations except `list-buckets`. 1931 AWSS3BucketKey = attribute.Key("aws.s3.bucket") 1932 1933 // AWSS3KeyKey is the attribute Key conforming to the "aws.s3.key" semantic 1934 // conventions. It represents the S3 object key the request refers to. 1935 // Corresponds to the `--key` parameter of the [S3 1936 // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) 1937 // operations. 1938 // 1939 // Type: string 1940 // RequirementLevel: Optional 1941 // Stability: stable 1942 // Examples: 'someFile.yml' 1943 // Note: The `key` attribute is applicable to all object-related S3 1944 // operations, i.e. that require the object key as a mandatory parameter. 1945 // This applies in particular to the following operations: 1946 // 1947 // - 1948 // [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) 1949 // - 1950 // [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) 1951 // - 1952 // [get-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/get-object.html) 1953 // - 1954 // [head-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/head-object.html) 1955 // - 1956 // [put-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-object.html) 1957 // - 1958 // [restore-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/restore-object.html) 1959 // - 1960 // [select-object-content](https://docs.aws.amazon.com/cli/latest/reference/s3api/select-object-content.html) 1961 // - 1962 // [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) 1963 // - 1964 // [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) 1965 // - 1966 // [create-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/create-multipart-upload.html) 1967 // - 1968 // [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) 1969 // - 1970 // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) 1971 // - 1972 // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) 1973 AWSS3KeyKey = attribute.Key("aws.s3.key") 1974 1975 // AWSS3CopySourceKey is the attribute Key conforming to the 1976 // "aws.s3.copy_source" semantic conventions. It represents the source 1977 // object (in the form `bucket`/`key`) for the copy operation. 1978 // 1979 // Type: string 1980 // RequirementLevel: Optional 1981 // Stability: stable 1982 // Examples: 'someFile.yml' 1983 // Note: The `copy_source` attribute applies to S3 copy operations and 1984 // corresponds to the `--copy-source` parameter 1985 // of the [copy-object operation within the S3 1986 // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html). 1987 // This applies in particular to the following operations: 1988 // 1989 // - 1990 // [copy-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html) 1991 // - 1992 // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) 1993 AWSS3CopySourceKey = attribute.Key("aws.s3.copy_source") 1994 1995 // AWSS3UploadIDKey is the attribute Key conforming to the 1996 // "aws.s3.upload_id" semantic conventions. It represents the upload ID 1997 // that identifies the multipart upload. 1998 // 1999 // Type: string 2000 // RequirementLevel: Optional 2001 // Stability: stable 2002 // Examples: 'dfRtDYWFbkRONycy.Yxwh66Yjlx.cph0gtNBtJ' 2003 // Note: The `upload_id` attribute applies to S3 multipart-upload 2004 // operations and corresponds to the `--upload-id` parameter 2005 // of the [S3 2006 // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) 2007 // multipart operations. 2008 // This applies in particular to the following operations: 2009 // 2010 // - 2011 // [abort-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html) 2012 // - 2013 // [complete-multipart-upload](https://docs.aws.amazon.com/cli/latest/reference/s3api/complete-multipart-upload.html) 2014 // - 2015 // [list-parts](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-parts.html) 2016 // - 2017 // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) 2018 // - 2019 // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) 2020 AWSS3UploadIDKey = attribute.Key("aws.s3.upload_id") 2021 2022 // AWSS3DeleteKey is the attribute Key conforming to the "aws.s3.delete" 2023 // semantic conventions. It represents the delete request container that 2024 // specifies the objects to be deleted. 2025 // 2026 // Type: string 2027 // RequirementLevel: Optional 2028 // Stability: stable 2029 // Examples: 2030 // 'Objects=[{Key=string,VersionID=string},{Key=string,VersionID=string}],Quiet=boolean' 2031 // Note: The `delete` attribute is only applicable to the 2032 // [delete-object](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-object.html) 2033 // operation. 2034 // The `delete` attribute corresponds to the `--delete` parameter of the 2035 // [delete-objects operation within the S3 2036 // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-objects.html). 2037 AWSS3DeleteKey = attribute.Key("aws.s3.delete") 2038 2039 // AWSS3PartNumberKey is the attribute Key conforming to the 2040 // "aws.s3.part_number" semantic conventions. It represents the part number 2041 // of the part being uploaded in a multipart-upload operation. This is a 2042 // positive integer between 1 and 10,000. 2043 // 2044 // Type: int 2045 // RequirementLevel: Optional 2046 // Stability: stable 2047 // Examples: 3456 2048 // Note: The `part_number` attribute is only applicable to the 2049 // [upload-part](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html) 2050 // and 2051 // [upload-part-copy](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html) 2052 // operations. 2053 // The `part_number` attribute corresponds to the `--part-number` parameter 2054 // of the 2055 // [upload-part operation within the S3 2056 // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part.html). 2057 AWSS3PartNumberKey = attribute.Key("aws.s3.part_number") 2058 ) 2059 2060 // AWSS3Bucket returns an attribute KeyValue conforming to the 2061 // "aws.s3.bucket" semantic conventions. It represents the S3 bucket name the 2062 // request refers to. Corresponds to the `--bucket` parameter of the [S3 2063 // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) 2064 // operations. 2065 func AWSS3Bucket(val string) attribute.KeyValue { 2066 return AWSS3BucketKey.String(val) 2067 } 2068 2069 // AWSS3Key returns an attribute KeyValue conforming to the "aws.s3.key" 2070 // semantic conventions. It represents the S3 object key the request refers to. 2071 // Corresponds to the `--key` parameter of the [S3 2072 // API](https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html) 2073 // operations. 2074 func AWSS3Key(val string) attribute.KeyValue { 2075 return AWSS3KeyKey.String(val) 2076 } 2077 2078 // AWSS3CopySource returns an attribute KeyValue conforming to the 2079 // "aws.s3.copy_source" semantic conventions. It represents the source object 2080 // (in the form `bucket`/`key`) for the copy operation. 2081 func AWSS3CopySource(val string) attribute.KeyValue { 2082 return AWSS3CopySourceKey.String(val) 2083 } 2084 2085 // AWSS3UploadID returns an attribute KeyValue conforming to the 2086 // "aws.s3.upload_id" semantic conventions. It represents the upload ID that 2087 // identifies the multipart upload. 2088 func AWSS3UploadID(val string) attribute.KeyValue { 2089 return AWSS3UploadIDKey.String(val) 2090 } 2091 2092 // AWSS3Delete returns an attribute KeyValue conforming to the 2093 // "aws.s3.delete" semantic conventions. It represents the delete request 2094 // container that specifies the objects to be deleted. 2095 func AWSS3Delete(val string) attribute.KeyValue { 2096 return AWSS3DeleteKey.String(val) 2097 } 2098 2099 // AWSS3PartNumber returns an attribute KeyValue conforming to the 2100 // "aws.s3.part_number" semantic conventions. It represents the part number of 2101 // the part being uploaded in a multipart-upload operation. This is a positive 2102 // integer between 1 and 10,000. 2103 func AWSS3PartNumber(val int) attribute.KeyValue { 2104 return AWSS3PartNumberKey.Int(val) 2105 } 2106 2107 // Semantic conventions to apply when instrumenting the GraphQL implementation. 2108 // They map GraphQL operations to attributes on a Span. 2109 const ( 2110 // GraphqlOperationNameKey is the attribute Key conforming to the 2111 // "graphql.operation.name" semantic conventions. It represents the name of 2112 // the operation being executed. 2113 // 2114 // Type: string 2115 // RequirementLevel: Optional 2116 // Stability: stable 2117 // Examples: 'findBookByID' 2118 GraphqlOperationNameKey = attribute.Key("graphql.operation.name") 2119 2120 // GraphqlOperationTypeKey is the attribute Key conforming to the 2121 // "graphql.operation.type" semantic conventions. It represents the type of 2122 // the operation being executed. 2123 // 2124 // Type: Enum 2125 // RequirementLevel: Optional 2126 // Stability: stable 2127 // Examples: 'query', 'mutation', 'subscription' 2128 GraphqlOperationTypeKey = attribute.Key("graphql.operation.type") 2129 2130 // GraphqlDocumentKey is the attribute Key conforming to the 2131 // "graphql.document" semantic conventions. It represents the GraphQL 2132 // document being executed. 2133 // 2134 // Type: string 2135 // RequirementLevel: Optional 2136 // Stability: stable 2137 // Examples: 'query findBookByID { bookByID(id: ?) { name } }' 2138 // Note: The value may be sanitized to exclude sensitive information. 2139 GraphqlDocumentKey = attribute.Key("graphql.document") 2140 ) 2141 2142 var ( 2143 // GraphQL query 2144 GraphqlOperationTypeQuery = GraphqlOperationTypeKey.String("query") 2145 // GraphQL mutation 2146 GraphqlOperationTypeMutation = GraphqlOperationTypeKey.String("mutation") 2147 // GraphQL subscription 2148 GraphqlOperationTypeSubscription = GraphqlOperationTypeKey.String("subscription") 2149 ) 2150 2151 // GraphqlOperationName returns an attribute KeyValue conforming to the 2152 // "graphql.operation.name" semantic conventions. It represents the name of the 2153 // operation being executed. 2154 func GraphqlOperationName(val string) attribute.KeyValue { 2155 return GraphqlOperationNameKey.String(val) 2156 } 2157 2158 // GraphqlDocument returns an attribute KeyValue conforming to the 2159 // "graphql.document" semantic conventions. It represents the GraphQL document 2160 // being executed. 2161 func GraphqlDocument(val string) attribute.KeyValue { 2162 return GraphqlDocumentKey.String(val) 2163 } 2164 2165 // General attributes used in messaging systems. 2166 const ( 2167 // MessagingSystemKey is the attribute Key conforming to the 2168 // "messaging.system" semantic conventions. It represents a string 2169 // identifying the messaging system. 2170 // 2171 // Type: string 2172 // RequirementLevel: Required 2173 // Stability: stable 2174 // Examples: 'kafka', 'rabbitmq', 'rocketmq', 'activemq', 'AmazonSQS' 2175 MessagingSystemKey = attribute.Key("messaging.system") 2176 2177 // MessagingOperationKey is the attribute Key conforming to the 2178 // "messaging.operation" semantic conventions. It represents a string 2179 // identifying the kind of messaging operation as defined in the [Operation 2180 // names](#operation-names) section above. 2181 // 2182 // Type: Enum 2183 // RequirementLevel: Required 2184 // Stability: stable 2185 // Note: If a custom value is used, it MUST be of low cardinality. 2186 MessagingOperationKey = attribute.Key("messaging.operation") 2187 2188 // MessagingBatchMessageCountKey is the attribute Key conforming to the 2189 // "messaging.batch.message_count" semantic conventions. It represents the 2190 // number of messages sent, received, or processed in the scope of the 2191 // batching operation. 2192 // 2193 // Type: int 2194 // RequirementLevel: ConditionallyRequired (If the span describes an 2195 // operation on a batch of messages.) 2196 // Stability: stable 2197 // Examples: 0, 1, 2 2198 // Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on 2199 // spans that operate with a single message. When a messaging client 2200 // library supports both batch and single-message API for the same 2201 // operation, instrumentations SHOULD use `messaging.batch.message_count` 2202 // for batching APIs and SHOULD NOT use it for single-message APIs. 2203 MessagingBatchMessageCountKey = attribute.Key("messaging.batch.message_count") 2204 2205 // MessagingClientIDKey is the attribute Key conforming to the 2206 // "messaging.client_id" semantic conventions. It represents a unique 2207 // identifier for the client that consumes or produces a message. 2208 // 2209 // Type: string 2210 // RequirementLevel: Recommended (If a client id is available) 2211 // Stability: stable 2212 // Examples: 'client-5', 'myhost@8742@s8083jm' 2213 MessagingClientIDKey = attribute.Key("messaging.client_id") 2214 ) 2215 2216 var ( 2217 // publish 2218 MessagingOperationPublish = MessagingOperationKey.String("publish") 2219 // receive 2220 MessagingOperationReceive = MessagingOperationKey.String("receive") 2221 // process 2222 MessagingOperationProcess = MessagingOperationKey.String("process") 2223 ) 2224 2225 // MessagingSystem returns an attribute KeyValue conforming to the 2226 // "messaging.system" semantic conventions. It represents a string identifying 2227 // the messaging system. 2228 func MessagingSystem(val string) attribute.KeyValue { 2229 return MessagingSystemKey.String(val) 2230 } 2231 2232 // MessagingBatchMessageCount returns an attribute KeyValue conforming to 2233 // the "messaging.batch.message_count" semantic conventions. It represents the 2234 // number of messages sent, received, or processed in the scope of the batching 2235 // operation. 2236 func MessagingBatchMessageCount(val int) attribute.KeyValue { 2237 return MessagingBatchMessageCountKey.Int(val) 2238 } 2239 2240 // MessagingClientID returns an attribute KeyValue conforming to the 2241 // "messaging.client_id" semantic conventions. It represents a unique 2242 // identifier for the client that consumes or produces a message. 2243 func MessagingClientID(val string) attribute.KeyValue { 2244 return MessagingClientIDKey.String(val) 2245 } 2246 2247 // Semantic conventions for remote procedure calls. 2248 const ( 2249 // RPCSystemKey is the attribute Key conforming to the "rpc.system" 2250 // semantic conventions. It represents a string identifying the remoting 2251 // system. See below for a list of well-known identifiers. 2252 // 2253 // Type: Enum 2254 // RequirementLevel: Required 2255 // Stability: stable 2256 RPCSystemKey = attribute.Key("rpc.system") 2257 2258 // RPCServiceKey is the attribute Key conforming to the "rpc.service" 2259 // semantic conventions. It represents the full (logical) name of the 2260 // service being called, including its package name, if applicable. 2261 // 2262 // Type: string 2263 // RequirementLevel: Recommended 2264 // Stability: stable 2265 // Examples: 'myservice.EchoService' 2266 // Note: This is the logical name of the service from the RPC interface 2267 // perspective, which can be different from the name of any implementing 2268 // class. The `code.namespace` attribute may be used to store the latter 2269 // (despite the attribute name, it may include a class name; e.g., class 2270 // with method actually executing the call on the server side, RPC client 2271 // stub class on the client side). 2272 RPCServiceKey = attribute.Key("rpc.service") 2273 2274 // RPCMethodKey is the attribute Key conforming to the "rpc.method" 2275 // semantic conventions. It represents the name of the (logical) method 2276 // being called, must be equal to the $method part in the span name. 2277 // 2278 // Type: string 2279 // RequirementLevel: Recommended 2280 // Stability: stable 2281 // Examples: 'exampleMethod' 2282 // Note: This is the logical name of the method from the RPC interface 2283 // perspective, which can be different from the name of any implementing 2284 // method/function. The `code.function` attribute may be used to store the 2285 // latter (e.g., method actually executing the call on the server side, RPC 2286 // client stub method on the client side). 2287 RPCMethodKey = attribute.Key("rpc.method") 2288 ) 2289 2290 var ( 2291 // gRPC 2292 RPCSystemGRPC = RPCSystemKey.String("grpc") 2293 // Java RMI 2294 RPCSystemJavaRmi = RPCSystemKey.String("java_rmi") 2295 // .NET WCF 2296 RPCSystemDotnetWcf = RPCSystemKey.String("dotnet_wcf") 2297 // Apache Dubbo 2298 RPCSystemApacheDubbo = RPCSystemKey.String("apache_dubbo") 2299 // Connect RPC 2300 RPCSystemConnectRPC = RPCSystemKey.String("connect_rpc") 2301 ) 2302 2303 // RPCService returns an attribute KeyValue conforming to the "rpc.service" 2304 // semantic conventions. It represents the full (logical) name of the service 2305 // being called, including its package name, if applicable. 2306 func RPCService(val string) attribute.KeyValue { 2307 return RPCServiceKey.String(val) 2308 } 2309 2310 // RPCMethod returns an attribute KeyValue conforming to the "rpc.method" 2311 // semantic conventions. It represents the name of the (logical) method being 2312 // called, must be equal to the $method part in the span name. 2313 func RPCMethod(val string) attribute.KeyValue { 2314 return RPCMethodKey.String(val) 2315 } 2316 2317 // Tech-specific attributes for gRPC. 2318 const ( 2319 // RPCGRPCStatusCodeKey is the attribute Key conforming to the 2320 // "rpc.grpc.status_code" semantic conventions. It represents the [numeric 2321 // status 2322 // code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of 2323 // the gRPC request. 2324 // 2325 // Type: Enum 2326 // RequirementLevel: Required 2327 // Stability: stable 2328 RPCGRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code") 2329 ) 2330 2331 var ( 2332 // OK 2333 RPCGRPCStatusCodeOk = RPCGRPCStatusCodeKey.Int(0) 2334 // CANCELLED 2335 RPCGRPCStatusCodeCancelled = RPCGRPCStatusCodeKey.Int(1) 2336 // UNKNOWN 2337 RPCGRPCStatusCodeUnknown = RPCGRPCStatusCodeKey.Int(2) 2338 // INVALID_ARGUMENT 2339 RPCGRPCStatusCodeInvalidArgument = RPCGRPCStatusCodeKey.Int(3) 2340 // DEADLINE_EXCEEDED 2341 RPCGRPCStatusCodeDeadlineExceeded = RPCGRPCStatusCodeKey.Int(4) 2342 // NOT_FOUND 2343 RPCGRPCStatusCodeNotFound = RPCGRPCStatusCodeKey.Int(5) 2344 // ALREADY_EXISTS 2345 RPCGRPCStatusCodeAlreadyExists = RPCGRPCStatusCodeKey.Int(6) 2346 // PERMISSION_DENIED 2347 RPCGRPCStatusCodePermissionDenied = RPCGRPCStatusCodeKey.Int(7) 2348 // RESOURCE_EXHAUSTED 2349 RPCGRPCStatusCodeResourceExhausted = RPCGRPCStatusCodeKey.Int(8) 2350 // FAILED_PRECONDITION 2351 RPCGRPCStatusCodeFailedPrecondition = RPCGRPCStatusCodeKey.Int(9) 2352 // ABORTED 2353 RPCGRPCStatusCodeAborted = RPCGRPCStatusCodeKey.Int(10) 2354 // OUT_OF_RANGE 2355 RPCGRPCStatusCodeOutOfRange = RPCGRPCStatusCodeKey.Int(11) 2356 // UNIMPLEMENTED 2357 RPCGRPCStatusCodeUnimplemented = RPCGRPCStatusCodeKey.Int(12) 2358 // INTERNAL 2359 RPCGRPCStatusCodeInternal = RPCGRPCStatusCodeKey.Int(13) 2360 // UNAVAILABLE 2361 RPCGRPCStatusCodeUnavailable = RPCGRPCStatusCodeKey.Int(14) 2362 // DATA_LOSS 2363 RPCGRPCStatusCodeDataLoss = RPCGRPCStatusCodeKey.Int(15) 2364 // UNAUTHENTICATED 2365 RPCGRPCStatusCodeUnauthenticated = RPCGRPCStatusCodeKey.Int(16) 2366 ) 2367 2368 // Tech-specific attributes for [JSON RPC](https://www.jsonrpc.org/). 2369 const ( 2370 // RPCJsonrpcVersionKey is the attribute Key conforming to the 2371 // "rpc.jsonrpc.version" semantic conventions. It represents the protocol 2372 // version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 2373 // does not specify this, the value can be omitted. 2374 // 2375 // Type: string 2376 // RequirementLevel: ConditionallyRequired (If other than the default 2377 // version (`1.0`)) 2378 // Stability: stable 2379 // Examples: '2.0', '1.0' 2380 RPCJsonrpcVersionKey = attribute.Key("rpc.jsonrpc.version") 2381 2382 // RPCJsonrpcRequestIDKey is the attribute Key conforming to the 2383 // "rpc.jsonrpc.request_id" semantic conventions. It represents the `id` 2384 // property of request or response. Since protocol allows id to be int, 2385 // string, `null` or missing (for notifications), value is expected to be 2386 // cast to string for simplicity. Use empty string in case of `null` value. 2387 // Omit entirely if this is a notification. 2388 // 2389 // Type: string 2390 // RequirementLevel: Optional 2391 // Stability: stable 2392 // Examples: '10', 'request-7', '' 2393 RPCJsonrpcRequestIDKey = attribute.Key("rpc.jsonrpc.request_id") 2394 2395 // RPCJsonrpcErrorCodeKey is the attribute Key conforming to the 2396 // "rpc.jsonrpc.error_code" semantic conventions. It represents the 2397 // `error.code` property of response if it is an error response. 2398 // 2399 // Type: int 2400 // RequirementLevel: ConditionallyRequired (If response is not successful.) 2401 // Stability: stable 2402 // Examples: -32700, 100 2403 RPCJsonrpcErrorCodeKey = attribute.Key("rpc.jsonrpc.error_code") 2404 2405 // RPCJsonrpcErrorMessageKey is the attribute Key conforming to the 2406 // "rpc.jsonrpc.error_message" semantic conventions. It represents the 2407 // `error.message` property of response if it is an error response. 2408 // 2409 // Type: string 2410 // RequirementLevel: Optional 2411 // Stability: stable 2412 // Examples: 'Parse error', 'User already exists' 2413 RPCJsonrpcErrorMessageKey = attribute.Key("rpc.jsonrpc.error_message") 2414 ) 2415 2416 // RPCJsonrpcVersion returns an attribute KeyValue conforming to the 2417 // "rpc.jsonrpc.version" semantic conventions. It represents the protocol 2418 // version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 2419 // does not specify this, the value can be omitted. 2420 func RPCJsonrpcVersion(val string) attribute.KeyValue { 2421 return RPCJsonrpcVersionKey.String(val) 2422 } 2423 2424 // RPCJsonrpcRequestID returns an attribute KeyValue conforming to the 2425 // "rpc.jsonrpc.request_id" semantic conventions. It represents the `id` 2426 // property of request or response. Since protocol allows id to be int, string, 2427 // `null` or missing (for notifications), value is expected to be cast to 2428 // string for simplicity. Use empty string in case of `null` value. Omit 2429 // entirely if this is a notification. 2430 func RPCJsonrpcRequestID(val string) attribute.KeyValue { 2431 return RPCJsonrpcRequestIDKey.String(val) 2432 } 2433 2434 // RPCJsonrpcErrorCode returns an attribute KeyValue conforming to the 2435 // "rpc.jsonrpc.error_code" semantic conventions. It represents the 2436 // `error.code` property of response if it is an error response. 2437 func RPCJsonrpcErrorCode(val int) attribute.KeyValue { 2438 return RPCJsonrpcErrorCodeKey.Int(val) 2439 } 2440 2441 // RPCJsonrpcErrorMessage returns an attribute KeyValue conforming to the 2442 // "rpc.jsonrpc.error_message" semantic conventions. It represents the 2443 // `error.message` property of response if it is an error response. 2444 func RPCJsonrpcErrorMessage(val string) attribute.KeyValue { 2445 return RPCJsonrpcErrorMessageKey.String(val) 2446 } 2447 2448 // Tech-specific attributes for Connect RPC. 2449 const ( 2450 // RPCConnectRPCErrorCodeKey is the attribute Key conforming to the 2451 // "rpc.connect_rpc.error_code" semantic conventions. It represents the 2452 // [error codes](https://connect.build/docs/protocol/#error-codes) of the 2453 // Connect request. Error codes are always string values. 2454 // 2455 // Type: Enum 2456 // RequirementLevel: ConditionallyRequired (If response is not successful 2457 // and if error code available.) 2458 // Stability: stable 2459 RPCConnectRPCErrorCodeKey = attribute.Key("rpc.connect_rpc.error_code") 2460 ) 2461 2462 var ( 2463 // cancelled 2464 RPCConnectRPCErrorCodeCancelled = RPCConnectRPCErrorCodeKey.String("cancelled") 2465 // unknown 2466 RPCConnectRPCErrorCodeUnknown = RPCConnectRPCErrorCodeKey.String("unknown") 2467 // invalid_argument 2468 RPCConnectRPCErrorCodeInvalidArgument = RPCConnectRPCErrorCodeKey.String("invalid_argument") 2469 // deadline_exceeded 2470 RPCConnectRPCErrorCodeDeadlineExceeded = RPCConnectRPCErrorCodeKey.String("deadline_exceeded") 2471 // not_found 2472 RPCConnectRPCErrorCodeNotFound = RPCConnectRPCErrorCodeKey.String("not_found") 2473 // already_exists 2474 RPCConnectRPCErrorCodeAlreadyExists = RPCConnectRPCErrorCodeKey.String("already_exists") 2475 // permission_denied 2476 RPCConnectRPCErrorCodePermissionDenied = RPCConnectRPCErrorCodeKey.String("permission_denied") 2477 // resource_exhausted 2478 RPCConnectRPCErrorCodeResourceExhausted = RPCConnectRPCErrorCodeKey.String("resource_exhausted") 2479 // failed_precondition 2480 RPCConnectRPCErrorCodeFailedPrecondition = RPCConnectRPCErrorCodeKey.String("failed_precondition") 2481 // aborted 2482 RPCConnectRPCErrorCodeAborted = RPCConnectRPCErrorCodeKey.String("aborted") 2483 // out_of_range 2484 RPCConnectRPCErrorCodeOutOfRange = RPCConnectRPCErrorCodeKey.String("out_of_range") 2485 // unimplemented 2486 RPCConnectRPCErrorCodeUnimplemented = RPCConnectRPCErrorCodeKey.String("unimplemented") 2487 // internal 2488 RPCConnectRPCErrorCodeInternal = RPCConnectRPCErrorCodeKey.String("internal") 2489 // unavailable 2490 RPCConnectRPCErrorCodeUnavailable = RPCConnectRPCErrorCodeKey.String("unavailable") 2491 // data_loss 2492 RPCConnectRPCErrorCodeDataLoss = RPCConnectRPCErrorCodeKey.String("data_loss") 2493 // unauthenticated 2494 RPCConnectRPCErrorCodeUnauthenticated = RPCConnectRPCErrorCodeKey.String("unauthenticated") 2495 ) 2496