Skip to content

Commit ac105bf

Browse files
authored
[SEMANTIC CONVENTIONS] Upgrade to version 1.14.0 (#1697)
1 parent d9f8bce commit ac105bf

File tree

4 files changed

+77
-81
lines changed

4 files changed

+77
-81
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Increment the:
1616
## [Unreleased]
1717

1818
* [BUILD] Add CMake OTELCPP_MAINTAINER_MODE [#1650](https://github.com/open-telemetry/opentelemetry-cpp/pull/1650)
19+
* [SEMANTIC CONVENTIONS] Upgrade to version 1.14.0 [#1697](https://github.com/open-telemetry/opentelemetry-cpp/pull/1697)
1920

2021
## [1.6.1] 2022-09-22
2122

api/include/opentelemetry/trace/semantic_conventions.h

+44-70
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,40 @@ namespace SemanticConventions
3333
/**
3434
* The URL of the OpenTelemetry schema for these keys and values.
3535
*/
36-
static constexpr const char *SCHEMA_URL = "https://opentelemetry.io/schemas/1.13.0";
36+
static constexpr const char *SCHEMA_URL = "https://opentelemetry.io/schemas/1.14.0";
37+
38+
/**
39+
* The type of the exception (its fully-qualified class name, if applicable). The dynamic type of
40+
* the exception should be preferred over the static type in languages that support it.
41+
*/
42+
static constexpr const char *EXCEPTION_TYPE = "exception.type";
43+
44+
/**
45+
* The exception message.
46+
*/
47+
static constexpr const char *EXCEPTION_MESSAGE = "exception.message";
48+
49+
/**
50+
* A stacktrace as a string in the natural representation for the language runtime. The
51+
* representation is to be determined and documented by each language SIG.
52+
*/
53+
static constexpr const char *EXCEPTION_STACKTRACE = "exception.stacktrace";
54+
55+
/**
56+
* The name identifies the event.
57+
*/
58+
static constexpr const char *EVENT_NAME = "event.name";
59+
60+
/**
61+
* The domain identifies the context in which an event happened. An event name is unique only within
62+
a domain.
63+
*
64+
* <p>Notes:
65+
<ul> <li>An {@code event.name} is supposed to be unique only in the context of an
66+
{@code event.domain}, so this allows for two events in different domains to
67+
have same {@code event.name}, yet be unrelated events.</li> </ul>
68+
*/
69+
static constexpr const char *EVENT_DOMAIN = "event.domain";
3770

3871
/**
3972
* 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";
224257
*/
225258
static constexpr const char *DB_SQL_TABLE = "db.sql.table";
226259

227-
/**
228-
* The type of the exception (its fully-qualified class name, if applicable). The dynamic type of
229-
* the exception should be preferred over the static type in languages that support it.
230-
*/
231-
static constexpr const char *EXCEPTION_TYPE = "exception.type";
232-
233-
/**
234-
* The exception message.
235-
*/
236-
static constexpr const char *EXCEPTION_MESSAGE = "exception.message";
237-
238-
/**
239-
* A stacktrace as a string in the natural representation for the language runtime. The
240-
* representation is to be determined and documented by each language SIG.
241-
*/
242-
static constexpr const char *EXCEPTION_STACKTRACE = "exception.stacktrace";
243-
244-
/**
245-
* SHOULD be set to true if the exception event is recorded at a point where it is known that the
246-
exception is escaping the scope of the span.
247-
*
248-
* <p>Notes:
249-
<ul> <li>An exception is considered to have escaped (or left) the scope of a span,
250-
if that span is ended while the exception is still logically &quot;in flight&quot;.
251-
This may be actually &quot;in flight&quot; in some languages (e.g. if the exception
252-
is passed to a Context manager's {@code __exit__} method in Python) but will
253-
usually be caught at the point of recording the exception in most languages.</li><li>It is usually
254-
not possible to determine at the point where an exception is thrown whether it will escape the scope
255-
of a span. However, it is trivial to know that an exception will escape, if one checks for an active
256-
exception just before ending the span, as done in the <a href="#recording-an-exception">example
257-
above</a>.</li><li>It follows that an exception may still escape the scope of the span even if the
258-
{@code exception.escaped} attribute was not set or set to false, since the event might have been
259-
recorded at a time where it was not clear whether the exception will escape.</li> </ul>
260-
*/
261-
static constexpr const char *EXCEPTION_ESCAPED = "exception.escaped";
262-
263260
/**
264261
* Type of the trigger which caused this function execution.
265262
*
@@ -961,32 +958,17 @@ static constexpr const char *RPC_JSONRPC_ERROR_CODE = "rpc.jsonrpc.error_code";
961958
*/
962959
static constexpr const char *RPC_JSONRPC_ERROR_MESSAGE = "rpc.jsonrpc.error_message";
963960

964-
/**
965-
* Whether this is a received or sent message.
966-
*/
967-
static constexpr const char *MESSAGE_TYPE = "message.type";
968-
969-
/**
970-
* MUST be calculated as two different counters starting from {@code 1} one for sent messages and
971-
one for received message.
972-
*
973-
* <p>Notes:
974-
<ul> <li>This way we guarantee that the values will be consistent between different
975-
implementations.</li> </ul>
976-
*/
977-
static constexpr const char *MESSAGE_ID = "message.id";
978-
979-
/**
980-
* Compressed size of the message in bytes.
981-
*/
982-
static constexpr const char *MESSAGE_COMPRESSED_SIZE = "message.compressed_size";
983-
984-
/**
985-
* Uncompressed size of the message in bytes.
986-
*/
987-
static constexpr const char *MESSAGE_UNCOMPRESSED_SIZE = "message.uncompressed_size";
988-
989961
// Enum definitions
962+
namespace EventDomainValues
963+
{
964+
/** Events from browser apps. */
965+
static constexpr const char *BROWSER = "browser";
966+
/** Events from mobile apps. */
967+
static constexpr const char *DEVICE = "device";
968+
/** Events from Kubernetes. */
969+
static constexpr const char *K8S = "k8s";
970+
} // namespace EventDomainValues
971+
990972
namespace OpentracingRefTypeValues
991973
{
992974
/** The parent Span depends on the child Span in some capacity. */
@@ -1355,14 +1337,6 @@ static constexpr const int DATA_LOSS = 15;
13551337
static constexpr const int UNAUTHENTICATED = 16;
13561338
} // namespace RpcGrpcStatusCodeValues
13571339

1358-
namespace MessageTypeValues
1359-
{
1360-
/** sent. */
1361-
static constexpr const char *SENT = "SENT";
1362-
/** received. */
1363-
static constexpr const char *RECEIVED = "RECEIVED";
1364-
} // namespace MessageTypeValues
1365-
13661340
} // namespace SemanticConventions
13671341
} // namespace trace
13681342
OPENTELEMETRY_END_NAMESPACE

buildscripts/semantic-convention/generate.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
1010
ROOT_DIR="${SCRIPT_DIR}/../../"
1111

1212
# freeze the spec & generator tools versions to make SemanticAttributes generation reproducible
13-
SEMCONV_VERSION=1.13.0
13+
SEMCONV_VERSION=1.14.0
1414
SPEC_VERSION=v$SEMCONV_VERSION
1515
SCHEMA_URL=https://opentelemetry.io/schemas/$SEMCONV_VERSION
1616
GENERATOR_VERSION=0.14.0
@@ -28,10 +28,11 @@ git reset --hard FETCH_HEAD
2828
cd ${SCRIPT_DIR}
2929

3030
docker run --rm \
31-
-v ${SCRIPT_DIR}/opentelemetry-specification/semantic_conventions/trace:/source \
31+
-v ${SCRIPT_DIR}/opentelemetry-specification/semantic_conventions:/source \
3232
-v ${SCRIPT_DIR}/templates:/templates \
3333
-v ${ROOT_DIR}/api/include/opentelemetry/trace/:/output \
3434
otel/semconvgen:$GENERATOR_VERSION \
35+
--only span \
3536
-f /source code \
3637
--template /templates/SemanticAttributes.h.j2 \
3738
--output /output/semantic_conventions.h \
@@ -42,10 +43,11 @@ docker run --rm \
4243
-Dnamespace_close="}"
4344

4445
docker run --rm \
45-
-v ${SCRIPT_DIR}/opentelemetry-specification/semantic_conventions/resource:/source \
46+
-v ${SCRIPT_DIR}/opentelemetry-specification/semantic_conventions:/source \
4647
-v ${SCRIPT_DIR}/templates:/templates \
4748
-v ${ROOT_DIR}/sdk/include/opentelemetry/sdk/resource/:/output \
4849
otel/semconvgen:$GENERATOR_VERSION \
50+
--only resource \
4951
-f /source code \
5052
--template /templates/SemanticAttributes.h.j2 \
5153
--output /output/semantic_conventions.h \

sdk/include/opentelemetry/sdk/resource/semantic_conventions.h

+27-8
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ namespace SemanticConventions
2323
/**
2424
* The URL of the OpenTelemetry schema for these keys and values.
2525
*/
26-
static constexpr const char *SCHEMA_URL = "https://opentelemetry.io/schemas/1.13.0";
26+
static constexpr const char *SCHEMA_URL = "https://opentelemetry.io/schemas/1.14.0";
2727

2828
/**
2929
* Array of brand name and version separated by a space
3030
*
3131
* <p>Notes:
3232
<ul> <li>This value is intended to be taken from the <a
33-
href="https://wicg.github.io/ua-client-hints/#interface">UA client hints API</a>
34-
(navigator.userAgentData.brands).</li> </ul>
33+
href="https://wicg.github.io/ua-client-hints/#interface">UA client hints API</a> ({@code
34+
navigator.userAgentData.brands}).</li> </ul>
3535
*/
3636
static constexpr const char *BROWSER_BRANDS = "browser.brands";
3737

@@ -40,18 +40,28 @@ static constexpr const char *BROWSER_BRANDS = "browser.brands";
4040
*
4141
* <p>Notes:
4242
<ul> <li>This value is intended to be taken from the <a
43-
href="https://wicg.github.io/ua-client-hints/#interface">UA client hints API</a>
44-
(navigator.userAgentData.platform). If unavailable, the legacy {@code navigator.platform} API SHOULD
43+
href="https://wicg.github.io/ua-client-hints/#interface">UA client hints API</a> ({@code
44+
navigator.userAgentData.platform}). If unavailable, the legacy {@code navigator.platform} API SHOULD
4545
NOT be used instead and this attribute SHOULD be left unset in order for the values to be
4646
consistent. The list of possible values is defined in the <a
4747
href="https://wicg.github.io/ua-client-hints/#sec-ch-ua-platform">W3C User-Agent Client Hints
4848
specification</a>. Note that some (but not all) of these values can overlap with values in the <a
49-
href="./os.md">os.type and os.name attributes</a>. However, for consistency, the values in the
50-
{@code browser.platform} attribute should capture the exact value that the user agent provides.</li>
51-
</ul>
49+
href="./os.md">{@code os.type} and {@code os.name} attributes</a>. However, for consistency, the
50+
values in the {@code browser.platform} attribute should capture the exact value that the user agent
51+
provides.</li> </ul>
5252
*/
5353
static constexpr const char *BROWSER_PLATFORM = "browser.platform";
5454

55+
/**
56+
* A boolean that is true if the browser is running on a mobile device
57+
*
58+
* <p>Notes:
59+
<ul> <li>This value is intended to be taken from the <a
60+
href="https://wicg.github.io/ua-client-hints/#interface">UA client hints API</a> ({@code
61+
navigator.userAgentData.mobile}). If unavailable, this attribute SHOULD be left unset.</li> </ul>
62+
*/
63+
static constexpr const char *BROWSER_MOBILE = "browser.mobile";
64+
5565
/**
5666
* Full user-agent string provided by the browser
5767
*
@@ -62,6 +72,15 @@ static constexpr const char *BROWSER_PLATFORM = "browser.platform";
6272
*/
6373
static constexpr const char *BROWSER_USER_AGENT = "browser.user_agent";
6474

75+
/**
76+
* Preferred language of the user using the browser
77+
*
78+
* <p>Notes:
79+
<ul> <li>This value is intended to be taken from the Navigator API {@code
80+
navigator.language}.</li> </ul>
81+
*/
82+
static constexpr const char *BROWSER_LANGUAGE = "browser.language";
83+
6584
/**
6685
* Name of the cloud provider.
6786
*/

0 commit comments

Comments
 (0)