Debian Codegraph @

semconv/v1.18.0/trace.go

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