Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
114 changes: 44 additions & 70 deletions api/include/opentelemetry/trace/semantic_conventions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
* <p>Notes:
<ul> <li>An {@code event.name} is supposed to be unique only in the context of an
{@code event.domain}, so this allows for two events in different domains to
have same {@code event.name}, yet be unrelated events.</li> </ul>
*/
static constexpr const char *EVENT_DOMAIN = "event.domain";

/**
* The full invoked ARN as provided on the {@code Context} passed to the function ({@code
Expand Down Expand Up @@ -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.
*
* <p>Notes:
<ul> <li>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 &quot;in flight&quot;.
This may be actually &quot;in flight&quot; 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.</li><li>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 <a href="#recording-an-exception">example
above</a>.</li><li>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.</li> </ul>
*/
static constexpr const char *EXCEPTION_ESCAPED = "exception.escaped";

/**
* Type of the trigger which caused this function execution.
*
Expand Down Expand Up @@ -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.
*
* <p>Notes:
<ul> <li>This way we guarantee that the values will be consistent between different
implementations.</li> </ul>
*/
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. */
Expand Down Expand Up @@ -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
8 changes: 5 additions & 3 deletions buildscripts/semantic-convention/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand All @@ -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 \
Expand Down
35 changes: 27 additions & 8 deletions sdk/include/opentelemetry/sdk/resource/semantic_conventions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
* <p>Notes:
<ul> <li>This value is intended to be taken from the <a
href="https://wicg.github.io/ua-client-hints/#interface">UA client hints API</a>
(navigator.userAgentData.brands).</li> </ul>
href="https://wicg.github.io/ua-client-hints/#interface">UA client hints API</a> ({@code
navigator.userAgentData.brands}).</li> </ul>
*/
static constexpr const char *BROWSER_BRANDS = "browser.brands";

Expand All @@ -40,18 +40,28 @@ static constexpr const char *BROWSER_BRANDS = "browser.brands";
*
* <p>Notes:
<ul> <li>This value is intended to be taken from the <a
href="https://wicg.github.io/ua-client-hints/#interface">UA client hints API</a>
(navigator.userAgentData.platform). If unavailable, the legacy {@code navigator.platform} API SHOULD
href="https://wicg.github.io/ua-client-hints/#interface">UA client hints API</a> ({@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 <a
href="https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform">W3C User-Agent Client Hints
specification</a>. Note that some (but not all) of these values can overlap with values in the <a
href="./os.md">os.type and os.name attributes</a>. However, for consistency, the values in the
{@code browser.platform} attribute should capture the exact value that the user agent provides.</li>
</ul>
href="./os.md">{@code os.type} and {@code os.name} attributes</a>. However, for consistency, the
values in the {@code browser.platform} attribute should capture the exact value that the user agent
provides.</li> </ul>
*/
static constexpr const char *BROWSER_PLATFORM = "browser.platform";

/**
* A boolean that is true if the browser is running on a mobile device
*
* <p>Notes:
<ul> <li>This value is intended to be taken from the <a
href="https://wicg.github.io/ua-client-hints/#interface">UA client hints API</a> ({@code
navigator.userAgentData.mobile}). If unavailable, this attribute SHOULD be left unset.</li> </ul>
*/
static constexpr const char *BROWSER_MOBILE = "browser.mobile";

/**
* Full user-agent string provided by the browser
*
Expand All @@ -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
*
* <p>Notes:
<ul> <li>This value is intended to be taken from the Navigator API {@code
navigator.language}.</li> </ul>
*/
static constexpr const char *BROWSER_LANGUAGE = "browser.language";

/**
* Name of the cloud provider.
*/
Expand Down