From 8f15440b45dd7e8cfc4e7b113df9ebc810553626 Mon Sep 17 00:00:00 2001
From: Ehsan Saei <71217171+esigo@users.noreply.github.com>
Date: Tue, 16 Apr 2024 23:29:10 +0200
Subject: [PATCH] [SEMANTIC CONVENTIONS] Upgrade to semantic convention 1.25.0
(#2633)
---
.../trace/semantic_conventions.h | 2634 ++++++++++++-----
buildscripts/semantic-convention/generate.sh | 4 +-
examples/grpc/client.cc | 16 +-
examples/grpc/server.cc | 15 +-
examples/http/client.cc | 16 +-
examples/http/server.cc | 22 +-
exporters/zipkin/src/recordable.cc | 5 +-
.../sdk/resource/semantic_conventions.h | 945 +-----
sdk/src/resource/resource.cc | 14 +-
sdk/src/resource/resource_detector.cc | 3 +-
sdk/test/resource/resource_test.cc | 25 +-
11 files changed, 2018 insertions(+), 1681 deletions(-)
diff --git a/api/include/opentelemetry/trace/semantic_conventions.h b/api/include/opentelemetry/trace/semantic_conventions.h
index baad4e674f..ba783e2333 100644
--- a/api/include/opentelemetry/trace/semantic_conventions.h
+++ b/api/include/opentelemetry/trace/semantic_conventions.h
@@ -22,76 +22,14 @@ namespace SemanticConventions
/**
* The URL of the OpenTelemetry schema for these keys and values.
*/
-static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.24.0";
-
-/**
- * The name of the invoked function.
- *
- *
Notes:
-
- SHOULD be equal to the {@code faas.name} resource attribute of the invoked function.
-
- */
-static constexpr const char *kFaasInvokedName = "faas.invoked_name";
-
-/**
- * The cloud provider of the invoked function.
- *
- * Notes:
-
- SHOULD be equal to the {@code cloud.provider} resource attribute of the invoked
- function.
- */
-static constexpr const char *kFaasInvokedProvider = "faas.invoked_provider";
-
-/**
- * The cloud region of the invoked function.
- *
- * Notes:
-
- SHOULD be equal to the {@code cloud.region} resource attribute of the invoked
- function.
- */
-static constexpr const char *kFaasInvokedRegion = "faas.invoked_region";
-
-/**
- * Type of the trigger which caused this function invocation.
- */
-static constexpr const char *kFaasTrigger = "faas.trigger";
-
-/**
- * The {@code service.name} of the remote service.
- * SHOULD be equal to the actual {@code service.name} resource attribute of the remote service if
- * any.
- */
-static constexpr const char *kPeerService = "peer.service";
-
-/**
- * Username or client_id extracted from the access token or Authorization header in the inbound
- * request from outside the system.
- */
-static constexpr const char *kEnduserId = "enduser.id";
-
-/**
- * Actual/assumed role the client is making the request under extracted from token or application
- * security context.
- */
-static constexpr const char *kEnduserRole = "enduser.role";
-
-/**
- * Scopes or granted authorities the client currently possesses extracted from token or application
- * security context. The value would come from the scope associated with an OAuth 2.0 Access Token or an attribute
- * value in a SAML 2.0
- * Assertion.
- */
-static constexpr const char *kEnduserScope = "enduser.scope";
+static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.25.0";
/**
* Identifies the class / type of event.
*
* Notes:
*/
@@ -157,9 +95,9 @@ static constexpr const char *kAndroidState = "android.state";
/**
* The name of the connection pool; unique within the instrumented application. In case the
- * connection pool implementation doesn't provide a name, then the db.connection_string
- * should be used
+ * connection pool implementation doesn't provide a name, instrumentation should use a combination
+ * of {@code server.address} and {@code server.port} attributes formatted as {@code
+ * server.address:server.port}.
*/
static constexpr const char *kPoolName = "pool.name";
@@ -168,6 +106,11 @@ static constexpr const char *kPoolName = "pool.name";
*/
static constexpr const char *kState = "state";
+/**
+ * Rate-limiting result, shows whether the lease was acquired or contains a rejection reason
+ */
+static constexpr const char *kAspnetcoreRateLimitingResult = "aspnetcore.rate_limiting.result";
+
/**
* Full type name of the {@code
@@ -181,11 +124,6 @@ static constexpr const char *kAspnetcoreDiagnosticsHandlerType =
*/
static constexpr const char *kAspnetcoreRateLimitingPolicy = "aspnetcore.rate_limiting.policy";
-/**
- * Rate-limiting result, shows whether the lease was acquired or contains a rejection reason
- */
-static constexpr const char *kAspnetcoreRateLimitingResult = "aspnetcore.rate_limiting.result";
-
/**
* Flag indicating if request was handled by the application pipeline.
*/
@@ -233,6 +171,12 @@ static constexpr const char *kJvmMemoryPoolName = "jvm.memory.pool.name";
*/
static constexpr const char *kJvmMemoryType = "jvm.memory.type";
+/**
+ * The CPU state for this data point. A process SHOULD be characterized either by data
+ * points with no {@code state} labels, or only data points with {@code state} labels.
+ */
+static constexpr const char *kProcessCpuState = "process.cpu.state";
+
/**
* The device identifier
*/
@@ -244,7 +188,8 @@ static constexpr const char *kSystemDevice = "system.device";
static constexpr const char *kSystemCpuLogicalNumber = "system.cpu.logical_number";
/**
- * The state of the CPU
+ * The CPU state for this data point. A system's CPU SHOULD be characterized either by data
+ * points with no {@code state} labels, or only data points with {@code state} labels.
*/
static constexpr const char *kSystemCpuState = "system.cpu.state";
@@ -298,512 +243,1313 @@ static constexpr const char *kSystemNetworkState = "system.network.state";
* href="https://man7.org/linux/man-pages/man1/ps.1.html#PROCESS_STATE_CODES">Linux Process State
* Codes
*/
-static constexpr const char *kSystemProcessesStatus = "system.processes.status";
+static constexpr const char *kSystemProcessStatus = "system.process.status";
/**
- * Client address - domain name if available without reverse DNS lookup; otherwise, IP address or
- Unix domain socket name.
- *
- * Notes:
-
- When observed from the server side, and when communicating through an intermediary,
- {@code client.address} SHOULD represent the client address behind any intermediaries, for example
- proxies, if it's available.
+ * Uniquely identifies the framework API revision offered by a version ({@code os.version}) of the
+ * android operating system. More information can be found here.
*/
-static constexpr const char *kClientAddress = "client.address";
+static constexpr const char *kAndroidOsApiLevel = "android.os.api_level";
/**
- * Client port number.
- *
- * Notes:
-
- When observed from the server side, and when communicating through an intermediary,
- {@code client.port} SHOULD represent the client port behind any intermediaries, for example
- proxies, if it's available.
+ * The JSON-serialized value of each item in the {@code AttributeDefinitions} request field.
*/
-static constexpr const char *kClientPort = "client.port";
+static constexpr const char *kAwsDynamodbAttributeDefinitions =
+ "aws.dynamodb.attribute_definitions";
/**
- * The column number in {@code code.filepath} best representing the operation. It SHOULD point
- * within the code unit named in {@code code.function}.
+ * The value of the {@code AttributesToGet} request parameter.
*/
-static constexpr const char *kCodeColumn = "code.column";
+static constexpr const char *kAwsDynamodbAttributesToGet = "aws.dynamodb.attributes_to_get";
/**
- * The source code file name that identifies the code unit as uniquely as possible (preferably an
- * absolute file path).
+ * The value of the {@code ConsistentRead} request parameter.
*/
-static constexpr const char *kCodeFilepath = "code.filepath";
+static constexpr const char *kAwsDynamodbConsistentRead = "aws.dynamodb.consistent_read";
/**
- * The method or function name, or equivalent (usually rightmost part of the code unit's name).
+ * The JSON-serialized value of each item in the {@code ConsumedCapacity} response field.
*/
-static constexpr const char *kCodeFunction = "code.function";
+static constexpr const char *kAwsDynamodbConsumedCapacity = "aws.dynamodb.consumed_capacity";
/**
- * The line number in {@code code.filepath} best representing the operation. It SHOULD point within
- * the code unit named in {@code code.function}.
+ * The value of the {@code Count} response parameter.
*/
-static constexpr const char *kCodeLineno = "code.lineno";
+static constexpr const char *kAwsDynamodbCount = "aws.dynamodb.count";
/**
- * The "namespace" within which {@code code.function} is defined. Usually the qualified
- * class or module name, such that {@code code.namespace} + some separator + {@code code.function}
- * form a unique identifier for the code unit.
+ * The value of the {@code ExclusiveStartTableName} request parameter.
*/
-static constexpr const char *kCodeNamespace = "code.namespace";
+static constexpr const char *kAwsDynamodbExclusiveStartTable = "aws.dynamodb.exclusive_start_table";
/**
- * A stacktrace as a string in the natural representation for the language runtime. The
- * representation is to be determined and documented by each language SIG.
+ * The JSON-serialized value of each item in the {@code GlobalSecondaryIndexUpdates} request field.
*/
-static constexpr const char *kCodeStacktrace = "code.stacktrace";
+static constexpr const char *kAwsDynamodbGlobalSecondaryIndexUpdates =
+ "aws.dynamodb.global_secondary_index_updates";
/**
- * The consistency level of the query. Based on consistency values from CQL.
+ * The JSON-serialized value of each item of the {@code GlobalSecondaryIndexes} request field
*/
-static constexpr const char *kDbCassandraConsistencyLevel = "db.cassandra.consistency_level";
+static constexpr const char *kAwsDynamodbGlobalSecondaryIndexes =
+ "aws.dynamodb.global_secondary_indexes";
/**
- * The data center of the coordinating node for a query.
+ * The value of the {@code IndexName} request parameter.
*/
-static constexpr const char *kDbCassandraCoordinatorDc = "db.cassandra.coordinator.dc";
+static constexpr const char *kAwsDynamodbIndexName = "aws.dynamodb.index_name";
/**
- * The ID of the coordinating node for a query.
+ * The JSON-serialized value of the {@code ItemCollectionMetrics} response field.
*/
-static constexpr const char *kDbCassandraCoordinatorId = "db.cassandra.coordinator.id";
+static constexpr const char *kAwsDynamodbItemCollectionMetrics =
+ "aws.dynamodb.item_collection_metrics";
/**
- * Whether or not the query is idempotent.
+ * The value of the {@code Limit} request parameter.
*/
-static constexpr const char *kDbCassandraIdempotence = "db.cassandra.idempotence";
+static constexpr const char *kAwsDynamodbLimit = "aws.dynamodb.limit";
/**
- * The fetch size used for paging, i.e. how many rows will be returned at once.
+ * The JSON-serialized value of each item of the {@code LocalSecondaryIndexes} request field.
*/
-static constexpr const char *kDbCassandraPageSize = "db.cassandra.page_size";
+static constexpr const char *kAwsDynamodbLocalSecondaryIndexes =
+ "aws.dynamodb.local_secondary_indexes";
/**
- * The number of times a query was speculatively executed. Not set or {@code 0} if the query was not
- * executed speculatively.
+ * The value of the {@code ProjectionExpression} request parameter.
*/
-static constexpr const char *kDbCassandraSpeculativeExecutionCount =
- "db.cassandra.speculative_execution_count";
+static constexpr const char *kAwsDynamodbProjection = "aws.dynamodb.projection";
/**
- * The name of the primary Cassandra table that the operation is acting upon, including the keyspace
- name (if applicable).
- *
- * Notes:
-
- This mirrors the db.sql.table attribute but references cassandra rather than sql. It is
- not recommended to attempt any client-side parsing of {@code db.statement} just to get this
- property, but it should be set if it is provided by the library being instrumented. If the
- operation is acting upon an anonymous table, or more than one table, this value MUST NOT be
- set.
+ * The value of the {@code ProvisionedThroughput.ReadCapacityUnits} request parameter.
*/
-static constexpr const char *kDbCassandraTable = "db.cassandra.table";
+static constexpr const char *kAwsDynamodbProvisionedReadCapacity =
+ "aws.dynamodb.provisioned_read_capacity";
/**
- * The connection string used to connect to the database. It is recommended to remove embedded
- * credentials.
+ * The value of the {@code ProvisionedThroughput.WriteCapacityUnits} request parameter.
*/
-static constexpr const char *kDbConnectionString = "db.connection_string";
+static constexpr const char *kAwsDynamodbProvisionedWriteCapacity =
+ "aws.dynamodb.provisioned_write_capacity";
/**
- * Unique Cosmos client instance id.
+ * The value of the {@code ScanIndexForward} request parameter.
*/
-static constexpr const char *kDbCosmosdbClientId = "db.cosmosdb.client_id";
+static constexpr const char *kAwsDynamodbScanForward = "aws.dynamodb.scan_forward";
/**
- * Cosmos client connection mode.
+ * The value of the {@code ScannedCount} response parameter.
*/
-static constexpr const char *kDbCosmosdbConnectionMode = "db.cosmosdb.connection_mode";
+static constexpr const char *kAwsDynamodbScannedCount = "aws.dynamodb.scanned_count";
/**
- * Cosmos DB container name.
+ * The value of the {@code Segment} request parameter.
*/
-static constexpr const char *kDbCosmosdbContainer = "db.cosmosdb.container";
+static constexpr const char *kAwsDynamodbSegment = "aws.dynamodb.segment";
/**
- * CosmosDB Operation Type.
+ * The value of the {@code Select} request parameter.
*/
-static constexpr const char *kDbCosmosdbOperationType = "db.cosmosdb.operation_type";
+static constexpr const char *kAwsDynamodbSelect = "aws.dynamodb.select";
/**
- * RU consumed for that operation
+ * The number of items in the {@code TableNames} response parameter.
*/
-static constexpr const char *kDbCosmosdbRequestCharge = "db.cosmosdb.request_charge";
+static constexpr const char *kAwsDynamodbTableCount = "aws.dynamodb.table_count";
/**
- * Request payload size in bytes
+ * The keys in the {@code RequestItems} object field.
*/
-static constexpr const char *kDbCosmosdbRequestContentLength = "db.cosmosdb.request_content_length";
+static constexpr const char *kAwsDynamodbTableNames = "aws.dynamodb.table_names";
/**
- * Cosmos DB status code.
+ * The value of the {@code TotalSegments} request parameter.
*/
-static constexpr const char *kDbCosmosdbStatusCode = "db.cosmosdb.status_code";
+static constexpr const char *kAwsDynamodbTotalSegments = "aws.dynamodb.total_segments";
/**
- * Cosmos DB sub status code.
+ * Array of brand name and version separated by a space
+ *
+ * Notes:
+
- This value is intended to be taken from the UA client hints API ({@code
+ navigator.userAgentData.brands}).
*/
-static constexpr const char *kDbCosmosdbSubStatusCode = "db.cosmosdb.sub_status_code";
+static constexpr const char *kBrowserBrands = "browser.brands";
/**
- * Represents the identifier of an Elasticsearch cluster.
+ * Preferred language of the user using the browser
+ *
+ * Notes:
+
- This value is intended to be taken from the Navigator API {@code
+ navigator.language}.
*/
-static constexpr const char *kDbElasticsearchClusterName = "db.elasticsearch.cluster.name";
+static constexpr const char *kBrowserLanguage = "browser.language";
/**
- * Represents the human-readable identifier of the node/instance to which a request was routed.
+ * A boolean that is true if the browser is running on a mobile device
+ *
+ * Notes:
+
- This value is intended to be taken from the UA client hints API ({@code
+ navigator.userAgentData.mobile}). If unavailable, this attribute SHOULD be left unset.
*/
-static constexpr const char *kDbElasticsearchNodeName = "db.elasticsearch.node.name";
+static constexpr const char *kBrowserMobile = "browser.mobile";
/**
- * An identifier (address, unique name, or any other identifier) of the database instance that is
- * executing queries or mutations on the current connection. This is useful in cases where the
- * database is running in a clustered environment and the instrumentation is able to record the node
- * executing the query. The client may obtain this value in databases like MySQL using queries like
- * {@code select @@hostname}.
+ * The platform on which the browser is running
+ *
+ * Notes:
+
- This value is intended to be taken from the UA client hints API ({@code
+navigator.userAgentData.platform}). If unavailable, the legacy {@code navigator.platform} API SHOULD
+NOT be used instead and this attribute SHOULD be left unset in order for the values to be
+consistent. The list of possible values is defined in the W3C User-Agent Client Hints
+specification. Note that some (but not all) of these values can overlap with values in the {@code os.type} and {@code os.name} attributes. However, for consistency, the
+values in the {@code browser.platform} attribute should capture the exact value that the user agent
+provides.
*/
-static constexpr const char *kDbInstanceId = "db.instance.id";
+static constexpr const char *kBrowserPlatform = "browser.platform";
/**
- * The fully-qualified class name of the Java Database Connectivity
- * (JDBC) driver used to connect.
+ * Client address - domain name if available without reverse DNS lookup; otherwise, IP address or
+ Unix domain socket name.
+ *
+ * Notes:
+
- When observed from the server side, and when communicating through an intermediary,
+ {@code client.address} SHOULD represent the client address behind any intermediaries, for example
+ proxies, if it's available.
*/
-static constexpr const char *kDbJdbcDriverClassname = "db.jdbc.driver_classname";
+static constexpr const char *kClientAddress = "client.address";
/**
- * The MongoDB collection being accessed within the database stated in {@code db.name}.
+ * Client port number.
+ *
+ * Notes:
+
- When observed from the server side, and when communicating through an intermediary,
+ {@code client.port} SHOULD represent the client port behind any intermediaries, for example
+ proxies, if it's available.
*/
-static constexpr const char *kDbMongodbCollection = "db.mongodb.collection";
+static constexpr const char *kClientPort = "client.port";
/**
- * The Microsoft SQL Server instance
- name connecting to. This name is used to determine the port of a named instance.
- *
- * Notes:
-
- If setting a {@code db.mssql.instance_name}, {@code server.port} is no longer required
- (but still recommended if non-standard).
+ * The cloud account ID the resource is assigned to.
*/
-static constexpr const char *kDbMssqlInstanceName = "db.mssql.instance_name";
+static constexpr const char *kCloudAccountId = "cloud.account.id";
/**
- * This attribute is used to report the name of the database being accessed. For commands that
- switch the database, this should be set to the target database (even if the command fails).
+ * Cloud regions often have multiple, isolated locations known as zones to increase availability.
+ Availability zone represents the zone where the resource is running.
*
* Notes:
-
- In some SQL databases, the database name to be used is called "schema name". In
- case there are multiple layers that could be considered for database name (e.g. Oracle instance
- name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema
- name).
+ - Availability zones are called "zones" on Alibaba Cloud and Google Cloud.
+
*/
-static constexpr const char *kDbName = "db.name";
+static constexpr const char *kCloudAvailabilityZone = "cloud.availability_zone";
/**
- * The name of the operation being executed, e.g. the MongoDB command
- name such as {@code findAndModify}, or the SQL keyword.
+ * The cloud platform in use.
*
* Notes:
-
- When setting this to an SQL keyword, it is not recommended to attempt any client-side
- parsing of {@code db.statement} just to get this property, but it should be set if the operation
+
- The prefix of the service SHOULD match the one specified in {@code cloud.provider}.
+
+ */
+static constexpr const char *kCloudPlatform = "cloud.platform";
+
+/**
+ * Name of the cloud provider.
+ */
+static constexpr const char *kCloudProvider = "cloud.provider";
+
+/**
+ * The geographical region the resource is running.
+ *
+ * Notes:
+
+ */
+static constexpr const char *kCloudRegion = "cloud.region";
+
+/**
+ * Cloud provider-specific native identifier of the monitored cloud resource (e.g. an ARN on AWS, a
+fully qualified
+resource ID on Azure, a full resource name
+on GCP)
+ *
+ * Notes:
+
- On some cloud providers, it may not be possible to determine the full ID at startup,
+so it may be necessary to set {@code cloud.resource_id} as a span attribute instead.
- The
+exact value to use for {@code cloud.resource_id} depends on the cloud provider. The following
+well-known definitions MUST be used if you set this attribute and they apply:
- AWS
+Lambda: The function ARN. Take care
+not to use the "invoked ARN" directly but replace any alias suffix with
+the resolved function version, as the same runtime instance may be invokable with multiple different
+aliases.
- GCP: The URI of the resource
+- Azure: The Fully Qualified Resource
+ID of the invoked function, not the function app, having the form
+{@code
+/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/}.
+This means that a span attribute MUST be used, as an Azure function app can host multiple functions
+that would usually share a TracerProvider.
+
+ */
+static constexpr const char *kCloudResourceId = "cloud.resource_id";
+
+/**
+ * The event_id
+ * uniquely identifies the event.
+ */
+static constexpr const char *kCloudeventsEventId = "cloudevents.event_id";
+
+/**
+ * The source
+ * identifies the context in which an event happened.
+ */
+static constexpr const char *kCloudeventsEventSource = "cloudevents.event_source";
+
+/**
+ * The version of
+ * the CloudEvents specification which the event uses.
+ */
+static constexpr const char *kCloudeventsEventSpecVersion = "cloudevents.event_spec_version";
+
+/**
+ * The subject of
+ * the event in the context of the event producer (identified by source).
+ */
+static constexpr const char *kCloudeventsEventSubject = "cloudevents.event_subject";
+
+/**
+ * The event_type
+ * contains a value describing the type of event related to the originating occurrence.
+ */
+static constexpr const char *kCloudeventsEventType = "cloudevents.event_type";
+
+/**
+ * The column number in {@code code.filepath} best representing the operation. It SHOULD point
+ * within the code unit named in {@code code.function}.
+ */
+static constexpr const char *kCodeColumn = "code.column";
+
+/**
+ * The source code file name that identifies the code unit as uniquely as possible (preferably an
+ * absolute file path).
+ */
+static constexpr const char *kCodeFilepath = "code.filepath";
+
+/**
+ * The method or function name, or equivalent (usually rightmost part of the code unit's name).
+ */
+static constexpr const char *kCodeFunction = "code.function";
+
+/**
+ * The line number in {@code code.filepath} best representing the operation. It SHOULD point within
+ * the code unit named in {@code code.function}.
+ */
+static constexpr const char *kCodeLineno = "code.lineno";
+
+/**
+ * The "namespace" within which {@code code.function} is defined. Usually the qualified
+ * class or module name, such that {@code code.namespace} + some separator + {@code code.function}
+ * form a unique identifier for the code unit.
+ */
+static constexpr const char *kCodeNamespace = "code.namespace";
+
+/**
+ * A stacktrace as a string in the natural representation for the language runtime. The
+ * representation is to be determined and documented by each language SIG.
+ */
+static constexpr const char *kCodeStacktrace = "code.stacktrace";
+
+/**
+ * The command used to run the container (i.e. the command name).
+ *
+ * Notes:
+
- If using embedded credentials or sensitive data, it is recommended to remove them to
+ prevent potential leakage.
+ */
+static constexpr const char *kContainerCommand = "container.command";
+
+/**
+ * All the command arguments (including the command/executable itself) run by the container. [2]
+ */
+static constexpr const char *kContainerCommandArgs = "container.command_args";
+
+/**
+ * The full command run by the container as a single string representing the full command. [2]
+ */
+static constexpr const char *kContainerCommandLine = "container.command_line";
+
+/**
+ * The CPU state for this data point.
+ */
+static constexpr const char *kContainerCpuState = "container.cpu.state";
+
+/**
+ * Container ID. Usually a UUID, as for example used to identify Docker
+ * containers. The UUID might be abbreviated.
+ */
+static constexpr const char *kContainerId = "container.id";
+
+/**
+ * Runtime specific image identifier. Usually a hash algorithm followed by a UUID.
+ *
+ * Notes:
+
- Docker defines a sha256 of the image id; {@code container.image.id} corresponds to the
+{@code Image} field from the Docker container inspect API
+endpoint. K8s defines a link to the container registry repository with digest {@code "imageID":
+"registry.azurecr.io
+/namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"}.
+The ID is assinged by the container runtime and can vary in different environments. Consider using
+{@code oci.manifest.digest} if it is important to identify the same image in different
+environments/runtimes.
+ */
+static constexpr const char *kContainerImageId = "container.image.id";
+
+/**
+ * Name of the image the container was built on.
+ */
+static constexpr const char *kContainerImageName = "container.image.name";
+
+/**
+ * Repo digests of the container image as provided by the container runtime.
+ *
+ * Notes:
+
- Docker and CRI
+ report those under the {@code RepoDigests} field.
+ */
+static constexpr const char *kContainerImageRepoDigests = "container.image.repo_digests";
+
+/**
+ * Container image tags. An example can be found in Docker Image
+ * Inspect. Should be only the {@code } section of the full name for example from {@code
+ * registry.example.com/my-org/my-image:}.
+ */
+static constexpr const char *kContainerImageTags = "container.image.tags";
+
+/**
+ * Container name used by container runtime.
+ */
+static constexpr const char *kContainerName = "container.name";
+
+/**
+ * The container runtime managing this container.
+ */
+static constexpr const char *kContainerRuntime = "container.runtime";
+
+/**
+ * The consistency level of the query. Based on consistency values from CQL.
+ */
+static constexpr const char *kDbCassandraConsistencyLevel = "db.cassandra.consistency_level";
+
+/**
+ * The data center of the coordinating node for a query.
+ */
+static constexpr const char *kDbCassandraCoordinatorDc = "db.cassandra.coordinator.dc";
+
+/**
+ * The ID of the coordinating node for a query.
+ */
+static constexpr const char *kDbCassandraCoordinatorId = "db.cassandra.coordinator.id";
+
+/**
+ * Whether or not the query is idempotent.
+ */
+static constexpr const char *kDbCassandraIdempotence = "db.cassandra.idempotence";
+
+/**
+ * The fetch size used for paging, i.e. how many rows will be returned at once.
+ */
+static constexpr const char *kDbCassandraPageSize = "db.cassandra.page_size";
+
+/**
+ * The number of times a query was speculatively executed. Not set or {@code 0} if the query was not
+ * executed speculatively.
+ */
+static constexpr const char *kDbCassandraSpeculativeExecutionCount =
+ "db.cassandra.speculative_execution_count";
+
+/**
+ * The name of the primary Cassandra table that the operation is acting upon, including the keyspace
+ name (if applicable).
+ *
+ * Notes:
+
- This mirrors the db.sql.table attribute but references cassandra rather than sql. It is
+ not recommended to attempt any client-side parsing of {@code db.statement} just to get this
+ property, but it should be set if it is provided by the library being instrumented. If the
+ operation is acting upon an anonymous table, or more than one table, this value MUST NOT be
+ set.
+ */
+static constexpr const char *kDbCassandraTable = "db.cassandra.table";
+
+/**
+ * Unique Cosmos client instance id.
+ */
+static constexpr const char *kDbCosmosdbClientId = "db.cosmosdb.client_id";
+
+/**
+ * Cosmos client connection mode.
+ */
+static constexpr const char *kDbCosmosdbConnectionMode = "db.cosmosdb.connection_mode";
+
+/**
+ * Cosmos DB container name.
+ */
+static constexpr const char *kDbCosmosdbContainer = "db.cosmosdb.container";
+
+/**
+ * CosmosDB Operation Type.
+ */
+static constexpr const char *kDbCosmosdbOperationType = "db.cosmosdb.operation_type";
+
+/**
+ * RU consumed for that operation
+ */
+static constexpr const char *kDbCosmosdbRequestCharge = "db.cosmosdb.request_charge";
+
+/**
+ * Request payload size in bytes
+ */
+static constexpr const char *kDbCosmosdbRequestContentLength = "db.cosmosdb.request_content_length";
+
+/**
+ * Cosmos DB status code.
+ */
+static constexpr const char *kDbCosmosdbStatusCode = "db.cosmosdb.status_code";
+
+/**
+ * Cosmos DB sub status code.
+ */
+static constexpr const char *kDbCosmosdbSubStatusCode = "db.cosmosdb.sub_status_code";
+
+/**
+ * Represents the identifier of an Elasticsearch cluster.
+ */
+static constexpr const char *kDbElasticsearchClusterName = "db.elasticsearch.cluster.name";
+
+/**
+ * An identifier (address, unique name, or any other identifier) of the database instance that is
+ * executing queries or mutations on the current connection. This is useful in cases where the
+ * database is running in a clustered environment and the instrumentation is able to record the node
+ * executing the query. The client may obtain this value in databases like MySQL using queries like
+ * {@code select @@hostname}.
+ */
+static constexpr const char *kDbInstanceId = "db.instance.id";
+
+/**
+ * The MongoDB collection being accessed within the database stated in {@code db.name}.
+ */
+static constexpr const char *kDbMongodbCollection = "db.mongodb.collection";
+
+/**
+ * The Microsoft SQL Server instance
+ name connecting to. This name is used to determine the port of a named instance.
+ *
+ * Notes:
+
- If setting a {@code db.mssql.instance_name}, {@code server.port} is no longer required
+ (but still recommended if non-standard).
+ */
+static constexpr const char *kDbMssqlInstanceName = "db.mssql.instance_name";
+
+/**
+ * This attribute is used to report the name of the database being accessed. For commands that
+ switch the database, this should be set to the target database (even if the command fails).
+ *
+ * Notes:
+
- In some SQL databases, the database name to be used is called "schema name". In
+ case there are multiple layers that could be considered for database name (e.g. Oracle instance
+ name and schema name), the database name to be used is the more specific layer (e.g. Oracle schema
+ name).
+ */
+static constexpr const char *kDbName = "db.name";
+
+/**
+ * The name of the operation being executed, e.g. the MongoDB command
+ name such as {@code findAndModify}, or the SQL keyword.
+ *
+ * Notes:
+
- When setting this to an SQL keyword, it is not recommended to attempt any client-side
+ parsing of {@code db.statement} just to get this property, but it should be set if the operation
name is provided by the library being instrumented. If the SQL statement has an ambiguous
operation, or performs more than one operation, this value may be omitted.
*/
-static constexpr const char *kDbOperation = "db.operation";
+static constexpr const char *kDbOperation = "db.operation";
+
+/**
+ * The index of the database being accessed as used in the {@code SELECT} command, provided as an integer. To be
+ * used instead of the generic {@code db.name} attribute.
+ */
+static constexpr const char *kDbRedisDatabaseIndex = "db.redis.database_index";
+
+/**
+ * The name of the primary table that the operation is acting upon, including the database name (if
+ applicable).
+ *
+ * Notes:
+
- It is not recommended to attempt any client-side parsing of {@code db.statement} just to
+ get this property, but it should be set if it is provided by the library being instrumented. If the
+ operation is acting upon an anonymous table, or more than one table, this value MUST NOT be
+ set.
+ */
+static constexpr const char *kDbSqlTable = "db.sql.table";
+
+/**
+ * The database statement being executed.
+ */
+static constexpr const char *kDbStatement = "db.statement";
+
+/**
+ * An identifier for the database management system (DBMS) product being used. See below for a list
+ * of well-known identifiers.
+ */
+static constexpr const char *kDbSystem = "db.system";
+
+/**
+ * Username for accessing the database.
+ */
+static constexpr const char *kDbUser = "db.user";
+
+/**
+ * Name of the deployment
+environment (aka deployment tier).
+ *
+ * Notes:
+
- {@code deployment.environment} does not affect the uniqueness constraints defined through
+the {@code service.namespace}, {@code service.name} and {@code service.instance.id} resource
+attributes. This implies that resources carrying the following attribute combinations MUST be
+considered to be identifying the same service:
- {@code service.name=frontend}, {@code
+deployment.environment=production}
- {@code service.name=frontend}, {@code
+deployment.environment=staging}.
+
+ */
+static constexpr const char *kDeploymentEnvironment = "deployment.environment";
+
+/**
+ * Deprecated, use {@code server.address}, {@code server.port} attributes instead.
+ *
+ * @deprecated Deprecated, use `server.address`, `server.port` attributes instead.
+ */
+OPENTELEMETRY_DEPRECATED
+static constexpr const char *kDbConnectionString = "db.connection_string";
+
+/**
+ * Deprecated, use {@code db.instance.id} instead.
+ *
+ * @deprecated Deprecated, use `db.instance.id` instead.
+ */
+OPENTELEMETRY_DEPRECATED
+static constexpr const char *kDbElasticsearchNodeName = "db.elasticsearch.node.name";
+
+/**
+ * Removed, no replacement at this time.
+ *
+ * @deprecated Removed, no replacement at this time.
+ */
+OPENTELEMETRY_DEPRECATED
+static constexpr const char *kDbJdbcDriverClassname = "db.jdbc.driver_classname";
+
+/**
+ * Deprecated, use {@code network.protocol.name} instead.
+ *
+ * @deprecated Deprecated, use `network.protocol.name` instead.
+ */
+OPENTELEMETRY_DEPRECATED
+static constexpr const char *kHttpFlavor = "http.flavor";
+
+/**
+ * Deprecated, use {@code http.request.method} instead.
+ *
+ * @deprecated Deprecated, use `http.request.method` instead.
+ */
+OPENTELEMETRY_DEPRECATED
+static constexpr const char *kHttpMethod = "http.method";
+
+/**
+ * Deprecated, use {@code http.request.header.content-length} instead.
+ *
+ * @deprecated Deprecated, use `http.request.header.content-length` instead.
+ */
+OPENTELEMETRY_DEPRECATED
+static constexpr const char *kHttpRequestContentLength = "http.request_content_length";
+
+/**
+ * Deprecated, use {@code http.response.header.content-length} instead.
+ *
+ * @deprecated Deprecated, use `http.response.header.content-length` instead.
+ */
+OPENTELEMETRY_DEPRECATED
+static constexpr const char *kHttpResponseContentLength = "http.response_content_length";
+
+/**
+ * Deprecated, use {@code url.scheme} instead.
+ *
+ * @deprecated Deprecated, use `url.scheme` instead.
+ */
+OPENTELEMETRY_DEPRECATED
+static constexpr const char *kHttpScheme = "http.scheme";
+
+/**
+ * Deprecated, use {@code http.response.status_code} instead.
+ *
+ * @deprecated Deprecated, use `http.response.status_code` instead.
+ */
+OPENTELEMETRY_DEPRECATED
+static constexpr const char *kHttpStatusCode = "http.status_code";
+
+/**
+ * Deprecated, use {@code url.path} and {@code url.query} instead.
+ *
+ * @deprecated Deprecated, use `url.path` and `url.query` instead.
+ */
+OPENTELEMETRY_DEPRECATED
+static constexpr const char *kHttpTarget = "http.target";
+
+/**
+ * Deprecated, use {@code url.full} instead.
+ *
+ * @deprecated Deprecated, use `url.full` instead.
+ */
+OPENTELEMETRY_DEPRECATED
+static constexpr const char *kHttpUrl = "http.url";
+
+/**
+ * Deprecated, use {@code user_agent.original} instead.
+ *
+ * @deprecated Deprecated, use `user_agent.original` instead.
+ */
+OPENTELEMETRY_DEPRECATED
+static constexpr const char *kHttpUserAgent = "http.user_agent";
+
+/**
+ * "Deprecated, use {@code messaging.destination.partition.id} instead."
+ *
+ * @deprecated "Deprecated, use `messaging.destination.partition.id` instead.".
+ */
+OPENTELEMETRY_DEPRECATED
+static constexpr const char *kMessagingKafkaDestinationPartition =
+ "messaging.kafka.destination.partition";
+
+/**
+ * Deprecated, use {@code server.address}.
+ *
+ * @deprecated Deprecated, use `server.address`.
+ */
+OPENTELEMETRY_DEPRECATED
+static constexpr const char *kNetHostName = "net.host.name";
+
+/**
+ * Deprecated, use {@code server.port}.
+ *
+ * @deprecated Deprecated, use `server.port`.
+ */
+OPENTELEMETRY_DEPRECATED
+static constexpr const char *kNetHostPort = "net.host.port";
+
+/**
+ * Deprecated, use {@code server.address} on client spans and {@code client.address} on server
+ * spans.
+ *
+ * @deprecated Deprecated, use `server.address` on client spans and `client.address` on server
+ * spans.
+ */
+OPENTELEMETRY_DEPRECATED
+static constexpr const char *kNetPeerName = "net.peer.name";
+
+/**
+ * Deprecated, use {@code server.port} on client spans and {@code client.port} on server spans.
+ *
+ * @deprecated Deprecated, use `server.port` on client spans and `client.port` on server spans.
+ */
+OPENTELEMETRY_DEPRECATED
+static constexpr const char *kNetPeerPort = "net.peer.port";
+
+/**
+ * Deprecated, use {@code network.protocol.name}.
+ *
+ * @deprecated Deprecated, use `network.protocol.name`.
+ */
+OPENTELEMETRY_DEPRECATED
+static constexpr const char *kNetProtocolName = "net.protocol.name";
+
+/**
+ * Deprecated, use {@code network.protocol.version}.
+ *
+ * @deprecated Deprecated, use `network.protocol.version`.
+ */
+OPENTELEMETRY_DEPRECATED
+static constexpr const char *kNetProtocolVersion = "net.protocol.version";
+
+/**
+ * Deprecated, use {@code network.transport} and {@code network.type}.
+ *
+ * @deprecated Deprecated, use `network.transport` and `network.type`.
+ */
+OPENTELEMETRY_DEPRECATED
+static constexpr const char *kNetSockFamily = "net.sock.family";
+
+/**
+ * Deprecated, use {@code network.local.address}.
+ *
+ * @deprecated Deprecated, use `network.local.address`.
+ */
+OPENTELEMETRY_DEPRECATED
+static constexpr const char *kNetSockHostAddr = "net.sock.host.addr";
+
+/**
+ * Deprecated, use {@code network.local.port}.
+ *
+ * @deprecated Deprecated, use `network.local.port`.
+ */
+OPENTELEMETRY_DEPRECATED
+static constexpr const char *kNetSockHostPort = "net.sock.host.port";
+
+/**
+ * Deprecated, use {@code network.peer.address}.
+ *
+ * @deprecated Deprecated, use `network.peer.address`.
+ */
+OPENTELEMETRY_DEPRECATED
+static constexpr const char *kNetSockPeerAddr = "net.sock.peer.addr";
+
+/**
+ * Deprecated, no replacement at this time.
+ *
+ * @deprecated Deprecated, no replacement at this time.
+ */
+OPENTELEMETRY_DEPRECATED
+static constexpr const char *kNetSockPeerName = "net.sock.peer.name";
+
+/**
+ * Deprecated, use {@code network.peer.port}.
+ *
+ * @deprecated Deprecated, use `network.peer.port`.
+ */
+OPENTELEMETRY_DEPRECATED
+static constexpr const char *kNetSockPeerPort = "net.sock.peer.port";
+
+/**
+ * Deprecated, use {@code network.transport}.
+ *
+ * @deprecated Deprecated, use `network.transport`.
+ */
+OPENTELEMETRY_DEPRECATED
+static constexpr const char *kNetTransport = "net.transport";
+
+/**
+ * Deprecated, use {@code system.process.status} instead.
+ *
+ * @deprecated Deprecated, use `system.process.status` instead.
+ */
+OPENTELEMETRY_DEPRECATED
+static constexpr const char *kSystemProcessesStatus = "system.processes.status";
+
+/**
+ * Destination address - domain name if available without reverse DNS lookup; otherwise, IP address
+ or Unix domain socket name.
+ *
+ * Notes:
+
- When observed from the source side, and when communicating through an intermediary,
+ {@code destination.address} SHOULD represent the destination address behind any intermediaries, for
+ example proxies, if it's available.
+ */
+static constexpr const char *kDestinationAddress = "destination.address";
+
+/**
+ * Destination port number
+ */
+static constexpr const char *kDestinationPort = "destination.port";
+
+/**
+ * A unique identifier representing the device
+ *
+ * Notes:
+
- The device identifier MUST only be defined using the values outlined below. This value is
+ not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this
+ value MUST be equal to the vendor
+ identifier. On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation
+ ID or a globally unique UUID which is persisted across sessions in your application. More
+ information can be found here on best practices and
+ exact implementation details. Caution should be taken when storing personal data or anything which
+ can identify a user. GDPR and data protection laws may apply, ensure you do your own due
+ diligence.
+ */
+static constexpr const char *kDeviceId = "device.id";
+
+/**
+ * The name of the device manufacturer
+ *
+ * Notes:
+
- The Android OS provides this field via Build. iOS apps
+ SHOULD hardcode the value {@code Apple}.
+ */
+static constexpr const char *kDeviceManufacturer = "device.manufacturer";
+
+/**
+ * The model identifier for the device
+ *
+ * Notes:
+
- It's recommended this value represents a machine-readable version of the model identifier
+ rather than the market or consumer-friendly name of the device.
+ */
+static constexpr const char *kDeviceModelIdentifier = "device.model.identifier";
+
+/**
+ * The marketing name for the device model
+ *
+ * Notes:
+
- It's recommended this value represents a human-readable version of the device model
+ rather than a machine-readable alternative.
+ */
+static constexpr const char *kDeviceModelName = "device.model.name";
+
+/**
+ * The disk IO operation direction.
+ */
+static constexpr const char *kDiskIoDirection = "disk.io.direction";
+
+/**
+ * The name being queried.
+ *
+ * Notes:
+
- If the name field contains non-printable characters (below 32 or above 126), those
+ characters should be represented as escaped base 10 integers (\DDD). Back slashes and quotes should
+ be escaped. Tabs, carriage returns, and line feeds should be converted to \t, \r, and \n
+ respectively.
+ */
+static constexpr const char *kDnsQuestionName = "dns.question.name";
+
+/**
+ * Username or client_id extracted from the access token or Authorization header in the inbound
+ * request from outside the system.
+ */
+static constexpr const char *kEnduserId = "enduser.id";
+
+/**
+ * Actual/assumed role the client is making the request under extracted from token or application
+ * security context.
+ */
+static constexpr const char *kEnduserRole = "enduser.role";
+
+/**
+ * Scopes or granted authorities the client currently possesses extracted from token or application
+ * security context. The value would come from the scope associated with an OAuth 2.0 Access Token or an attribute
+ * value in a SAML 2.0
+ * Assertion.
+ */
+static constexpr const char *kEnduserScope = "enduser.scope";
/**
- * The index of the database being accessed as used in the {@code SELECT} command, provided as an integer. To be
- * used instead of the generic {@code db.name} attribute.
+ * Describes a class of error the operation ended with.
+ *
+ * Notes:
+
- The {@code error.type} SHOULD be predictable and SHOULD have low cardinality.
+Instrumentations SHOULD document the list of errors they report.
- The cardinality of {@code
+error.type} within one instrumentation library SHOULD be low. Telemetry consumers that aggregate
+data from multiple instrumentation libraries and applications should be prepared for {@code
+error.type} to have high cardinality at query time when no additional filters are
+applied.
- If the operation has completed successfully, instrumentations SHOULD NOT set {@code
+error.type}.
- If a specific domain defines its own set of error identifiers (such as HTTP or
+gRPC status codes), it's RECOMMENDED to:
- Use a domain-specific attribute
- Set {@code
+error.type} to capture all errors, regardless of whether they are defined within the domain-specific
+set or not.
+
*/
-static constexpr const char *kDbRedisDatabaseIndex = "db.redis.database_index";
+static constexpr const char *kErrorType = "error.type";
/**
- * The name of the primary table that the operation is acting upon, including the database name (if
- applicable).
+ * SHOULD be set to true if the exception event is recorded at a point where it is known that the
+exception is escaping the scope of the span.
*
* Notes:
-
- It is not recommended to attempt any client-side parsing of {@code db.statement} just to
- get this property, but it should be set if it is provided by the library being instrumented. If the
- operation is acting upon an anonymous table, or more than one table, this value MUST NOT be
- set.
+ - An exception is considered to have escaped (or left) the scope of a span,
+if that span is ended while the exception is still logically "in flight".
+This may be actually "in flight" in some languages (e.g. if the exception
+is passed to a Context manager's {@code __exit__} method in Python) but will
+usually be caught at the point of recording the exception in most languages.
- It is usually
+not possible to determine at the point where an exception is thrown whether it will escape the scope
+of a span. However, it is trivial to know that an exception will escape, if one checks for an active
+exception just before ending the span, as done in the example for
+recording span exceptions.
- It follows that an exception may still escape the scope of
+the span even if the {@code exception.escaped} attribute was not set or set to false, since the
+event might have been recorded at a time where it was not clear whether the exception will
+escape.
*/
-static constexpr const char *kDbSqlTable = "db.sql.table";
+static constexpr const char *kExceptionEscaped = "exception.escaped";
/**
- * The database statement being executed.
+ * The exception message.
*/
-static constexpr const char *kDbStatement = "db.statement";
+static constexpr const char *kExceptionMessage = "exception.message";
/**
- * An identifier for the database management system (DBMS) product being used. See below for a list
- * of well-known identifiers.
+ * A stacktrace as a string in the natural representation for the language runtime. The
+ * representation is to be determined and documented by each language SIG.
*/
-static constexpr const char *kDbSystem = "db.system";
+static constexpr const char *kExceptionStacktrace = "exception.stacktrace";
/**
- * Username for accessing the database.
+ * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of
+ * the exception should be preferred over the static type in languages that support it.
*/
-static constexpr const char *kDbUser = "db.user";
+static constexpr const char *kExceptionType = "exception.type";
/**
- * Deprecated, use {@code network.protocol.name} instead.
- *
- * @deprecated Deprecated, use `network.protocol.name` instead.
+ * A boolean that is true if the serverless function is executed for the first time (aka
+ * cold-start).
*/
-OPENTELEMETRY_DEPRECATED
-static constexpr const char *kHttpFlavor = "http.flavor";
+static constexpr const char *kFaasColdstart = "faas.coldstart";
/**
- * Deprecated, use {@code http.request.method} instead.
- *
- * @deprecated Deprecated, use `http.request.method` instead.
+ * A string containing the schedule period as Cron
+ * Expression.
*/
-OPENTELEMETRY_DEPRECATED
-static constexpr const char *kHttpMethod = "http.method";
+static constexpr const char *kFaasCron = "faas.cron";
/**
- * Deprecated, use {@code http.request.header.content-length} instead.
- *
- * @deprecated Deprecated, use `http.request.header.content-length` instead.
+ * The name of the source on which the triggering operation was performed. For example, in Cloud
+ * Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name.
*/
-OPENTELEMETRY_DEPRECATED
-static constexpr const char *kHttpRequestContentLength = "http.request_content_length";
+static constexpr const char *kFaasDocumentCollection = "faas.document.collection";
/**
- * Deprecated, use {@code http.response.header.content-length} instead.
- *
- * @deprecated Deprecated, use `http.response.header.content-length` instead.
+ * The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the
+ * name of the file, and in Cosmos DB the table name.
*/
-OPENTELEMETRY_DEPRECATED
-static constexpr const char *kHttpResponseContentLength = "http.response_content_length";
+static constexpr const char *kFaasDocumentName = "faas.document.name";
/**
- * Deprecated, use {@code url.scheme} instead.
- *
- * @deprecated Deprecated, use `url.scheme` instead.
+ * Describes the type of the operation that was performed on the data.
*/
-OPENTELEMETRY_DEPRECATED
-static constexpr const char *kHttpScheme = "http.scheme";
+static constexpr const char *kFaasDocumentOperation = "faas.document.operation";
/**
- * Deprecated, use {@code http.response.status_code} instead.
- *
- * @deprecated Deprecated, use `http.response.status_code` instead.
+ * A string containing the time when the data was accessed in the ISO 8601 format expressed in UTC.
*/
-OPENTELEMETRY_DEPRECATED
-static constexpr const char *kHttpStatusCode = "http.status_code";
+static constexpr const char *kFaasDocumentTime = "faas.document.time";
/**
- * Deprecated, use {@code url.path} and {@code url.query} instead.
+ * The execution environment ID as a string, that will be potentially reused for other invocations
+ to the same function/function version.
*
- * @deprecated Deprecated, use `url.path` and `url.query` instead.
+ * Notes:
+
- AWS Lambda: Use the (full) log stream name.
+
*/
-OPENTELEMETRY_DEPRECATED
-static constexpr const char *kHttpTarget = "http.target";
+static constexpr const char *kFaasInstance = "faas.instance";
/**
- * Deprecated, use {@code url.full} instead.
- *
- * @deprecated Deprecated, use `url.full` instead.
+ * The invocation ID of the current function invocation.
*/
-OPENTELEMETRY_DEPRECATED
-static constexpr const char *kHttpUrl = "http.url";
+static constexpr const char *kFaasInvocationId = "faas.invocation_id";
/**
- * Deprecated, use {@code user_agent.original} instead.
+ * The name of the invoked function.
*
- * @deprecated Deprecated, use `user_agent.original` instead.
+ * Notes:
+
- SHOULD be equal to the {@code faas.name} resource attribute of the invoked function.
+
*/
-OPENTELEMETRY_DEPRECATED
-static constexpr const char *kHttpUserAgent = "http.user_agent";
+static constexpr const char *kFaasInvokedName = "faas.invoked_name";
/**
- * Deprecated, use {@code server.address}.
+ * The cloud provider of the invoked function.
*
- * @deprecated Deprecated, use `server.address`.
+ * Notes:
+
- SHOULD be equal to the {@code cloud.provider} resource attribute of the invoked
+ function.
*/
-OPENTELEMETRY_DEPRECATED
-static constexpr const char *kNetHostName = "net.host.name";
+static constexpr const char *kFaasInvokedProvider = "faas.invoked_provider";
/**
- * Deprecated, use {@code server.port}.
+ * The cloud region of the invoked function.
*
- * @deprecated Deprecated, use `server.port`.
+ * Notes:
+
- SHOULD be equal to the {@code cloud.region} resource attribute of the invoked
+ function.
*/
-OPENTELEMETRY_DEPRECATED
-static constexpr const char *kNetHostPort = "net.host.port";
+static constexpr const char *kFaasInvokedRegion = "faas.invoked_region";
/**
- * Deprecated, use {@code server.address} on client spans and {@code client.address} on server
- * spans.
+ * The amount of memory available to the serverless function converted to Bytes.
*
- * @deprecated Deprecated, use `server.address` on client spans and `client.address` on server
- * spans.
+ * Notes:
+
- It's recommended to set this attribute since e.g. too little memory can easily stop a
+ Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable {@code
+ AWS_LAMBDA_FUNCTION_MEMORY_SIZE} provides this information (which must be multiplied by
+ 1,048,576).
*/
-OPENTELEMETRY_DEPRECATED
-static constexpr const char *kNetPeerName = "net.peer.name";
+static constexpr const char *kFaasMaxMemory = "faas.max_memory";
/**
- * Deprecated, use {@code server.port} on client spans and {@code client.port} on server spans.
+ * The name of the single function that this runtime instance executes.
*
- * @deprecated Deprecated, use `server.port` on client spans and `client.port` on server spans.
+ * Notes:
+
- This is the name of the function as configured/deployed on the FaaS
+platform and is usually different from the name of the callback
+function (which may be stored in the
+{@code code.namespace}/{@code
+code.function} span attributes).
- For some cloud providers, the above definition is
+ambiguous. The following definition of function name MUST be used for this attribute (and
+consequently the span name) for the listed cloud providers/products:
- Azure:
+The full name {@code /}, i.e., function app name followed by a forward slash followed
+by the function name (this form can also be seen in the resource JSON for the function). This means
+that a span attribute MUST be used, as an Azure function app can host multiple functions that would
+usually share a TracerProvider (see also the {@code cloud.resource_id} attribute).
+
*/
-OPENTELEMETRY_DEPRECATED
-static constexpr const char *kNetPeerPort = "net.peer.port";
+static constexpr const char *kFaasName = "faas.name";
/**
- * Deprecated, use {@code network.protocol.name}.
- *
- * @deprecated Deprecated, use `network.protocol.name`.
+ * A string containing the function invocation time in the ISO 8601 format expressed in UTC.
*/
-OPENTELEMETRY_DEPRECATED
-static constexpr const char *kNetProtocolName = "net.protocol.name";
+static constexpr const char *kFaasTime = "faas.time";
/**
- * Deprecated, use {@code network.protocol.version}.
- *
- * @deprecated Deprecated, use `network.protocol.version`.
+ * Type of the trigger which caused this function invocation.
*/
-OPENTELEMETRY_DEPRECATED
-static constexpr const char *kNetProtocolVersion = "net.protocol.version";
+static constexpr const char *kFaasTrigger = "faas.trigger";
/**
- * Deprecated, use {@code network.transport} and {@code network.type}.
+ * The immutable version of the function being executed.
*
- * @deprecated Deprecated, use `network.transport` and `network.type`.
+ * Notes:
+
- Depending on the cloud provider and platform, use:
- AWS Lambda:
+The function
+version (an integer represented as a decimal string).
- Google Cloud Run
+(Services): The revision
+(i.e., the function name plus the revision suffix).
+- Google Cloud Functions: The value of the
+{@code
+K_REVISION} environment variable.
- Azure Functions: Not applicable. Do
+not set this attribute.
+
*/
-OPENTELEMETRY_DEPRECATED
-static constexpr const char *kNetSockFamily = "net.sock.family";
+static constexpr const char *kFaasVersion = "faas.version";
/**
- * Deprecated, use {@code network.local.address}.
- *
- * @deprecated Deprecated, use `network.local.address`.
+ * The unique identifier of the feature flag.
*/
-OPENTELEMETRY_DEPRECATED
-static constexpr const char *kNetSockHostAddr = "net.sock.host.addr";
+static constexpr const char *kFeatureFlagKey = "feature_flag.key";
/**
- * Deprecated, use {@code network.local.port}.
- *
- * @deprecated Deprecated, use `network.local.port`.
+ * The name of the service provider that performs the flag evaluation.
*/
-OPENTELEMETRY_DEPRECATED
-static constexpr const char *kNetSockHostPort = "net.sock.host.port";
+static constexpr const char *kFeatureFlagProviderName = "feature_flag.provider_name";
/**
- * Deprecated, use {@code network.peer.address}.
+ * SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the
+value can be used.
*
- * @deprecated Deprecated, use `network.peer.address`.
+ * Notes:
+
- A semantic identifier, commonly referred to as a variant, provides a means
+for referring to a value without including the value itself. This can
+provide additional context for understanding the meaning behind a value.
+For example, the variant {@code red} maybe be used for the value {@code #c05543}.
- A
+stringified version of the value can be used in situations where a semantic identifier is
+unavailable. String representation of the value should be determined by the implementer.
*/
-OPENTELEMETRY_DEPRECATED
-static constexpr const char *kNetSockPeerAddr = "net.sock.peer.addr";
+static constexpr const char *kFeatureFlagVariant = "feature_flag.variant";
/**
- * Deprecated, no replacement at this time.
+ * Directory where the file is located. It should include the drive letter, when appropriate.
+ */
+static constexpr const char *kFileDirectory = "file.directory";
+
+/**
+ * File extension, excluding the leading dot.
*
- * @deprecated Deprecated, no replacement at this time.
+ * Notes:
+
- When the file name has multiple extensions (example.tar.gz), only the last one should be
+ captured ("gz", not "tar.gz").
*/
-OPENTELEMETRY_DEPRECATED
-static constexpr const char *kNetSockPeerName = "net.sock.peer.name";
+static constexpr const char *kFileExtension = "file.extension";
+
+/**
+ * Name of the file including the extension, without the directory.
+ */
+static constexpr const char *kFileName = "file.name";
+
+/**
+ * Full path to the file, including the file name. It should include the drive letter, when
+ * appropriate.
+ */
+static constexpr const char *kFilePath = "file.path";
+
+/**
+ * File size in bytes.
+ */
+static constexpr const char *kFileSize = "file.size";
+
+/**
+ * The name of the Cloud Run execution being run for the
+ * Job, as set by the {@code
+ * CLOUD_RUN_EXECUTION} environment variable.
+ */
+static constexpr const char *kGcpCloudRunJobExecution = "gcp.cloud_run.job.execution";
+
+/**
+ * The index for a task within an execution as provided by the {@code
+ * CLOUD_RUN_TASK_INDEX} environment variable.
+ */
+static constexpr const char *kGcpCloudRunJobTaskIndex = "gcp.cloud_run.job.task_index";
+
+/**
+ * The hostname of a GCE instance. This is the full value of the default or custom hostname.
+ */
+static constexpr const char *kGcpGceInstanceHostname = "gcp.gce.instance.hostname";
+
+/**
+ * The instance name of a GCE instance. This is the value provided by {@code host.name}, the visible
+ * name of the instance in the Cloud Console UI, and the prefix for the default hostname of the
+ * instance as defined by the default
+ * internal DNS name.
+ */
+static constexpr const char *kGcpGceInstanceName = "gcp.gce.instance.name";
+
+/**
+ * The CPU architecture the host system is running on.
+ */
+static constexpr const char *kHostArch = "host.arch";
+
+/**
+ * The amount of level 2 memory cache available to the processor (in Bytes).
+ */
+static constexpr const char *kHostCpuCacheL2Size = "host.cpu.cache.l2.size";
+
+/**
+ * Family or generation of the CPU.
+ */
+static constexpr const char *kHostCpuFamily = "host.cpu.family";
+
+/**
+ * Model identifier. It provides more granular information about the CPU, distinguishing it from
+ * other CPUs within the same family.
+ */
+static constexpr const char *kHostCpuModelId = "host.cpu.model.id";
+
+/**
+ * Model designation of the processor.
+ */
+static constexpr const char *kHostCpuModelName = "host.cpu.model.name";
+
+/**
+ * Stepping or core revisions.
+ */
+static constexpr const char *kHostCpuStepping = "host.cpu.stepping";
/**
- * Deprecated, use {@code network.peer.port}.
+ * Processor manufacturer identifier. A maximum 12-character string.
*
- * @deprecated Deprecated, use `network.peer.port`.
+ * Notes:
+
- CPUID command returns the vendor ID string in
+ EBX, EDX and ECX registers. Writing these to memory in this order results in a 12-character
+ string.
*/
-OPENTELEMETRY_DEPRECATED
-static constexpr const char *kNetSockPeerPort = "net.sock.peer.port";
+static constexpr const char *kHostCpuVendorId = "host.cpu.vendor.id";
/**
- * Deprecated, use {@code network.transport}.
- *
- * @deprecated Deprecated, use `network.transport`.
+ * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For
+ * non-containerized systems, this should be the {@code machine-id}. See the table below for the
+ * sources to use to determine the {@code machine-id} based on operating system.
*/
-OPENTELEMETRY_DEPRECATED
-static constexpr const char *kNetTransport = "net.transport";
+static constexpr const char *kHostId = "host.id";
/**
- * Destination address - domain name if available without reverse DNS lookup; otherwise, IP address
- or Unix domain socket name.
- *
- * Notes:
-
- When observed from the source side, and when communicating through an intermediary,
- {@code destination.address} SHOULD represent the destination address behind any intermediaries, for
- example proxies, if it's available.
+ * VM image ID or host OS image ID. For Cloud, this value is from the provider.
*/
-static constexpr const char *kDestinationAddress = "destination.address";
+static constexpr const char *kHostImageId = "host.image.id";
/**
- * Destination port number
+ * Name of the VM image or OS install the host was instantiated from.
*/
-static constexpr const char *kDestinationPort = "destination.port";
+static constexpr const char *kHostImageName = "host.image.name";
/**
- * The disk IO operation direction.
+ * The version string of the VM image or host OS as defined in Version Attributes.
*/
-static constexpr const char *kDiskIoDirection = "disk.io.direction";
+static constexpr const char *kHostImageVersion = "host.image.version";
/**
- * Describes a class of error the operation ended with.
+ * Available IP addresses of the host, excluding loopback interfaces.
*
* Notes:
-
- The {@code error.type} SHOULD be predictable and SHOULD have low cardinality.
-Instrumentations SHOULD document the list of errors they report.
- The cardinality of {@code
-error.type} within one instrumentation library SHOULD be low. Telemetry consumers that aggregate
-data from multiple instrumentation libraries and applications should be prepared for {@code
-error.type} to have high cardinality at query time when no additional filters are
-applied.
- If the operation has completed successfully, instrumentations SHOULD NOT set {@code
-error.type}.
- If a specific domain defines its own set of error identifiers (such as HTTP or
-gRPC status codes), it's RECOMMENDED to:
- Use a domain-specific attribute
- Set {@code
-error.type} to capture all errors, regardless of whether they are defined within the domain-specific
-set or not.
+ - IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 addresses MUST be
+ specified in the RFC 5952 format.
*/
-static constexpr const char *kErrorType = "error.type";
+static constexpr const char *kHostIp = "host.ip";
/**
- * SHOULD be set to true if the exception event is recorded at a point where it is known that the
-exception is escaping the scope of the span.
+ * Available MAC addresses of the host, excluding loopback interfaces.
*
* Notes:
-
- An exception is considered to have escaped (or left) the scope of a span,
-if that span is ended while the exception is still logically "in flight".
-This may be actually "in flight" in some languages (e.g. if the exception
-is passed to a Context manager's {@code __exit__} method in Python) but will
-usually be caught at the point of recording the exception in most languages.
- It is usually
-not possible to determine at the point where an exception is thrown whether it will escape the scope
-of a span. However, it is trivial to know that an exception will escape, if one checks for an active
-exception just before ending the span, as done in the example for
-recording span exceptions.
- It follows that an exception may still escape the scope of
-the span even if the {@code exception.escaped} attribute was not set or set to false, since the
-event might have been recorded at a time where it was not clear whether the exception will
-escape.
+ - MAC Addresses MUST be represented in IEEE RA
+ hexadecimal form: as hyphen-separated octets in uppercase hexadecimal form from most to least
+ significant.
*/
-static constexpr const char *kExceptionEscaped = "exception.escaped";
+static constexpr const char *kHostMac = "host.mac";
/**
- * The exception message.
+ * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully
+ * qualified hostname, or another name specified by the user.
*/
-static constexpr const char *kExceptionMessage = "exception.message";
+static constexpr const char *kHostName = "host.name";
/**
- * A stacktrace as a string in the natural representation for the language runtime. The
- * representation is to be determined and documented by each language SIG.
+ * Type of host. For Cloud, this must be the machine type.
*/
-static constexpr const char *kExceptionStacktrace = "exception.stacktrace";
+static constexpr const char *kHostType = "host.type";
/**
- * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of
- * the exception should be preferred over the static type in languages that support it.
+ * State of the HTTP connection in the HTTP connection pool.
*/
-static constexpr const char *kExceptionType = "exception.type";
+static constexpr const char *kHttpConnectionState = "http.connection.state";
/**
* The size of the request payload body in bytes. This is the number of bytes transferred excluding
@@ -850,6 +1596,13 @@ static constexpr const char *kHttpRequestMethodOriginal = "http.request.method_o
*/
static constexpr const char *kHttpRequestResendCount = "http.request.resend_count";
+/**
+ * The total size of the request in bytes. This should be the total number of bytes sent over the
+ * wire, including the request line (HTTP/1.1), framing (HTTP/2 and HTTP/3), headers, and request
+ * body if any.
+ */
+static constexpr const char *kHttpRequestSize = "http.request.size";
+
/**
* The size of the response payload body in bytes. This is the number of bytes transferred excluding
* headers and is often, but not always, present as the HTTP response status code.
*/
@@ -875,6 +1635,132 @@ one.
*/
static constexpr const char *kHttpRoute = "http.route";
+/**
+ * The name of the cluster.
+ */
+static constexpr const char *kK8sClusterName = "k8s.cluster.name";
+
+/**
+ * A pseudo-ID for the cluster, set to the UID of the {@code kube-system} namespace.
+ *
+ * Notes:
+
- K8s doesn't have support for obtaining a cluster ID. If this is ever
+added, we will recommend collecting the {@code k8s.cluster.uid} through the
+official APIs. In the meantime, we are able to use the {@code uid} of the
+{@code kube-system} namespace as a proxy for cluster ID. Read on for the
+rationale.
- Every object created in a K8s cluster is assigned a distinct UID. The
+{@code kube-system} namespace is used by Kubernetes itself and will exist
+for the lifetime of the cluster. Using the {@code uid} of the {@code kube-system}
+namespace is a reasonable proxy for the K8s ClusterID as it will only
+change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are
+UUIDs as standardized by
+ISO/IEC 9834-8 and ITU-T X.667.
+Which states:
+- If generated according to one of the mechanisms defined in Rec.
+- ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be
+ different from all other UUIDs generated before 3603 A.D., or is
+ extremely likely to be different (depending on the mechanism chosen).
- Therefore, UIDs
+between clusters should be extremely unlikely to conflict.
+ */
+static constexpr const char *kK8sClusterUid = "k8s.cluster.uid";
+
+/**
+ * The name of the Container from Pod specification, must be unique within a Pod. Container runtime
+ * usually uses different globally unique name ({@code container.name}).
+ */
+static constexpr const char *kK8sContainerName = "k8s.container.name";
+
+/**
+ * Number of times the container was restarted. This attribute can be used to identify a particular
+ * container (running or stopped) within a container spec.
+ */
+static constexpr const char *kK8sContainerRestartCount = "k8s.container.restart_count";
+
+/**
+ * The name of the CronJob.
+ */
+static constexpr const char *kK8sCronjobName = "k8s.cronjob.name";
+
+/**
+ * The UID of the CronJob.
+ */
+static constexpr const char *kK8sCronjobUid = "k8s.cronjob.uid";
+
+/**
+ * The name of the DaemonSet.
+ */
+static constexpr const char *kK8sDaemonsetName = "k8s.daemonset.name";
+
+/**
+ * The UID of the DaemonSet.
+ */
+static constexpr const char *kK8sDaemonsetUid = "k8s.daemonset.uid";
+
+/**
+ * The name of the Deployment.
+ */
+static constexpr const char *kK8sDeploymentName = "k8s.deployment.name";
+
+/**
+ * The UID of the Deployment.
+ */
+static constexpr const char *kK8sDeploymentUid = "k8s.deployment.uid";
+
+/**
+ * The name of the Job.
+ */
+static constexpr const char *kK8sJobName = "k8s.job.name";
+
+/**
+ * The UID of the Job.
+ */
+static constexpr const char *kK8sJobUid = "k8s.job.uid";
+
+/**
+ * The name of the namespace that the pod is running in.
+ */
+static constexpr const char *kK8sNamespaceName = "k8s.namespace.name";
+
+/**
+ * The name of the Node.
+ */
+static constexpr const char *kK8sNodeName = "k8s.node.name";
+
+/**
+ * The UID of the Node.
+ */
+static constexpr const char *kK8sNodeUid = "k8s.node.uid";
+
+/**
+ * The name of the Pod.
+ */
+static constexpr const char *kK8sPodName = "k8s.pod.name";
+
+/**
+ * The UID of the Pod.
+ */
+static constexpr const char *kK8sPodUid = "k8s.pod.uid";
+
+/**
+ * The name of the ReplicaSet.
+ */
+static constexpr const char *kK8sReplicasetName = "k8s.replicaset.name";
+
+/**
+ * The UID of the ReplicaSet.
+ */
+static constexpr const char *kK8sReplicasetUid = "k8s.replicaset.uid";
+
+/**
+ * The name of the StatefulSet.
+ */
+static constexpr const char *kK8sStatefulsetName = "k8s.statefulset.name";
+
+/**
+ * The UID of the StatefulSet.
+ */
+static constexpr const char *kK8sStatefulsetUid = "k8s.statefulset.uid";
+
/**
* The number of messages sent, received, or processed in the scope of the batching operation.
*
@@ -908,6 +1794,13 @@ the broker.
*/
static constexpr const char *kMessagingDestinationName = "messaging.destination.name";
+/**
+ * The identifier of the partition messages are sent to or received from, unique within the {@code
+ * messaging.destination.name}.
+ */
+static constexpr const char *kMessagingDestinationPartitionId =
+ "messaging.destination.partition.id";
+
/**
* Low cardinality representation of the messaging destination name
*
@@ -943,6 +1836,18 @@ identify the broker.
static constexpr const char *kMessagingDestinationPublishName =
"messaging.destination_publish.name";
+/**
+ * The name of the consumer group the event consumer is associated with.
+ */
+static constexpr const char *kMessagingEventhubsConsumerGroup =
+ "messaging.eventhubs.consumer.group";
+
+/**
+ * The UTC epoch seconds at which the message has been accepted and stored in the entity.
+ */
+static constexpr const char *kMessagingEventhubsMessageEnqueuedTime =
+ "messaging.eventhubs.message.enqueued_time";
+
/**
* The ordering key for a given message. If the attribute is not present, the message does not have
* an ordering key.
@@ -956,12 +1861,6 @@ static constexpr const char *kMessagingGcpPubsubMessageOrderingKey =
*/
static constexpr const char *kMessagingKafkaConsumerGroup = "messaging.kafka.consumer.group";
-/**
- * Partition the message is sent to.
- */
-static constexpr const char *kMessagingKafkaDestinationPartition =
- "messaging.kafka.destination.partition";
-
/**
* Message keys in Kafka are used for grouping alike messages to ensure they're processed on the
same partition. They differ from {@code messaging.message.id} in that they're not unique. If the
@@ -1027,6 +1926,12 @@ static constexpr const char *kMessagingOperation = "messaging.operation";
static constexpr const char *kMessagingRabbitmqDestinationRoutingKey =
"messaging.rabbitmq.destination.routing_key";
+/**
+ * RabbitMQ message delivery tag
+ */
+static constexpr const char *kMessagingRabbitmqMessageDeliveryTag =
+ "messaging.rabbitmq.message.delivery_tag";
+
/**
* Name of the RocketMQ producer/consumer group that is handling the message. The client type is
* identified by the SpanKind.
@@ -1077,6 +1982,32 @@ static constexpr const char *kMessagingRocketmqMessageType = "messaging.rocketmq
*/
static constexpr const char *kMessagingRocketmqNamespace = "messaging.rocketmq.namespace";
+/**
+ * The name of the subscription in the topic messages are received from.
+ */
+static constexpr const char *kMessagingServicebusDestinationSubscriptionName =
+ "messaging.servicebus.destination.subscription_name";
+
+/**
+ * Describes the settlement
+ * type.
+ */
+static constexpr const char *kMessagingServicebusDispositionStatus =
+ "messaging.servicebus.disposition_status";
+
+/**
+ * Number of deliveries that have been attempted for this message.
+ */
+static constexpr const char *kMessagingServicebusMessageDeliveryCount =
+ "messaging.servicebus.message.delivery_count";
+
+/**
+ * The UTC epoch seconds at which the message has been accepted and stored in the entity.
+ */
+static constexpr const char *kMessagingServicebusMessageEnqueuedTime =
+ "messaging.servicebus.message.enqueued_time";
+
/**
* An identifier for the messaging system being used. See below for a list of well-known
* identifiers.
@@ -1149,12 +2080,13 @@ static constexpr const char *kNetworkPeerPort = "network.peer.port";
static constexpr const char *kNetworkProtocolName = "network.protocol.name";
/**
- * Version of the protocol specified in {@code network.protocol.name}.
+ * The actual version of the protocol used for network communication.
*
* Notes:
-
- {@code network.protocol.version} refers to the version of the protocol used and might be
- different from the protocol client's version. If the HTTP client has a version of {@code 0.27.2},
- but sends HTTP version {@code 1.1}, this attribute should be set to {@code 1.1}.
+ - If protocol version is subject to negotiation (for example using ALPN), this attribute SHOULD be set to the
+ negotiated version. If the actual protocol version is not known, this attribute SHOULD NOT be
+ set.
*/
static constexpr const char *kNetworkProtocolVersion = "network.protocol.version";
@@ -1179,6 +2111,121 @@ static constexpr const char *kNetworkTransport = "network.transport";
*/
static constexpr const char *kNetworkType = "network.type";
+/**
+ * The digest of the OCI image manifest. For container images specifically is the digest by which
+the container image is known.
+ *
+ * Notes:
+
+ */
+static constexpr const char *kOciManifestDigest = "oci.manifest.digest";
+
+/**
+ * Unique identifier for a particular build or compilation of the operating system.
+ */
+static constexpr const char *kOsBuildId = "os.build_id";
+
+/**
+ * Human readable (not intended to be parsed) OS version information, like e.g. reported by {@code
+ * ver} or {@code lsb_release -a} commands.
+ */
+static constexpr const char *kOsDescription = "os.description";
+
+/**
+ * Human readable operating system name.
+ */
+static constexpr const char *kOsName = "os.name";
+
+/**
+ * The operating system type.
+ */
+static constexpr const char *kOsType = "os.type";
+
+/**
+ * The version string of the operating system as defined in Version Attributes.
+ */
+static constexpr const char *kOsVersion = "os.version";
+
+/**
+ * The {@code service.name} of the remote service.
+ * SHOULD be equal to the actual {@code service.name} resource attribute of the remote service if
+ * any.
+ */
+static constexpr const char *kPeerService = "peer.service";
+
+/**
+ * The command used to launch the process (i.e. the command name). On Linux based systems, can be
+ * set to the zeroth string in {@code proc/[pid]/cmdline}. On Windows, can be set to the first
+ * parameter extracted from {@code GetCommandLineW}.
+ */
+static constexpr const char *kProcessCommand = "process.command";
+
+/**
+ * All the command arguments (including the command/executable itself) as received by the process.
+ * On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according
+ * to the list of null-delimited strings extracted from {@code proc/[pid]/cmdline}. For libc-based
+ * executables, this would be the full argv vector passed to {@code main}.
+ */
+static constexpr const char *kProcessCommandArgs = "process.command_args";
+
+/**
+ * The full command used to launch the process as a single string representing the full command. On
+ * Windows, can be set to the result of {@code GetCommandLineW}. Do not set this if you have to
+ * assemble it just for monitoring; use {@code process.command_args} instead.
+ */
+static constexpr const char *kProcessCommandLine = "process.command_line";
+
+/**
+ * The name of the process executable. On Linux based systems, can be set to the {@code Name} in
+ * {@code proc/[pid]/status}. On Windows, can be set to the base name of {@code
+ * GetProcessImageFileNameW}.
+ */
+static constexpr const char *kProcessExecutableName = "process.executable.name";
+
+/**
+ * The full path to the process executable. On Linux based systems, can be set to the target of
+ * {@code proc/[pid]/exe}. On Windows, can be set to the result of {@code GetProcessImageFileNameW}.
+ */
+static constexpr const char *kProcessExecutablePath = "process.executable.path";
+
+/**
+ * The username of the user that owns the process.
+ */
+static constexpr const char *kProcessOwner = "process.owner";
+
+/**
+ * Parent Process identifier (PPID).
+ */
+static constexpr const char *kProcessParentPid = "process.parent_pid";
+
+/**
+ * Process identifier (PID).
+ */
+static constexpr const char *kProcessPid = "process.pid";
+
+/**
+ * An additional description about the runtime of the process, for example a specific vendor
+ * customization of the runtime environment.
+ */
+static constexpr const char *kProcessRuntimeDescription = "process.runtime.description";
+
+/**
+ * The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of
+ * the compiler.
+ */
+static constexpr const char *kProcessRuntimeName = "process.runtime.name";
+
+/**
+ * The version of the runtime of this process, as returned by the runtime without modification.
+ */
+static constexpr const char *kProcessRuntimeVersion = "process.runtime.version";
+
/**
* The error codes of the Connect
* request. Error codes are always string values.
@@ -1236,33 +2283,104 @@ static constexpr const char *kRpcMethod = "rpc.method";
method actually executing the call on the server side, RPC client stub class on the client
side).
*/
-static constexpr const char *kRpcService = "rpc.service";
+static constexpr const char *kRpcService = "rpc.service";
+
+/**
+ * A string identifying the remoting system. See below for a list of well-known identifiers.
+ */
+static constexpr const char *kRpcSystem = "rpc.system";
+
+/**
+ * Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain
+ socket name.
+ *
+ * Notes:
+
- When observed from the client side, and when communicating through an intermediary,
+ {@code server.address} SHOULD represent the server address behind any intermediaries, for example
+ proxies, if it's available.
+ */
+static constexpr const char *kServerAddress = "server.address";
+
+/**
+ * Server port number.
+ *
+ * Notes:
+
- When observed from the client side, and when communicating through an intermediary,
+ {@code server.port} SHOULD represent the server port behind any intermediaries, for example
+ proxies, if it's available.
+ */
+static constexpr const char *kServerPort = "server.port";
+
+/**
+ * The string ID of the service instance.
+ *
+ * Notes:
+
- MUST be unique for each instance of the same {@code service.namespace,service.name} pair
+(in other words
+{@code service.namespace,service.name,service.instance.id} triplet MUST be globally unique). The ID
+helps to distinguish instances of the same service that exist at the same time (e.g. instances of a
+horizontally scaled service).
- Implementations, such as SDKs, are recommended to generate a
+random Version 1 or Version 4 RFC 4122 UUID, but
+are free to use an inherent unique ID as the source of this value if stability is desirable. In that
+case, the ID SHOULD be used as source of a UUID Version 5 and SHOULD use the following UUID as the
+namespace: {@code 4d63009a-8d0f-11ee-aad7-4c796ed8e320}.
- UUIDs are typically recommended, as
+only an opaque value for the purposes of identifying a service instance is needed. Similar to what
+can be seen in the man page for the {@code /etc/machine-id}
+file, the underlying data, such as pod name and namespace should be treated as confidential, being
+the user's choice to expose it or not via another resource attribute.
- For applications
+running behind an application server (like unicorn), we do not recommend using one identifier for
+all processes participating in the application. Instead, it's recommended each division (e.g. a
+worker thread in unicorn) to have its own instance.id.
- It's not recommended for a Collector
+to set {@code service.instance.id} if it can't unambiguously determine the service instance that is
+generating that telemetry. For instance, creating an UUID based on {@code pod.name} will likely be
+wrong, as the Collector might not know from which container within that pod the telemetry
+originated. However, Collectors can set the {@code service.instance.id} if they can unambiguously
+determine the service instance for that telemetry. This is typically the case for scraping
+receivers, as they know the target address and port.
+ */
+static constexpr const char *kServiceInstanceId = "service.instance.id";
+
+/**
+ * Logical name of the service.
+ *
+ * Notes:
+
- MUST be the same for all instances of horizontally scaled services. If the value was not
+ specified, SDKs MUST fallback to {@code unknown_service:} concatenated with {@code process.executable.name}, e.g. {@code unknown_service:bash}.
+ If {@code process.executable.name} is not available, the value MUST be set to {@code
+ unknown_service}.
+ */
+static constexpr const char *kServiceName = "service.name";
+
+/**
+ * A namespace for {@code service.name}.
+ *
+ * Notes:
+
- A string value having a meaning that helps to distinguish a group of services, for
+ example the team name that owns a group of services. {@code service.name} is expected to be unique
+ within the same namespace. If {@code service.namespace} is not specified in the Resource then
+ {@code service.name} is expected to be unique for all services that have no explicit namespace
+ defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length
+ namespace string is assumed equal to unspecified namespace.
+ */
+static constexpr const char *kServiceNamespace = "service.namespace";
/**
- * A string identifying the remoting system. See below for a list of well-known identifiers.
+ * The version string of the service API or implementation. The format is not defined by these
+ * conventions.
*/
-static constexpr const char *kRpcSystem = "rpc.system";
+static constexpr const char *kServiceVersion = "service.version";
/**
- * Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain
- socket name.
- *
- * Notes:
-
- When observed from the client side, and when communicating through an intermediary,
- {@code server.address} SHOULD represent the server address behind any intermediaries, for example
- proxies, if it's available.
+ * A unique id to identify a session.
*/
-static constexpr const char *kServerAddress = "server.address";
+static constexpr const char *kSessionId = "session.id";
/**
- * Server port number.
- *
- * Notes:
-
- When observed from the client side, and when communicating through an intermediary,
- {@code server.port} SHOULD represent the server port behind any intermediaries, for example
- proxies, if it's available.
+ * The previous {@code session.id} for this user, when known.
*/
-static constexpr const char *kServerPort = "server.port";
+static constexpr const char *kSessionPreviousId = "session.previous_id";
/**
* Source address - domain name if available without reverse DNS lookup; otherwise, IP address or
@@ -1280,6 +2398,45 @@ static constexpr const char *kSourceAddress = "source.address";
*/
static constexpr const char *kSourcePort = "source.port";
+/**
+ * The language of the telemetry SDK.
+ */
+static constexpr const char *kTelemetrySdkLanguage = "telemetry.sdk.language";
+
+/**
+ * The name of the telemetry SDK as defined above.
+ *
+ * Notes:
+
- The OpenTelemetry SDK MUST set the {@code telemetry.sdk.name} attribute to {@code
+opentelemetry}. If another SDK, like a fork or a vendor-provided implementation, is used, this SDK
+MUST set the
+{@code telemetry.sdk.name} attribute to the fully-qualified class or module name of this SDK's main
+entry point or another suitable identifier depending on the language. The identifier {@code
+opentelemetry} is reserved and MUST NOT be used in this case. All custom identifiers SHOULD be
+stable across different versions of an implementation.
+ */
+static constexpr const char *kTelemetrySdkName = "telemetry.sdk.name";
+
+/**
+ * The version string of the telemetry SDK.
+ */
+static constexpr const char *kTelemetrySdkVersion = "telemetry.sdk.version";
+
+/**
+ * The name of the auto instrumentation agent or distribution, if used.
+ *
+ * Notes:
+
- Official auto instrumentation agents and distributions SHOULD set the {@code
+telemetry.distro.name} attribute to a string starting with {@code opentelemetry-}, e.g. {@code
+opentelemetry-java-instrumentation}.
+ */
+static constexpr const char *kTelemetryDistroName = "telemetry.distro.name";
+
+/**
+ * The version string of the auto instrumentation agent or distribution, if used.
+ */
+static constexpr const char *kTelemetryDistroVersion = "telemetry.distro.version";
+
/**
* Current "managed" thread ID (as opposed to OS thread ID).
*/
@@ -1445,349 +2602,215 @@ static constexpr const char *kTlsServerHashSha1 = "tls.server.hash.sha1";
* uppercase hash.
*/
static constexpr const char *kTlsServerHashSha256 = "tls.server.hash.sha256";
-
-/**
- * Distinguished name of subject of the issuer of
- * the x.509 certificate presented by the client.
- */
-static constexpr const char *kTlsServerIssuer = "tls.server.issuer";
-
-/**
- * A hash that identifies servers based on how they perform an SSL/TLS handshake.
- */
-static constexpr const char *kTlsServerJa3s = "tls.server.ja3s";
-
-/**
- * Date/Time indicating when server certificate is no longer considered valid.
- */
-static constexpr const char *kTlsServerNotAfter = "tls.server.not_after";
-
-/**
- * Date/Time indicating when server certificate is first considered valid.
- */
-static constexpr const char *kTlsServerNotBefore = "tls.server.not_before";
-
-/**
- * Distinguished name of subject of the x.509 certificate presented by the server.
- */
-static constexpr const char *kTlsServerSubject = "tls.server.subject";
-
-/**
- * The URI fragment component
- */
-static constexpr const char *kUrlFragment = "url.fragment";
-
-/**
- * Absolute URL describing a network resource according to RFC3986
- *
- * Notes:
-
- For network calls, URL usually has {@code scheme://host[:port][path][?query][#fragment]}
-format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included
-nevertheless.
-{@code url.full} MUST NOT contain credentials passed via URL in form of {@code
-https://username:password@www.example.com/}. In such case username and password SHOULD be redacted
-and attribute's value SHOULD be {@code https://REDACTED:REDACTED@www.example.com/}.
-{@code url.full} SHOULD capture the absolute URL when it is available (or can be reconstructed) and
-SHOULD NOT be validated or modified except for sanitizing purposes.
- */
-static constexpr const char *kUrlFull = "url.full";
-
-/**
- * The URI path component
- */
-static constexpr const char *kUrlPath = "url.path";
-
-/**
- * The URI query component
- *
- * Notes:
-
- Sensitive content provided in query string SHOULD be scrubbed when instrumentations can
- identify it.
- */
-static constexpr const char *kUrlQuery = "url.query";
-
-/**
- * The URI scheme component
- * identifying the used protocol.
- */
-static constexpr const char *kUrlScheme = "url.scheme";
-
-/**
- * Value of the HTTP
- * User-Agent header sent by the client.
- */
-static constexpr const char *kUserAgentOriginal = "user_agent.original";
-
-/**
- * A unique id to identify a session.
- */
-static constexpr const char *kSessionId = "session.id";
-
-/**
- * The previous {@code session.id} for this user, when known.
- */
-static constexpr const char *kSessionPreviousId = "session.previous_id";
-
-/**
- * The full invoked ARN as provided on the {@code Context} passed to the function ({@code
- Lambda-Runtime-Invoked-Function-Arn} header on the {@code /runtime/invocation/next} applicable).
- *
- * Notes:
-
- This may be different from {@code cloud.resource_id} if an alias is involved.
- */
-static constexpr const char *kAwsLambdaInvokedArn = "aws.lambda.invoked_arn";
-
-/**
- * The event_id
- * uniquely identifies the event.
- */
-static constexpr const char *kCloudeventsEventId = "cloudevents.event_id";
-
-/**
- * The source
- * identifies the context in which an event happened.
- */
-static constexpr const char *kCloudeventsEventSource = "cloudevents.event_source";
-
-/**
- * The version of
- * the CloudEvents specification which the event uses.
- */
-static constexpr const char *kCloudeventsEventSpecVersion = "cloudevents.event_spec_version";
-
-/**
- * The subject of
- * the event in the context of the event producer (identified by source).
- */
-static constexpr const char *kCloudeventsEventSubject = "cloudevents.event_subject";
-
-/**
- * The event_type
- * contains a value describing the type of event related to the originating occurrence.
- */
-static constexpr const char *kCloudeventsEventType = "cloudevents.event_type";
-
-/**
- * Parent-child Reference type
- *
- * Notes:
-
- The causal relationship between a child Span and a parent Span.
- */
-static constexpr const char *kOpentracingRefType = "opentracing.ref_type";
-
-/**
- * Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code
- * is UNSET.
- */
-static constexpr const char *kOtelStatusCode = "otel.status_code";
-
-/**
- * Description of the Status if it has a value, otherwise not set.
- */
-static constexpr const char *kOtelStatusDescription = "otel.status_description";
-
-/**
- * The invocation ID of the current function invocation.
- */
-static constexpr const char *kFaasInvocationId = "faas.invocation_id";
-
-/**
- * The name of the source on which the triggering operation was performed. For example, in Cloud
- * Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name.
- */
-static constexpr const char *kFaasDocumentCollection = "faas.document.collection";
-
-/**
- * The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the
- * name of the file, and in Cosmos DB the table name.
- */
-static constexpr const char *kFaasDocumentName = "faas.document.name";
-
-/**
- * Describes the type of the operation that was performed on the data.
- */
-static constexpr const char *kFaasDocumentOperation = "faas.document.operation";
-
-/**
- * A string containing the time when the data was accessed in the ISO 8601 format expressed in UTC.
- */
-static constexpr const char *kFaasDocumentTime = "faas.document.time";
-
-/**
- * A string containing the schedule period as Cron
- * Expression.
- */
-static constexpr const char *kFaasCron = "faas.cron";
-
-/**
- * A string containing the function invocation time in the ISO 8601 format expressed in UTC.
- */
-static constexpr const char *kFaasTime = "faas.time";
-
-/**
- * A boolean that is true if the serverless function is executed for the first time (aka
- * cold-start).
- */
-static constexpr const char *kFaasColdstart = "faas.coldstart";
-
-/**
- * The unique identifier of the feature flag.
- */
-static constexpr const char *kFeatureFlagKey = "feature_flag.key";
-
-/**
- * The name of the service provider that performs the flag evaluation.
- */
-static constexpr const char *kFeatureFlagProviderName = "feature_flag.provider_name";
-
-/**
- * SHOULD be a semantic identifier for a value. If one is unavailable, a stringified version of the
-value can be used.
- *
- * Notes:
-
- A semantic identifier, commonly referred to as a variant, provides a means
-for referring to a value without including the value itself. This can
-provide additional context for understanding the meaning behind a value.
-For example, the variant {@code red} maybe be used for the value {@code #c05543}.
- A
-stringified version of the value can be used in situations where a semantic identifier is
-unavailable. String representation of the value should be determined by the implementer.
+
+/**
+ * Distinguished name of subject of the issuer of
+ * the x.509 certificate presented by the client.
*/
-static constexpr const char *kFeatureFlagVariant = "feature_flag.variant";
+static constexpr const char *kTlsServerIssuer = "tls.server.issuer";
/**
- * The AWS request ID as returned in the response headers {@code x-amz-request-id} or {@code
- * x-amz-requestid}.
+ * A hash that identifies servers based on how they perform an SSL/TLS handshake.
*/
-static constexpr const char *kAwsRequestId = "aws.request_id";
+static constexpr const char *kTlsServerJa3s = "tls.server.ja3s";
/**
- * The value of the {@code AttributesToGet} request parameter.
+ * Date/Time indicating when server certificate is no longer considered valid.
*/
-static constexpr const char *kAwsDynamodbAttributesToGet = "aws.dynamodb.attributes_to_get";
+static constexpr const char *kTlsServerNotAfter = "tls.server.not_after";
/**
- * The value of the {@code ConsistentRead} request parameter.
+ * Date/Time indicating when server certificate is first considered valid.
*/
-static constexpr const char *kAwsDynamodbConsistentRead = "aws.dynamodb.consistent_read";
+static constexpr const char *kTlsServerNotBefore = "tls.server.not_before";
/**
- * The JSON-serialized value of each item in the {@code ConsumedCapacity} response field.
+ * Distinguished name of subject of the x.509 certificate presented by the server.
*/
-static constexpr const char *kAwsDynamodbConsumedCapacity = "aws.dynamodb.consumed_capacity";
+static constexpr const char *kTlsServerSubject = "tls.server.subject";
/**
- * The value of the {@code IndexName} request parameter.
+ * Domain extracted from the {@code url.full}, such as "opentelemetry.io".
+ *
+ * Notes:
+
- In some cases a URL may refer to an IP and/or port directly, without a domain name. In
+ this case, the IP address would go to the domain field. If the URL contains a literal IPv6 address enclosed by {@code
+ [} and {@code ]}, the {@code [} and {@code ]} characters should also be captured in the domain
+ field.
*/
-static constexpr const char *kAwsDynamodbIndexName = "aws.dynamodb.index_name";
+static constexpr const char *kUrlDomain = "url.domain";
/**
- * The JSON-serialized value of the {@code ItemCollectionMetrics} response field.
+ * The file extension extracted from the {@code url.full}, excluding the leading dot.
+ *
+ * Notes:
+
- The file extension is only set if it exists, as not every url has a file extension. When
+ the file name has multiple extensions {@code example.tar.gz}, only the last one should be captured
+ {@code gz}, not {@code tar.gz}.
*/
-static constexpr const char *kAwsDynamodbItemCollectionMetrics =
- "aws.dynamodb.item_collection_metrics";
+static constexpr const char *kUrlExtension = "url.extension";
/**
- * The value of the {@code Limit} request parameter.
+ * The URI fragment component
*/
-static constexpr const char *kAwsDynamodbLimit = "aws.dynamodb.limit";
+static constexpr const char *kUrlFragment = "url.fragment";
/**
- * The value of the {@code ProjectionExpression} request parameter.
+ * Absolute URL describing a network resource according to RFC3986
+ *
+ * Notes:
+
- For network calls, URL usually has {@code scheme://host[:port][path][?query][#fragment]}
+format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included
+nevertheless.
+{@code url.full} MUST NOT contain credentials passed via URL in form of {@code
+https://username:password@www.example.com/}. In such case username and password SHOULD be redacted
+and attribute's value SHOULD be {@code https://REDACTED:REDACTED@www.example.com/}.
+{@code url.full} SHOULD capture the absolute URL when it is available (or can be reconstructed).
+Sensitive content provided in {@code url.full} SHOULD be scrubbed when instrumentations can identify
+it.
*/
-static constexpr const char *kAwsDynamodbProjection = "aws.dynamodb.projection";
+static constexpr const char *kUrlFull = "url.full";
/**
- * The value of the {@code ProvisionedThroughput.ReadCapacityUnits} request parameter.
+ * Unmodified original URL as seen in the event source.
+ *
+ * Notes:
+
- In network monitoring, the observed URL may be a full URL, whereas in access logs, the
+URL is often just represented as a path. This field is meant to represent the URL as it was
+observed, complete or not.
+{@code url.original} might contain credentials passed via URL in form of {@code
+https://username:password@www.example.com/}. In such case password and username SHOULD NOT be
+redacted and attribute's value SHOULD remain the same.
*/
-static constexpr const char *kAwsDynamodbProvisionedReadCapacity =
- "aws.dynamodb.provisioned_read_capacity";
+static constexpr const char *kUrlOriginal = "url.original";
/**
- * The value of the {@code ProvisionedThroughput.WriteCapacityUnits} request parameter.
+ * The URI path component
+ *
+ * Notes:
+
- Sensitive content provided in {@code url.path} SHOULD be scrubbed when instrumentations
+ can identify it.
*/
-static constexpr const char *kAwsDynamodbProvisionedWriteCapacity =
- "aws.dynamodb.provisioned_write_capacity";
+static constexpr const char *kUrlPath = "url.path";
/**
- * The value of the {@code Select} request parameter.
+ * Port extracted from the {@code url.full}
*/
-static constexpr const char *kAwsDynamodbSelect = "aws.dynamodb.select";
+static constexpr const char *kUrlPort = "url.port";
/**
- * The keys in the {@code RequestItems} object field.
+ * The URI query component
+ *
+ * Notes:
+
- Sensitive content provided in {@code url.query} SHOULD be scrubbed when instrumentations
+ can identify it.
*/
-static constexpr const char *kAwsDynamodbTableNames = "aws.dynamodb.table_names";
+static constexpr const char *kUrlQuery = "url.query";
/**
- * The JSON-serialized value of each item of the {@code GlobalSecondaryIndexes} request field
+ * The highest registered url domain, stripped of the subdomain.
+ *
+ * Notes:
+
- This value can be determined precisely with the public
+ suffix list. For example, the registered domain for {@code foo.example.com} is {@code
+ example.com}. Trying to approximate this by simply taking the last two labels will not work well
+ for TLDs such as {@code co.uk}.
*/
-static constexpr const char *kAwsDynamodbGlobalSecondaryIndexes =
- "aws.dynamodb.global_secondary_indexes";
+static constexpr const char *kUrlRegisteredDomain = "url.registered_domain";
/**
- * The JSON-serialized value of each item of the {@code LocalSecondaryIndexes} request field.
+ * The URI scheme component
+ * identifying the used protocol.
*/
-static constexpr const char *kAwsDynamodbLocalSecondaryIndexes =
- "aws.dynamodb.local_secondary_indexes";
+static constexpr const char *kUrlScheme = "url.scheme";
/**
- * The value of the {@code ExclusiveStartTableName} request parameter.
+ * The subdomain portion of a fully qualified domain name includes all of the names except the host
+ name under the registered_domain. In a partially qualified domain, or if the qualification level of
+ the full name cannot be determined, subdomain contains all of the names below the registered
+ domain.
+ *
+ * Notes:
+
- The subdomain portion of {@code www.east.mydomain.co.uk} is {@code east}. If the domain
+ has multiple levels of subdomain, such as {@code sub2.sub1.example.com}, the subdomain field should
+ contain {@code sub2.sub1}, with no trailing period.
*/
-static constexpr const char *kAwsDynamodbExclusiveStartTable = "aws.dynamodb.exclusive_start_table";
+static constexpr const char *kUrlSubdomain = "url.subdomain";
/**
- * The the number of items in the {@code TableNames} response parameter.
+ * The effective top level domain (eTLD), also known as the domain suffix, is the last part of the
+ domain name. For example, the top level domain for example.com is {@code com}.
+ *
+ * Notes:
+
*/
-static constexpr const char *kAwsDynamodbTableCount = "aws.dynamodb.table_count";
+static constexpr const char *kUrlTopLevelDomain = "url.top_level_domain";
/**
- * The value of the {@code ScanIndexForward} request parameter.
+ * Name of the user-agent extracted from original. Usually refers to the browser's name.
+ *
+ * Notes:
+
- Example of extracting browser's name from
+ original string. In the case of using a user-agent for non-browser products, such as microservices
+ with multiple names/versions inside the {@code user_agent.original}, the most significant name
+ SHOULD be selected. In such a scenario it should align with {@code user_agent.version}
*/
-static constexpr const char *kAwsDynamodbScanForward = "aws.dynamodb.scan_forward";
+static constexpr const char *kUserAgentName = "user_agent.name";
/**
- * The value of the {@code Count} response parameter.
+ * Value of the HTTP
+ * User-Agent header sent by the client.
*/
-static constexpr const char *kAwsDynamodbCount = "aws.dynamodb.count";
+static constexpr const char *kUserAgentOriginal = "user_agent.original";
/**
- * The value of the {@code ScannedCount} response parameter.
+ * Version of the user-agent extracted from original. Usually refers to the browser's version
+ *
+ * Notes:
+
- Example of extracting browser's version from
+ original string. In the case of using a user-agent for non-browser products, such as microservices
+ with multiple names/versions inside the {@code user_agent.original}, the most significant version
+ SHOULD be selected. In such a scenario it should align with {@code user_agent.name}
*/
-static constexpr const char *kAwsDynamodbScannedCount = "aws.dynamodb.scanned_count";
+static constexpr const char *kUserAgentVersion = "user_agent.version";
/**
- * The value of the {@code Segment} request parameter.
+ * The full invoked ARN as provided on the {@code Context} passed to the function ({@code
+ Lambda-Runtime-Invoked-Function-Arn} header on the {@code /runtime/invocation/next} applicable).
+ *
+ * Notes:
+
- This may be different from {@code cloud.resource_id} if an alias is involved.
*/
-static constexpr const char *kAwsDynamodbSegment = "aws.dynamodb.segment";
+static constexpr const char *kAwsLambdaInvokedArn = "aws.lambda.invoked_arn";
/**
- * The value of the {@code TotalSegments} request parameter.
+ * Parent-child Reference type
+ *
+ * Notes:
+
- The causal relationship between a child Span and a parent Span.
*/
-static constexpr const char *kAwsDynamodbTotalSegments = "aws.dynamodb.total_segments";
+static constexpr const char *kOpentracingRefType = "opentracing.ref_type";
/**
- * The JSON-serialized value of each item in the {@code AttributeDefinitions} request field.
+ * Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code
+ * is UNSET.
*/
-static constexpr const char *kAwsDynamodbAttributeDefinitions =
- "aws.dynamodb.attribute_definitions";
+static constexpr const char *kOtelStatusCode = "otel.status_code";
/**
- * The JSON-serialized value of each item in the the {@code GlobalSecondaryIndexUpdates} request
- * field.
+ * Description of the Status if it has a value, otherwise not set.
*/
-static constexpr const char *kAwsDynamodbGlobalSecondaryIndexUpdates =
- "aws.dynamodb.global_secondary_index_updates";
+static constexpr const char *kOtelStatusDescription = "otel.status_description";
+
+/**
+ * The AWS request ID as returned in the response headers {@code x-amz-request-id} or {@code
+ * x-amz-requestid}.
+ */
+static constexpr const char *kAwsRequestId = "aws.request_id";
/**
* The S3 bucket name the request refers to. Corresponds to the {@code --bucket} parameter of the StartSpan(
span_name,
- {{SemanticConventions::kRpcSystem, "grpc"},
- {SemanticConventions::kRpcService, "grpc-example.GreetService"},
- {SemanticConventions::kRpcMethod, "Greet"},
- {SemanticConventions::kNetworkPeerAddress, ip},
- {SemanticConventions::kNetworkPeerPort, port}},
+ {{opentelemetry::trace::SemanticConventions::kRpcSystem, "grpc"},
+ {opentelemetry::trace::SemanticConventions::kRpcService, "grpc-example.GreetService"},
+ {opentelemetry::trace::SemanticConventions::kRpcMethod, "Greet"},
+ {opentelemetry::trace::SemanticConventions::kNetworkPeerAddress, ip},
+ {opentelemetry::trace::SemanticConventions::kNetworkPeerPort, port}},
options);
auto scope = get_tracer("grpc-client")->WithActiveSpan(span);
@@ -70,7 +70,8 @@ class GreeterClient
if (status.ok())
{
span->SetStatus(StatusCode::kOk);
- span->SetAttribute(SemanticConventions::kRpcGrpcStatusCode, status.error_code());
+ span->SetAttribute(opentelemetry::trace::SemanticConventions::kRpcGrpcStatusCode,
+ status.error_code());
// Make sure to end your spans!
span->End();
return response.response();
@@ -79,7 +80,8 @@ class GreeterClient
{
std::cout << status.error_code() << ": " << status.error_message() << std::endl;
span->SetStatus(StatusCode::kError);
- span->SetAttribute(SemanticConventions::kRpcGrpcStatusCode, status.error_code());
+ span->SetAttribute(opentelemetry::trace::SemanticConventions::kRpcGrpcStatusCode,
+ status.error_code());
// Make sure to end your spans!
span->End();
return "RPC failed";
diff --git a/examples/grpc/server.cc b/examples/grpc/server.cc
index 6ba96a009e..5aeb506499 100644
--- a/examples/grpc/server.cc
+++ b/examples/grpc/server.cc
@@ -67,13 +67,14 @@ class GreeterServer final : public Greeter::Service
options.parent = GetSpan(new_context)->GetContext();
std::string span_name = "GreeterService/Greet";
- auto span = get_tracer("grpc")->StartSpan(span_name,
- {{SemanticConventions::kRpcSystem, "grpc"},
- {SemanticConventions::kRpcService, "GreeterService"},
- {SemanticConventions::kRpcMethod, "Greet"},
- {SemanticConventions::kRpcGrpcStatusCode, 0}},
- options);
- auto scope = get_tracer("grpc")->WithActiveSpan(span);
+ auto span = get_tracer("grpc")->StartSpan(
+ span_name,
+ {{opentelemetry::trace::SemanticConventions::kRpcSystem, "grpc"},
+ {opentelemetry::trace::SemanticConventions::kRpcService, "GreeterService"},
+ {opentelemetry::trace::SemanticConventions::kRpcMethod, "Greet"},
+ {opentelemetry::trace::SemanticConventions::kRpcGrpcStatusCode, 0}},
+ options);
+ auto scope = get_tracer("grpc")->WithActiveSpan(span);
// Fetch and parse whatever HTTP headers we can from the gRPC request.
span->AddEvent("Processing client attributes");
diff --git a/examples/http/client.cc b/examples/http/client.cc
index 3a8486f55f..cd1835ea55 100644
--- a/examples/http/client.cc
+++ b/examples/http/client.cc
@@ -24,12 +24,13 @@ void sendRequest(const std::string &url)
opentelemetry::ext::http::common::UrlParser url_parser(url);
std::string span_name = url_parser.path_;
- auto span = get_tracer("http-client")
- ->StartSpan(span_name,
- {{SemanticConventions::kUrlFull, url_parser.url_},
- {SemanticConventions::kUrlScheme, url_parser.scheme_},
- {SemanticConventions::kHttpRequestMethod, "GET"}},
- options);
+ auto span =
+ get_tracer("http-client")
+ ->StartSpan(span_name,
+ {{opentelemetry::trace::SemanticConventions::kUrlFull, url_parser.url_},
+ {opentelemetry::trace::SemanticConventions::kUrlScheme, url_parser.scheme_},
+ {opentelemetry::trace::SemanticConventions::kHttpRequestMethod, "GET"}},
+ options);
auto scope = get_tracer("http-client")->WithActiveSpan(span);
// inject current context into http header
@@ -44,7 +45,8 @@ void sendRequest(const std::string &url)
{
// set span attributes
auto status_code = result.GetResponse().GetStatusCode();
- span->SetAttribute(SemanticConventions::kHttpResponseStatusCode, status_code);
+ span->SetAttribute(opentelemetry::trace::SemanticConventions::kHttpResponseStatusCode,
+ status_code);
result.GetResponse().ForEachHeader(
[&span](nostd::string_view header_name, nostd::string_view header_value) {
span->SetAttribute("http.header." + std::string(header_name.data()), header_value);
diff --git a/examples/http/server.cc b/examples/http/server.cc
index 3dbdae8512..d4ae1b4485 100644
--- a/examples/http/server.cc
+++ b/examples/http/server.cc
@@ -38,16 +38,18 @@ class RequestHandler : public HTTP_SERVER_NS::HttpRequestCallback
options.parent = GetSpan(new_context)->GetContext();
// start span with parent context extracted from http header
- auto span = get_tracer("http-server")
- ->StartSpan(span_name,
- {{SemanticConventions::kServerAddress, server_name},
- {SemanticConventions::kServerPort, server_port},
- {SemanticConventions::kHttpRequestMethod, request.method},
- {SemanticConventions::kUrlScheme, "http"},
- {SemanticConventions::kHttpRequestBodySize,
- static_cast(request.content.length())},
- {SemanticConventions::kClientAddress, request.client}},
- options);
+ auto span =
+ get_tracer("http-server")
+ ->StartSpan(
+ span_name,
+ {{opentelemetry::trace::SemanticConventions::kServerAddress, server_name},
+ {opentelemetry::trace::SemanticConventions::kServerPort, server_port},
+ {opentelemetry::trace::SemanticConventions::kHttpRequestMethod, request.method},
+ {opentelemetry::trace::SemanticConventions::kUrlScheme, "http"},
+ {opentelemetry::trace::SemanticConventions::kHttpRequestBodySize,
+ static_cast(request.content.length())},
+ {opentelemetry::trace::SemanticConventions::kClientAddress, request.client}},
+ options);
auto scope = get_tracer("http_server")->WithActiveSpan(span);
diff --git a/exporters/zipkin/src/recordable.cc b/exporters/zipkin/src/recordable.cc
index ed43cb8a2d..265163fccb 100644
--- a/exporters/zipkin/src/recordable.cc
+++ b/exporters/zipkin/src/recordable.cc
@@ -4,6 +4,7 @@
#include "opentelemetry/exporters/zipkin/recordable.h"
#include "opentelemetry/sdk/resource/resource.h"
#include "opentelemetry/sdk/resource/semantic_conventions.h"
+#include "opentelemetry/trace/semantic_conventions.h"
#include