diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d8e3c7c47..0311312b2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,8 @@ Increment the: top level.[#2062](https://github.com/open-telemetry/opentelemetry-cpp/pull/2062) * [EXPORTERS]Add `ForceFlush` for `LogRecordExporter` and `SpanExporter` [#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) Important changes: diff --git a/api/include/opentelemetry/trace/semantic_conventions.h b/api/include/opentelemetry/trace/semantic_conventions.h index d0485704ef..051d865f86 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.18.0"; +static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.19.0"; /** * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of @@ -40,6 +40,38 @@ static constexpr const char *kExceptionMessage = "exception.message"; */ static constexpr const char *kExceptionStacktrace = "exception.stacktrace"; +/** + * HTTP request method. + */ +static constexpr const char *kHttpMethod = "http.method"; + +/** + * HTTP response status code. + */ +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. + */ +static constexpr const char *kHttpScheme = "http.scheme"; + +/** + * The matched route (path template in the format used by the respective server framework). See note +below + * + *

Notes: +

+ */ +static constexpr const char *kHttpRoute = "http.route"; + /** * The name identifies the event. */ @@ -59,7 +91,7 @@ static constexpr const char *kEventDomain = "event.domain"; Lambda-Runtime-Invoked-Function-Arn} header on the {@code /runtime/invocation/next} applicable). * *

Notes: -

+ */ static constexpr const char *kAwsLambdaInvokedArn = "aws.lambda.invoked_arn"; @@ -255,7 +287,7 @@ static constexpr const char *kOtelStatusCode = "otel.status_code"; static constexpr const char *kOtelStatusDescription = "otel.status_description"; /** - * Type of the trigger which caused this function execution. + * Type of the trigger which caused this function invocation. * *

Notes:

static constexpr const char *kFaasTrigger = "faas.trigger"; /** - * The execution ID of the current function execution. + * The invocation ID of the current function invocation. */ -static constexpr const char *kFaasExecution = "faas.execution"; +static constexpr const char *kFaasInvocationId = "faas.invocation_id"; /** * The name of the source on which the triggering operation was performed. For example, in Cloud @@ -343,6 +375,30 @@ static constexpr const char *kFaasInvokedProvider = "faas.invoked_provider"; */ static constexpr const char *kFaasInvokedRegion = "faas.invoked_region"; +/** + * 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: +

+ */ +static constexpr const char *kFeatureFlagVariant = "feature_flag.variant"; + /** * Transport protocol used. See note below. */ @@ -521,31 +577,6 @@ static constexpr const char *kCodeLineno = "code.lineno"; */ static constexpr const char *kCodeColumn = "code.column"; -/** - * HTTP request method. - */ -static constexpr const char *kHttpMethod = "http.method"; - -/** - * HTTP response status code. - */ -static constexpr const char *kHttpStatusCode = "http.status_code"; - -/** - * Kind of HTTP protocol used. - * - *

Notes: -

- */ -static constexpr const char *kHttpFlavor = "http.flavor"; - -/** - * Value of the HTTP - * User-Agent header sent by the client. - */ -static constexpr const char *kHttpUserAgent = "http.user_agent"; - /** * The size of the request payload body in bytes. This is the number of bytes transferred excluding * headers and is often, but not always, present as the Notes: - - */ -static constexpr const char *kHttpRoute = "http.route"; - /** * The IP address of the original client behind all proxies, if known (e.g. from X-Forwarded-For). @@ -1054,7 +1069,79 @@ static constexpr const char *kRpcJsonrpcErrorCode = "rpc.jsonrpc.error_code"; */ static constexpr const char *kRpcJsonrpcErrorMessage = "rpc.jsonrpc.error_message"; +/** + * Whether this is a received or sent message. + */ +static constexpr const char *kMessageType = "message.type"; + +/** + * MUST be calculated as two different counters starting from {@code 1} one for sent messages and + one for received message. + * + *

Notes: +

+ */ +static constexpr const char *kMessageId = "message.id"; + +/** + * Compressed size of the message in bytes. + */ +static constexpr const char *kMessageCompressedSize = "message.compressed_size"; + +/** + * Uncompressed size of the message in bytes. + */ +static constexpr const char *kMessageUncompressedSize = "message.uncompressed_size"; + +/** + * The error codes of the Connect + * request. Error codes are always string values. + */ +static constexpr const char *kRpcConnectRpcErrorCode = "rpc.connect_rpc.error_code"; + +/** + * 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: +

+ */ +static constexpr const char *kExceptionEscaped = "exception.escaped"; + +/** + * Value of the HTTP + * User-Agent header sent by the client. + */ +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. */ @@ -1336,22 +1423,6 @@ static constexpr const char *kNrnsa = "nrnsa"; static constexpr const char *kLteCa = "lte_ca"; } // namespace NetHostConnectionSubtypeValues -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 GraphqlOperationTypeValues { /** GraphQL query. */ @@ -1418,6 +1489,8 @@ static constexpr const char *kJavaRmi = "java_rmi"; static constexpr const char *kDotnetWcf = "dotnet_wcf"; /** Apache Dubbo. */ static constexpr const char *kApacheDubbo = "apache_dubbo"; +/** Connect RPC. */ +static constexpr const char *kConnectRpc = "connect_rpc"; } // namespace RpcSystemValues namespace RpcGrpcStatusCodeValues @@ -1458,6 +1531,50 @@ static constexpr const int kDataLoss = 15; static constexpr const int kUnauthenticated = 16; } // namespace RpcGrpcStatusCodeValues +namespace MessageTypeValues +{ +/** sent. */ +static constexpr const char *kSent = "SENT"; +/** received. */ +static constexpr const char *kReceived = "RECEIVED"; +} // namespace MessageTypeValues + +namespace RpcConnectRpcErrorCodeValues +{ +/** cancelled. */ +static constexpr const char *kCancelled = "cancelled"; +/** unknown. */ +static constexpr const char *kUnknown = "unknown"; +/** invalid_argument. */ +static constexpr const char *kInvalidArgument = "invalid_argument"; +/** deadline_exceeded. */ +static constexpr const char *kDeadlineExceeded = "deadline_exceeded"; +/** not_found. */ +static constexpr const char *kNotFound = "not_found"; +/** already_exists. */ +static constexpr const char *kAlreadyExists = "already_exists"; +/** permission_denied. */ +static constexpr const char *kPermissionDenied = "permission_denied"; +/** resource_exhausted. */ +static constexpr const char *kResourceExhausted = "resource_exhausted"; +/** failed_precondition. */ +static constexpr const char *kFailedPrecondition = "failed_precondition"; +/** aborted. */ +static constexpr const char *kAborted = "aborted"; +/** out_of_range. */ +static constexpr const char *kOutOfRange = "out_of_range"; +/** unimplemented. */ +static constexpr const char *kUnimplemented = "unimplemented"; +/** internal. */ +static constexpr const char *kInternal = "internal"; +/** unavailable. */ +static constexpr const char *kUnavailable = "unavailable"; +/** data_loss. */ +static constexpr const char *kDataLoss = "data_loss"; +/** unauthenticated. */ +static constexpr const char *kUnauthenticated = "unauthenticated"; +} // namespace RpcConnectRpcErrorCodeValues + } // namespace SemanticConventions } // namespace trace OPENTELEMETRY_END_NAMESPACE diff --git a/buildscripts/semantic-convention/generate.sh b/buildscripts/semantic-convention/generate.sh index ee9d3ae1a4..22f556c486 100755 --- a/buildscripts/semantic-convention/generate.sh +++ b/buildscripts/semantic-convention/generate.sh @@ -15,10 +15,10 @@ 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.18.0 +SEMCONV_VERSION=1.19.0 # repository: https://github.com/open-telemetry/build-tools -GENERATOR_VERSION=0.15.1 +GENERATOR_VERSION=0.18.0 SPEC_VERSION=v$SEMCONV_VERSION SCHEMA_URL=https://opentelemetry.io/schemas/$SEMCONV_VERSION @@ -46,7 +46,7 @@ docker run --rm \ -v ${SCRIPT_DIR}/templates:/templates \ -v ${ROOT_DIR}/api/include/opentelemetry/trace/:/output \ otel/semconvgen:$GENERATOR_VERSION \ - --only span \ + --only span,event,attribute_group,scope \ -f /source code \ --template /templates/SemanticAttributes.h.j2 \ --output /output/semantic_conventions.h \ diff --git a/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h b/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h index 27aff268cc..895aa720d3 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.18.0"; +static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.19.0"; /** * Array of brand name and version separated by a space @@ -62,16 +62,6 @@ static constexpr const char *kBrowserPlatform = "browser.platform"; */ static constexpr const char *kBrowserMobile = "browser.mobile"; -/** - * Full user-agent string provided by the browser - * - *

Notes: -

- */ -static constexpr const char *kBrowserUserAgent = "browser.user_agent"; - /** * Preferred language of the user using the browser * @@ -100,11 +90,41 @@ static constexpr const char *kCloudAccountId = "cloud.account.id"; href="https://aws.amazon.com/about-aws/global-infrastructure/regions_az/">AWS regions, Azure regions, Google Cloud regions, or Tencent Cloud regions. - + href="https://www.tencentcloud.com/document/product/213/6091">Tencent Cloud regions. */ 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: +

+ */ +static constexpr const char *kCloudResourceId = "cloud.resource_id"; + /** * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. @@ -201,6 +221,21 @@ static constexpr const char *kAwsLogStreamNames = "aws.log.stream.names"; */ static constexpr const char *kAwsLogStreamArns = "aws.log.stream.arns"; +/** + * Time and date the release was created + */ +static constexpr const char *kHerokuReleaseCreationTimestamp = "heroku.release.creation_timestamp"; + +/** + * Commit hash for the current release + */ +static constexpr const char *kHerokuReleaseCommit = "heroku.release.commit"; + +/** + * Unique identifier for the application + */ +static constexpr const char *kHerokuAppId = "heroku.app.id"; + /** * Container name used by container runtime. */ @@ -295,35 +330,11 @@ providers/products:
  • Azure: The full name {@code +the {@code cloud.resource_id} attribute).
  • */ static constexpr const char *kFaasName = "faas.name"; -/** - * The unique ID of the single function that this runtime instance executes. - * - *

    Notes: -

    - */ -static constexpr const char *kFaasId = "faas.id"; - /** * The immutable version of the function being executed. * @@ -352,19 +363,20 @@ static constexpr const char *kFaasVersion = "faas.version"; static constexpr const char *kFaasInstance = "faas.instance"; /** - * The amount of memory available to the serverless function in MiB. + * The amount of memory available to the serverless function converted to Bytes. * *

    Notes:

    + AWS_LAMBDA_FUNCTION_MEMORY_SIZE} provides this information (which must be multiplied by + 1,048,576). */ static constexpr const char *kFaasMaxMemory = "faas.max_memory"; /** * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For - * non-containerized Linux systems, the {@code machine-id} located in {@code /etc/machine-id} or - * {@code /var/lib/dbus/machine-id} may be used. + * 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. */ static constexpr const char *kHostId = "host.id"; @@ -703,6 +715,8 @@ static constexpr const char *kAws = "aws"; static constexpr const char *kAzure = "azure"; /** Google Cloud Platform. */ static constexpr const char *kGcp = "gcp"; +/** Heroku Platform as a Service. */ +static constexpr const char *kHeroku = "heroku"; /** IBM Cloud. */ static constexpr const char *kIbmCloud = "ibm_cloud"; /** Tencent Cloud. */