From efb1a260fed0b5a69abe768edac474b10d79e288 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Wed, 12 Apr 2023 09:02:17 +0200 Subject: [PATCH] [SEMANTIC CONVENTIONS] Upgrade to version 1.20.0 (#2088) Fix #2087 --- CHANGELOG.md | 2 + .../trace/semantic_conventions.h | 270 ++++++++++++++---- buildscripts/semantic-convention/generate.sh | 2 +- .../sdk/resource/semantic_conventions.h | 2 +- 4 files changed, 220 insertions(+), 56 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce1457b469..ea75d39241 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,8 @@ Increment the: [#2000](https://github.com/open-telemetry/opentelemetry-cpp/pull/2000) * [SEMANTIC CONVENTIONS] Upgrade to version 1.19.0 [#2017](https://github.com/open-telemetry/opentelemetry-cpp/pull/2017) +* [SEMANTIC CONVENTIONS] Upgrade to version 1.20.0 + [#2088](https://github.com/open-telemetry/opentelemetry-cpp/pull/2088) * [EXPORTER] Add OTLP HTTP SSL support [#1793](https://github.com/open-telemetry/opentelemetry-cpp/pull/1793) diff --git a/api/include/opentelemetry/trace/semantic_conventions.h b/api/include/opentelemetry/trace/semantic_conventions.h index 051d865f86..ecada99a41 100644 --- a/api/include/opentelemetry/trace/semantic_conventions.h +++ b/api/include/opentelemetry/trace/semantic_conventions.h @@ -21,7 +21,7 @@ namespace SemanticConventions /** * The URL of the OpenTelemetry schema for these keys and values. */ -static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.19.0"; +static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.20.0"; /** * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of @@ -50,11 +50,6 @@ static constexpr const char *kHttpMethod = "http.method"; */ static constexpr const char *kHttpStatusCode = "http.status_code"; -/** - * Kind of HTTP protocol used. - */ -static constexpr const char *kHttpFlavor = "http.flavor"; - /** * The URI scheme identifying the used protocol. */ @@ -86,6 +81,17 @@ unrelated events. */ static constexpr const char *kEventDomain = "event.domain"; +/** + * A unique identifier for the Log Record. + * + *

Notes: +

+ */ +static constexpr const char *kLogRecordUid = "log.record.uid"; + /** * 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). @@ -175,9 +181,6 @@ static constexpr const char *kDbName = "db.name"; /** * The database statement being executed. - * - *

Notes: -

*/ static constexpr const char *kDbStatement = "db.statement"; @@ -275,6 +278,46 @@ static constexpr const char *kDbMongodbCollection = "db.mongodb.collection"; */ static constexpr const char *kDbSqlTable = "db.sql.table"; +/** + * Unique Cosmos client instance id. + */ +static constexpr const char *kDbCosmosdbClientId = "db.cosmosdb.client_id"; + +/** + * CosmosDB Operation Type. + */ +static constexpr const char *kDbCosmosdbOperationType = "db.cosmosdb.operation_type"; + +/** + * 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"; + +/** + * 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"; + +/** + * RU consumed for that operation + */ +static constexpr const char *kDbCosmosdbRequestCharge = "db.cosmosdb.request_charge"; + /** * Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code * is UNSET. @@ -407,18 +450,18 @@ static constexpr const char *kNetTransport = "net.transport"; /** * Application layer protocol used. The value SHOULD be normalized to lowercase. */ -static constexpr const char *kNetAppProtocolName = "net.app.protocol.name"; +static constexpr const char *kNetProtocolName = "net.protocol.name"; /** * Version of the application layer protocol used. See note below. * *

Notes: -

*/ static constexpr const char *kHttpClientIp = "http.client_ip"; +/** + * 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 keys in the {@code RequestItems} object field. */ @@ -754,6 +803,117 @@ static constexpr const char *kAwsDynamodbAttributeDefinitions = static constexpr const char *kAwsDynamodbGlobalSecondaryIndexUpdates = "aws.dynamodb.global_secondary_index_updates"; +/** + * The S3 bucket name the request refers to. Corresponds to the {@code --bucket} parameter of the S3 API operations. + * + *

Notes: +

+ */ +static constexpr const char *kAwsS3Bucket = "aws.s3.bucket"; + +/** + * The S3 object key the request refers to. Corresponds to the {@code --key} parameter of the S3 API operations. + * + *

Notes: +

+ */ +static constexpr const char *kAwsS3Key = "aws.s3.key"; + +/** + * The source object (in the form {@code bucket}/{@code key}) for the copy operation. + * + *

Notes: +

+ */ +static constexpr const char *kAwsS3CopySource = "aws.s3.copy_source"; + +/** + * Upload ID that identifies the multipart upload. + * + *

Notes: +

+ */ +static constexpr const char *kAwsS3UploadId = "aws.s3.upload_id"; + +/** + * The delete request container that specifies the objects to be deleted. + * + *

Notes: +

+ */ +static constexpr const char *kAwsS3Delete = "aws.s3.delete"; + +/** + * The part number of the part being uploaded in a multipart-upload operation. This is a positive +integer between 1 and 10,000. + * + *

Notes: +

+ */ +static constexpr const char *kAwsS3PartNumber = "aws.s3.part_number"; + /** * The name of the operation being executed. */ @@ -806,11 +966,6 @@ the broker. */ static constexpr const char *kMessagingDestinationName = "messaging.destination.name"; -/** - * The kind of message destination - */ -static constexpr const char *kMessagingDestinationKind = "messaging.destination.kind"; - /** * Low cardinality representation of the messaging destination name * @@ -844,11 +999,6 @@ broker. */ static constexpr const char *kMessagingSourceName = "messaging.source.name"; -/** - * The kind of message source - */ -static constexpr const char *kMessagingSourceKind = "messaging.source.kind"; - /** * Low cardinality representation of the messaging source name * @@ -1126,22 +1276,6 @@ static constexpr const char *kExceptionEscaped = "exception.escaped"; static constexpr const char *kUserAgentOriginal = "user_agent.original"; // Enum definitions -namespace HttpFlavorValues -{ -/** HTTP/1.0. */ -static constexpr const char *kHttp10 = "1.0"; -/** HTTP/1.1. */ -static constexpr const char *kHttp11 = "1.1"; -/** HTTP/2. */ -static constexpr const char *kHttp20 = "2.0"; -/** HTTP/3. */ -static constexpr const char *kHttp30 = "3.0"; -/** SPDY protocol. */ -static constexpr const char *kSpdy = "SPDY"; -/** QUIC protocol. */ -static constexpr const char *kQuic = "QUIC"; -} // namespace HttpFlavorValues - namespace EventDomainValues { /** Events from browser apps. */ @@ -1264,6 +1398,8 @@ static constexpr const char *kOpensearch = "opensearch"; static constexpr const char *kClickhouse = "clickhouse"; /** Cloud Spanner. */ static constexpr const char *kSpanner = "spanner"; +/** Trino. */ +static constexpr const char *kTrino = "trino"; } // namespace DbSystemValues namespace DbCassandraConsistencyLevelValues @@ -1292,6 +1428,48 @@ static constexpr const char *kSerial = "serial"; static constexpr const char *kLocalSerial = "local_serial"; } // namespace DbCassandraConsistencyLevelValues +namespace DbCosmosdbOperationTypeValues +{ +/** invalid. */ +static constexpr const char *kInvalid = "Invalid"; +/** create. */ +static constexpr const char *kCreate = "Create"; +/** patch. */ +static constexpr const char *kPatch = "Patch"; +/** read. */ +static constexpr const char *kRead = "Read"; +/** read_feed. */ +static constexpr const char *kReadFeed = "ReadFeed"; +/** delete. */ +static constexpr const char *kDelete = "Delete"; +/** replace. */ +static constexpr const char *kReplace = "Replace"; +/** execute. */ +static constexpr const char *kExecute = "Execute"; +/** query. */ +static constexpr const char *kQuery = "Query"; +/** head. */ +static constexpr const char *kHead = "Head"; +/** head_feed. */ +static constexpr const char *kHeadFeed = "HeadFeed"; +/** upsert. */ +static constexpr const char *kUpsert = "Upsert"; +/** batch. */ +static constexpr const char *kBatch = "Batch"; +/** query_plan. */ +static constexpr const char *kQueryPlan = "QueryPlan"; +/** execute_javascript. */ +static constexpr const char *kExecuteJavascript = "ExecuteJavaScript"; +} // namespace DbCosmosdbOperationTypeValues + +namespace DbCosmosdbConnectionModeValues +{ +/** Gateway (HTTP) connections mode. */ +static constexpr const char *kGateway = "gateway"; +/** Direct connection. */ +static constexpr const char *kDirect = "direct"; +} // namespace DbCosmosdbConnectionModeValues + namespace OtelStatusCodeValues { /** The operation has been validated by an Application developer or Operator to have completed @@ -1433,22 +1611,6 @@ static constexpr const char *kMutation = "mutation"; static constexpr const char *kSubscription = "subscription"; } // namespace GraphqlOperationTypeValues -namespace MessagingDestinationKindValues -{ -/** A message sent to a queue. */ -static constexpr const char *kQueue = "queue"; -/** A message sent to a topic. */ -static constexpr const char *kTopic = "topic"; -} // namespace MessagingDestinationKindValues - -namespace MessagingSourceKindValues -{ -/** A message received from a queue. */ -static constexpr const char *kQueue = "queue"; -/** A message received from a topic. */ -static constexpr const char *kTopic = "topic"; -} // namespace MessagingSourceKindValues - namespace MessagingOperationValues { /** publish. */ diff --git a/buildscripts/semantic-convention/generate.sh b/buildscripts/semantic-convention/generate.sh index 22f556c486..2fd203013f 100755 --- a/buildscripts/semantic-convention/generate.sh +++ b/buildscripts/semantic-convention/generate.sh @@ -15,7 +15,7 @@ ROOT_DIR="${SCRIPT_DIR}/../../" # freeze the spec & generator tools versions to make SemanticAttributes generation reproducible # repository: https://github.com/open-telemetry/opentelemetry-specification -SEMCONV_VERSION=1.19.0 +SEMCONV_VERSION=1.20.0 # repository: https://github.com/open-telemetry/build-tools GENERATOR_VERSION=0.18.0 diff --git a/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h b/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h index 895aa720d3..f1315d9262 100644 --- a/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h +++ b/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h @@ -23,7 +23,7 @@ namespace SemanticConventions /** * The URL of the OpenTelemetry schema for these keys and values. */ -static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.19.0"; +static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.20.0"; /** * Array of brand name and version separated by a space