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