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.19.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: ConditionallyRequired (If applicable and not 309 // explicitly disabled via instrumentation configuration.) 310 // Stability: stable 311 // Examples: 'SELECT * FROM wuser_table', 'SET mykey "WuValue"' 312 // Note: The value may be sanitized to exclude sensitive information. 313 DBStatementKey = attribute.Key("db.statement") 314 315 // DBOperationKey is the attribute Key conforming to the "db.operation" 316 // semantic conventions. It represents the name of the operation being 317 // executed, e.g. the [MongoDB command 318 // name](https://docs.mongodb.com/manual/reference/command/#database-operations) 319 // such as `findAndModify`, or the SQL keyword. 320 // 321 // Type: string 322 // RequirementLevel: ConditionallyRequired (If `db.statement` is not 323 // applicable.) 324 // Stability: stable 325 // Examples: 'findAndModify', 'HMSET', 'SELECT' 326 // Note: When setting this to an SQL keyword, it is not recommended to 327 // attempt any client-side parsing of `db.statement` just to get this 328 // property, but it should be set if the operation name is provided by the 329 // library being instrumented. If the SQL statement has an ambiguous 330 // operation, or performs more than one operation, this value may be 331 // omitted. 332 DBOperationKey = attribute.Key("db.operation") 333 ) 334 335 var ( 336 // Some other SQL database. Fallback only. See notes 337 DBSystemOtherSQL = DBSystemKey.String("other_sql") 338 // Microsoft SQL Server 339 DBSystemMSSQL = DBSystemKey.String("mssql") 340 // Microsoft SQL Server Compact 341 DBSystemMssqlcompact = DBSystemKey.String("mssqlcompact") 342 // MySQL 343 DBSystemMySQL = DBSystemKey.String("mysql") 344 // Oracle Database 345 DBSystemOracle = DBSystemKey.String("oracle") 346 // IBM DB2 347 DBSystemDB2 = DBSystemKey.String("db2") 348 // PostgreSQL 349 DBSystemPostgreSQL = DBSystemKey.String("postgresql") 350 // Amazon Redshift 351 DBSystemRedshift = DBSystemKey.String("redshift") 352 // Apache Hive 353 DBSystemHive = DBSystemKey.String("hive") 354 // Cloudscape 355 DBSystemCloudscape = DBSystemKey.String("cloudscape") 356 // HyperSQL DataBase 357 DBSystemHSQLDB = DBSystemKey.String("hsqldb") 358 // Progress Database 359 DBSystemProgress = DBSystemKey.String("progress") 360 // SAP MaxDB 361 DBSystemMaxDB = DBSystemKey.String("maxdb") 362 // SAP HANA 363 DBSystemHanaDB = DBSystemKey.String("hanadb") 364 // Ingres 365 DBSystemIngres = DBSystemKey.String("ingres") 366 // FirstSQL 367 DBSystemFirstSQL = DBSystemKey.String("firstsql") 368 // EnterpriseDB 369 DBSystemEDB = DBSystemKey.String("edb") 370 // InterSystems Caché 371 DBSystemCache = DBSystemKey.String("cache") 372 // Adabas (Adaptable Database System) 373 DBSystemAdabas = DBSystemKey.String("adabas") 374 // Firebird 375 DBSystemFirebird = DBSystemKey.String("firebird") 376 // Apache Derby 377 DBSystemDerby = DBSystemKey.String("derby") 378 // FileMaker 379 DBSystemFilemaker = DBSystemKey.String("filemaker") 380 // Informix 381 DBSystemInformix = DBSystemKey.String("informix") 382 // InstantDB 383 DBSystemInstantDB = DBSystemKey.String("instantdb") 384 // InterBase 385 DBSystemInterbase = DBSystemKey.String("interbase") 386 // MariaDB 387 DBSystemMariaDB = DBSystemKey.String("mariadb") 388 // Netezza 389 DBSystemNetezza = DBSystemKey.String("netezza") 390 // Pervasive PSQL 391 DBSystemPervasive = DBSystemKey.String("pervasive") 392 // PointBase 393 DBSystemPointbase = DBSystemKey.String("pointbase") 394 // SQLite 395 DBSystemSqlite = DBSystemKey.String("sqlite") 396 // Sybase 397 DBSystemSybase = DBSystemKey.String("sybase") 398 // Teradata 399 DBSystemTeradata = DBSystemKey.String("teradata") 400 // Vertica 401 DBSystemVertica = DBSystemKey.String("vertica") 402 // H2 403 DBSystemH2 = DBSystemKey.String("h2") 404 // ColdFusion IMQ 405 DBSystemColdfusion = DBSystemKey.String("coldfusion") 406 // Apache Cassandra 407 DBSystemCassandra = DBSystemKey.String("cassandra") 408 // Apache HBase 409 DBSystemHBase = DBSystemKey.String("hbase") 410 // MongoDB 411 DBSystemMongoDB = DBSystemKey.String("mongodb") 412 // Redis 413 DBSystemRedis = DBSystemKey.String("redis") 414 // Couchbase 415 DBSystemCouchbase = DBSystemKey.String("couchbase") 416 // CouchDB 417 DBSystemCouchDB = DBSystemKey.String("couchdb") 418 // Microsoft Azure Cosmos DB 419 DBSystemCosmosDB = DBSystemKey.String("cosmosdb") 420 // Amazon DynamoDB 421 DBSystemDynamoDB = DBSystemKey.String("dynamodb") 422 // Neo4j 423 DBSystemNeo4j = DBSystemKey.String("neo4j") 424 // Apache Geode 425 DBSystemGeode = DBSystemKey.String("geode") 426 // Elasticsearch 427 DBSystemElasticsearch = DBSystemKey.String("elasticsearch") 428 // Memcached 429 DBSystemMemcached = DBSystemKey.String("memcached") 430 // CockroachDB 431 DBSystemCockroachdb = DBSystemKey.String("cockroachdb") 432 // OpenSearch 433 DBSystemOpensearch = DBSystemKey.String("opensearch") 434 // ClickHouse 435 DBSystemClickhouse = DBSystemKey.String("clickhouse") 436 // Cloud Spanner 437 DBSystemSpanner = DBSystemKey.String("spanner") 438 ) 439 440 // DBConnectionString returns an attribute KeyValue conforming to the 441 // "db.connection_string" semantic conventions. It represents the connection 442 // string used to connect to the database. It is recommended to remove embedded 443 // credentials. 444 func DBConnectionString(val string) attribute.KeyValue { 445 return DBConnectionStringKey.String(val) 446 } 447 448 // DBUser returns an attribute KeyValue conforming to the "db.user" semantic 449 // conventions. It represents the username for accessing the database. 450 func DBUser(val string) attribute.KeyValue { 451 return DBUserKey.String(val) 452 } 453 454 // DBJDBCDriverClassname returns an attribute KeyValue conforming to the 455 // "db.jdbc.driver_classname" semantic conventions. It represents the 456 // fully-qualified class name of the [Java Database Connectivity 457 // (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver 458 // used to connect. 459 func DBJDBCDriverClassname(val string) attribute.KeyValue { 460 return DBJDBCDriverClassnameKey.String(val) 461 } 462 463 // DBName returns an attribute KeyValue conforming to the "db.name" semantic 464 // conventions. It represents the this attribute is used to report the name of 465 // the database being accessed. For commands that switch the database, this 466 // should be set to the target database (even if the command fails). 467 func DBName(val string) attribute.KeyValue { 468 return DBNameKey.String(val) 469 } 470 471 // DBStatement returns an attribute KeyValue conforming to the 472 // "db.statement" semantic conventions. It represents the database statement 473 // being executed. 474 func DBStatement(val string) attribute.KeyValue { 475 return DBStatementKey.String(val) 476 } 477 478 // DBOperation returns an attribute KeyValue conforming to the 479 // "db.operation" semantic conventions. It represents the name of the operation 480 // being executed, e.g. the [MongoDB command 481 // name](https://docs.mongodb.com/manual/reference/command/#database-operations) 482 // such as `findAndModify`, or the SQL keyword. 483 func DBOperation(val string) attribute.KeyValue { 484 return DBOperationKey.String(val) 485 } 486 487 // Connection-level attributes for Microsoft SQL Server 488 const ( 489 // DBMSSQLInstanceNameKey is the attribute Key conforming to the 490 // "db.mssql.instance_name" semantic conventions. It represents the 491 // Microsoft SQL Server [instance 492 // name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) 493 // connecting to. This name is used to determine the port of a named 494 // instance. 495 // 496 // Type: string 497 // RequirementLevel: Optional 498 // Stability: stable 499 // Examples: 'MSSQLSERVER' 500 // Note: If setting a `db.mssql.instance_name`, `net.peer.port` is no 501 // longer required (but still recommended if non-standard). 502 DBMSSQLInstanceNameKey = attribute.Key("db.mssql.instance_name") 503 ) 504 505 // DBMSSQLInstanceName returns an attribute KeyValue conforming to the 506 // "db.mssql.instance_name" semantic conventions. It represents the Microsoft 507 // SQL Server [instance 508 // name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) 509 // connecting to. This name is used to determine the port of a named instance. 510 func DBMSSQLInstanceName(val string) attribute.KeyValue { 511 return DBMSSQLInstanceNameKey.String(val) 512 } 513 514 // Call-level attributes for Cassandra 515 const ( 516 // DBCassandraPageSizeKey is the attribute Key conforming to the 517 // "db.cassandra.page_size" semantic conventions. It represents the fetch 518 // size used for paging, i.e. how many rows will be returned at once. 519 // 520 // Type: int 521 // RequirementLevel: Optional 522 // Stability: stable 523 // Examples: 5000 524 DBCassandraPageSizeKey = attribute.Key("db.cassandra.page_size") 525 526 // DBCassandraConsistencyLevelKey is the attribute Key conforming to the 527 // "db.cassandra.consistency_level" semantic conventions. It represents the 528 // consistency level of the query. Based on consistency values from 529 // [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). 530 // 531 // Type: Enum 532 // RequirementLevel: Optional 533 // Stability: stable 534 DBCassandraConsistencyLevelKey = attribute.Key("db.cassandra.consistency_level") 535 536 // DBCassandraTableKey is the attribute Key conforming to the 537 // "db.cassandra.table" semantic conventions. It represents the name of the 538 // primary table that the operation is acting upon, including the keyspace 539 // name (if applicable). 540 // 541 // Type: string 542 // RequirementLevel: Recommended 543 // Stability: stable 544 // Examples: 'mytable' 545 // Note: This mirrors the db.sql.table attribute but references cassandra 546 // rather than sql. It is not recommended to attempt any client-side 547 // parsing of `db.statement` just to get this property, but it should be 548 // set if it is provided by the library being instrumented. If the 549 // operation is acting upon an anonymous table, or more than one table, 550 // this value MUST NOT be set. 551 DBCassandraTableKey = attribute.Key("db.cassandra.table") 552 553 // DBCassandraIdempotenceKey is the attribute Key conforming to the 554 // "db.cassandra.idempotence" semantic conventions. It represents the 555 // whether or not the query is idempotent. 556 // 557 // Type: boolean 558 // RequirementLevel: Optional 559 // Stability: stable 560 DBCassandraIdempotenceKey = attribute.Key("db.cassandra.idempotence") 561 562 // DBCassandraSpeculativeExecutionCountKey is the attribute Key conforming 563 // to the "db.cassandra.speculative_execution_count" semantic conventions. 564 // It represents the number of times a query was speculatively executed. 565 // Not set or `0` if the query was not executed speculatively. 566 // 567 // Type: int 568 // RequirementLevel: Optional 569 // Stability: stable 570 // Examples: 0, 2 571 DBCassandraSpeculativeExecutionCountKey = attribute.Key("db.cassandra.speculative_execution_count") 572 573 // DBCassandraCoordinatorIDKey is the attribute Key conforming to the 574 // "db.cassandra.coordinator.id" semantic conventions. It represents the ID 575 // of the coordinating node for a query. 576 // 577 // Type: string 578 // RequirementLevel: Optional 579 // Stability: stable 580 // Examples: 'be13faa2-8574-4d71-926d-27f16cf8a7af' 581 DBCassandraCoordinatorIDKey = attribute.Key("db.cassandra.coordinator.id") 582 583 // DBCassandraCoordinatorDCKey is the attribute Key conforming to the 584 // "db.cassandra.coordinator.dc" semantic conventions. It represents the 585 // data center of the coordinating node for a query. 586 // 587 // Type: string 588 // RequirementLevel: Optional 589 // Stability: stable 590 // Examples: 'us-west-2' 591 DBCassandraCoordinatorDCKey = attribute.Key("db.cassandra.coordinator.dc") 592 ) 593 594 var ( 595 // all 596 DBCassandraConsistencyLevelAll = DBCassandraConsistencyLevelKey.String("all") 597 // each_quorum 598 DBCassandraConsistencyLevelEachQuorum = DBCassandraConsistencyLevelKey.String("each_quorum") 599 // quorum 600 DBCassandraConsistencyLevelQuorum = DBCassandraConsistencyLevelKey.String("quorum") 601 // local_quorum 602 DBCassandraConsistencyLevelLocalQuorum = DBCassandraConsistencyLevelKey.String("local_quorum") 603 // one 604 DBCassandraConsistencyLevelOne = DBCassandraConsistencyLevelKey.String("one") 605 // two 606 DBCassandraConsistencyLevelTwo = DBCassandraConsistencyLevelKey.String("two") 607 // three 608 DBCassandraConsistencyLevelThree = DBCassandraConsistencyLevelKey.String("three") 609 // local_one 610 DBCassandraConsistencyLevelLocalOne = DBCassandraConsistencyLevelKey.String("local_one") 611 // any 612 DBCassandraConsistencyLevelAny = DBCassandraConsistencyLevelKey.String("any") 613 // serial 614 DBCassandraConsistencyLevelSerial = DBCassandraConsistencyLevelKey.String("serial") 615 // local_serial 616 DBCassandraConsistencyLevelLocalSerial = DBCassandraConsistencyLevelKey.String("local_serial") 617 ) 618 619 // DBCassandraPageSize returns an attribute KeyValue conforming to the 620 // "db.cassandra.page_size" semantic conventions. It represents the fetch size 621 // used for paging, i.e. how many rows will be returned at once. 622 func DBCassandraPageSize(val int) attribute.KeyValue { 623 return DBCassandraPageSizeKey.Int(val) 624 } 625 626 // DBCassandraTable returns an attribute KeyValue conforming to the 627 // "db.cassandra.table" semantic conventions. It represents the name of the 628 // primary table that the operation is acting upon, including the keyspace name 629 // (if applicable). 630 func DBCassandraTable(val string) attribute.KeyValue { 631 return DBCassandraTableKey.String(val) 632 } 633 634 // DBCassandraIdempotence returns an attribute KeyValue conforming to the 635 // "db.cassandra.idempotence" semantic conventions. It represents the whether 636 // or not the query is idempotent. 637 func DBCassandraIdempotence(val bool) attribute.KeyValue { 638 return DBCassandraIdempotenceKey.Bool(val) 639 } 640 641 // DBCassandraSpeculativeExecutionCount returns an attribute KeyValue 642 // conforming to the "db.cassandra.speculative_execution_count" semantic 643 // conventions. It represents the number of times a query was speculatively 644 // executed. Not set or `0` if the query was not executed speculatively. 645 func DBCassandraSpeculativeExecutionCount(val int) attribute.KeyValue { 646 return DBCassandraSpeculativeExecutionCountKey.Int(val) 647 } 648 649 // DBCassandraCoordinatorID returns an attribute KeyValue conforming to the 650 // "db.cassandra.coordinator.id" semantic conventions. It represents the ID of 651 // the coordinating node for a query. 652 func DBCassandraCoordinatorID(val string) attribute.KeyValue { 653 return DBCassandraCoordinatorIDKey.String(val) 654 } 655 656 // DBCassandraCoordinatorDC returns an attribute KeyValue conforming to the 657 // "db.cassandra.coordinator.dc" semantic conventions. It represents the data 658 // center of the coordinating node for a query. 659 func DBCassandraCoordinatorDC(val string) attribute.KeyValue { 660 return DBCassandraCoordinatorDCKey.String(val) 661 } 662 663 // Call-level attributes for Redis 664 const ( 665 // DBRedisDBIndexKey is the attribute Key conforming to the 666 // "db.redis.database_index" semantic conventions. It represents the index 667 // of the database being accessed as used in the [`SELECT` 668 // command](https://redis.io/commands/select), provided as an integer. To 669 // be used instead of the generic `db.name` attribute. 670 // 671 // Type: int 672 // RequirementLevel: ConditionallyRequired (If other than the default 673 // database (`0`).) 674 // Stability: stable 675 // Examples: 0, 1, 15 676 DBRedisDBIndexKey = attribute.Key("db.redis.database_index") 677 ) 678 679 // DBRedisDBIndex returns an attribute KeyValue conforming to the 680 // "db.redis.database_index" semantic conventions. It represents the index of 681 // the database being accessed as used in the [`SELECT` 682 // command](https://redis.io/commands/select), provided as an integer. To be 683 // used instead of the generic `db.name` attribute. 684 func DBRedisDBIndex(val int) attribute.KeyValue { 685 return DBRedisDBIndexKey.Int(val) 686 } 687 688 // Call-level attributes for MongoDB 689 const ( 690 // DBMongoDBCollectionKey is the attribute Key conforming to the 691 // "db.mongodb.collection" semantic conventions. It represents the 692 // collection being accessed within the database stated in `db.name`. 693 // 694 // Type: string 695 // RequirementLevel: Required 696 // Stability: stable 697 // Examples: 'customers', 'products' 698 DBMongoDBCollectionKey = attribute.Key("db.mongodb.collection") 699 ) 700 701 // DBMongoDBCollection returns an attribute KeyValue conforming to the 702 // "db.mongodb.collection" semantic conventions. It represents the collection 703 // being accessed within the database stated in `db.name`. 704 func DBMongoDBCollection(val string) attribute.KeyValue { 705 return DBMongoDBCollectionKey.String(val) 706 } 707 708 // Call-level attributes for SQL databases 709 const ( 710 // DBSQLTableKey is the attribute Key conforming to the "db.sql.table" 711 // semantic conventions. It represents the name of the primary table that 712 // the operation is acting upon, including the database name (if 713 // applicable). 714 // 715 // Type: string 716 // RequirementLevel: Recommended 717 // Stability: stable 718 // Examples: 'public.users', 'customers' 719 // Note: It is not recommended to attempt any client-side parsing of 720 // `db.statement` just to get this property, but it should be set if it is 721 // provided by the library being instrumented. If the operation is acting 722 // upon an anonymous table, or more than one table, this value MUST NOT be 723 // set. 724 DBSQLTableKey = attribute.Key("db.sql.table") 725 ) 726 727 // DBSQLTable returns an attribute KeyValue conforming to the "db.sql.table" 728 // semantic conventions. It represents the name of the primary table that the 729 // operation is acting upon, including the database name (if applicable). 730 func DBSQLTable(val string) attribute.KeyValue { 731 return DBSQLTableKey.String(val) 732 } 733 734 // Span attributes used by non-OTLP exporters to represent OpenTelemetry Span's 735 // concepts. 736 const ( 737 // OTelStatusCodeKey is the attribute Key conforming to the 738 // "otel.status_code" semantic conventions. It represents the name of the 739 // code, either "OK" or "ERROR". MUST NOT be set if the status code is 740 // UNSET. 741 // 742 // Type: Enum 743 // RequirementLevel: Optional 744 // Stability: stable 745 OTelStatusCodeKey = attribute.Key("otel.status_code") 746 747 // OTelStatusDescriptionKey is the attribute Key conforming to the 748 // "otel.status_description" semantic conventions. It represents the 749 // description of the Status if it has a value, otherwise not set. 750 // 751 // Type: string 752 // RequirementLevel: Optional 753 // Stability: stable 754 // Examples: 'resource not found' 755 OTelStatusDescriptionKey = attribute.Key("otel.status_description") 756 ) 757 758 var ( 759 // The operation has been validated by an Application developer or Operator to have completed successfully 760 OTelStatusCodeOk = OTelStatusCodeKey.String("OK") 761 // The operation contains an error 762 OTelStatusCodeError = OTelStatusCodeKey.String("ERROR") 763 ) 764 765 // OTelStatusDescription returns an attribute KeyValue conforming to the 766 // "otel.status_description" semantic conventions. It represents the 767 // description of the Status if it has a value, otherwise not set. 768 func OTelStatusDescription(val string) attribute.KeyValue { 769 return OTelStatusDescriptionKey.String(val) 770 } 771 772 // This semantic convention describes an instance of a function that runs 773 // without provisioning or managing of servers (also known as serverless 774 // functions or Function as a Service (FaaS)) with spans. 775 const ( 776 // FaaSTriggerKey is the attribute Key conforming to the "faas.trigger" 777 // semantic conventions. It represents the type of the trigger which caused 778 // this function invocation. 779 // 780 // Type: Enum 781 // RequirementLevel: Optional 782 // Stability: stable 783 // Note: For the server/consumer span on the incoming side, 784 // `faas.trigger` MUST be set. 785 // 786 // Clients invoking FaaS instances usually cannot set `faas.trigger`, 787 // since they would typically need to look in the payload to determine 788 // the event type. If clients set it, it should be the same as the 789 // trigger that corresponding incoming would have (i.e., this has 790 // nothing to do with the underlying transport used to make the API 791 // call to invoke the lambda, which is often HTTP). 792 FaaSTriggerKey = attribute.Key("faas.trigger") 793 794 // FaaSInvocationIDKey is the attribute Key conforming to the 795 // "faas.invocation_id" semantic conventions. It represents the invocation 796 // ID of the current function invocation. 797 // 798 // Type: string 799 // RequirementLevel: Optional 800 // Stability: stable 801 // Examples: 'af9d5aa4-a685-4c5f-a22b-444f80b3cc28' 802 FaaSInvocationIDKey = attribute.Key("faas.invocation_id") 803 ) 804 805 var ( 806 // A response to some data source operation such as a database or filesystem read/write 807 FaaSTriggerDatasource = FaaSTriggerKey.String("datasource") 808 // To provide an answer to an inbound HTTP request 809 FaaSTriggerHTTP = FaaSTriggerKey.String("http") 810 // A function is set to be executed when messages are sent to a messaging system 811 FaaSTriggerPubsub = FaaSTriggerKey.String("pubsub") 812 // A function is scheduled to be executed regularly 813 FaaSTriggerTimer = FaaSTriggerKey.String("timer") 814 // If none of the others apply 815 FaaSTriggerOther = FaaSTriggerKey.String("other") 816 ) 817 818 // FaaSInvocationID returns an attribute KeyValue conforming to the 819 // "faas.invocation_id" semantic conventions. It represents the invocation ID 820 // of the current function invocation. 821 func FaaSInvocationID(val string) attribute.KeyValue { 822 return FaaSInvocationIDKey.String(val) 823 } 824 825 // Semantic Convention for FaaS triggered as a response to some data source 826 // operation such as a database or filesystem read/write. 827 const ( 828 // FaaSDocumentCollectionKey is the attribute Key conforming to the 829 // "faas.document.collection" semantic conventions. It represents the name 830 // of the source on which the triggering operation was performed. For 831 // example, in Cloud Storage or S3 corresponds to the bucket name, and in 832 // Cosmos DB to the database name. 833 // 834 // Type: string 835 // RequirementLevel: Required 836 // Stability: stable 837 // Examples: 'myBucketName', 'myDBName' 838 FaaSDocumentCollectionKey = attribute.Key("faas.document.collection") 839 840 // FaaSDocumentOperationKey is the attribute Key conforming to the 841 // "faas.document.operation" semantic conventions. It represents the 842 // describes the type of the operation that was performed on the data. 843 // 844 // Type: Enum 845 // RequirementLevel: Required 846 // Stability: stable 847 FaaSDocumentOperationKey = attribute.Key("faas.document.operation") 848 849 // FaaSDocumentTimeKey is the attribute Key conforming to the 850 // "faas.document.time" semantic conventions. It represents a string 851 // containing the time when the data was accessed in the [ISO 852 // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format 853 // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). 854 // 855 // Type: string 856 // RequirementLevel: Optional 857 // Stability: stable 858 // Examples: '2020-01-23T13:47:06Z' 859 FaaSDocumentTimeKey = attribute.Key("faas.document.time") 860 861 // FaaSDocumentNameKey is the attribute Key conforming to the 862 // "faas.document.name" semantic conventions. It represents the document 863 // name/table subjected to the operation. For example, in Cloud Storage or 864 // S3 is the name of the file, and in Cosmos DB the table name. 865 // 866 // Type: string 867 // RequirementLevel: Optional 868 // Stability: stable 869 // Examples: 'myFile.txt', 'myTableName' 870 FaaSDocumentNameKey = attribute.Key("faas.document.name") 871 ) 872 873 var ( 874 // When a new object is created 875 FaaSDocumentOperationInsert = FaaSDocumentOperationKey.String("insert") 876 // When an object is modified 877 FaaSDocumentOperationEdit = FaaSDocumentOperationKey.String("edit") 878 // When an object is deleted 879 FaaSDocumentOperationDelete = FaaSDocumentOperationKey.String("delete") 880 ) 881 882 // FaaSDocumentCollection returns an attribute KeyValue conforming to the 883 // "faas.document.collection" semantic conventions. It represents the name of 884 // the source on which the triggering operation was performed. For example, in 885 // Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the 886 // database name. 887 func FaaSDocumentCollection(val string) attribute.KeyValue { 888 return FaaSDocumentCollectionKey.String(val) 889 } 890 891 // FaaSDocumentTime returns an attribute KeyValue conforming to the 892 // "faas.document.time" semantic conventions. It represents a string containing 893 // the time when the data was accessed in the [ISO 894 // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format 895 // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). 896 func FaaSDocumentTime(val string) attribute.KeyValue { 897 return FaaSDocumentTimeKey.String(val) 898 } 899 900 // FaaSDocumentName returns an attribute KeyValue conforming to the 901 // "faas.document.name" semantic conventions. It represents the document 902 // name/table subjected to the operation. For example, in Cloud Storage or S3 903 // is the name of the file, and in Cosmos DB the table name. 904 func FaaSDocumentName(val string) attribute.KeyValue { 905 return FaaSDocumentNameKey.String(val) 906 } 907 908 // Semantic Convention for FaaS scheduled to be executed regularly. 909 const ( 910 // FaaSTimeKey is the attribute Key conforming to the "faas.time" semantic 911 // conventions. It represents a string containing the function invocation 912 // time in the [ISO 913 // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format 914 // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). 915 // 916 // Type: string 917 // RequirementLevel: Optional 918 // Stability: stable 919 // Examples: '2020-01-23T13:47:06Z' 920 FaaSTimeKey = attribute.Key("faas.time") 921 922 // FaaSCronKey is the attribute Key conforming to the "faas.cron" semantic 923 // conventions. It represents a string containing the schedule period as 924 // [Cron 925 // Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). 926 // 927 // Type: string 928 // RequirementLevel: Optional 929 // Stability: stable 930 // Examples: '0/5 * * * ? *' 931 FaaSCronKey = attribute.Key("faas.cron") 932 ) 933 934 // FaaSTime returns an attribute KeyValue conforming to the "faas.time" 935 // semantic conventions. It represents a string containing the function 936 // invocation time in the [ISO 937 // 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format 938 // expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). 939 func FaaSTime(val string) attribute.KeyValue { 940 return FaaSTimeKey.String(val) 941 } 942 943 // FaaSCron returns an attribute KeyValue conforming to the "faas.cron" 944 // semantic conventions. It represents a string containing the schedule period 945 // as [Cron 946 // Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). 947 func FaaSCron(val string) attribute.KeyValue { 948 return FaaSCronKey.String(val) 949 } 950 951 // Contains additional attributes for incoming FaaS spans. 952 const ( 953 // FaaSColdstartKey is the attribute Key conforming to the "faas.coldstart" 954 // semantic conventions. It represents a boolean that is true if the 955 // serverless function is executed for the first time (aka cold-start). 956 // 957 // Type: boolean 958 // RequirementLevel: Optional 959 // Stability: stable 960 FaaSColdstartKey = attribute.Key("faas.coldstart") 961 ) 962 963 // FaaSColdstart returns an attribute KeyValue conforming to the 964 // "faas.coldstart" semantic conventions. It represents a boolean that is true 965 // if the serverless function is executed for the first time (aka cold-start). 966 func FaaSColdstart(val bool) attribute.KeyValue { 967 return FaaSColdstartKey.Bool(val) 968 } 969 970 // Contains additional attributes for outgoing FaaS spans. 971 const ( 972 // FaaSInvokedNameKey is the attribute Key conforming to the 973 // "faas.invoked_name" semantic conventions. It represents the name of the 974 // invoked function. 975 // 976 // Type: string 977 // RequirementLevel: Required 978 // Stability: stable 979 // Examples: 'my-function' 980 // Note: SHOULD be equal to the `faas.name` resource attribute of the 981 // invoked function. 982 FaaSInvokedNameKey = attribute.Key("faas.invoked_name") 983 984 // FaaSInvokedProviderKey is the attribute Key conforming to the 985 // "faas.invoked_provider" semantic conventions. It represents the cloud 986 // provider of the invoked function. 987 // 988 // Type: Enum 989 // RequirementLevel: Required 990 // Stability: stable 991 // Note: SHOULD be equal to the `cloud.provider` resource attribute of the 992 // invoked function. 993 FaaSInvokedProviderKey = attribute.Key("faas.invoked_provider") 994 995 // FaaSInvokedRegionKey is the attribute Key conforming to the 996 // "faas.invoked_region" semantic conventions. It represents the cloud 997 // region of the invoked function. 998 // 999 // Type: string 1000 // RequirementLevel: ConditionallyRequired (For some cloud providers, like 1001 // AWS or GCP, the region in which a function is hosted is essential to 1002 // uniquely identify the function and also part of its endpoint. Since it's 1003 // part of the endpoint being called, the region is always known to 1004 // clients. In these cases, `faas.invoked_region` MUST be set accordingly. 1005 // If the region is unknown to the client or not required for identifying 1006 // the invoked function, setting `faas.invoked_region` is optional.) 1007 // Stability: stable 1008 // Examples: 'eu-central-1' 1009 // Note: SHOULD be equal to the `cloud.region` resource attribute of the 1010 // invoked function. 1011 FaaSInvokedRegionKey = attribute.Key("faas.invoked_region") 1012 ) 1013 1014 var ( 1015 // Alibaba Cloud 1016 FaaSInvokedProviderAlibabaCloud = FaaSInvokedProviderKey.String("alibaba_cloud") 1017 // Amazon Web Services 1018 FaaSInvokedProviderAWS = FaaSInvokedProviderKey.String("aws") 1019 // Microsoft Azure 1020 FaaSInvokedProviderAzure = FaaSInvokedProviderKey.String("azure") 1021 // Google Cloud Platform 1022 FaaSInvokedProviderGCP = FaaSInvokedProviderKey.String("gcp") 1023 // Tencent Cloud 1024 FaaSInvokedProviderTencentCloud = FaaSInvokedProviderKey.String("tencent_cloud") 1025 ) 1026 1027 // FaaSInvokedName returns an attribute KeyValue conforming to the 1028 // "faas.invoked_name" semantic conventions. It represents the name of the 1029 // invoked function. 1030 func FaaSInvokedName(val string) attribute.KeyValue { 1031 return FaaSInvokedNameKey.String(val) 1032 } 1033 1034 // FaaSInvokedRegion returns an attribute KeyValue conforming to the 1035 // "faas.invoked_region" semantic conventions. It represents the cloud region 1036 // of the invoked function. 1037 func FaaSInvokedRegion(val string) attribute.KeyValue { 1038 return FaaSInvokedRegionKey.String(val) 1039 } 1040 1041 // Operations that access some remote service. 1042 const ( 1043 // PeerServiceKey is the attribute Key conforming to the "peer.service" 1044 // semantic conventions. It represents the 1045 // [`service.name`](../../resource/semantic_conventions/README.md#service) 1046 // of the remote service. SHOULD be equal to the actual `service.name` 1047 // resource attribute of the remote service if any. 1048 // 1049 // Type: string 1050 // RequirementLevel: Optional 1051 // Stability: stable 1052 // Examples: 'AuthTokenCache' 1053 PeerServiceKey = attribute.Key("peer.service") 1054 ) 1055 1056 // PeerService returns an attribute KeyValue conforming to the 1057 // "peer.service" semantic conventions. It represents the 1058 // [`service.name`](../../resource/semantic_conventions/README.md#service) of 1059 // the remote service. SHOULD be equal to the actual `service.name` resource 1060 // attribute of the remote service if any. 1061 func PeerService(val string) attribute.KeyValue { 1062 return PeerServiceKey.String(val) 1063 } 1064 1065 // These attributes may be used for any operation with an authenticated and/or 1066 // authorized enduser. 1067 const ( 1068 // EnduserIDKey is the attribute Key conforming to the "enduser.id" 1069 // semantic conventions. It represents the username or client_id extracted 1070 // from the access token or 1071 // [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header 1072 // in the inbound request from outside the system. 1073 // 1074 // Type: string 1075 // RequirementLevel: Optional 1076 // Stability: stable 1077 // Examples: 'username' 1078 EnduserIDKey = attribute.Key("enduser.id") 1079 1080 // EnduserRoleKey is the attribute Key conforming to the "enduser.role" 1081 // semantic conventions. It represents the actual/assumed role the client 1082 // is making the request under extracted from token or application security 1083 // context. 1084 // 1085 // Type: string 1086 // RequirementLevel: Optional 1087 // Stability: stable 1088 // Examples: 'admin' 1089 EnduserRoleKey = attribute.Key("enduser.role") 1090 1091 // EnduserScopeKey is the attribute Key conforming to the "enduser.scope" 1092 // semantic conventions. It represents the scopes or granted authorities 1093 // the client currently possesses extracted from token or application 1094 // security context. The value would come from the scope associated with an 1095 // [OAuth 2.0 Access 1096 // Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute 1097 // value in a [SAML 2.0 1098 // Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). 1099 // 1100 // Type: string 1101 // RequirementLevel: Optional 1102 // Stability: stable 1103 // Examples: 'read:message, write:files' 1104 EnduserScopeKey = attribute.Key("enduser.scope") 1105 ) 1106 1107 // EnduserID returns an attribute KeyValue conforming to the "enduser.id" 1108 // semantic conventions. It represents the username or client_id extracted from 1109 // the access token or 1110 // [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in 1111 // the inbound request from outside the system. 1112 func EnduserID(val string) attribute.KeyValue { 1113 return EnduserIDKey.String(val) 1114 } 1115 1116 // EnduserRole returns an attribute KeyValue conforming to the 1117 // "enduser.role" semantic conventions. It represents the actual/assumed role 1118 // the client is making the request under extracted from token or application 1119 // security context. 1120 func EnduserRole(val string) attribute.KeyValue { 1121 return EnduserRoleKey.String(val) 1122 } 1123 1124 // EnduserScope returns an attribute KeyValue conforming to the 1125 // "enduser.scope" semantic conventions. It represents the scopes or granted 1126 // authorities the client currently possesses extracted from token or 1127 // application security context. The value would come from the scope associated 1128 // with an [OAuth 2.0 Access 1129 // Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute 1130 // value in a [SAML 2.0 1131 // Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). 1132 func EnduserScope(val string) attribute.KeyValue { 1133 return EnduserScopeKey.String(val) 1134 } 1135 1136 // These attributes may be used for any operation to store information about a 1137 // thread that started a span. 1138 const ( 1139 // ThreadIDKey is the attribute Key conforming to the "thread.id" semantic 1140 // conventions. It represents the current "managed" thread ID (as opposed 1141 // to OS thread ID). 1142 // 1143 // Type: int 1144 // RequirementLevel: Optional 1145 // Stability: stable 1146 // Examples: 42 1147 ThreadIDKey = attribute.Key("thread.id") 1148 1149 // ThreadNameKey is the attribute Key conforming to the "thread.name" 1150 // semantic conventions. It represents the current thread name. 1151 // 1152 // Type: string 1153 // RequirementLevel: Optional 1154 // Stability: stable 1155 // Examples: 'main' 1156 ThreadNameKey = attribute.Key("thread.name") 1157 ) 1158 1159 // ThreadID returns an attribute KeyValue conforming to the "thread.id" 1160 // semantic conventions. It represents the current "managed" thread ID (as 1161 // opposed to OS thread ID). 1162 func ThreadID(val int) attribute.KeyValue { 1163 return ThreadIDKey.Int(val) 1164 } 1165 1166 // ThreadName returns an attribute KeyValue conforming to the "thread.name" 1167 // semantic conventions. It represents the current thread name. 1168 func ThreadName(val string) attribute.KeyValue { 1169 return ThreadNameKey.String(val) 1170 } 1171 1172 // These attributes allow to report this unit of code and therefore to provide 1173 // more context about the span. 1174 const ( 1175 // CodeFunctionKey is the attribute Key conforming to the "code.function" 1176 // semantic conventions. It represents the method or function name, or 1177 // equivalent (usually rightmost part of the code unit's name). 1178 // 1179 // Type: string 1180 // RequirementLevel: Optional 1181 // Stability: stable 1182 // Examples: 'serveRequest' 1183 CodeFunctionKey = attribute.Key("code.function") 1184 1185 // CodeNamespaceKey is the attribute Key conforming to the "code.namespace" 1186 // semantic conventions. It represents the "namespace" within which 1187 // `code.function` is defined. Usually the qualified class or module name, 1188 // such that `code.namespace` + some separator + `code.function` form a 1189 // unique identifier for the code unit. 1190 // 1191 // Type: string 1192 // RequirementLevel: Optional 1193 // Stability: stable 1194 // Examples: 'com.example.MyHTTPService' 1195 CodeNamespaceKey = attribute.Key("code.namespace") 1196 1197 // CodeFilepathKey is the attribute Key conforming to the "code.filepath" 1198 // semantic conventions. It represents the source code file name that 1199 // identifies the code unit as uniquely as possible (preferably an absolute 1200 // file path). 1201 // 1202 // Type: string 1203 // RequirementLevel: Optional 1204 // Stability: stable 1205 // Examples: '/usr/local/MyApplication/content_root/app/index.php' 1206 CodeFilepathKey = attribute.Key("code.filepath") 1207 1208 // CodeLineNumberKey is the attribute Key conforming to the "code.lineno" 1209 // semantic conventions. It represents the line number in `code.filepath` 1210 // best representing the operation. It SHOULD point within the code unit 1211 // named in `code.function`. 1212 // 1213 // Type: int 1214 // RequirementLevel: Optional 1215 // Stability: stable 1216 // Examples: 42 1217 CodeLineNumberKey = attribute.Key("code.lineno") 1218 1219 // CodeColumnKey is the attribute Key conforming to the "code.column" 1220 // semantic conventions. It represents the column number in `code.filepath` 1221 // best representing the operation. It SHOULD point within the code unit 1222 // named in `code.function`. 1223 // 1224 // Type: int 1225 // RequirementLevel: Optional 1226 // Stability: stable 1227 // Examples: 16 1228 CodeColumnKey = attribute.Key("code.column") 1229 ) 1230 1231 // CodeFunction returns an attribute KeyValue conforming to the 1232 // "code.function" semantic conventions. It represents the method or function 1233 // name, or equivalent (usually rightmost part of the code unit's name). 1234 func CodeFunction(val string) attribute.KeyValue { 1235 return CodeFunctionKey.String(val) 1236 } 1237 1238 // CodeNamespace returns an attribute KeyValue conforming to the 1239 // "code.namespace" semantic conventions. It represents the "namespace" within 1240 // which `code.function` is defined. Usually the qualified class or module 1241 // name, such that `code.namespace` + some separator + `code.function` form a 1242 // unique identifier for the code unit. 1243 func CodeNamespace(val string) attribute.KeyValue { 1244 return CodeNamespaceKey.String(val) 1245 } 1246 1247 // CodeFilepath returns an attribute KeyValue conforming to the 1248 // "code.filepath" semantic conventions. It represents the source code file 1249 // name that identifies the code unit as uniquely as possible (preferably an 1250 // absolute file path). 1251 func CodeFilepath(val string) attribute.KeyValue { 1252 return CodeFilepathKey.String(val) 1253 } 1254 1255 // CodeLineNumber returns an attribute KeyValue conforming to the "code.lineno" 1256 // semantic conventions. It represents the line number in `code.filepath` best 1257 // representing the operation. It SHOULD point within the code unit named in 1258 // `code.function`. 1259 func CodeLineNumber(val int) attribute.KeyValue { 1260 return CodeLineNumberKey.Int(val) 1261 } 1262 1263 // CodeColumn returns an attribute KeyValue conforming to the "code.column" 1264 // semantic conventions. It represents the column number in `code.filepath` 1265 // best representing the operation. It SHOULD point within the code unit named 1266 // in `code.function`. 1267 func CodeColumn(val int) attribute.KeyValue { 1268 return CodeColumnKey.Int(val) 1269 } 1270 1271 // Semantic Convention for HTTP Client 1272 const ( 1273 // HTTPURLKey is the attribute Key conforming to the "http.url" semantic 1274 // conventions. It represents the full HTTP request URL in the form 1275 // `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is 1276 // not transmitted over HTTP, but if it is known, it should be included 1277 // nevertheless. 1278 // 1279 // Type: string 1280 // RequirementLevel: Required 1281 // Stability: stable 1282 // Examples: 'https://www.foo.bar/search?q=OpenTelemetry#SemConv' 1283 // Note: `http.url` MUST NOT contain credentials passed via URL in form of 1284 // `https://username:password@www.example.com/`. In such case the 1285 // attribute's value should be `https://www.example.com/`. 1286 HTTPURLKey = attribute.Key("http.url") 1287 1288 // HTTPResendCountKey is the attribute Key conforming to the 1289 // "http.resend_count" semantic conventions. It represents the ordinal 1290 // number of request resending attempt (for any reason, including 1291 // redirects). 1292 // 1293 // Type: int 1294 // RequirementLevel: Recommended (if and only if request was retried.) 1295 // Stability: stable 1296 // Examples: 3 1297 // Note: The resend count SHOULD be updated each time an HTTP request gets 1298 // resent by the client, regardless of what was the cause of the resending 1299 // (e.g. redirection, authorization failure, 503 Server Unavailable, 1300 // network issues, or any other). 1301 HTTPResendCountKey = attribute.Key("http.resend_count") 1302 ) 1303 1304 // HTTPURL returns an attribute KeyValue conforming to the "http.url" 1305 // semantic conventions. It represents the full HTTP request URL in the form 1306 // `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not 1307 // transmitted over HTTP, but if it is known, it should be included 1308 // nevertheless. 1309 func HTTPURL(val string) attribute.KeyValue { 1310 return HTTPURLKey.String(val) 1311 } 1312 1313 // HTTPResendCount returns an attribute KeyValue conforming to the 1314 // "http.resend_count" semantic conventions. It represents the ordinal number 1315 // of request resending attempt (for any reason, including redirects). 1316 func HTTPResendCount(val int) attribute.KeyValue { 1317 return HTTPResendCountKey.Int(val) 1318 } 1319 1320 // Semantic Convention for HTTP Server 1321 const ( 1322 // HTTPTargetKey is the attribute Key conforming to the "http.target" 1323 // semantic conventions. It represents the full request target as passed in 1324 // a HTTP request line or equivalent. 1325 // 1326 // Type: string 1327 // RequirementLevel: Required 1328 // Stability: stable 1329 // Examples: '/path/12314/?q=ddds' 1330 HTTPTargetKey = attribute.Key("http.target") 1331 1332 // HTTPClientIPKey is the attribute Key conforming to the "http.client_ip" 1333 // semantic conventions. It represents the IP address of the original 1334 // client behind all proxies, if known (e.g. from 1335 // [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)). 1336 // 1337 // Type: string 1338 // RequirementLevel: Optional 1339 // Stability: stable 1340 // Examples: '83.164.160.102' 1341 // Note: This is not necessarily the same as `net.sock.peer.addr`, which 1342 // would 1343 // identify the network-level peer, which may be a proxy. 1344 // 1345 // This attribute should be set when a source of information different 1346 // from the one used for `net.sock.peer.addr`, is available even if that 1347 // other 1348 // source just confirms the same value as `net.sock.peer.addr`. 1349 // Rationale: For `net.sock.peer.addr`, one typically does not know if it 1350 // comes from a proxy, reverse proxy, or the actual client. Setting 1351 // `http.client_ip` when it's the same as `net.sock.peer.addr` means that 1352 // one is at least somewhat confident that the address is not that of 1353 // the closest proxy. 1354 HTTPClientIPKey = attribute.Key("http.client_ip") 1355 ) 1356 1357 // HTTPTarget returns an attribute KeyValue conforming to the "http.target" 1358 // semantic conventions. It represents the full request target as passed in a 1359 // HTTP request line or equivalent. 1360 func HTTPTarget(val string) attribute.KeyValue { 1361 return HTTPTargetKey.String(val) 1362 } 1363 1364 // HTTPClientIP returns an attribute KeyValue conforming to the 1365 // "http.client_ip" semantic conventions. It represents the IP address of the 1366 // original client behind all proxies, if known (e.g. from 1367 // [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)). 1368 func HTTPClientIP(val string) attribute.KeyValue { 1369 return HTTPClientIPKey.String(val) 1370 } 1371 1372 // Attributes that exist for multiple DynamoDB request types. 1373 const ( 1374 // AWSDynamoDBTableNamesKey is the attribute Key conforming to the 1375 // "aws.dynamodb.table_names" semantic conventions. It represents the keys 1376 // in the `RequestItems` object field. 1377 // 1378 // Type: string[] 1379 // RequirementLevel: Optional 1380 // Stability: stable 1381 // Examples: 'Users', 'Cats' 1382 AWSDynamoDBTableNamesKey = attribute.Key("aws.dynamodb.table_names") 1383 1384 // AWSDynamoDBConsumedCapacityKey is the attribute Key conforming to the 1385 // "aws.dynamodb.consumed_capacity" semantic conventions. It represents the 1386 // JSON-serialized value of each item in the `ConsumedCapacity` response 1387 // field. 1388 // 1389 // Type: string[] 1390 // RequirementLevel: Optional 1391 // Stability: stable 1392 // Examples: '{ "CapacityUnits": number, "GlobalSecondaryIndexes": { 1393 // "string" : { "CapacityUnits": number, "ReadCapacityUnits": number, 1394 // "WriteCapacityUnits": number } }, "LocalSecondaryIndexes": { "string" : 1395 // { "CapacityUnits": number, "ReadCapacityUnits": number, 1396 // "WriteCapacityUnits": number } }, "ReadCapacityUnits": number, "Table": 1397 // { "CapacityUnits": number, "ReadCapacityUnits": number, 1398 // "WriteCapacityUnits": number }, "TableName": "string", 1399 // "WriteCapacityUnits": number }' 1400 AWSDynamoDBConsumedCapacityKey = attribute.Key("aws.dynamodb.consumed_capacity") 1401 1402 // AWSDynamoDBItemCollectionMetricsKey is the attribute Key conforming to 1403 // the "aws.dynamodb.item_collection_metrics" semantic conventions. It 1404 // represents the JSON-serialized value of the `ItemCollectionMetrics` 1405 // response field. 1406 // 1407 // Type: string 1408 // RequirementLevel: Optional 1409 // Stability: stable 1410 // Examples: '{ "string" : [ { "ItemCollectionKey": { "string" : { "B": 1411 // blob, "BOOL": boolean, "BS": [ blob ], "L": [ "AttributeValue" ], "M": { 1412 // "string" : "AttributeValue" }, "N": "string", "NS": [ "string" ], 1413 // "NULL": boolean, "S": "string", "SS": [ "string" ] } }, 1414 // "SizeEstimateRangeGB": [ number ] } ] }' 1415 AWSDynamoDBItemCollectionMetricsKey = attribute.Key("aws.dynamodb.item_collection_metrics") 1416 1417 // AWSDynamoDBProvisionedReadCapacityKey is the attribute Key conforming to 1418 // the "aws.dynamodb.provisioned_read_capacity" semantic conventions. It 1419 // represents the value of the `ProvisionedThroughput.ReadCapacityUnits` 1420 // request parameter. 1421 // 1422 // Type: double 1423 // RequirementLevel: Optional 1424 // Stability: stable 1425 // Examples: 1.0, 2.0 1426 AWSDynamoDBProvisionedReadCapacityKey = attribute.Key("aws.dynamodb.provisioned_read_capacity") 1427 1428 // AWSDynamoDBProvisionedWriteCapacityKey is the attribute Key conforming 1429 // to the "aws.dynamodb.provisioned_write_capacity" semantic conventions. 1430 // It represents the value of the 1431 // `ProvisionedThroughput.WriteCapacityUnits` request parameter. 1432 // 1433 // Type: double 1434 // RequirementLevel: Optional 1435 // Stability: stable 1436 // Examples: 1.0, 2.0 1437 AWSDynamoDBProvisionedWriteCapacityKey = attribute.Key("aws.dynamodb.provisioned_write_capacity") 1438 1439 // AWSDynamoDBConsistentReadKey is the attribute Key conforming to the 1440 // "aws.dynamodb.consistent_read" semantic conventions. It represents the 1441 // value of the `ConsistentRead` request parameter. 1442 // 1443 // Type: boolean 1444 // RequirementLevel: Optional 1445 // Stability: stable 1446 AWSDynamoDBConsistentReadKey = attribute.Key("aws.dynamodb.consistent_read") 1447 1448 // AWSDynamoDBProjectionKey is the attribute Key conforming to the 1449 // "aws.dynamodb.projection" semantic conventions. It represents the value 1450 // of the `ProjectionExpression` request parameter. 1451 // 1452 // Type: string 1453 // RequirementLevel: Optional 1454 // Stability: stable 1455 // Examples: 'Title', 'Title, Price, Color', 'Title, Description, 1456 // RelatedItems, ProductReviews' 1457 AWSDynamoDBProjectionKey = attribute.Key("aws.dynamodb.projection") 1458 1459 // AWSDynamoDBLimitKey is the attribute Key conforming to the 1460 // "aws.dynamodb.limit" semantic conventions. It represents the value of 1461 // the `Limit` request parameter. 1462 // 1463 // Type: int 1464 // RequirementLevel: Optional 1465 // Stability: stable 1466 // Examples: 10 1467 AWSDynamoDBLimitKey = attribute.Key("aws.dynamodb.limit") 1468 1469 // AWSDynamoDBAttributesToGetKey is the attribute Key conforming to the 1470 // "aws.dynamodb.attributes_to_get" semantic conventions. It represents the 1471 // value of the `AttributesToGet` request parameter. 1472 // 1473 // Type: string[] 1474 // RequirementLevel: Optional 1475 // Stability: stable 1476 // Examples: 'lives', 'id' 1477 AWSDynamoDBAttributesToGetKey = attribute.Key("aws.dynamodb.attributes_to_get") 1478 1479 // AWSDynamoDBIndexNameKey is the attribute Key conforming to the 1480 // "aws.dynamodb.index_name" semantic conventions. It represents the value 1481 // of the `IndexName` request parameter. 1482 // 1483 // Type: string 1484 // RequirementLevel: Optional 1485 // Stability: stable 1486 // Examples: 'name_to_group' 1487 AWSDynamoDBIndexNameKey = attribute.Key("aws.dynamodb.index_name") 1488 1489 // AWSDynamoDBSelectKey is the attribute Key conforming to the 1490 // "aws.dynamodb.select" semantic conventions. It represents the value of 1491 // the `Select` request parameter. 1492 // 1493 // Type: string 1494 // RequirementLevel: Optional 1495 // Stability: stable 1496 // Examples: 'ALL_ATTRIBUTES', 'COUNT' 1497 AWSDynamoDBSelectKey = attribute.Key("aws.dynamodb.select") 1498 ) 1499 1500 // AWSDynamoDBTableNames returns an attribute KeyValue conforming to the 1501 // "aws.dynamodb.table_names" semantic conventions. It represents the keys in 1502 // the `RequestItems` object field. 1503 func AWSDynamoDBTableNames(val ...string) attribute.KeyValue { 1504 return AWSDynamoDBTableNamesKey.StringSlice(val) 1505 } 1506 1507 // AWSDynamoDBConsumedCapacity returns an attribute KeyValue conforming to 1508 // the "aws.dynamodb.consumed_capacity" semantic conventions. It represents the 1509 // JSON-serialized value of each item in the `ConsumedCapacity` response field. 1510 func AWSDynamoDBConsumedCapacity(val ...string) attribute.KeyValue { 1511 return AWSDynamoDBConsumedCapacityKey.StringSlice(val) 1512 } 1513 1514 // AWSDynamoDBItemCollectionMetrics returns an attribute KeyValue conforming 1515 // to the "aws.dynamodb.item_collection_metrics" semantic conventions. It 1516 // represents the JSON-serialized value of the `ItemCollectionMetrics` response 1517 // field. 1518 func AWSDynamoDBItemCollectionMetrics(val string) attribute.KeyValue { 1519 return AWSDynamoDBItemCollectionMetricsKey.String(val) 1520 } 1521 1522 // AWSDynamoDBProvisionedReadCapacity returns an attribute KeyValue 1523 // conforming to the "aws.dynamodb.provisioned_read_capacity" semantic 1524 // conventions. It represents the value of the 1525 // `ProvisionedThroughput.ReadCapacityUnits` request parameter. 1526 func AWSDynamoDBProvisionedReadCapacity(val float64) attribute.KeyValue { 1527 return AWSDynamoDBProvisionedReadCapacityKey.Float64(val) 1528 } 1529 1530 // AWSDynamoDBProvisionedWriteCapacity returns an attribute KeyValue 1531 // conforming to the "aws.dynamodb.provisioned_write_capacity" semantic 1532 // conventions. It represents the value of the 1533 // `ProvisionedThroughput.WriteCapacityUnits` request parameter. 1534 func AWSDynamoDBProvisionedWriteCapacity(val float64) attribute.KeyValue { 1535 return AWSDynamoDBProvisionedWriteCapacityKey.Float64(val) 1536 } 1537 1538 // AWSDynamoDBConsistentRead returns an attribute KeyValue conforming to the 1539 // "aws.dynamodb.consistent_read" semantic conventions. It represents the value 1540 // of the `ConsistentRead` request parameter. 1541 func AWSDynamoDBConsistentRead(val bool) attribute.KeyValue { 1542 return AWSDynamoDBConsistentReadKey.Bool(val) 1543 } 1544 1545 // AWSDynamoDBProjection returns an attribute KeyValue conforming to the 1546 // "aws.dynamodb.projection" semantic conventions. It represents the value of 1547 // the `ProjectionExpression` request parameter. 1548 func AWSDynamoDBProjection(val string) attribute.KeyValue { 1549 return AWSDynamoDBProjectionKey.String(val) 1550 } 1551 1552 // AWSDynamoDBLimit returns an attribute KeyValue conforming to the 1553 // "aws.dynamodb.limit" semantic conventions. It represents the value of the 1554 // `Limit` request parameter. 1555 func AWSDynamoDBLimit(val int) attribute.KeyValue { 1556 return AWSDynamoDBLimitKey.Int(val) 1557 } 1558 1559 // AWSDynamoDBAttributesToGet returns an attribute KeyValue conforming to 1560 // the "aws.dynamodb.attributes_to_get" semantic conventions. It represents the 1561 // value of the `AttributesToGet` request parameter. 1562 func AWSDynamoDBAttributesToGet(val ...string) attribute.KeyValue { 1563 return AWSDynamoDBAttributesToGetKey.StringSlice(val) 1564 } 1565 1566 // AWSDynamoDBIndexName returns an attribute KeyValue conforming to the 1567 // "aws.dynamodb.index_name" semantic conventions. It represents the value of 1568 // the `IndexName` request parameter. 1569 func AWSDynamoDBIndexName(val string) attribute.KeyValue { 1570 return AWSDynamoDBIndexNameKey.String(val) 1571 } 1572 1573 // AWSDynamoDBSelect returns an attribute KeyValue conforming to the 1574 // "aws.dynamodb.select" semantic conventions. It represents the value of the 1575 // `Select` request parameter. 1576 func AWSDynamoDBSelect(val string) attribute.KeyValue { 1577 return AWSDynamoDBSelectKey.String(val) 1578 } 1579 1580 // DynamoDB.CreateTable 1581 const ( 1582 // AWSDynamoDBGlobalSecondaryIndexesKey is the attribute Key conforming to 1583 // the "aws.dynamodb.global_secondary_indexes" semantic conventions. It 1584 // represents the JSON-serialized value of each item of the 1585 // `GlobalSecondaryIndexes` request field 1586 // 1587 // Type: string[] 1588 // RequirementLevel: Optional 1589 // Stability: stable 1590 // Examples: '{ "IndexName": "string", "KeySchema": [ { "AttributeName": 1591 // "string", "KeyType": "string" } ], "Projection": { "NonKeyAttributes": [ 1592 // "string" ], "ProjectionType": "string" }, "ProvisionedThroughput": { 1593 // "ReadCapacityUnits": number, "WriteCapacityUnits": number } }' 1594 AWSDynamoDBGlobalSecondaryIndexesKey = attribute.Key("aws.dynamodb.global_secondary_indexes") 1595 1596 // AWSDynamoDBLocalSecondaryIndexesKey is the attribute Key conforming to 1597 // the "aws.dynamodb.local_secondary_indexes" semantic conventions. It 1598 // represents the JSON-serialized value of each item of the 1599 // `LocalSecondaryIndexes` request field. 1600 // 1601 // Type: string[] 1602 // RequirementLevel: Optional 1603 // Stability: stable 1604 // Examples: '{ "IndexARN": "string", "IndexName": "string", 1605 // "IndexSizeBytes": number, "ItemCount": number, "KeySchema": [ { 1606 // "AttributeName": "string", "KeyType": "string" } ], "Projection": { 1607 // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" } }' 1608 AWSDynamoDBLocalSecondaryIndexesKey = attribute.Key("aws.dynamodb.local_secondary_indexes") 1609 ) 1610 1611 // AWSDynamoDBGlobalSecondaryIndexes returns an attribute KeyValue 1612 // conforming to the "aws.dynamodb.global_secondary_indexes" semantic 1613 // conventions. It represents the JSON-serialized value of each item of the 1614 // `GlobalSecondaryIndexes` request field 1615 func AWSDynamoDBGlobalSecondaryIndexes(val ...string) attribute.KeyValue { 1616 return AWSDynamoDBGlobalSecondaryIndexesKey.StringSlice(val) 1617 } 1618 1619 // AWSDynamoDBLocalSecondaryIndexes returns an attribute KeyValue conforming 1620 // to the "aws.dynamodb.local_secondary_indexes" semantic conventions. It 1621 // represents the JSON-serialized value of each item of the 1622 // `LocalSecondaryIndexes` request field. 1623 func AWSDynamoDBLocalSecondaryIndexes(val ...string) attribute.KeyValue { 1624 return AWSDynamoDBLocalSecondaryIndexesKey.StringSlice(val) 1625 } 1626 1627 // DynamoDB.ListTables 1628 const ( 1629 // AWSDynamoDBExclusiveStartTableKey is the attribute Key conforming to the 1630 // "aws.dynamodb.exclusive_start_table" semantic conventions. It represents 1631 // the value of the `ExclusiveStartTableName` request parameter. 1632 // 1633 // Type: string 1634 // RequirementLevel: Optional 1635 // Stability: stable 1636 // Examples: 'Users', 'CatsTable' 1637 AWSDynamoDBExclusiveStartTableKey = attribute.Key("aws.dynamodb.exclusive_start_table") 1638 1639 // AWSDynamoDBTableCountKey is the attribute Key conforming to the 1640 // "aws.dynamodb.table_count" semantic conventions. It represents the the 1641 // number of items in the `TableNames` response parameter. 1642 // 1643 // Type: int 1644 // RequirementLevel: Optional 1645 // Stability: stable 1646 // Examples: 20 1647 AWSDynamoDBTableCountKey = attribute.Key("aws.dynamodb.table_count") 1648 ) 1649 1650 // AWSDynamoDBExclusiveStartTable returns an attribute KeyValue conforming 1651 // to the "aws.dynamodb.exclusive_start_table" semantic conventions. It 1652 // represents the value of the `ExclusiveStartTableName` request parameter. 1653 func AWSDynamoDBExclusiveStartTable(val string) attribute.KeyValue { 1654 return AWSDynamoDBExclusiveStartTableKey.String(val) 1655 } 1656 1657 // AWSDynamoDBTableCount returns an attribute KeyValue conforming to the 1658 // "aws.dynamodb.table_count" semantic conventions. It represents the the 1659 // number of items in the `TableNames` response parameter. 1660 func AWSDynamoDBTableCount(val int) attribute.KeyValue { 1661 return AWSDynamoDBTableCountKey.Int(val) 1662 } 1663 1664 // DynamoDB.Query 1665 const ( 1666 // AWSDynamoDBScanForwardKey is the attribute Key conforming to the 1667 // "aws.dynamodb.scan_forward" semantic conventions. It represents the 1668 // value of the `ScanIndexForward` request parameter. 1669 // 1670 // Type: boolean 1671 // RequirementLevel: Optional 1672 // Stability: stable 1673 AWSDynamoDBScanForwardKey = attribute.Key("aws.dynamodb.scan_forward") 1674 ) 1675 1676 // AWSDynamoDBScanForward returns an attribute KeyValue conforming to the 1677 // "aws.dynamodb.scan_forward" semantic conventions. It represents the value of 1678 // the `ScanIndexForward` request parameter. 1679 func AWSDynamoDBScanForward(val bool) attribute.KeyValue { 1680 return AWSDynamoDBScanForwardKey.Bool(val) 1681 } 1682 1683 // DynamoDB.Scan 1684 const ( 1685 // AWSDynamoDBSegmentKey is the attribute Key conforming to the 1686 // "aws.dynamodb.segment" semantic conventions. It represents the value of 1687 // the `Segment` request parameter. 1688 // 1689 // Type: int 1690 // RequirementLevel: Optional 1691 // Stability: stable 1692 // Examples: 10 1693 AWSDynamoDBSegmentKey = attribute.Key("aws.dynamodb.segment") 1694 1695 // AWSDynamoDBTotalSegmentsKey is the attribute Key conforming to the 1696 // "aws.dynamodb.total_segments" semantic conventions. It represents the 1697 // value of the `TotalSegments` request parameter. 1698 // 1699 // Type: int 1700 // RequirementLevel: Optional 1701 // Stability: stable 1702 // Examples: 100 1703 AWSDynamoDBTotalSegmentsKey = attribute.Key("aws.dynamodb.total_segments") 1704 1705 // AWSDynamoDBCountKey is the attribute Key conforming to the 1706 // "aws.dynamodb.count" semantic conventions. It represents the value of 1707 // the `Count` response parameter. 1708 // 1709 // Type: int 1710 // RequirementLevel: Optional 1711 // Stability: stable 1712 // Examples: 10 1713 AWSDynamoDBCountKey = attribute.Key("aws.dynamodb.count") 1714 1715 // AWSDynamoDBScannedCountKey is the attribute Key conforming to the 1716 // "aws.dynamodb.scanned_count" semantic conventions. It represents the 1717 // value of the `ScannedCount` response parameter. 1718 // 1719 // Type: int 1720 // RequirementLevel: Optional 1721 // Stability: stable 1722 // Examples: 50 1723 AWSDynamoDBScannedCountKey = attribute.Key("aws.dynamodb.scanned_count") 1724 ) 1725 1726 // AWSDynamoDBSegment returns an attribute KeyValue conforming to the 1727 // "aws.dynamodb.segment" semantic conventions. It represents the value of the 1728 // `Segment` request parameter. 1729 func AWSDynamoDBSegment(val int) attribute.KeyValue { 1730 return AWSDynamoDBSegmentKey.Int(val) 1731 } 1732 1733 // AWSDynamoDBTotalSegments returns an attribute KeyValue conforming to the 1734 // "aws.dynamodb.total_segments" semantic conventions. It represents the value 1735 // of the `TotalSegments` request parameter. 1736 func AWSDynamoDBTotalSegments(val int) attribute.KeyValue { 1737 return AWSDynamoDBTotalSegmentsKey.Int(val) 1738 } 1739 1740 // AWSDynamoDBCount returns an attribute KeyValue conforming to the 1741 // "aws.dynamodb.count" semantic conventions. It represents the value of the 1742 // `Count` response parameter. 1743 func AWSDynamoDBCount(val int) attribute.KeyValue { 1744 return AWSDynamoDBCountKey.Int(val) 1745 } 1746 1747 // AWSDynamoDBScannedCount returns an attribute KeyValue conforming to the 1748 // "aws.dynamodb.scanned_count" semantic conventions. It represents the value 1749 // of the `ScannedCount` response parameter. 1750 func AWSDynamoDBScannedCount(val int) attribute.KeyValue { 1751 return AWSDynamoDBScannedCountKey.Int(val) 1752 } 1753 1754 // DynamoDB.UpdateTable 1755 const ( 1756 // AWSDynamoDBAttributeDefinitionsKey is the attribute Key conforming to 1757 // the "aws.dynamodb.attribute_definitions" semantic conventions. It 1758 // represents the JSON-serialized value of each item in the 1759 // `AttributeDefinitions` request field. 1760 // 1761 // Type: string[] 1762 // RequirementLevel: Optional 1763 // Stability: stable 1764 // Examples: '{ "AttributeName": "string", "AttributeType": "string" }' 1765 AWSDynamoDBAttributeDefinitionsKey = attribute.Key("aws.dynamodb.attribute_definitions") 1766 1767 // AWSDynamoDBGlobalSecondaryIndexUpdatesKey is the attribute Key 1768 // conforming to the "aws.dynamodb.global_secondary_index_updates" semantic 1769 // conventions. It represents the JSON-serialized value of each item in the 1770 // the `GlobalSecondaryIndexUpdates` request field. 1771 // 1772 // Type: string[] 1773 // RequirementLevel: Optional 1774 // Stability: stable 1775 // Examples: '{ "Create": { "IndexName": "string", "KeySchema": [ { 1776 // "AttributeName": "string", "KeyType": "string" } ], "Projection": { 1777 // "NonKeyAttributes": [ "string" ], "ProjectionType": "string" }, 1778 // "ProvisionedThroughput": { "ReadCapacityUnits": number, 1779 // "WriteCapacityUnits": number } }' 1780 AWSDynamoDBGlobalSecondaryIndexUpdatesKey = attribute.Key("aws.dynamodb.global_secondary_index_updates") 1781 ) 1782 1783 // AWSDynamoDBAttributeDefinitions returns an attribute KeyValue conforming 1784 // to the "aws.dynamodb.attribute_definitions" semantic conventions. It 1785 // represents the JSON-serialized value of each item in the 1786 // `AttributeDefinitions` request field. 1787 func AWSDynamoDBAttributeDefinitions(val ...string) attribute.KeyValue { 1788 return AWSDynamoDBAttributeDefinitionsKey.StringSlice(val) 1789 } 1790 1791 // AWSDynamoDBGlobalSecondaryIndexUpdates returns an attribute KeyValue 1792 // conforming to the "aws.dynamodb.global_secondary_index_updates" semantic 1793 // conventions. It represents the JSON-serialized value of each item in the the 1794 // `GlobalSecondaryIndexUpdates` request field. 1795 func AWSDynamoDBGlobalSecondaryIndexUpdates(val ...string) attribute.KeyValue { 1796 return AWSDynamoDBGlobalSecondaryIndexUpdatesKey.StringSlice(val) 1797 } 1798 1799 // Semantic conventions to apply when instrumenting the GraphQL implementation. 1800 // They map GraphQL operations to attributes on a Span. 1801 const ( 1802 // GraphqlOperationNameKey is the attribute Key conforming to the 1803 // "graphql.operation.name" semantic conventions. It represents the name of 1804 // the operation being executed. 1805 // 1806 // Type: string 1807 // RequirementLevel: Optional 1808 // Stability: stable 1809 // Examples: 'findBookByID' 1810 GraphqlOperationNameKey = attribute.Key("graphql.operation.name") 1811 1812 // GraphqlOperationTypeKey is the attribute Key conforming to the 1813 // "graphql.operation.type" semantic conventions. It represents the type of 1814 // the operation being executed. 1815 // 1816 // Type: Enum 1817 // RequirementLevel: Optional 1818 // Stability: stable 1819 // Examples: 'query', 'mutation', 'subscription' 1820 GraphqlOperationTypeKey = attribute.Key("graphql.operation.type") 1821 1822 // GraphqlDocumentKey is the attribute Key conforming to the 1823 // "graphql.document" semantic conventions. It represents the GraphQL 1824 // document being executed. 1825 // 1826 // Type: string 1827 // RequirementLevel: Optional 1828 // Stability: stable 1829 // Examples: 'query findBookByID { bookByID(id: ?) { name } }' 1830 // Note: The value may be sanitized to exclude sensitive information. 1831 GraphqlDocumentKey = attribute.Key("graphql.document") 1832 ) 1833 1834 var ( 1835 // GraphQL query 1836 GraphqlOperationTypeQuery = GraphqlOperationTypeKey.String("query") 1837 // GraphQL mutation 1838 GraphqlOperationTypeMutation = GraphqlOperationTypeKey.String("mutation") 1839 // GraphQL subscription 1840 GraphqlOperationTypeSubscription = GraphqlOperationTypeKey.String("subscription") 1841 ) 1842 1843 // GraphqlOperationName returns an attribute KeyValue conforming to the 1844 // "graphql.operation.name" semantic conventions. It represents the name of the 1845 // operation being executed. 1846 func GraphqlOperationName(val string) attribute.KeyValue { 1847 return GraphqlOperationNameKey.String(val) 1848 } 1849 1850 // GraphqlDocument returns an attribute KeyValue conforming to the 1851 // "graphql.document" semantic conventions. It represents the GraphQL document 1852 // being executed. 1853 func GraphqlDocument(val string) attribute.KeyValue { 1854 return GraphqlDocumentKey.String(val) 1855 } 1856 1857 // General attributes used in messaging systems. 1858 const ( 1859 // MessagingSystemKey is the attribute Key conforming to the 1860 // "messaging.system" semantic conventions. It represents a string 1861 // identifying the messaging system. 1862 // 1863 // Type: string 1864 // RequirementLevel: Required 1865 // Stability: stable 1866 // Examples: 'kafka', 'rabbitmq', 'rocketmq', 'activemq', 'AmazonSQS' 1867 MessagingSystemKey = attribute.Key("messaging.system") 1868 1869 // MessagingOperationKey is the attribute Key conforming to the 1870 // "messaging.operation" semantic conventions. It represents a string 1871 // identifying the kind of messaging operation as defined in the [Operation 1872 // names](#operation-names) section above. 1873 // 1874 // Type: Enum 1875 // RequirementLevel: Required 1876 // Stability: stable 1877 // Note: If a custom value is used, it MUST be of low cardinality. 1878 MessagingOperationKey = attribute.Key("messaging.operation") 1879 1880 // MessagingBatchMessageCountKey is the attribute Key conforming to the 1881 // "messaging.batch.message_count" semantic conventions. It represents the 1882 // number of messages sent, received, or processed in the scope of the 1883 // batching operation. 1884 // 1885 // Type: int 1886 // RequirementLevel: ConditionallyRequired (If the span describes an 1887 // operation on a batch of messages.) 1888 // Stability: stable 1889 // Examples: 0, 1, 2 1890 // Note: Instrumentations SHOULD NOT set `messaging.batch.message_count` on 1891 // spans that operate with a single message. When a messaging client 1892 // library supports both batch and single-message API for the same 1893 // operation, instrumentations SHOULD use `messaging.batch.message_count` 1894 // for batching APIs and SHOULD NOT use it for single-message APIs. 1895 MessagingBatchMessageCountKey = attribute.Key("messaging.batch.message_count") 1896 ) 1897 1898 var ( 1899 // publish 1900 MessagingOperationPublish = MessagingOperationKey.String("publish") 1901 // receive 1902 MessagingOperationReceive = MessagingOperationKey.String("receive") 1903 // process 1904 MessagingOperationProcess = MessagingOperationKey.String("process") 1905 ) 1906 1907 // MessagingSystem returns an attribute KeyValue conforming to the 1908 // "messaging.system" semantic conventions. It represents a string identifying 1909 // the messaging system. 1910 func MessagingSystem(val string) attribute.KeyValue { 1911 return MessagingSystemKey.String(val) 1912 } 1913 1914 // MessagingBatchMessageCount returns an attribute KeyValue conforming to 1915 // the "messaging.batch.message_count" semantic conventions. It represents the 1916 // number of messages sent, received, or processed in the scope of the batching 1917 // operation. 1918 func MessagingBatchMessageCount(val int) attribute.KeyValue { 1919 return MessagingBatchMessageCountKey.Int(val) 1920 } 1921 1922 // Semantic convention for a consumer of messages received from a messaging 1923 // system 1924 const ( 1925 // MessagingConsumerIDKey is the attribute Key conforming to the 1926 // "messaging.consumer.id" semantic conventions. It represents the 1927 // identifier for the consumer receiving a message. For Kafka, set it to 1928 // `{messaging.kafka.consumer.group} - {messaging.kafka.client_id}`, if 1929 // both are present, or only `messaging.kafka.consumer.group`. For brokers, 1930 // such as RabbitMQ and Artemis, set it to the `client_id` of the client 1931 // consuming the message. 1932 // 1933 // Type: string 1934 // RequirementLevel: Optional 1935 // Stability: stable 1936 // Examples: 'mygroup - client-6' 1937 MessagingConsumerIDKey = attribute.Key("messaging.consumer.id") 1938 ) 1939 1940 // MessagingConsumerID returns an attribute KeyValue conforming to the 1941 // "messaging.consumer.id" semantic conventions. It represents the identifier 1942 // for the consumer receiving a message. For Kafka, set it to 1943 // `{messaging.kafka.consumer.group} - {messaging.kafka.client_id}`, if both 1944 // are present, or only `messaging.kafka.consumer.group`. For brokers, such as 1945 // RabbitMQ and Artemis, set it to the `client_id` of the client consuming the 1946 // message. 1947 func MessagingConsumerID(val string) attribute.KeyValue { 1948 return MessagingConsumerIDKey.String(val) 1949 } 1950 1951 // Semantic conventions for remote procedure calls. 1952 const ( 1953 // RPCSystemKey is the attribute Key conforming to the "rpc.system" 1954 // semantic conventions. It represents a string identifying the remoting 1955 // system. See below for a list of well-known identifiers. 1956 // 1957 // Type: Enum 1958 // RequirementLevel: Required 1959 // Stability: stable 1960 RPCSystemKey = attribute.Key("rpc.system") 1961 1962 // RPCServiceKey is the attribute Key conforming to the "rpc.service" 1963 // semantic conventions. It represents the full (logical) name of the 1964 // service being called, including its package name, if applicable. 1965 // 1966 // Type: string 1967 // RequirementLevel: Recommended 1968 // Stability: stable 1969 // Examples: 'myservice.EchoService' 1970 // Note: This is the logical name of the service from the RPC interface 1971 // perspective, which can be different from the name of any implementing 1972 // class. The `code.namespace` attribute may be used to store the latter 1973 // (despite the attribute name, it may include a class name; e.g., class 1974 // with method actually executing the call on the server side, RPC client 1975 // stub class on the client side). 1976 RPCServiceKey = attribute.Key("rpc.service") 1977 1978 // RPCMethodKey is the attribute Key conforming to the "rpc.method" 1979 // semantic conventions. It represents the name of the (logical) method 1980 // being called, must be equal to the $method part in the span name. 1981 // 1982 // Type: string 1983 // RequirementLevel: Recommended 1984 // Stability: stable 1985 // Examples: 'exampleMethod' 1986 // Note: This is the logical name of the method from the RPC interface 1987 // perspective, which can be different from the name of any implementing 1988 // method/function. The `code.function` attribute may be used to store the 1989 // latter (e.g., method actually executing the call on the server side, RPC 1990 // client stub method on the client side). 1991 RPCMethodKey = attribute.Key("rpc.method") 1992 ) 1993 1994 var ( 1995 // gRPC 1996 RPCSystemGRPC = RPCSystemKey.String("grpc") 1997 // Java RMI 1998 RPCSystemJavaRmi = RPCSystemKey.String("java_rmi") 1999 // .NET WCF 2000 RPCSystemDotnetWcf = RPCSystemKey.String("dotnet_wcf") 2001 // Apache Dubbo 2002 RPCSystemApacheDubbo = RPCSystemKey.String("apache_dubbo") 2003 // Connect RPC 2004 RPCSystemConnectRPC = RPCSystemKey.String("connect_rpc") 2005 ) 2006 2007 // RPCService returns an attribute KeyValue conforming to the "rpc.service" 2008 // semantic conventions. It represents the full (logical) name of the service 2009 // being called, including its package name, if applicable. 2010 func RPCService(val string) attribute.KeyValue { 2011 return RPCServiceKey.String(val) 2012 } 2013 2014 // RPCMethod returns an attribute KeyValue conforming to the "rpc.method" 2015 // semantic conventions. It represents the name of the (logical) method being 2016 // called, must be equal to the $method part in the span name. 2017 func RPCMethod(val string) attribute.KeyValue { 2018 return RPCMethodKey.String(val) 2019 } 2020 2021 // Tech-specific attributes for gRPC. 2022 const ( 2023 // RPCGRPCStatusCodeKey is the attribute Key conforming to the 2024 // "rpc.grpc.status_code" semantic conventions. It represents the [numeric 2025 // status 2026 // code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of 2027 // the gRPC request. 2028 // 2029 // Type: Enum 2030 // RequirementLevel: Required 2031 // Stability: stable 2032 RPCGRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code") 2033 ) 2034 2035 var ( 2036 // OK 2037 RPCGRPCStatusCodeOk = RPCGRPCStatusCodeKey.Int(0) 2038 // CANCELLED 2039 RPCGRPCStatusCodeCancelled = RPCGRPCStatusCodeKey.Int(1) 2040 // UNKNOWN 2041 RPCGRPCStatusCodeUnknown = RPCGRPCStatusCodeKey.Int(2) 2042 // INVALID_ARGUMENT 2043 RPCGRPCStatusCodeInvalidArgument = RPCGRPCStatusCodeKey.Int(3) 2044 // DEADLINE_EXCEEDED 2045 RPCGRPCStatusCodeDeadlineExceeded = RPCGRPCStatusCodeKey.Int(4) 2046 // NOT_FOUND 2047 RPCGRPCStatusCodeNotFound = RPCGRPCStatusCodeKey.Int(5) 2048 // ALREADY_EXISTS 2049 RPCGRPCStatusCodeAlreadyExists = RPCGRPCStatusCodeKey.Int(6) 2050 // PERMISSION_DENIED 2051 RPCGRPCStatusCodePermissionDenied = RPCGRPCStatusCodeKey.Int(7) 2052 // RESOURCE_EXHAUSTED 2053 RPCGRPCStatusCodeResourceExhausted = RPCGRPCStatusCodeKey.Int(8) 2054 // FAILED_PRECONDITION 2055 RPCGRPCStatusCodeFailedPrecondition = RPCGRPCStatusCodeKey.Int(9) 2056 // ABORTED 2057 RPCGRPCStatusCodeAborted = RPCGRPCStatusCodeKey.Int(10) 2058 // OUT_OF_RANGE 2059 RPCGRPCStatusCodeOutOfRange = RPCGRPCStatusCodeKey.Int(11) 2060 // UNIMPLEMENTED 2061 RPCGRPCStatusCodeUnimplemented = RPCGRPCStatusCodeKey.Int(12) 2062 // INTERNAL 2063 RPCGRPCStatusCodeInternal = RPCGRPCStatusCodeKey.Int(13) 2064 // UNAVAILABLE 2065 RPCGRPCStatusCodeUnavailable = RPCGRPCStatusCodeKey.Int(14) 2066 // DATA_LOSS 2067 RPCGRPCStatusCodeDataLoss = RPCGRPCStatusCodeKey.Int(15) 2068 // UNAUTHENTICATED 2069 RPCGRPCStatusCodeUnauthenticated = RPCGRPCStatusCodeKey.Int(16) 2070 ) 2071 2072 // Tech-specific attributes for [JSON RPC](https://www.jsonrpc.org/). 2073 const ( 2074 // RPCJsonrpcVersionKey is the attribute Key conforming to the 2075 // "rpc.jsonrpc.version" semantic conventions. It represents the protocol 2076 // version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 2077 // does not specify this, the value can be omitted. 2078 // 2079 // Type: string 2080 // RequirementLevel: ConditionallyRequired (If other than the default 2081 // version (`1.0`)) 2082 // Stability: stable 2083 // Examples: '2.0', '1.0' 2084 RPCJsonrpcVersionKey = attribute.Key("rpc.jsonrpc.version") 2085 2086 // RPCJsonrpcRequestIDKey is the attribute Key conforming to the 2087 // "rpc.jsonrpc.request_id" semantic conventions. It represents the `id` 2088 // property of request or response. Since protocol allows id to be int, 2089 // string, `null` or missing (for notifications), value is expected to be 2090 // cast to string for simplicity. Use empty string in case of `null` value. 2091 // Omit entirely if this is a notification. 2092 // 2093 // Type: string 2094 // RequirementLevel: Optional 2095 // Stability: stable 2096 // Examples: '10', 'request-7', '' 2097 RPCJsonrpcRequestIDKey = attribute.Key("rpc.jsonrpc.request_id") 2098 2099 // RPCJsonrpcErrorCodeKey is the attribute Key conforming to the 2100 // "rpc.jsonrpc.error_code" semantic conventions. It represents the 2101 // `error.code` property of response if it is an error response. 2102 // 2103 // Type: int 2104 // RequirementLevel: ConditionallyRequired (If response is not successful.) 2105 // Stability: stable 2106 // Examples: -32700, 100 2107 RPCJsonrpcErrorCodeKey = attribute.Key("rpc.jsonrpc.error_code") 2108 2109 // RPCJsonrpcErrorMessageKey is the attribute Key conforming to the 2110 // "rpc.jsonrpc.error_message" semantic conventions. It represents the 2111 // `error.message` property of response if it is an error response. 2112 // 2113 // Type: string 2114 // RequirementLevel: Optional 2115 // Stability: stable 2116 // Examples: 'Parse error', 'User already exists' 2117 RPCJsonrpcErrorMessageKey = attribute.Key("rpc.jsonrpc.error_message") 2118 ) 2119 2120 // RPCJsonrpcVersion returns an attribute KeyValue conforming to the 2121 // "rpc.jsonrpc.version" semantic conventions. It represents the protocol 2122 // version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 2123 // does not specify this, the value can be omitted. 2124 func RPCJsonrpcVersion(val string) attribute.KeyValue { 2125 return RPCJsonrpcVersionKey.String(val) 2126 } 2127 2128 // RPCJsonrpcRequestID returns an attribute KeyValue conforming to the 2129 // "rpc.jsonrpc.request_id" semantic conventions. It represents the `id` 2130 // property of request or response. Since protocol allows id to be int, string, 2131 // `null` or missing (for notifications), value is expected to be cast to 2132 // string for simplicity. Use empty string in case of `null` value. Omit 2133 // entirely if this is a notification. 2134 func RPCJsonrpcRequestID(val string) attribute.KeyValue { 2135 return RPCJsonrpcRequestIDKey.String(val) 2136 } 2137 2138 // RPCJsonrpcErrorCode returns an attribute KeyValue conforming to the 2139 // "rpc.jsonrpc.error_code" semantic conventions. It represents the 2140 // `error.code` property of response if it is an error response. 2141 func RPCJsonrpcErrorCode(val int) attribute.KeyValue { 2142 return RPCJsonrpcErrorCodeKey.Int(val) 2143 } 2144 2145 // RPCJsonrpcErrorMessage returns an attribute KeyValue conforming to the 2146 // "rpc.jsonrpc.error_message" semantic conventions. It represents the 2147 // `error.message` property of response if it is an error response. 2148 func RPCJsonrpcErrorMessage(val string) attribute.KeyValue { 2149 return RPCJsonrpcErrorMessageKey.String(val) 2150 } 2151 2152 // Tech-specific attributes for Connect RPC. 2153 const ( 2154 // RPCConnectRPCErrorCodeKey is the attribute Key conforming to the 2155 // "rpc.connect_rpc.error_code" semantic conventions. It represents the 2156 // [error codes](https://connect.build/docs/protocol/#error-codes) of the 2157 // Connect request. Error codes are always string values. 2158 // 2159 // Type: Enum 2160 // RequirementLevel: ConditionallyRequired (If response is not successful 2161 // and if error code available.) 2162 // Stability: stable 2163 RPCConnectRPCErrorCodeKey = attribute.Key("rpc.connect_rpc.error_code") 2164 ) 2165 2166 var ( 2167 // cancelled 2168 RPCConnectRPCErrorCodeCancelled = RPCConnectRPCErrorCodeKey.String("cancelled") 2169 // unknown 2170 RPCConnectRPCErrorCodeUnknown = RPCConnectRPCErrorCodeKey.String("unknown") 2171 // invalid_argument 2172 RPCConnectRPCErrorCodeInvalidArgument = RPCConnectRPCErrorCodeKey.String("invalid_argument") 2173 // deadline_exceeded 2174 RPCConnectRPCErrorCodeDeadlineExceeded = RPCConnectRPCErrorCodeKey.String("deadline_exceeded") 2175 // not_found 2176 RPCConnectRPCErrorCodeNotFound = RPCConnectRPCErrorCodeKey.String("not_found") 2177 // already_exists 2178 RPCConnectRPCErrorCodeAlreadyExists = RPCConnectRPCErrorCodeKey.String("already_exists") 2179 // permission_denied 2180 RPCConnectRPCErrorCodePermissionDenied = RPCConnectRPCErrorCodeKey.String("permission_denied") 2181 // resource_exhausted 2182 RPCConnectRPCErrorCodeResourceExhausted = RPCConnectRPCErrorCodeKey.String("resource_exhausted") 2183 // failed_precondition 2184 RPCConnectRPCErrorCodeFailedPrecondition = RPCConnectRPCErrorCodeKey.String("failed_precondition") 2185 // aborted 2186 RPCConnectRPCErrorCodeAborted = RPCConnectRPCErrorCodeKey.String("aborted") 2187 // out_of_range 2188 RPCConnectRPCErrorCodeOutOfRange = RPCConnectRPCErrorCodeKey.String("out_of_range") 2189 // unimplemented 2190 RPCConnectRPCErrorCodeUnimplemented = RPCConnectRPCErrorCodeKey.String("unimplemented") 2191 // internal 2192 RPCConnectRPCErrorCodeInternal = RPCConnectRPCErrorCodeKey.String("internal") 2193 // unavailable 2194 RPCConnectRPCErrorCodeUnavailable = RPCConnectRPCErrorCodeKey.String("unavailable") 2195 // data_loss 2196 RPCConnectRPCErrorCodeDataLoss = RPCConnectRPCErrorCodeKey.String("data_loss") 2197 // unauthenticated 2198 RPCConnectRPCErrorCodeUnauthenticated = RPCConnectRPCErrorCodeKey.String("unauthenticated") 2199 ) 2200