diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bc1c8e054..529434bd63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ Increment the: ## [Unreleased] * [BUILD] Add CMake OTELCPP_MAINTAINER_MODE [#1650](https://github.com/open-telemetry/opentelemetry-cpp/pull/1650) +* [SEMANTIC CONVENTIONS] Upgrade to version 1.14.0 [#1697](https://github.com/open-telemetry/opentelemetry-cpp/pull/1697) ## [1.6.1] 2022-09-22 diff --git a/api/include/opentelemetry/trace/semantic_conventions.h b/api/include/opentelemetry/trace/semantic_conventions.h index 93bb86d789..063b49cf97 100644 --- a/api/include/opentelemetry/trace/semantic_conventions.h +++ b/api/include/opentelemetry/trace/semantic_conventions.h @@ -33,7 +33,40 @@ namespace SemanticConventions /** * The URL of the OpenTelemetry schema for these keys and values. */ -static constexpr const char *SCHEMA_URL = "https://opentelemetry.io/schemas/1.13.0"; +static constexpr const char *SCHEMA_URL = "https://opentelemetry.io/schemas/1.14.0"; + +/** + * 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 *EXCEPTION_TYPE = "exception.type"; + +/** + * The exception message. + */ +static constexpr const char *EXCEPTION_MESSAGE = "exception.message"; + +/** + * 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 *EXCEPTION_STACKTRACE = "exception.stacktrace"; + +/** + * The name identifies the event. + */ +static constexpr const char *EVENT_NAME = "event.name"; + +/** + * The domain identifies the context in which an event happened. An event name is unique only within +a domain. + * + *

Notes: +

+ */ +static constexpr const char *EVENT_DOMAIN = "event.domain"; /** * The full invoked ARN as provided on the {@code Context} passed to the function ({@code @@ -224,42 +257,6 @@ static constexpr const char *DB_MONGODB_COLLECTION = "db.mongodb.collection"; */ static constexpr const char *DB_SQL_TABLE = "db.sql.table"; -/** - * 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 *EXCEPTION_TYPE = "exception.type"; - -/** - * The exception message. - */ -static constexpr const char *EXCEPTION_MESSAGE = "exception.message"; - -/** - * 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 *EXCEPTION_STACKTRACE = "exception.stacktrace"; - -/** - * 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 *EXCEPTION_ESCAPED = "exception.escaped"; - /** * Type of the trigger which caused this function execution. * @@ -961,32 +958,17 @@ static constexpr const char *RPC_JSONRPC_ERROR_CODE = "rpc.jsonrpc.error_code"; */ static constexpr const char *RPC_JSONRPC_ERROR_MESSAGE = "rpc.jsonrpc.error_message"; -/** - * Whether this is a received or sent message. - */ -static constexpr const char *MESSAGE_TYPE = "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 *MESSAGE_ID = "message.id"; - -/** - * Compressed size of the message in bytes. - */ -static constexpr const char *MESSAGE_COMPRESSED_SIZE = "message.compressed_size"; - -/** - * Uncompressed size of the message in bytes. - */ -static constexpr const char *MESSAGE_UNCOMPRESSED_SIZE = "message.uncompressed_size"; - // Enum definitions +namespace EventDomainValues +{ +/** Events from browser apps. */ +static constexpr const char *BROWSER = "browser"; +/** Events from mobile apps. */ +static constexpr const char *DEVICE = "device"; +/** Events from Kubernetes. */ +static constexpr const char *K8S = "k8s"; +} // namespace EventDomainValues + namespace OpentracingRefTypeValues { /** The parent Span depends on the child Span in some capacity. */ @@ -1355,14 +1337,6 @@ static constexpr const int DATA_LOSS = 15; static constexpr const int UNAUTHENTICATED = 16; } // namespace RpcGrpcStatusCodeValues -namespace MessageTypeValues -{ -/** sent. */ -static constexpr const char *SENT = "SENT"; -/** received. */ -static constexpr const char *RECEIVED = "RECEIVED"; -} // namespace MessageTypeValues - } // namespace SemanticConventions } // namespace trace OPENTELEMETRY_END_NAMESPACE diff --git a/buildscripts/semantic-convention/generate.sh b/buildscripts/semantic-convention/generate.sh index 5cf63ce5c2..ba8470e36d 100755 --- a/buildscripts/semantic-convention/generate.sh +++ b/buildscripts/semantic-convention/generate.sh @@ -10,7 +10,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ROOT_DIR="${SCRIPT_DIR}/../../" # freeze the spec & generator tools versions to make SemanticAttributes generation reproducible -SEMCONV_VERSION=1.13.0 +SEMCONV_VERSION=1.14.0 SPEC_VERSION=v$SEMCONV_VERSION SCHEMA_URL=https://opentelemetry.io/schemas/$SEMCONV_VERSION GENERATOR_VERSION=0.14.0 @@ -28,10 +28,11 @@ git reset --hard FETCH_HEAD cd ${SCRIPT_DIR} docker run --rm \ - -v ${SCRIPT_DIR}/opentelemetry-specification/semantic_conventions/trace:/source \ + -v ${SCRIPT_DIR}/opentelemetry-specification/semantic_conventions:/source \ -v ${SCRIPT_DIR}/templates:/templates \ -v ${ROOT_DIR}/api/include/opentelemetry/trace/:/output \ otel/semconvgen:$GENERATOR_VERSION \ + --only span \ -f /source code \ --template /templates/SemanticAttributes.h.j2 \ --output /output/semantic_conventions.h \ @@ -42,10 +43,11 @@ docker run --rm \ -Dnamespace_close="}" docker run --rm \ - -v ${SCRIPT_DIR}/opentelemetry-specification/semantic_conventions/resource:/source \ + -v ${SCRIPT_DIR}/opentelemetry-specification/semantic_conventions:/source \ -v ${SCRIPT_DIR}/templates:/templates \ -v ${ROOT_DIR}/sdk/include/opentelemetry/sdk/resource/:/output \ otel/semconvgen:$GENERATOR_VERSION \ + --only resource \ -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 48f51b00b2..a018e28422 100644 --- a/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h +++ b/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h @@ -23,15 +23,15 @@ namespace SemanticConventions /** * The URL of the OpenTelemetry schema for these keys and values. */ -static constexpr const char *SCHEMA_URL = "https://opentelemetry.io/schemas/1.13.0"; +static constexpr const char *SCHEMA_URL = "https://opentelemetry.io/schemas/1.14.0"; /** * Array of brand name and version separated by a space * *

Notes:

+ href="https://wicg.github.io/ua-client-hints/#interface">UA client hints API ({@code + navigator.userAgentData.brands}). */ static constexpr const char *BROWSER_BRANDS = "browser.brands"; @@ -40,18 +40,28 @@ static constexpr const char *BROWSER_BRANDS = "browser.brands"; * *

Notes:

+href="./os.md">{@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 *BROWSER_PLATFORM = "browser.platform"; +/** + * A boolean that is true if the browser is running on a mobile device + * + *

Notes: +

+ */ +static constexpr const char *BROWSER_MOBILE = "browser.mobile"; + /** * Full user-agent string provided by the browser * @@ -62,6 +72,15 @@ static constexpr const char *BROWSER_PLATFORM = "browser.platform"; */ static constexpr const char *BROWSER_USER_AGENT = "browser.user_agent"; +/** + * Preferred language of the user using the browser + * + *

Notes: +

+ */ +static constexpr const char *BROWSER_LANGUAGE = "browser.language"; + /** * Name of the cloud provider. */